Skip to content

Commit

Permalink
mei: do not overwrite state on hw start
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ausyskin authored and gregkh committed Feb 25, 2022
1 parent 04af137 commit 2be483f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/misc/mei/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ int mei_reset(struct mei_device *dev)
return ret;
}

if (dev->dev_state != MEI_DEV_RESETTING) {
dev_dbg(dev->dev, "wrong state = %d on link start\n", dev->dev_state);
return 0;
}

dev_dbg(dev->dev, "link is established start sending messages.\n");

mei_set_devstate(dev, MEI_DEV_INIT_CLIENTS);
Expand Down

0 comments on commit 2be483f

Please sign in to comment.