From: b29396@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] mmc: sdhci-esdhc-imx: fix warning during module remove function
Date: Tue, 24 Dec 2013 10:34:13 +0800 [thread overview]
Message-ID: <20131224023412.GC23230@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <20131223140613.GL26070@S2101-09.ap.freescale.net>
On Mon, Dec 23, 2013 at 10:06:15PM +0800, Shawn Guo wrote:
> On Mon, Dec 23, 2013 at 07:02:24PM +0800, Dong Aisheng wrote:
> > @@ -1160,8 +1160,6 @@ free_sdhci:
> > static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
> > {
> > struct sdhci_host *host = platform_get_drvdata(pdev);
> > - struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> > - struct pltfm_imx_data *imx_data = pltfm_host->priv;
> > int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
> >
> > sdhci_remove_host(host, dead);
> > @@ -1169,10 +1167,6 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
> > pm_runtime_dont_use_autosuspend(&pdev->dev);
> > pm_runtime_disable(&pdev->dev);
> >
> > - clk_disable_unprepare(imx_data->clk_per);
> > - clk_disable_unprepare(imx_data->clk_ipg);
> > - clk_disable_unprepare(imx_data->clk_ahb);
>
> It's obviously a bad change to me. We should definitely have these
> clk_disable_unprepare() calls in sdhci_esdhc_imx_remove() to match the
> clk_prepare_enable() calls in sdhci_esdhc_imx_probe(). Otherwise, at
> least for !CONFIG_PM_RUNTIME build, it's broken.
>
How about add the !CONFIG_RUMTIME_PM precondition for these code to avoid
break non runtime pm case?
#ifndef CONFIG_PM_RUNTIME
clk_disable_unprepare(imx_data->clk_per);
clk_disable_unprepare(imx_data->clk_ipg);
clk_disable_unprepare(imx_data->clk_ahb);
#endif
> I'm looking at sdhci-pxav3 driver. Why can it call
> clk_disable_unprepare(pltfm_host->clk) in .remove() with runtime PM
> support in there? Is there anything about runtime PM not being done
> correctly for our driver?
>
I checked the code, it seems it calls pm_runtime_get_sync(&pdev->dev);
before clk_disable_*.
That means the clock is already enabled,
Without it, i wonder it may have the same problem.
static int sdhci_pxav3_remove(struct platform_device *pdev)
{
...
pm_runtime_get_sync(&pdev->dev);
sdhci_remove_host(host, 1);
pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(pltfm_host->clk);
clk_put(pltfm_host->clk);
..
}
Regards
Dong Aisheng
> Shawn
>
> > -
> > sdhci_pltfm_free(pdev);
> >
> > return 0;
> > --
> > 1.7.2.rc3
> >
> >
>
next prev parent reply other threads:[~2013-12-24 2:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-23 11:02 [PATCH 1/2] mmc: sdhci-esdhc-imx: fix access hardirq-unsafe lock in atomic context Dong Aisheng
2013-12-23 11:02 ` [PATCH 2/2] mmc: sdhci-esdhc-imx: fix warning during module remove function Dong Aisheng
2013-12-23 14:06 ` Shawn Guo
2013-12-24 2:34 ` Dong Aisheng [this message]
2013-12-24 3:16 ` Shawn Guo
2013-12-24 3:29 ` Shawn Guo
2013-12-24 3:29 ` Dong Aisheng
2013-12-23 12:47 ` [PATCH 1/2] mmc: sdhci-esdhc-imx: fix access hardirq-unsafe lock in atomic context Shawn Guo
2013-12-24 2:13 ` Dong Aisheng
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=20131224023412.GC23230@shlinux2.ap.freescale.net \
--to=b29396@freescale.com \
--cc=linux-arm-kernel@lists.infradead.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).