From 4a8efd4a1a9593a11c808da94e6609f6d4ee7276 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Sun, 4 Dec 2016 15:22:58 +0200 Subject: mei: synchronize irq before initiating a reset. We need to synchronize irqs before issuing reset to make sure that the clients communication is concluded and doesn't leak to the reset flow and confusing the state machine. This issue is happening during suspend/resume stress testing. Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/hw-me.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/misc/mei/hw-me.c') diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index 998f7fc0e920..e2b56e8cf745 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c @@ -284,6 +284,18 @@ static void mei_me_intr_disable(struct mei_device *dev) mei_hcsr_set(dev, hcsr); } +/** + * mei_me_synchronize_irq - wait for pending IRQ handlers + * + * @dev: the device structure + */ +static void mei_me_synchronize_irq(struct mei_device *dev) +{ + struct pci_dev *pdev = to_pci_dev(dev->dev); + + synchronize_irq(pdev->irq); +} + /** * mei_me_hw_reset_release - release device from the reset * @@ -1238,6 +1250,7 @@ static const struct mei_hw_ops mei_me_hw_ops = { .intr_clear = mei_me_intr_clear, .intr_enable = mei_me_intr_enable, .intr_disable = mei_me_intr_disable, + .synchronize_irq = mei_me_synchronize_irq, .hbuf_free_slots = mei_me_hbuf_empty_slots, .hbuf_is_ready = mei_me_hbuf_is_empty, -- cgit v1.2.3