From patchwork Fri Sep 10 10:12:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 508994 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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 4F94BC433F5 for ; Fri, 10 Sep 2021 10:13:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 342596103D for ; Fri, 10 Sep 2021 10:13:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232408AbhIJKO2 (ORCPT ); Fri, 10 Sep 2021 06:14:28 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:38827 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232209AbhIJKO1 (ORCPT ); Fri, 10 Sep 2021 06:14:27 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 27DCF2B012B6; Fri, 10 Sep 2021 06:13:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 10 Sep 2021 06:13:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=f7+8rOA2zq11N 06RP7ErbqsdE2zZLyFKicXjgncFrp8=; b=hDJqzOlWGKIGekmk5j7vrdoL/C5cA NabEDOqP0Elhw7Ta/TVcdLrp4Eg2KUejSVQh4DvZegjT7AGCQoykELygYMOa1b4V xr+UQrl3iB7bzB/ZsxwEuOddFxPAcjEk69QUyh5YBGVWi1fX6ZdeyVsxpM5gimGk P3bxDK4IKIsZvcbcQ1GkMzRnpMsFXy1swaMfesFQCb5rDaG4i2d4g5BFZpYCA7RV jPvvi/81cHa72F9Mrjg9tTtmNhTHnSdDi841e4H0kZyWxj0cuJa33dDHajEqfpH/ 5SdsEud3pRTUwUE0ZqFHVyGN5+AVc3Bh0HKledQoSN2FFsxtGEtj4g/cg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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= fm3; bh=f7+8rOA2zq11N06RP7ErbqsdE2zZLyFKicXjgncFrp8=; b=Y3mV7C3H g76lPMblNGpqcUbqArr7lcpTdEfxjgfU0mqcP8kUkZR1EFWFfAQOR6Ys6MUSkAvJ uAGn1EAo51MHjfmY6il3Mbey5tF6rvWfbbIKhujcZCpTC4GyQBWiH2loPQcmAbfA U2lUcbRuBalTLFO5Eyj/vFux9iImORCRN9tqULHEq9NH6P8yqQun0JZFAshkxCUv o+AP4InnE1Uw9TeBxaJHQQSgKNM5UNJZhw09fAJhv2dOO5OQip8B+Aj4hbvZ6DxQ e2ZZ76aqUKv0EGrnH0d5ltu8xSK4lbVq6xgVhzcjOHBt63+lmNnbMYSBG+Kf3T32 FxebiIYMseWvZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeguddgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Sep 2021 06:13:10 -0400 (EDT) From: Maxime Ripard To: Andrzej Hajda , Sam Ravnborg , Daniel Vetter , David Airlie , Jonas Karlman , Laurent Pinchart , Thierry Reding , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Neil Armstrong , Robert Foss , Jernej Skrabec Cc: Sean Paul , freedreno@lists.freedesktop.org, Kyungmin Park , linux-kernel@vger.kernel.org, Xinliang Liu , Seung-Woo Kim , Tian Tao , Inki Dae , linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, Rob Clark , dri-devel@lists.freedesktop.org, John Stultz , Chen Feng , Xinwei Kong , Joonyoung Shim Subject: [PATCH v4 08/24] drm/bridge: anx7625: Register and attach our DSI device at probe Date: Fri, 10 Sep 2021 12:12:02 +0200 Message-Id: <20210910101218.1632297-9-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210910101218.1632297-1-maxime@cerno.tech> References: <20210910101218.1632297-1-maxime@cerno.tech> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/bridge/analogix/anx7625.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 4adeb2bad03a..d0317651cd75 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1367,12 +1367,6 @@ static int anx7625_bridge_attach(struct drm_bridge *bridge, return -ENODEV; } - err = anx7625_attach_dsi(ctx); - if (err) { - DRM_DEV_ERROR(dev, "Fail to attach to dsi : %d\n", err); - return err; - } - if (ctx->pdata.panel_bridge) { err = drm_bridge_attach(bridge->encoder, ctx->pdata.panel_bridge, @@ -1845,10 +1839,24 @@ static int anx7625_i2c_probe(struct i2c_client *client, platform->bridge.type = DRM_MODE_CONNECTOR_eDP; drm_bridge_add(&platform->bridge); + ret = anx7625_attach_dsi(platform); + if (ret) { + DRM_DEV_ERROR(dev, "Fail to attach to dsi : %d\n", ret); + goto unregister_bridge; + } + DRM_DEV_DEBUG_DRIVER(dev, "probe done\n"); return 0; +unregister_bridge: + drm_bridge_remove(&platform->bridge); + + if (!platform->pdata.low_power_mode) + pm_runtime_put_sync_suspend(&client->dev); + + anx7625_unregister_i2c_dummy_clients(platform); + free_wq: if (platform->workqueue) destroy_workqueue(platform->workqueue);