From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF56DEE644C for ; Fri, 15 Sep 2023 10:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Gzdv1O5XZnPtc2l30+ICb1diXJHPlzxdh4QZouUwwcg=; b=Ozq/RSvdbtHlBCFsBWuOXFOlo0 0XjDYvElee/Sci+JZPQoalyy2Ks5RBnDlgzAACrH7kzWCqJpoG0cuJMcnpLkXxDMQl8evaSFMoh9f Ndx4m/ja3zJTyAI1t2lm9kS8GyLtRePsU29+9qDfcnqoysbzOssv5CeDHOjDEKTSMhwhDspAippZc +urk9RXd6LVwN3INJvAm5uSxORA6Y1jis4f+VYhJ5AQ7BUZSqyvQcOfEWPz1idF6scju6nmHnQroY 9w/frgN1V+bVb5yDfxDCdDl1wj5D0VDVV78n24tACjJCa+SCSlIdRSM4D0Kbe0CKrDRecPmh6KJ7q eHZUilqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qh5fn-00AM2r-2Q; Fri, 15 Sep 2023 10:03:39 +0000 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qh5fl-00AM1o-0d for linux-arm-kernel@lists.infradead.org; Fri, 15 Sep 2023 10:03:38 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3A7961C0009; Fri, 15 Sep 2023 10:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1694772210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0RJaHCWox609H1viPdZua6BwY1o0hPjtbEeqoNA0ha8=; b=eXSkWgBNTxWofIKNGKxhYddW9tYHgH3Wp9sQ3WMOAJKvh/dFQhFZqiIDlkln+hRu83l/ue 97J5B3RGkyDpxjiSLAvDGt6MygKC4qp+WGv0+fesqjQlsHkGvzhhsCJt6JYggG1fzrEgb4 VbPT8/jPnvPUDl3wFnTc9b0D2RwZ2nZkDuW36/cyWq3Zv4p62gexn0q74ZZTExxw6N8wBN VAYsOU+TxH4ZojwVepCBGTrweACm2JpVvS3Yz5lR8w+EYx0dyDB0wMY62R28RUGxHVyfxN JW3JF6Ei73lBpHsMoEGL1dXP4YN6AZRkQbJwcFlXPaS6RbGfnapBe6V6yGITuQ== Date: Fri, 15 Sep 2023 12:03:28 +0200 From: Paul Kocialkowski To: Jernej Skrabec 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 Message-ID: References: <20230911184612.1754373-1-jernej.skrabec@gmail.com> MIME-Version: 1.0 In-Reply-To: <20230911184612.1754373-1-jernej.skrabec@gmail.com> X-GND-Sasl: paul.kocialkowski@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230915_030337_552443_777D174B X-CRM114-Status: GOOD ( 18.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============3770646341185183445==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3770646341185183445== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="U/o0wQSnyl6QuOjI" Content-Disposition: inline --U/o0wQSnyl6QuOjI Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 Cheers, Paul > Fixes: d5aecd289bab ("media: cedrus: Implement runtime PM") > Signed-off-by: Jernej Skrabec > --- > .../staging/media/sunxi/cedrus/cedrus_hw.c | 24 +++++++++---------- > 1 file changed, 12 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c b/drivers/sta= ging/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 =3D dev_get_drvdata(device); > =20 > - reset_control_assert(dev->rstc); > - > clk_disable_unprepare(dev->ram_clk); > clk_disable_unprepare(dev->mod_clk); > clk_disable_unprepare(dev->ahb_clk); > =20 > + reset_control_assert(dev->rstc); > + > return 0; > } > =20 > @@ -186,11 +186,18 @@ int cedrus_hw_resume(struct device *device) > struct cedrus_dev *dev =3D dev_get_drvdata(device); > int ret; > =20 > + ret =3D reset_control_reset(dev->rstc); > + if (ret) { > + dev_err(dev->dev, "Failed to apply reset\n"); > + > + return ret; > + } > + > ret =3D clk_prepare_enable(dev->ahb_clk); > if (ret) { > dev_err(dev->dev, "Failed to enable AHB clock\n"); > =20 > - return ret; > + goto err_rst; > } > =20 > ret =3D clk_prepare_enable(dev->mod_clk); > @@ -207,21 +214,14 @@ int cedrus_hw_resume(struct device *device) > goto err_mod_clk; > } > =20 > - ret =3D reset_control_reset(dev->rstc); > - if (ret) { > - dev_err(dev->dev, "Failed to apply reset\n"); > - > - goto err_ram_clk; > - } > - > return 0; > =20 > -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); > =20 > return ret; > } > --=20 > 2.42.0 >=20 --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --U/o0wQSnyl6QuOjI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmUEK/AACgkQ3cLmz3+f v9E8hQf9GCb2ltMDDoEoNcg6RITV8kvOIFCVHC3ltcesf2VF+MAj+cVGmfAen28O r6UX5rQhptLslyX/0BJGnXhdek/fY+m/UpQuAvRSiML43HkSObcg0FU8hTnerJiF v5WXmxrKEmOUTNNRt/OSgbtyOlCm+8rHkvbh0NdHn9T+liNXm84TxCv9GISU+OEs 8Eynlw/FOakPWImKlXBhxmhxDEs2YQYFN8f7UmjW9BDQkOFIO+kAWQX1/SwEM4ji tLB/kcx+vq7XG6yiLmGmfG3vabJD3BMFE9qla210IgJF6NhV+ZMfyYbGVBMm/KOo yvYTthou+syRnZfM3tQh519yYnXIbw== =bUDq -----END PGP SIGNATURE----- --U/o0wQSnyl6QuOjI-- --===============3770646341185183445== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============3770646341185183445==--