Re: [PATCH] can: c_can: move runtime PM enable/disable to c_can_platform
From: Tong Zhang <hidden>
Date: 2021-03-02 08:11:21
Also in:
lkml, netdev
From: Tong Zhang <hidden>
Date: 2021-03-02 08:11:21
Also in:
lkml, netdev
On Mon, Mar 1, 2021 at 2:49 PM Marc Kleine-Budde [off-list ref] wrote:
On 28.02.2021 23:15:48, Tong Zhang wrote:quoted
Currently doing modprobe c_can_pci will make kernel complain "Unbalanced pm_runtime_enable!", this is caused by pm_runtime_enable() called before pm is initialized in register_candev() and doing so willI don't see where register_candev() is doing any pm related initialization.quoted
also cause it to enable twice.quoted
This fix is similar to 227619c3ff7c, move those pm_enable/disable code to c_can_platform.As I understand 227619c3ff7c ("can: m_can: move runtime PM enable/disable to m_can_platform"), PCI devices automatically enable PM, when the "PCI device is added".
Hi Marc, Thanks for the comments. I thinks you are right -- I was mislead by the trace -- I have corrected the commit log along with the indent fix in v2 patch. Thanks again for your help, - Tong
Please clarify the above point, otherwise the code looks OK, small nitpick inline: