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 A9659C433F5 for ; Mon, 13 Dec 2021 17:06:57 +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=VpCOndwmPbiUJi5LRQITI2U3bHo4tUr+InV/2NQX4EM=; b=hGgngQjb0DGYduMmchV2R4qG7D vXCAhGoRUSxC8/cbWCWQhG+DjkXBeBwI1sVNkQMV4LNu2uWoyCD/92kzwZj45xp+1m7PjDpebU3kO fMKC3j9f575+3ySViVvxNYUF6jhUfKJl7pQ6r9JnGnEwH5/C9neyHOb2/AmWdGYVVFLzHvxcu09cE WUieVFdLDsRjiK6jltkjElbyScEEHdzZN+ARSgJ/EvrGTSLZdfMT2fFeo0K7TVnJWlfnxuh5eAtJ1 YNiAqr1O+kk6zhjNpoSFMOr5HN6Ve7j8jrbIrkA+azeRWSUMFb6MofK5UVERqrzTf2IwLD7QNR13d XWfDCk/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwolP-00Alri-G3; Mon, 13 Dec 2021 17:05:23 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwolK-00AlqA-U7 for linux-arm-kernel@lists.infradead.org; Mon, 13 Dec 2021 17:05:20 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3B0965C01A6; Mon, 13 Dec 2021 12:05:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 13 Dec 2021 12:05:18 -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=e95AF2j9MiIxrIXhpLNwutXXb93 SHacg7FqvkjbL/Y8=; b=Rz50GGTSkJ261LZbn5rizfYS/0Rc9cUE7UnTs64ita+ z4RDrqY81V1u5AfLAFEiW2QqzwhOXU9hQ7pkphfh+6PsSvWt0dHWGn83WHDHqxQ3 PZX5+mSI2XF72Ox3rgS5KtJSWWCZ4kUy2KI0uSiKWLgP+BXD5w4q8kHKaadoJ2YQ P/zK1PhFTrk1igi+mppugTxPUDXerSyOTwVLzsVqC+6zwU1WEG5wQSSaTWHoxCcN 9BE5aVQG5YAobHhZG2GLSVW0sb5dV/M4Rw3lm0ip/rUfJ4wypzswAyIFcSnhLneb cdNcpXqOXN50x9iuFw8smzeG9y5+zVd4wEoowE5UPRA== 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=e95AF2 j9MiIxrIXhpLNwutXXb93SHacg7FqvkjbL/Y8=; b=G8M323Ra4+izS3Hh9FF8KR xidconoKDOKfkMM5p1yP559sqizx7qSp34O7tClSPxQzxrff/zZrx5h/Vtm2Co4d DIn9zFA5du3lM9BAbEGhJ6ayhv6OpCS1dlMgc+5ASqrPYWRM+aQtc0zGOCx7IjmF 2Xdr7AJgIjzJDaiIiuo6+0XvBGF7YEQDxZ75vixI4BTU4FkmixQ8du8ytOrSrNed zjEmRsHFZ3Ub694z9Dvqqi/6o/wsNngA66EQDu0d3Wz9QDtjS2ylkTw7IdtKT33r 2DMxXAeIJjOKUPMRHarhnk5u4dOzYoXSurvQ/X/XE0UYj+XIJm83aVICbZqVtT3w == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeelkeeghefhuddtleejgfeljeffheffgfeijefhgfeufefhtdevteegheeiheeg udenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 12:05:16 -0500 (EST) Date: Mon, 13 Dec 2021 18:05:15 +0100 From: Maxime Ripard To: Jagan Teki Cc: Chen-Yu Tsai , Laurent Pinchart , Neil Armstrong , Robert Foss , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com Subject: Re: [PATCH v6 2/6] drm: sun4i: dsi: Add component only once DSI device attached Message-ID: <20211213170515.2xzx52pedqcjqiyy@houat> References: <20211210111711.2072660-1-jagan@amarulasolutions.com> <20211210111711.2072660-3-jagan@amarulasolutions.com> MIME-Version: 1.0 In-Reply-To: <20211210111711.2072660-3-jagan@amarulasolutions.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_090519_082343_124990C6 X-CRM114-Status: GOOD ( 28.86 ) 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="===============4153333854502926799==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4153333854502926799== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y7qgik3d2zhwi7o4" Content-Disposition: inline --y7qgik3d2zhwi7o4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 10, 2021 at 04:47:07PM +0530, Jagan Teki wrote: > Having component_add for running all drm bind callbacks returns > error or unbound due to chain of DSI devices connected across > bridge topology on a display pipeline. I'm not sure what that means? > In a typical bridge oriented display pipeline where the host is > connected to the bridge converter and that indeed connected to > a panel. >=20 > DRM =3D> SUN6I DSI Host =3D> Chipone ICN6211 =3D> BananaPi Panel >=20 > The bridge converter is looking for a panel to probe first and > then attach the host. The host attach is looking for a bridge > converter to probe and preserve bridge pointer, at this movement ^ moment ? > the host is trying to bind the all callbacks and one of the bind > callback in the DSI host is trying to find the bridge using the > bridge pointer in sun6i_dsi_attach call. >=20 > chipone_probe().start > drm_of_find_panel_or_bridge > mipi_dsi_attach > sun6i_dsi_attach > drm_of_find_panel_or_bridge > chipone_probe().done >=20 > sun6i_dsi_probe().start > mipi_dsi_host_register > component_add > sun6i_dsi_probe().done >=20 > However, the movement when panel defers the probe, will make the > bridge converter defer the host attach call which eventually found > a NULL bridge pointer during DSI component bind callback. >=20 > So, in order to prevent this scenario of binding invalid bridge, > wait for DSI devices on the pipeline to probe first and start the > binding process by moving component_add in host probe to attach call. >=20 > chipone_probe().start > drm_of_find_panel_or_bridge > mipi_dsi_attach > sun6i_dsi_attach > drm_of_find_panel_or_bridge > component_add > chipone_probe().done >=20 > sun6i_dsi_probe().start > mipi_dsi_host_register > sun6i_dsi_probe().done >=20 > Signed-off-by: Jagan Teki > --- > Changes for v6: > - none > Changes for v5: > - new patch >=20 > drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 120 +++++++++++++------------ > 1 file changed, 61 insertions(+), 59 deletions(-) >=20 > diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun= 4i/sun6i_mipi_dsi.c > index 4bdcce8f1d84..9cf91dcac3f2 100644 > --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c > @@ -959,11 +959,63 @@ static int sun6i_dsi_dcs_read(struct sun6i_dsi *dsi, > return 1; > } > =20 > +static int sun6i_dsi_bind(struct device *dev, struct device *master, > + void *data) > +{ > + struct drm_device *drm =3D data; > + struct sun6i_dsi *dsi =3D dev_get_drvdata(dev); > + int ret; > + > + drm_encoder_helper_add(&dsi->encoder, > + &sun6i_dsi_enc_helper_funcs); > + ret =3D drm_simple_encoder_init(drm, &dsi->encoder, > + DRM_MODE_ENCODER_DSI); > + if (ret) { > + dev_err(dsi->dev, "Couldn't initialise the DSI encoder\n"); > + return ret; > + } > + dsi->encoder.possible_crtcs =3D BIT(0); > + > + drm_connector_helper_add(&dsi->connector, > + &sun6i_dsi_connector_helper_funcs); > + ret =3D drm_connector_init(drm, &dsi->connector, > + &sun6i_dsi_connector_funcs, > + DRM_MODE_CONNECTOR_DSI); > + if (ret) { > + dev_err(dsi->dev, > + "Couldn't initialise the DSI connector\n"); > + goto err_cleanup_connector; > + } > + > + drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); > + > + return 0; > + > +err_cleanup_connector: > + drm_encoder_cleanup(&dsi->encoder); > + return ret; > +} > + > +static void sun6i_dsi_unbind(struct device *dev, struct device *master, > + void *data) > +{ > + struct sun6i_dsi *dsi =3D dev_get_drvdata(dev); > + > + drm_encoder_cleanup(&dsi->encoder); > +} > + > +static const struct component_ops sun6i_dsi_ops =3D { > + .bind =3D sun6i_dsi_bind, > + .unbind =3D sun6i_dsi_unbind, > +}; Just use a forward declaration there, it will make the patch more straightforward. Maxime --y7qgik3d2zhwi7o4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYbd9SwAKCRDj7w1vZxhR xTfsAQD+sHZYd5aYSJVMY/r6BH/r1d40RbJ4XF6fFY7wcKtfEgEA+BQwdgaDHwdG miCwNJkfa7m6wgG7zJMkFSKpyz24RAI= =ffqM -----END PGP SIGNATURE----- --y7qgik3d2zhwi7o4-- --===============4153333854502926799== 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 --===============4153333854502926799==--