[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB36002AEF160536CBD8121554FF760@VI1PR0402MB3600.eurprd04.prod.outlook.com>
Date: Wed, 13 Nov 2019 01:50:20 +0000
From: Andy Duan <fugang.duan@....com>
To: David Miller <davem@...emloft.net>,
"hslester96@...il.com" <hslester96@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [EXT] Re: [PATCH net v2] net: fec: add a check for CONFIG_PM to
avoid clock count mis-match
From: David Miller <davem@...emloft.net> Sent: Wednesday, November 13, 2019 3:13 AM
> From: Chuhong Yuan <hslester96@...il.com>
> Date: Tue, 12 Nov 2019 19:28:30 +0800
>
> > If CONFIG_PM is enabled, runtime pm will work and call runtime_suspend
> > automatically to disable clks.
> > Therefore, remove only needs to disable clks when CONFIG_PM is disabled.
> > Add this check to avoid clock count mis-match caused by double-disable.
> >
> > Fixes: c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in
> > remove")
> > Signed-off-by: Chuhong Yuan <hslester96@...il.com>
>
> I don't understand this at all.
>
> The clk disables here match the unconditional clk enables in the probe
> function.
>
> And that is how this is supposed to work, probe enables match remove
> disables. And suspend disables match resume enables.
>
> Why isn't the probe enable taking the correct count, which the remove
> function must match with an appropriate disable? There is no CONFIG_PM
> guarding the probe time clk enables.
Current driver runtime pm callback enable/disable clk_ipg/clk_ahb two clks.
CONFIG_PM is a optional config, if CONFIG_PM is disabled, runtime callbacks will
Not be called.
The driver enable clk_ipg/clk_ahb two clks during probe, and depends runtime
suspend to disable the two clks if CONFIG_PM is enabled.
In driver remove() also need to disable the two clks if CONIFG_PM is disabled.
So the patch c43eab3eddb4 ("net: fec: add missed clk_disable_unprepare in emove")
target the fixes if CONFIG_PM is not enabled, but the patch ignore to check the
CONFIG_PM that make clock count mismatch in CONFIG_PM enabled case.
Andy
Powered by blists - more mailing lists