netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: hslester96@gmail.com
Cc: fugang.duan@nxp.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] net: fec: add a check for CONFIG_PM to avoid clock count mis-match
Date: Tue, 12 Nov 2019 11:13:18 -0800 (PST)	[thread overview]
Message-ID: <20191112.111318.1764384720609728917.davem@davemloft.net> (raw)
In-Reply-To: <20191112112830.27561-1-hslester96@gmail.com>

From: Chuhong Yuan <hslester96@gmail.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@gmail.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.

  reply	other threads:[~2019-11-12 19:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 11:28 [PATCH net v2] net: fec: add a check for CONFIG_PM to avoid clock count mis-match Chuhong Yuan
2019-11-12 19:13 ` David Miller [this message]
2019-11-13  1:50   ` [EXT] " Andy Duan
2019-11-15 20:10 ` David Miller
2019-11-16  6:57   ` [EXT] " Andy Duan
2019-11-16 14:00     ` Chuhong Yuan
2019-11-18  6:47       ` Andy Duan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191112.111318.1764384720609728917.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=fugang.duan@nxp.com \
    --cc=hslester96@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).