summaryrefslogtreecommitdiff
path: root/drivers/misc/mei
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2016-02-07 21:35:25 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 22:47:20 (GMT)
commit5cf8b2a9be0abec35f675bc719ca6eba9e559b1d (patch)
tree93add494a6fa86a19593f8ef50eb414b57e74a3c /drivers/misc/mei
parent62e8e6ad60975df491d886efaa7fe0aa832947fb (diff)
downloadlinux-5cf8b2a9be0abec35f675bc719ca6eba9e559b1d.tar.xz
mei: amthif: allow only one request at a time
A next amthif write can be executed only after the previous one has completed. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r--drivers/misc/mei/amthif.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 647edc6..4383a9a 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -315,6 +315,14 @@ int mei_amthif_write(struct mei_cl *cl, struct mei_cl_cb *cb)
dev = cl->dev;
list_add_tail(&cb->list, &dev->amthif_cmd_list.list);
+
+ /*
+ * The previous request is still in processing, queue this one.
+ */
+ if (dev->iamthif_state > MEI_IAMTHIF_IDLE &&
+ dev->iamthif_state < MEI_IAMTHIF_READ_COMPLETE)
+ return 0;
+
return mei_amthif_run_next_cmd(dev);
}