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 4549CC433F5 for ; Mon, 21 Mar 2022 09:12:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345714AbiCUJOJ (ORCPT ); Mon, 21 Mar 2022 05:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345704AbiCUJOG (ORCPT ); Mon, 21 Mar 2022 05:14:06 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FB45DB4BE for ; Mon, 21 Mar 2022 02:12:41 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D37CF5C0127; Mon, 21 Mar 2022 05:12:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 21 Mar 2022 05:12:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=yk+nKpl1q7kSZQ0Ga4s6cX3UW3mqfycxEk/hbr UrqjA=; b=tmBZLNYeUIr+1OS4X+l580Np02SDwdmZAkLq7BaZTqKx4CYSflht2Y 2vY9O0hLhund1WtFWicyL9AlUouCJpEzF0our6MgPUHGfbEfzN8Sw+Jvp4Llqv8J hrLdnY/Zl3qsZ9ZNJpeDhXPjGHuZ5kN8xYrR669a8Qz6taSdx2LpNlCqpLP5h+h1 3FXEb4nVL/KkNXO+0F2X5aA1OEsyTTOetLs9M5NGmB+crUMZVUljwzp1u+bd5Un4 QSsTmthEOedQU0IuVjeX7u9IB198nUeLnjJ+c3CUKeyWl6i6di9voSRZ4QlNe95n /FgUwVZhj1sPg+zL81esajn3L4mxD/jg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=yk+nKpl1q7kSZQ0Ga 4s6cX3UW3mqfycxEk/hbrUrqjA=; b=OHwE84h3b8iy5JgHvWJCL+WbZIVXUDo5p Anl4bP0H2v0DZFIRFCb4UjK8LI9OoMRaYsfiFQGIgi/nUk7QRP5jf5CCjLtzVZJ8 9W3cKb85OuGyinPF1py1So0c+m3yK14VEj0JcrS8/jUA6RpQ6PjgBctGBQkbQ7Nv fwIUmtkeGeFIDrAIg7dp348ARfpzBOAAuSDcSsgC8yQIJifBj7Qw22kitxMikyb4 K1k1For9j++/mX/3J218iyzqsKEstfRQAR4DCQ7rp4cP0BOzR77wo9E5bEEamJtE qc6G1Hf0pwfBrd4j6BZ2kShe857mjWNAfcPzI3kG36+iy1kMejl/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegfedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucdnkfhovfculdeitddmnecujfgurhepfffhvffukf hfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhmvgcutfhiphgrrhguuceo mhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvghrnhepleekgeehhf dutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieehgedunecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnh hordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Mar 2022 05:12:39 -0400 (EDT) Date: Mon, 21 Mar 2022 10:12:36 +0100 From: Maxime Ripard To: Paul Kocialkowski Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Linus Walleij , Jagan Teki , Thomas Petazzoni Subject: Re: [PATCH v2] drm: of: Properly try all possible cases for bridge/panel detection Message-ID: <20220321091236.5rcottkhtztvijpl@houat> References: <20220318160249.126431-1-paul.kocialkowski@bootlin.com> <20220318161847.ezi6yat4on7rvfdf@houat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5mrpx3bhcyhfcg74" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --5mrpx3bhcyhfcg74 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 18, 2022 at 05:22:46PM +0100, Paul Kocialkowski wrote: > On Fri 18 Mar 22, 17:18, Maxime Ripard wrote: > > On Fri, Mar 18, 2022 at 05:02:49PM +0100, Paul Kocialkowski wrote: > > > While bridge/panel detection was initially relying on the usual > > > port/ports-based of graph detection, it was recently changed to > > > perform the lookup on any child node that is not port/ports > > > instead when such a node is available, with no fallback on the > > > usual way. > > >=20 > > > This results in breaking detection when a child node is present > > > but does not contain any panel or bridge node, even when the > > > usual port/ports-based of graph is there. > > >=20 > > > In order to support both situations properly, this commit reworks > > > the logic to try both options and not just one of the two: it will > > > only return -EPROBE_DEFER when both have failed. > > >=20 > > > Signed-off-by: Paul Kocialkowski > > > Fixes: 80253168dbfd ("drm: of: Lookup if child node has panel or brid= ge") > > > --- > > >=20 > > > Changes since v1: > > > - Renamed remote to node; > > > - Renamed helper to find_panel_or_bridge; > > > - Cleared bridge pointer early; > > > - Returned early to make the code more concise; > > >=20 > > > --- > > > drivers/gpu/drm/drm_of.c | 98 ++++++++++++++++++++------------------= -- > > > 1 file changed, 49 insertions(+), 49 deletions(-) > > >=20 > > > diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c > > > index 9d90cd75c457..63137c833b7a 100644 > > > --- a/drivers/gpu/drm/drm_of.c > > > +++ b/drivers/gpu/drm/drm_of.c > > > @@ -219,6 +219,28 @@ int drm_of_encoder_active_endpoint(struct device= _node *node, > > > } > > > EXPORT_SYMBOL_GPL(drm_of_encoder_active_endpoint); > > > =20 > > > +static int find_panel_or_bridge(struct device_node *node, > > > + struct drm_panel **panel, > > > + struct drm_bridge **bridge) > > > +{ > > > + if (panel) { > > > + *panel =3D of_drm_find_panel(node); > > > + if (!IS_ERR(*panel)) > > > + return 0; > > > + else > > > + *panel =3D NULL; > >=20 > > You don't need the else branch here, we already cleared panel in > > drm_of_find_panel_or_bridge >=20 > I think we do, because of_drm_find_panel doesn't return NULL when an error > happens but PTR_ERR(), so we need to clear it to keep up with previous > expectations. Ah, right. We should remove the else then, checkpatch complains about it. Maxime --5mrpx3bhcyhfcg74 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYjhBhAAKCRDj7w1vZxhR xY30AP48CB5lqRqbdnOS6zvsuJf8aSBYpBIhroE2fAQCOUmvtwD+LPaP2ISCRzgk ZZKzRmLYAorwUG84gEHQLYeajML57AI= =J2Z3 -----END PGP SIGNATURE----- --5mrpx3bhcyhfcg74--