On Mon, Mar 1, 2021 at 2:49 PM Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx> wrote: > > On 28.02.2021 23:15:48, Tong Zhang wrote: > > 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 will > > I don't see where register_candev() is doing any pm related > initialization. > > > also cause it to enable twice. > > > 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: