Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1677653pxb; Mon, 23 Aug 2021 01:48:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYRWvv+NNgjxAocqIwTTmTQRrurOeUOksYcAxMCM8bwRQOfGmle8NaWMIv1ZLweVoGcuq0 X-Received: by 2002:a02:a98c:: with SMTP id q12mr12356060jam.59.1629708506250; Mon, 23 Aug 2021 01:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629708506; cv=none; d=google.com; s=arc-20160816; b=uQLR+AxJ+ZRM2G7P1veeN/YxvvmbLcSRTv6ypzHhB8PXcEoZbkXnYN7jZ0YCSbU5U3 6CXjOXpPuvTI6lTE0/smjoqJj2LlO6n8bEofd7uU9W19r9V4yiaRWV7jQIkk98mAteGt nRH/2Wj2HNEgBC+Jxt0fT1GIcyiTYr4odCTeg62OdSHZ3id0DboHsaBOTnRqJR7YbE0K ajInjC30ew7xIwBCxmFaQgvufPBKI/v0woZPN4j2m8OM/9hFLVUjQeE5MgqGcMqgMc6Q EQ4EzKUMlaTRskXAUPk7jq0Noz7ODzg1T8fRSSUEMA3MCIjysQPPGFx0TwM+dGWLrGqS vfsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=YtP/mGd/n0beQ9BPe465qCbE6NHfKkagZy8yb8Qg1jY=; b=q0UNtxuEjXsEhWIKCx85yzCVuIyafeP4dR24tTNXUBoRzObqwaJURjYi0FOh045H4Z eUcYBJKXXWE17YX6HHgdLV/CidRpvdx9CebFc7Gtkm5AoUZ9y7qKmj5HPqV6pRcy+hH5 24DY/xPNWan66IwarGQ3RBetdmnGxehgx8khSqKaefWLbVgN8Lb0G42uUT94u5Cp4Y82 yryjDvG/eZCWTXleOswBLJP4PlnMCUXZpnuBzOh5e3q4odS18xAdWAXZG60uLlqPpfAD AEQdpXIlZgmMxf1B3fe/ZbqMP0c8SugPBK3npxKMfQrIhSsjy0O48mDA3frADzH8swsS JDPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=H28FLAd0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dDzJTX5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si14701984ilo.31.2021.08.23.01.48.14; Mon, 23 Aug 2021 01:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=H28FLAd0; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=dDzJTX5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235607AbhHWIsQ (ORCPT + 99 others); Mon, 23 Aug 2021 04:48:16 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:48025 "EHLO new2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235387AbhHWIsO (ORCPT ); Mon, 23 Aug 2021 04:48:14 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 9F0D6580C63; Mon, 23 Aug 2021 04:47:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 23 Aug 2021 04:47:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:content-type:mime-version :content-transfer-encoding; s=fm3; bh=YtP/mGd/n0beQ9BPe465qCbE6N HfKkagZy8yb8Qg1jY=; b=H28FLAd08NKDFMH9Vaxs8fIkx+hgg4RBFcNoPjd96T bHOK0a0iiq2cE7bS+bZixq4j2QcFfOjLbGt/60m3rfHgvWCFPPdN+rXOQeqznBXp qC6EVu8IR67H2WqcCUX5uGqGuDe1x2G2iQa/h0zjyQuWghAhIeTA69mkhf+e69UB omInCzkfcA7jaeqDaJLVCBWWjb7ODIDw49jJXdiLvOdrsLM8GV/5xidkOanIvSxP 9mxMG89FUb0p64XCNmz54JgSddAg0pyM1a/uGn0S7kByaawqiIV8smUSi8kyCHAK 1BCi4yURleH+JazV3J6BjpMOZXW/nhJ67ClESVx4EX/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=YtP/mG d/n0beQ9BPe465qCbE6NHfKkagZy8yb8Qg1jY=; b=dDzJTX5qEaYX/2G8L1y+kN nuG+LkilGQAp8IsExwFYWpvLnOwroLjrkKRUhh3WQL9vdEPm+Uda7GgJV/ZELuqU bK13lfsWc9kT9OIDZ9D7lV52gXxy8sdHA4pOkEbneft9rh6tB8GG/kXYvF/eQ0Id l9FnaD/WXbODNRjuYUAL3J+opyaKwcdS7/p4wxf2Sk574ZTlrwseoUYD46n9BJSf P0TtjF5d3IUyo+OdAhvz+ce+zaw7FS0ogJ4ULAs42vqlwiihVcuTr91aBUbKmTp8 GonUln8tq5OHoelZMa/MzbZrxg9atunsFEJhlNLAEov8z2gl1XtXn9pYp1wIru8Q == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddthedgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffotggggfesthhqredtredtjeenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeetieekgfffkeegkeeltdehudetteejgfekueevhffhteegudfgkedtueegfffg feenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Aug 2021 04:47:26 -0400 (EDT) From: Maxime Ripard To: Jonas Karlman , Sam Ravnborg , Jernej Skrabec , Thierry Reding , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Neil Armstrong , Laurent Pinchart , Robert Foss , Andrzej Hajda Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 0/8] drm/bridge: Make panel and bridge probe order consistent Date: Mon, 23 Aug 2021 10:47:15 +0200 Message-Id: <20210823084723.1493908-1-maxime@cerno.tech> X-Mailer: git-send-email 2.31.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi,=0D =0D We've encountered an issue with the RaspberryPi DSI panel that prevented th= e=0D whole display driver from probing.=0D =0D The issue is described in detail in the commit 7213246a803f ("drm/vc4: dsi:= =0D Only register our component once a DSI device is attached"), but the basic = idea=0D is that since the panel is probed through i2c, there's no synchronization=0D between its probe and the registration of the MIPI-DSI host it's attached t= o.=0D =0D We initially moved the component framework registration to the MIPI-DSI Hos= t=0D attach hook to make sure we register our component only when we have a DSI= =0D device attached to our MIPI-DSI host, and then use lookup our DSI device in= our=0D bind hook.=0D =0D However, all the DSI bridges controlled through i2c are only registering th= eir=0D associated DSI device in their bridge attach hook, meaning with our change= =0D above, we never got that far, and therefore ended up in the same situation = than=0D the one we were trying to fix for panels.=0D =0D The best practice to avoid those issues is to register its functions only a= fter=0D all its dependencies are live. We also shouldn't wait any longer than we sh= ould=0D to play nice with the other components that are waiting for us, so in our c= ase=0D that would mean moving the DSI device registration to the bridge probe.=0D =0D If the general approach is agreed upon, other bridge drivers will obviously= be=0D converted.=0D =0D Let me know what you think,=0D Maxime=0D =0D ---=0D =0D Changes from v2:=0D - Changed the approach as suggested by Andrzej, and aligned the bridge on= the=0D panel this time.=0D - Fixed some typos=0D =0D Changes from v1:=0D - Change the name of drm_of_get_next function to drm_of_get_bridge=0D - Mention the revert of 87154ff86bf6 and squash the two patches that were= =0D reverting that commit=0D - Add some documentation=0D - Make drm_panel_attach and _detach succeed when no callback is there=0D =0D Maxime Ripard (8):=0D drm/bridge: Add documentation sections=0D drm/bridge: Document the probe issue with MIPI-DSI bridges=0D drm/mipi-dsi: Create devm device registration=0D drm/mipi-dsi: Create devm device attachment=0D drm/bridge: ps8640: Switch to devm MIPI-DSI helpers=0D drm/bridge: ps8640: Register and attach our DSI device at probe=0D drm/bridge: sn65dsi83: Switch to devm MIPI-DSI helpers=0D drm/bridge: sn65dsi83: Register and attach our DSI device at probe=0D =0D Documentation/gpu/drm-kms-helpers.rst | 12 ++++=0D drivers/gpu/drm/bridge/parade-ps8640.c | 97 ++++++++++++++------------=0D drivers/gpu/drm/bridge/ti-sn65dsi83.c | 82 +++++++++++-----------=0D drivers/gpu/drm/drm_bridge.c | 70 +++++++++++++++++--=0D drivers/gpu/drm/drm_mipi_dsi.c | 81 +++++++++++++++++++++=0D include/drm/drm_mipi_dsi.h | 4 ++=0D 6 files changed, 256 insertions(+), 90 deletions(-)=0D =0D -- =0D 2.31.1=0D =0D