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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 451F6C433F5 for ; Tue, 11 Jan 2022 13:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240214AbiAKNBw (ORCPT ); Tue, 11 Jan 2022 08:01:52 -0500 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:53951 "EHLO wnew1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239661AbiAKNBt (ORCPT ); Tue, 11 Jan 2022 08:01:49 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id AB3202B000AA; Tue, 11 Jan 2022 08:01:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 11 Jan 2022 08:01:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=t/jyaTfuGX6T5u75/bYTe7A2rVR H5GYboErwsWPA6rE=; b=kx30Q9n7m32+u8SHiRHmXjmosz7FoQfkUP1T9hoWVvA YvzyGLSDM1giV+3UbFMqdvEhmocpa0uerfDoKgBwoIXz+7kQkEhwqUgt8l60uX3F mRLMNsN+QmgV4sZZOGxSgL/Z2CTEvazPnItv0nIXxXj6wjoh9qc9GAhsqaUobACy 2zIMEApg+UTaDvOWEQUvT2cYqAjt1EziRRf1KhuO0oSOs3TxY9Jiz8BWzBz9L2tn zu0SzQUF07HDHnYw0zP50SVNqswAmu2jTUo/bgP6wLnIaEQVTkFOqYrmRjk1jtSl eEdd2y3cfSumuTJ3oa2+Go80on7h7z8EW/BHURE3ENQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=t/jyaT fuGX6T5u75/bYTe7A2rVRH5GYboErwsWPA6rE=; b=d4FzuOZb/w9q75M0aNRZ6v zWTwmMMDLgFsKbruGT9IF38yO/kfoiquCSk3EDruAKQS5z8iIlS7TFnRb7pKYOGn Xxuhgc9D2bhl6uDzFM5mIGrOqfvm/VwlcwwBE/THZxfXXRPl7651FXtWhPd7+47i YGhao5EQIZM/vDSazpWrvfEGkBwmF9uV9kWwjTDMDkUyKoMSWT0bMetC7RPs7dSm k6WKdnknlvr+e6QjhihUv5oOeof0AmsTSXWPmn7oeFoCVBt27DZfbjXGnK1UcEkd JkBiKTPP4pQlGFFkVMJirUh5Gl095UvjwVneUaMjo0NfSxDeWa//fpc5sG/BEXHA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehfedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Jan 2022 08:01:45 -0500 (EST) Date: Tue, 11 Jan 2022 14:01:44 +0100 From: Maxime Ripard To: Thomas Zimmermann Cc: Florian Fainelli , Ray Jui , Nicolas Saenz Julienne , Daniel Vetter , David Airlie , Maarten Lankhorst , Scott Branden , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Dom Cobley , Tim Gover , Dave Stevenson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, Phil Elwell , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RESEND v4 v5 4/4] drm/vc4: Notify the firmware when DRM is in charge Message-ID: <20220111130144.y2fs74tkpe7ecada@houat> References: <20211215095117.176435-1-maxime@cerno.tech> <20211215095117.176435-5-maxime@cerno.tech> <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eknbquhrmytuqbad" Content-Disposition: inline In-Reply-To: <1a42431d-59bc-53e0-199b-815c96f97a29@suse.de> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org --eknbquhrmytuqbad Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thomas, On Tue, Jan 11, 2022 at 10:38:36AM +0100, Thomas Zimmermann wrote: > Hi >=20 > Am 15.12.21 um 10:51 schrieb Maxime Ripard: > > Once the call to drm_fb_helper_remove_conflicting_framebuffers() has > > been made, simplefb has been unregistered and the KMS driver is entirely > > in charge of the display. > >=20 > > Thus, we can notify the firmware it can free whatever resource it was > > using to maintain simplefb functional. > >=20 > > Signed-off-by: Maxime Ripard > > --- > > drivers/gpu/drm/vc4/vc4_drv.c | 22 ++++++++++++++++++++++ > > 1 file changed, 22 insertions(+) > >=20 > > diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_dr= v.c > > index 86c61ee120b7..a03053c8e22c 100644 > > --- a/drivers/gpu/drm/vc4/vc4_drv.c > > +++ b/drivers/gpu/drm/vc4/vc4_drv.c > > @@ -37,6 +37,8 @@ > > #include > > #include > > +#include > > + > > #include "uapi/drm/vc4_drm.h" > > #include "vc4_drv.h" > > @@ -215,6 +217,7 @@ static void vc4_match_add_drivers(struct device *de= v, > > static int vc4_drm_bind(struct device *dev) > > { > > struct platform_device *pdev =3D to_platform_device(dev); > > + struct rpi_firmware *firmware =3D NULL; > > struct drm_device *drm; > > struct vc4_dev *vc4; > > struct device_node *node; > > @@ -251,10 +254,29 @@ static int vc4_drm_bind(struct device *dev) > > if (ret) > > return ret; > > + node =3D of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-fir= mware"); > > + if (node) { > > + firmware =3D rpi_firmware_get(node); > > + of_node_put(node); > > + > > + if (!firmware) > > + return -EPROBE_DEFER; > > + } > > + >=20 > The code is >=20 > Acked-by: Thomas Zimmermann Thanks for your review > Just for my understanding: >=20 > You retrieve the firmware before killing simpledrm simply to keep the > display on if it fails, right? Exactly > What's the possible error that would justify a retry (via EPROBE_DEFER)? The firmware there is backed by a driver that might not have probed yet, in which case we just want to retry later on Maxime --eknbquhrmytuqbad Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYd1/uAAKCRDj7w1vZxhR xeldAQDChNSM76RAq7W2gPVkPoweMGpJz6/TGfj4Pi+ZULSuwQD8CmSAhoMN2pve 3O2WrSSFt3UJzozo/w6KXpBiFXR9+A8= =Lqs6 -----END PGP SIGNATURE----- --eknbquhrmytuqbad--