From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: mripard@kernel.org, mchehab@kernel.org,
gregkh@linuxfoundation.org, wens@csie.org, samuel@sholland.org,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: cedrus: Fix clock/reset sequence
Date: Fri, 15 Sep 2023 12:03:28 +0200 [thread overview]
Message-ID: <ZQQr8LdOpALMIant@aptenodytes> (raw)
In-Reply-To: <20230911184612.1754373-1-jernej.skrabec@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2392 bytes --]
Hi Jernej,
On Mon 11 Sep 23, 20:46, Jernej Skrabec wrote:
> According to H6 user manual, resets should always be de-asserted before
> clocks are enabled. This is also consistent with vendor driver.
You're right, thanks for the patch!
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cheers,
Paul
> Fixes: d5aecd289bab ("media: cedrus: Implement runtime PM")
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> ---
> .../staging/media/sunxi/cedrus/cedrus_hw.c | 24 +++++++++----------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> index b696bf884cbd..32af0e96e762 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
> @@ -172,12 +172,12 @@ int cedrus_hw_suspend(struct device *device)
> {
> struct cedrus_dev *dev = dev_get_drvdata(device);
>
> - reset_control_assert(dev->rstc);
> -
> clk_disable_unprepare(dev->ram_clk);
> clk_disable_unprepare(dev->mod_clk);
> clk_disable_unprepare(dev->ahb_clk);
>
> + reset_control_assert(dev->rstc);
> +
> return 0;
> }
>
> @@ -186,11 +186,18 @@ int cedrus_hw_resume(struct device *device)
> struct cedrus_dev *dev = dev_get_drvdata(device);
> int ret;
>
> + ret = reset_control_reset(dev->rstc);
> + if (ret) {
> + dev_err(dev->dev, "Failed to apply reset\n");
> +
> + return ret;
> + }
> +
> ret = clk_prepare_enable(dev->ahb_clk);
> if (ret) {
> dev_err(dev->dev, "Failed to enable AHB clock\n");
>
> - return ret;
> + goto err_rst;
> }
>
> ret = clk_prepare_enable(dev->mod_clk);
> @@ -207,21 +214,14 @@ int cedrus_hw_resume(struct device *device)
> goto err_mod_clk;
> }
>
> - ret = reset_control_reset(dev->rstc);
> - if (ret) {
> - dev_err(dev->dev, "Failed to apply reset\n");
> -
> - goto err_ram_clk;
> - }
> -
> return 0;
>
> -err_ram_clk:
> - clk_disable_unprepare(dev->ram_clk);
> err_mod_clk:
> clk_disable_unprepare(dev->mod_clk);
> err_ahb_clk:
> clk_disable_unprepare(dev->ahb_clk);
> +err_rst:
> + reset_control_assert(dev->rstc);
>
> return ret;
> }
> --
> 2.42.0
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-09-15 10:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 18:46 [PATCH] media: cedrus: Fix clock/reset sequence Jernej Skrabec
2023-09-15 10:03 ` Paul Kocialkowski [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=ZQQr8LdOpALMIant@aptenodytes \
--to=paul.kocialkowski@bootlin.com \
--cc=gregkh@linuxfoundation.org \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-sunxi@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mripard@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@csie.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).