Skip to contentSkip to conversation

can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call

PATCH In review Joshua Crofts 2 participants 6 messages Sep 16 – Sep 26

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call

m_can_pci_remove() forgets to call pm_runtime_dont_use_autosuspend() on teardown, even though autosuspend is enabled in m_can_pci_probe().

Add the missing function call.

---
Found using a Coccinelle script I'm currently working on [1].

[1] https://lore.kernel.org/cocci/[email protected]

---
 drivers/net/can/m_can/m_can_pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/can/m_can/m_can_pci.c +1 -0
index d11a7c88fc32..3c595749b5c7 100644
@@ -159,6 +159,7 @@ static void m_can_pci_remove(struct pci_dev *pci)
 	struct m_can_pci_priv *priv = cdev_to_priv(mcan_class);
 
 	pm_runtime_forbid(&pci->dev);
+	pm_runtime_dont_use_autosuspend(&pci->dev);
 	pm_runtime_get_noresume(&pci->dev);
 
 	/* Disable interrupt control at CAN wrapper IP */
Signature · 1 line
2.47.3
#2 lore raw
Quoted 10 lines · On Fri, 18 Sep 2026 11:24:09 +0200 "Markus Schneider-Pargmann"…

Hi Joshua,

Quoted 5 lines · Joshua Crofts

m_can_pci_remove() forgets to call pm_runtime_dont_use_autosuspend() on teardown, even though autosuspend is enabled in m_can_pci_probe().

Add the missing function call.

Can you please add a Fixes: tag?

I guess it's not a problem, however we had a discussion in the USB subsystem whether this type of patch is a fix and ended up agreeing that it's more hardening, hence no Fixes tag.

Alright if I just append the tag here for b4 to collect?

Signature · 2 lines
Kind regards,
Joshua Crofts
#3 lore raw
Quoted 12 lines · Joshua Crofts
Quoted 9 lines · On Fri, 18 Sep 2026 11:24:09 +0200 "Markus Schneider-Pargmann"…

Hi Joshua,

Quoted 5 lines · Joshua Crofts

m_can_pci_remove() forgets to call pm_runtime_dont_use_autosuspend() on teardown, even though autosuspend is enabled in m_can_pci_probe().

Add the missing function call.

Quoted 7 lines
Quoted 1 line

Can you please add a Fixes: tag?

I guess it's not a problem, however we had a discussion in the USB subsystem whether this type of patch is a fix and ended up agreeing that it's more hardening, hence no Fixes tag.

Alright if I just append the tag here for b4 to collect?

Yes, that's ok for me.

#4 lore raw
Quoted 15 lines · On Wed, 23 Sep 2026 09:06:59 +0200 "Markus Schneider-Pargmann"…
Quoted 14 lines · Joshua Crofts
Quoted 10 lines · On Fri, 18 Sep 2026 11:24:09 +0200 "Markus Schneider-Pargmann"…

Hi Joshua,

Quoted 5 lines · Joshua Crofts

m_can_pci_remove() forgets to call pm_runtime_dont_use_autosuspend() on teardown, even though autosuspend is enabled in m_can_pci_probe().

Add the missing function call.

Can you please add a Fixes: tag?

Quoted 8 lines
Quoted 5 lines

I guess it's not a problem, however we had a discussion in the USB subsystem whether this type of patch is a fix and ended up agreeing that it's more hardening, hence no Fixes tag.

Alright if I just append the tag here for b4 to collect?

Yes, that's ok for me.

Fixes cab7ffc0324f ("can: m_can: add PCI glue driver for Intel Elkhart Lake")
Signature · 2 lines
Kind regards,
Joshua Crofts
#5 lore raw
Quoted 23 lines · Joshua Crofts
Quoted 19 lines · On Wed, 23 Sep 2026 09:06:59 +0200 "Markus Schneider-Pargmann"…
Quoted 18 lines · Joshua Crofts
Quoted 10 lines · On Fri, 18 Sep 2026 11:24:09 +0200 "Markus Schneider-Pargmann"…

Hi Joshua,

Quoted 5 lines · Joshua Crofts

m_can_pci_remove() forgets to call pm_runtime_dont_use_autosuspend() on teardown, even though autosuspend is enabled in m_can_pci_probe().

Add the missing function call.

Can you please add a Fixes: tag?

I guess it's not a problem, however we had a discussion in the USB subsystem whether this type of patch is a fix and ended up agreeing that it's more hardening, hence no Fixes tag.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Alright if I just append the tag here for b4 to collect?

Yes, that's ok for me.

Fixes cab7ffc0324f ("can: m_can: add PCI glue driver for Intel Elkhart Lake")

You can drop this patch, as I now have a patch queued for 7.4 that makes PM runtime call this automatically on driver unbind [1].

[1] https://lore.kernel.org/all/[email protected]/

--
Kind regards,
Joshua Crofts