Commit 685867f4 authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman
Browse files

mei: me: avoid link reset on shutdown



Avoid lingering reset thread on driver shutdown.
If the firmware is down during a shutdown flow
do not initiate the link reset, simply disconnect
all clients and let shutdown flow finish

Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20220215080438.264876-2-tomas.winkler@intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ccdf6f80
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2148,6 +2148,7 @@ void mei_cl_all_disconnect(struct mei_device *dev)
	list_for_each_entry(cl, &dev->file_list, link)
		mei_cl_set_disconnected(cl);
}
EXPORT_SYMBOL_GPL(mei_cl_all_disconnect);

static struct mei_cl *mei_cl_dma_map_find(struct mei_device *dev, u8 buffer_id)
{
+5 −1
Original line number Diff line number Diff line
@@ -1257,6 +1257,10 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
	/* check if ME wants a reset */
	if (!mei_hw_is_ready(dev) && dev->dev_state != MEI_DEV_RESETTING) {
		dev_warn(dev->dev, "FW not ready: resetting.\n");
		if (dev->dev_state == MEI_DEV_POWERING_DOWN ||
		    dev->dev_state == MEI_DEV_POWER_DOWN)
			mei_cl_all_disconnect(dev);
		else if (dev->dev_state != MEI_DEV_DISABLED)
			schedule_work(&dev->reset_work);
		goto end;
	}