[PATCH] can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call

Joshua Crofts posted 1 patch 1 week, 1 day ago
drivers/net/can/m_can/m_can_pci.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call
Posted by Joshua Crofts 1 week, 1 day ago
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.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
Found using a Coccinelle script I'm currently working on [1].

[1] https://lore.kernel.org/cocci/20260916095616.1394-1-joshua.crofts1@gmail.com
---
 drivers/net/can/m_can/m_can_pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/m_can/m_can_pci.c b/drivers/net/can/m_can/m_can_pci.c
index d11a7c88fc32..3c595749b5c7 100644
--- a/drivers/net/can/m_can/m_can_pci.c
+++ b/drivers/net/can/m_can/m_can_pci.c
@@ -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 */
-- 
2.47.3
Re: [PATCH] can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call
Posted by Markus Schneider-Pargmann 6 days, 19 hours ago
Hi Joshua,

On Wed Sep 16, 2026 at 2:42 PM CEST, Joshua Crofts wrote:
> 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?

> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>

After that it looks good to me:

Acked-by: Markus Schneider-Pargmann <msp@baylibre.com>

Best
Markus
Re: [PATCH] can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call
Posted by Joshua Crofts 6 days, 17 hours ago
On Fri, 18 Sep 2026 11:24:09 +0200
"Markus Schneider-Pargmann" <msp@baylibre.com> wrote:

> Hi Joshua,
> 
> On Wed Sep 16, 2026 at 2:42 PM CEST, Joshua Crofts wrote:
> > 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?

-- 
Kind regards,
Joshua Crofts
Re: [PATCH] can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call
Posted by Markus Schneider-Pargmann 1 day, 21 hours ago
On Fri Sep 18, 2026 at 1:15 PM CEST, Joshua Crofts wrote:
> On Fri, 18 Sep 2026 11:24:09 +0200
> "Markus Schneider-Pargmann" <msp@baylibre.com> wrote:
>
>> Hi Joshua,
>> 
>> On Wed Sep 16, 2026 at 2:42 PM CEST, Joshua Crofts wrote:
>> > 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?

Yes, that's ok for me.
Re: [PATCH] can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call
Posted by Joshua Crofts 1 day, 21 hours ago
On Wed, 23 Sep 2026 09:06:59 +0200
"Markus Schneider-Pargmann" <msp@baylibre.com> wrote:

> On Fri Sep 18, 2026 at 1:15 PM CEST, Joshua Crofts wrote:
> > On Fri, 18 Sep 2026 11:24:09 +0200
> > "Markus Schneider-Pargmann" <msp@baylibre.com> wrote:
> >  
> >> Hi Joshua,
> >> 
> >> On Wed Sep 16, 2026 at 2:42 PM CEST, Joshua Crofts wrote:  
> >> > 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?  
> 
> Yes, that's ok for me.
> 

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

-- 
Kind regards,
Joshua Crofts