From patchwork Mon Jun 18 10:28:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 10470821 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E143E601D7 for ; Mon, 18 Jun 2018 10:28:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92D442884B for ; Mon, 18 Jun 2018 10:28:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87AA4288C6; Mon, 18 Jun 2018 10:28:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 388952884B for ; Mon, 18 Jun 2018 10:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4Q/qo82JCkYQrMibEeThBEKHe7ZTgKmFolJlWATpw1I=; b=kqGpzr+eU4+YU4G6GuhTpPzRmc N0i6YIsG1ZU/Jzk6UeUFtCd7D8QkcYJ9YpyFAuirutVzi+Lk0taSd3fY1eDTmMnVhfAVXwLMljxpr CymZ7CY9amQqXHKDJX8UmwekXPhCaeQQ+2nNyUiiAnojNG33mILYslTq5I0lyKKpk3VvfnN95W4zT 6WXOnYbBcahEm2p/I/jd8q+6vOL+otLSIx0lVQKDce9pYxQIQWyKDXsImmYauEmJDJ61TMM+KrMOf 6VaPEPeDspM4OQlaF2ZyG/QYsKKmVWhXQqZ9DB0V6QAXFvmjwz3B7w8YXbUgC2x7z13Z2S/Yoh/5V KsBvcqYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUrOz-0001FU-Kg; Mon, 18 Jun 2018 10:28:49 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fUrOm-00018H-5B for linux-rockchip@lists.infradead.org; Mon, 18 Jun 2018 10:28:40 +0000 Received: from wd0897.dip.tu-dresden.de ([141.76.111.129] helo=phil.dip.tu-dresden.de) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fUrOT-0003Hw-NR; Mon, 18 Jun 2018 12:28:17 +0200 From: Heiko Stuebner To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 3/8] drm/bridge/synopsys: dsi: defer probing if panel not available in bridge-attach Date: Mon, 18 Jun 2018 12:28:01 +0200 Message-Id: <20180618102806.15650-4-heiko@sntech.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180618102806.15650-1-heiko@sntech.de> References: <20180618102806.15650-1-heiko@sntech.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180618_032836_417758_C2125B55 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, architt@codeaurora.org, Heiko Stuebner , a.hajda@samsung.com, briannorris@chromium.org, hoegsberg@gmail.com, philippe.cornu@st.com, yannick.fertre@st.com, linux-rockchip@lists.infradead.org, nickey.yang@rock-chips.com, robh+dt@kernel.org, thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, seanpaul@chromium.org, mka@chromium.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When the panel-driver is build as a module it currently fails hard as the panel cannot be probed directly: dw_mipi_dsi_bind() __dw_mipi_dsi_probe() creates dsi bus creates panel device triggers panel module load panel not probed (module not loaded or panel probe slow) drm_bridge_attach fails with -EINVAL due to empty panel_bridge So emit a -EPROBE_DEFER in that case to give the driver another chance at getting the display later. Signed-off-by: Heiko Stuebner Reviewed-by: Philippe Cornu Tested-by: Philippe Cornu --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index bb4aeca5c0f9..bd503f000ed5 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -835,6 +835,9 @@ static int dw_mipi_dsi_bridge_attach(struct drm_bridge *bridge) return -ENODEV; } + if (!dsi->panel_bridge) + return -EPROBE_DEFER; + /* Set the encoder type as caller does not know it */ bridge->encoder->encoder_type = DRM_MODE_ENCODER_DSI;