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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF322C64E7C for ; Wed, 2 Dec 2020 16:10:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3987C205CA for ; Wed, 2 Dec 2020 16:10:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3987C205CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject: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=T20iMbMIaxl0UntGk8C0CXjcYt2thn6JLDSUIHFBF6k=; b=Ls9JZN0NGZy42We2PLvOrFZ7C L29Vcpl6JE3Y9bZY30kEPKzT2HF6gc34caJo2lcM3JjMwUv/X+t1KXKKAaxOkW+58gIEjp3ehaF2X ZL5WwGI/tqsTuWCp8A6JvsPIY0qmUgV+3C0zFRTKDAD5Tx1b1mt6jbkkC9aDTKhCaJ/BGdvQ60kTD M/RK3mYRPjpJPgXprwYkIE0PDrfXTbRqkwuRrHyOujI7x6lXV2YsHJJtb5yE8NdoRwxiopb36CHi/ R4+W3SolhsN3OAHn+UjAflF7pstZASqC7Ib0xHo44BbYhcTzg8nV4bullKHRNOTU87/wdy7E042v9 Yd1CKHZlg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkUhC-0000Tt-1f; Wed, 02 Dec 2020 16:09:34 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkUh6-0000Ru-U2 for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2020 16:09:30 +0000 X-Originating-IP: 93.29.109.196 Received: from aptenodytes (196.109.29.93.rev.sfr.net [93.29.109.196]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 23E8520002; Wed, 2 Dec 2020 16:09:20 +0000 (UTC) Date: Wed, 2 Dec 2020 17:09:20 +0100 From: Paul Kocialkowski To: Maxime Ripard Subject: Re: [PATCH v2 13/19] media: sunxi: Add support for the A31 MIPI CSI-2 controller Message-ID: References: <20201128142839.517949-1-paul.kocialkowski@bootlin.com> <20201128142839.517949-14-paul.kocialkowski@bootlin.com> <20201201122038.bxk3vu2w3mg43ayq@gilmour> <20201202154818.bf72m2firemyc5ve@gilmour> MIME-Version: 1.0 In-Reply-To: <20201202154818.bf72m2firemyc5ve@gilmour> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_110929_151214_8E58390C X-CRM114-Status: GOOD ( 25.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dafna Hirschfeld , linux-doc@vger.kernel.org, linux-sunxi@googlegroups.com, Thomas Petazzoni , kevin.lhopital@hotmail.com, devel@driverdev.osuosl.org, Jonathan Corbet , Kishon Vijay Abraham I , Chen-Yu Tsai , Hans Verkuil , linux-media@vger.kernel.org, devicetree@vger.kernel.org, Sakari Ailus , Helen Koike , Rob Herring , Yong Deng , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Jernej Skrabec , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Vinod Koul , Philipp Zabel Content-Type: multipart/mixed; boundary="===============3279777971350966692==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============3279777971350966692== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NYHUWLtOMJokL+dM" Content-Disposition: inline --NYHUWLtOMJokL+dM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed 02 Dec 20, 16:48, Maxime Ripard wrote: > On Wed, Dec 02, 2020 at 03:44:47PM +0100, Paul Kocialkowski wrote: > > > > +static int __maybe_unused sun6i_mipi_csi2_suspend(struct device *d= ev) > > > > +{ > > > > + struct sun6i_mipi_csi2_dev *cdev =3D dev_get_drvdata(dev); > > > > + > > > > + clk_disable_unprepare(cdev->clk_mod); > > > > + clk_disable_unprepare(cdev->clk_bus); > > > > + reset_control_assert(cdev->reset); > > > > + > > > > + return 0; > > > > +} > > > > + > > > > +static int __maybe_unused sun6i_mipi_csi2_resume(struct device *de= v) > > > > +{ > > > > + struct sun6i_mipi_csi2_dev *cdev =3D dev_get_drvdata(dev); > > > > + int ret; > > > > + > > > > + ret =3D reset_control_deassert(cdev->reset); > > > > + if (ret) { > > > > + dev_err(cdev->dev, "failed to deassert reset\n"); > > > > + return ret; > > > > + } > > > > + > > > > + ret =3D clk_prepare_enable(cdev->clk_bus); > > > > + if (ret) { > > > > + dev_err(cdev->dev, "failed to enable bus clock\n"); > > > > + goto error_reset; > > > > + } > > > > + > > > > + ret =3D clk_prepare_enable(cdev->clk_mod); > > > > + if (ret) { > > > > + dev_err(cdev->dev, "failed to enable module clock\n"); > > > > + goto error_clk_bus; > > > > + } > > > > + > > > > + return 0; > > > > + > > > > +error_clk_bus: > > > > + clk_disable_unprepare(cdev->clk_bus); > > > > + > > > > +error_reset: > > > > + reset_control_assert(cdev->reset); > > > > + > > > > + return ret; > > > > +} > > >=20 > > > I'm guessing you set the __maybe_unused attribute because you're using > > > SET_RUNTIME_PM_OPS, but what would happen if runtime_pm isn't selecte= d? > > > It looks like you don't handle that case. > >=20 > > Indeed, __maybe_unused is because of the conditional definition of > > SET_RUNTIME_PM_OPS. If CONFIG_PM is not selected, then I guess the cont= roller > > wouldn't be powered and wouldn't work. So I should definitely add a Kco= nfig > > dependency on PM then, right? >=20 > There's two ways we can do it. What you suggested is one, the other is > to have something like our SPI driver to call directly the resume > function if there's no runtime pm support. Understood! I think I'll stick to depending on PM (unless you prefer not to) but it's good to know. Cheers, Paul --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --NYHUWLtOMJokL+dM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAl/HvDAACgkQ3cLmz3+f v9Fm8AgAiWV6aebhuxeTBIhOQywJt0bWH442ibCI6O2W3BO1aBzn5le48//KHOBW 3KuGiKTjL4guqfc4fNKG+moEqOai8v11MAVAz8ii/74l0WyN4LYUFwrKRJzGwS0J KQw/ldQxF5u8pYMGxaderBmACdscPzBoTvQZuVshEnRlQ9qKUHIsDa6CGieDQqIs 9GNj9KiG/mWBV/AAYRwvllA3QW/EQJo3zbNs7wAAMMtOebNwSfh6P9peh8/memFn 3MOHDAbEKAHKUWimARCMBhOQRGnQf3/wjBif0L7iebN4FUYqyl8cN5iOCwGVwfgs iFi3TSt1u9r0cUsE5yzDwsR6UZBipA== =TddM -----END PGP SIGNATURE----- --NYHUWLtOMJokL+dM-- --===============3279777971350966692== 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 --===============3279777971350966692==--