summaryrefslogtreecommitdiff
path: root/drivers/misc/mei/hw-txe.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2014-02-19 19:35:47 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-01 03:15:56 +0400
commit6aae48ff18f2fcfb533d2b448ecae16d1de006c1 (patch)
tree1e886fe2f579ed8dea6f594219e591f7c6820d89 /drivers/misc/mei/hw-txe.c
parent4a22176aa89b8121a5160064d77244e26fe38790 (diff)
downloadlinux-6aae48ff18f2fcfb533d2b448ecae16d1de006c1.tar.xz
mei: add mei_hbuf_acquire wrapper
A client has to acquire host buffer before writing, we add lock like wrapper to replace the code snippet if (dev->hbuf_is_ready) dev->hbuf_is_ready = false; Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hw-txe.c')
-rw-r--r--drivers/misc/mei/hw-txe.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
index 49a5ed376969..8f5e4be9ebc2 100644
--- a/drivers/misc/mei/hw-txe.c
+++ b/drivers/misc/mei/hw-txe.c
@@ -605,7 +605,6 @@ static int mei_txe_write(struct mei_device *dev,
mei_txe_input_payload_write(dev, i + 1, reg);
}
- dev->hbuf_is_ready = false;
/* Set Input-Doorbell */
mei_txe_input_doorbell_set(hw);
@@ -983,20 +982,16 @@ irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id)
dev->hbuf_is_ready = true;
if (hw->aliveness && dev->hbuf_is_ready) {
- /* if SeC did not complete reading the written data by host */
- if (!mei_txe_is_input_ready(dev)) {
- dev_dbg(&dev->pdev->dev, "got Input Ready Int, but SEC_IPC_INPUT_STATUS_RDY is 0.\n");
- goto end;
- }
+ /* get the real register value */
+ dev->hbuf_is_ready = mei_hbuf_is_ready(dev);
rets = mei_irq_write_handler(dev, &complete_list);
- if (rets)
- dev_err(&dev->pdev->dev,
- "mei_irq_write_handler ret = %d.\n", rets);
+ if (rets && rets != -EMSGSIZE)
+ dev_err(&dev->pdev->dev, "mei_irq_write_handler ret = %d.\n",
+ rets);
+ dev->hbuf_is_ready = mei_hbuf_is_ready(dev);
}
-
-
mei_irq_compl_handler(dev, &complete_list);
end: