From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Takuo Koguchi <takuo.koguchi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: lkml-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
khoroshilov-ufN2psIa012HXe+LvDLADg@public.gmane.org,
takuo.koguchi.sw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
Takuo Koguchi
<takuo.koguchi.sw-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] spi: sun4i: disable clocks in the remove function
Date: Wed, 6 Dec 2017 16:20:05 +0100 [thread overview]
Message-ID: <20171206152005.yfbyylu6tbe5gnnv@flea.lan> (raw)
In-Reply-To: <1512573752-13091-1-git-send-email-takuo.koguchi.sw-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]
Hi,
On Thu, Dec 07, 2017 at 12:22:13AM +0900, Takuo Koguchi wrote:
> mclk and hclk need to be disabled explicitly since pm_runtime_disable does
> not disable the clocks.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Takuo Koguchi <takuo.koguchi.sw-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>
> ---
> drivers/spi/spi-sun4i.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
> index c5cd635..9011c09 100644
> --- a/drivers/spi/spi-sun4i.c
> +++ b/drivers/spi/spi-sun4i.c
> @@ -525,6 +525,11 @@ static int sun4i_spi_probe(struct platform_device *pdev)
>
> static int sun4i_spi_remove(struct platform_device *pdev)
> {
> + struct spi_master *master = dev_get_drvdata(&pdev->dev);
> + struct sun4i_spi *sspi = spi_master_get_devdata(master);
> +
> + clk_disable_unprepare(sspi->mclk);
> + clk_disable_unprepare(sspi->hclk);
And that will in turn create an unbalanced disable call if suspend was
called before the remove, which is very likely.
Why are you not calling pm_runtime_force_suspend? How did you test
that patch?
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-12-06 15:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-06 15:22 [PATCH] spi: sun4i: disable clocks in the remove function Takuo Koguchi
[not found] ` <1512573752-13091-1-git-send-email-takuo.koguchi.sw-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>
2017-12-06 15:20 ` Maxime Ripard [this message]
[not found] ` <20171206152005.yfbyylu6tbe5gnnv-ZC1Zs529Oq4@public.gmane.org>
2017-12-06 18:00 ` Takuo Koguchi
2017-12-07 7:20 ` [PATCH V3] " Takuo Koguchi
[not found] ` <1512631227-27334-1-git-send-email-takuo.koguchi.sw-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org>
2017-12-07 9:18 ` Maxime Ripard
2017-12-07 11:58 ` Mark Brown
2017-12-07 12:35 ` Applied "spi: sun4i: disable clocks in the remove function" to the spi tree Mark Brown
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=20171206152005.yfbyylu6tbe5gnnv@flea.lan \
--to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=khoroshilov-ufN2psIa012HXe+LvDLADg@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lkml-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=takuo.koguchi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=takuo.koguchi.sw-FCd8Q96Dh0JBDgjK7y7TUQ@public.gmane.org \
--cc=takuo.koguchi.sw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=wens-jdAy2FN1RRM@public.gmane.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