mei: me: fix irq number stored in hw struct
Subsystems (2)
PATCH 1/1 mei: me: fix irq number stored in hw struct
Commit 261b3e1f2a01 ("mei: me: store irq number in the hw struct.") stores the irq number in the hw struct before MSI is enabled. This caused a regression for mei_me_synchronize_irq() waiting for the wrong irq number. On my laptop this causes a hang on shutdown. Fix the issue by storing the irq number after enabling MSI.
--- drivers/misc/mei/pci-me.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/misc/mei/pci-me.c +2 -1
@@ -203,11 +203,12 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } hw =to_me_hw (dev); hw->mem_addr =pcim_iomap_table (pdev)[0 ]; - hw->irq = pdev->irq; hw->read_fws = mei_me_read_fws;pci_enable_msi (pdev); + hw->irq = pdev->irq; +/* request and enable interrupt */ irqflags =pci_dev_msi_enabled (pdev) ?IRQF_ONESHOT :IRQF_SHARED ;
Signature · 1 line
2.26.1
Quoted 6 lines
Commit
261b3e1f2a01("mei: me: store irq number in the hw struct.") stores the irq number in the hw struct before MSI is enabled. This caused a regression formei_me_synchronize_irq()waiting for the wrong irq number. On my laptop this causes a hang on shutdown. Fix the issue by storing the irq number after enabling MSI.
Thanks a lot for cracking this down, this should go to stable (5.5) as well.
We should be probably calling hw->irq = pci_irq_vector(pdev, 0); as pci_enable_msi was deprecated. Will try to address this in a follow up patch.
Quoted 28 lines
Fixes 261b3e1f2a01 ("mei: me: store irq number in the hw struct.")Signed-off-by Benjamin Lee <[email protected]>--- drivers/misc/mei/pci-me.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/misc/mei/pci-me.c index renamed from drivers/misc/mei/pci-me.c +0
-0
3d21c38e2dbb..0c390fe421ad100644drivers/misc/mei/pci-me.c +2
-1@@ -203,11 +203,12 @@ static int mei_me_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } hw =to_me_hw (dev); hw->mem_addr =pcim_iomap_table (pdev)[0 ]; - hw->irq = pdev->irq; hw->read_fws = mei_me_read_fws;pci_enable_msi (pdev); + hw->irq = pdev->irq; +/* request and enable interrupt */ irqflags = pci_dev_msi_enabled(pdev) ? IRQF_ONESHOT :
IRQF_SHARED;--
2.26.1