From 6aae48ff18f2fcfb533d2b448ecae16d1de006c1 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Wed, 19 Feb 2014 17:35:47 +0200 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/interrupt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/misc/mei/interrupt.c') diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 6c4597e9b997..aed03efa72f4 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -446,10 +446,10 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list) s32 slots; int ret; - if (!mei_hbuf_is_ready(dev)) { - dev_dbg(&dev->pdev->dev, "host buffer is not empty.\n"); + + if (!mei_hbuf_acquire(dev)) return 0; - } + slots = mei_hbuf_empty_slots(dev); if (slots <= 0) return -EMSGSIZE; -- cgit v1.2.3