All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Samuel Holland <samuel@sholland.org>
Cc: Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Andre Przywara <andre.przywara@arm.com>,
	 Maxime Ripard <maxime@cerno.tech>,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
	 linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] mmc: sunxi-mmc: Fix clock refcount imbalance during unbind
Date: Mon, 2 Jan 2023 16:07:21 +0100	[thread overview]
Message-ID: <CAPDyKFpiuWY+vC1cY8xLozFucsTA0vMHVk_KTpzCfOcXntcBZg@mail.gmail.com> (raw)
In-Reply-To: <5a6a65c6-6df3-0d24-b28a-324b28fd4756@sholland.org>

On Sun, 1 Jan 2023 at 20:25, Samuel Holland <samuel@sholland.org> wrote:
>
> On 8/15/22 05:11, Ulf Hansson wrote:
> > On Wed, 10 Aug 2022 at 04:25, Samuel Holland <samuel@sholland.org> wrote:
> >>
> >> If the controller is suspended by runtime PM, the clock is already
> >> disabled, so do not try to disable it again during removal. Use
> >> pm_runtime_disable() to flush any pending runtime PM transitions.
> >>
> >> Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
> >> Signed-off-by: Samuel Holland <samuel@sholland.org>
> >> ---
> >>
> >>  drivers/mmc/host/sunxi-mmc.c | 8 +++++---
> >>  1 file changed, 5 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> >> index b16e12e62e72..3db9f32d6a7b 100644
> >> --- a/drivers/mmc/host/sunxi-mmc.c
> >> +++ b/drivers/mmc/host/sunxi-mmc.c
> >> @@ -1492,9 +1492,11 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
> >>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> >>
> >>         mmc_remove_host(mmc);
> >> -       pm_runtime_force_suspend(&pdev->dev);
> >> -       disable_irq(host->irq);
> >> -       sunxi_mmc_disable(host);
> >
> > Perhaps a better option than the below, would just be to drop the
> > above calls to disable_irq() and sunxi_mmc_disable(), as that is
> > already managed through the call to pm_runtime_force_suspend().
>
> I like the idea, but it will not work for !CONFIG_PM builds, which this
> driver currently supports.

Good point! I have applied the patch for fixes and added a stable tag
to it, thanks!

[...]

Kind regards
Uffe

WARNING: multiple messages have this Message-ID (diff)
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Samuel Holland <samuel@sholland.org>
Cc: Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Andre Przywara <andre.przywara@arm.com>,
	 Maxime Ripard <maxime@cerno.tech>,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
	 linux-sunxi@lists.linux.dev
Subject: Re: [PATCH] mmc: sunxi-mmc: Fix clock refcount imbalance during unbind
Date: Mon, 2 Jan 2023 16:07:21 +0100	[thread overview]
Message-ID: <CAPDyKFpiuWY+vC1cY8xLozFucsTA0vMHVk_KTpzCfOcXntcBZg@mail.gmail.com> (raw)
In-Reply-To: <5a6a65c6-6df3-0d24-b28a-324b28fd4756@sholland.org>

On Sun, 1 Jan 2023 at 20:25, Samuel Holland <samuel@sholland.org> wrote:
>
> On 8/15/22 05:11, Ulf Hansson wrote:
> > On Wed, 10 Aug 2022 at 04:25, Samuel Holland <samuel@sholland.org> wrote:
> >>
> >> If the controller is suspended by runtime PM, the clock is already
> >> disabled, so do not try to disable it again during removal. Use
> >> pm_runtime_disable() to flush any pending runtime PM transitions.
> >>
> >> Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
> >> Signed-off-by: Samuel Holland <samuel@sholland.org>
> >> ---
> >>
> >>  drivers/mmc/host/sunxi-mmc.c | 8 +++++---
> >>  1 file changed, 5 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> >> index b16e12e62e72..3db9f32d6a7b 100644
> >> --- a/drivers/mmc/host/sunxi-mmc.c
> >> +++ b/drivers/mmc/host/sunxi-mmc.c
> >> @@ -1492,9 +1492,11 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
> >>         struct sunxi_mmc_host *host = mmc_priv(mmc);
> >>
> >>         mmc_remove_host(mmc);
> >> -       pm_runtime_force_suspend(&pdev->dev);
> >> -       disable_irq(host->irq);
> >> -       sunxi_mmc_disable(host);
> >
> > Perhaps a better option than the below, would just be to drop the
> > above calls to disable_irq() and sunxi_mmc_disable(), as that is
> > already managed through the call to pm_runtime_force_suspend().
>
> I like the idea, but it will not work for !CONFIG_PM builds, which this
> driver currently supports.

Good point! I have applied the patch for fixes and added a stable tag
to it, thanks!

[...]

Kind regards
Uffe

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-01-02 15:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  2:25 [PATCH] mmc: sunxi-mmc: Fix clock refcount imbalance during unbind Samuel Holland
2022-08-10  2:25 ` Samuel Holland
2022-08-14  8:22 ` Jernej Škrabec
2022-08-14  8:22   ` Jernej Škrabec
2022-08-14 17:56   ` Samuel Holland
2022-08-14 17:56     ` Samuel Holland
2022-08-15 10:11 ` Ulf Hansson
2022-08-15 10:11   ` Ulf Hansson
2023-01-01 19:25   ` Samuel Holland
2023-01-01 19:25     ` Samuel Holland
2023-01-02 15:07     ` Ulf Hansson [this message]
2023-01-02 15:07       ` Ulf Hansson

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=CAPDyKFpiuWY+vC1cY8xLozFucsTA0vMHVk_KTpzCfOcXntcBZg@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=andre.przywara@arm.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maxime@cerno.tech \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.