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

Configure Feed

Select the types of activity you want to include in your feed.

mei: me: reduce the scope on unexpected reset

After commit 2cedb296988c ("mei: me: trigger link reset if hw ready is unexpected")
some devices started to show long resume times (5-7 seconds).
This happens as mei falsely detects unready hardware,
starts parallel link reset flow and triggers link reset timeouts
in the resume callback.

Address it by performing detection of unready hardware only
when driver is in the MEI_DEV_ENABLED state instead of blacklisting
states as done in the original patch.
This eliminates active waitqueue check as in MEI_DEV_ENABLED state
there will be no active waitqueue.

Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221023
Tested-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Fixes: 2cedb296988c ("mei: me: trigger link reset if hw ready is unexpected")
Cc: stable <stable@kernel.org>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Link: https://patch.msgid.link/20260330083830.536056-1-alexander.usyskin@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Usyskin and committed by
Greg Kroah-Hartman
8c27b1bc ec327aba

+4 -10
+4 -10
drivers/misc/mei/hw-me.c
··· 1337 1337 /* check if we need to start the dev */ 1338 1338 if (!mei_host_is_ready(dev)) { 1339 1339 if (mei_hw_is_ready(dev)) { 1340 - /* synchronized by dev mutex */ 1341 - if (waitqueue_active(&dev->wait_hw_ready)) { 1342 - dev_dbg(&dev->dev, "we need to start the dev.\n"); 1343 - dev->recvd_hw_ready = true; 1344 - wake_up(&dev->wait_hw_ready); 1345 - } else if (dev->dev_state != MEI_DEV_UNINITIALIZED && 1346 - dev->dev_state != MEI_DEV_POWERING_DOWN && 1347 - dev->dev_state != MEI_DEV_POWER_DOWN) { 1340 + if (dev->dev_state == MEI_DEV_ENABLED) { 1348 1341 dev_dbg(&dev->dev, "Force link reset.\n"); 1349 1342 schedule_work(&dev->reset_work); 1350 1343 } else { 1351 - dev_dbg(&dev->dev, "Ignore this interrupt in state = %d\n", 1352 - dev->dev_state); 1344 + dev_dbg(&dev->dev, "we need to start the dev.\n"); 1345 + dev->recvd_hw_ready = true; 1346 + wake_up(&dev->wait_hw_ready); 1353 1347 } 1354 1348 } else { 1355 1349 dev_dbg(&dev->dev, "Spurious Interrupt\n");