From: Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Heiner Kallweit <hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 3/4 RESEND] spi: s3c64xx: simplify suspend / resume handlers
Date: Fri, 21 Aug 2015 10:05:15 +0900 [thread overview]
Message-ID: <55D6794B.60800@samsung.com> (raw)
In-Reply-To: <55D63376.5070607-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 21.08.2015 05:07, Heiner Kallweit wrote:
> The runtime PM suspend / resume handlers take care of the enabling/
> disabling the clocks already. Therefore replace the duplicated
> clock handling with pm_runtime_force_suspend/resume.
>
> Signed-off-by: Heiner Kallweit <hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> Changed:
> - Replaced pm_runtime_suspend/resume calls with their
> .._force_.. equivalents.
>
> drivers/spi/spi-s3c64xx.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index edeac06..735b7f5 100644
> --- a/drivers/spi/spi-s3c64xx.c
> +++ b/drivers/spi/spi-s3c64xx.c
> @@ -1246,10 +1246,9 @@ static int s3c64xx_spi_suspend(struct device *dev)
> if (ret)
> return ret;
>
> - if (!pm_runtime_suspended(dev)) {
> - clk_disable_unprepare(sdd->clk);
> - clk_disable_unprepare(sdd->src_clk);
> - }
> + ret = pm_runtime_force_suspend(dev);
> + if (ret < 0)
> + return ret;
>
> sdd->cur_speed = 0; /* Output Clock is stopped */
>
> @@ -1261,14 +1260,14 @@ static int s3c64xx_spi_resume(struct device *dev)
> struct spi_master *master = dev_get_drvdata(dev);
> struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
> struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
> + int ret;
>
> if (sci->cfg_gpio)
> sci->cfg_gpio();
>
> - if (!pm_runtime_suspended(dev)) {
> - clk_prepare_enable(sdd->src_clk);
> - clk_prepare_enable(sdd->clk);
> - }
> + ret = pm_runtime_force_resume(dev);
> + if (ret < 0)
> + return ret;
The logic of resume is changed.
Previously if device was runtime suspended when sleeping then clocks
would not be enabled during system resume.
Now device is always runtime suspended before and always runtime resumed
after. So this is different... but I think it's right approach with
current PM model:
Reviewed-by: Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Best regards,
Krzysztof
>
> s3c64xx_spi_hwinit(sdd, sdd->port_id);
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-08-21 1:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 20:07 [PATCH 3/4 RESEND] spi: s3c64xx: simplify suspend / resume handlers Heiner Kallweit
[not found] ` <55D63376.5070607-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-08-21 1:05 ` Krzysztof Kozlowski [this message]
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=55D6794B.60800@samsung.com \
--to=k.kozlowski-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@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 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.