Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mei: do not overwrite state on hw start

During the hardware start sequence, do not overwrite the driver state
and do not proceed with the initialization sequence if the state
was changed while the driver was waiting for the start interrupt.

This can happen if the driver's removal/stop procedure was triggered
from the parent level while the driver is waiting for the start
interrupt. This may lead to stray the reset work or the timer
after driver were removed.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20220215080438.264876-4-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Usyskin and committed by
Greg Kroah-Hartman
2be483f1 04af137c

+5
+5
drivers/misc/mei/init.c
··· 161 161 return ret; 162 162 } 163 163 164 + if (dev->dev_state != MEI_DEV_RESETTING) { 165 + dev_dbg(dev->dev, "wrong state = %d on link start\n", dev->dev_state); 166 + return 0; 167 + } 168 + 164 169 dev_dbg(dev->dev, "link is established start sending messages.\n"); 165 170 166 171 mei_set_devstate(dev, MEI_DEV_INIT_CLIENTS);