aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2014-03-02 17:21:28 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-17 18:49:41 -0400
commitb1b94b5d387e3a1f034c308e22f9295828d7174a (patch)
tree131a47df93abde60908304e8dd57983651b0c7cf /drivers/misc/mei
parent07792c7e102110b9e7243c5c6aca891041272b67 (diff)
mei: me: do not reset when less than expected data is received
There is a race in ME hardware between data copy for host and interrupt delivery. An interrupt can be delivered prior to whole data copied for the host to read but rather then going trough the reset we just merely need to wait for the next interrupt. The bug is visible in read/write stress with multiple connections per client This is a regression caused as a side effect of the commit: commit 544f94601409653f07ae6e22d4a39e3a90dceead mei: do not run reset flow from the interrupt thread Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Cc: stable <stable@vger.kernel.org> # 3.14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r--drivers/misc/mei/hw-me.c9
-rw-r--r--drivers/misc/mei/interrupt.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 7e769c59a420..7145929cdb51 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -507,7 +507,16 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
507 while (slots > 0) { 507 while (slots > 0) {
508 dev_dbg(&dev->pdev->dev, "slots to read = %08x\n", slots); 508 dev_dbg(&dev->pdev->dev, "slots to read = %08x\n", slots);
509 rets = mei_irq_read_handler(dev, &complete_list, &slots); 509 rets = mei_irq_read_handler(dev, &complete_list, &slots);
510 /* There is a race between ME write and interrupt delivery:
511 * Not all data is always available immediately after the
512 * interrupt, so try to read again on the next interrupt.
513 */
514 if (rets == -ENODATA)
515 break;
516
510 if (rets && dev->dev_state != MEI_DEV_RESETTING) { 517 if (rets && dev->dev_state != MEI_DEV_RESETTING) {
518 dev_err(&dev->pdev->dev, "mei_irq_read_handler ret = %d.\n",
519 rets);
511 schedule_work(&dev->reset_work); 520 schedule_work(&dev->reset_work);
512 goto end; 521 goto end;
513 } 522 }
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index 2fbf0c0625ed..f38a32addad0 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -351,7 +351,7 @@ int mei_irq_read_handler(struct mei_device *dev,
351 dev_err(&dev->pdev->dev, "less data available than length=%08x.\n", 351 dev_err(&dev->pdev->dev, "less data available than length=%08x.\n",
352 *slots); 352 *slots);
353 /* we can't read the message */ 353 /* we can't read the message */
354 ret = -EBADMSG; 354 ret = -ENODATA;
355 goto end; 355 goto end;
356 } 356 }
357 357