OSDN Git Service

mei: gsc: wait for reset thread on stop
authorAlexander Usyskin <alexander.usyskin@intel.com>
Wed, 7 Sep 2022 21:51:04 +0000 (00:51 +0300)
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Mon, 12 Sep 2022 12:23:10 +0000 (15:23 +0300)
Wait for reset work to complete before initiating
stop reset flow sequence.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-8-tomas.winkler@intel.com
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/misc/mei/init.c

index eb05200..bc054ba 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (c) 2012-2019, Intel Corporation. All rights reserved.
+ * Copyright (c) 2012-2022, Intel Corporation. All rights reserved.
  * Intel Management Engine Interface (Intel MEI) Linux driver
  */
 
@@ -320,6 +320,8 @@ void mei_stop(struct mei_device *dev)
 
        mei_clear_interrupts(dev);
        mei_synchronize_irq(dev);
+       /* to catch HW-initiated reset */
+       mei_cancel_work(dev);
 
        mutex_lock(&dev->device_lock);