Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1800425ybi; Wed, 3 Jul 2019 23:40:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxq3fChIIwhWyd2sEHl6xB2Iv6aPCAE3SKpSn5OrBf3UaOXzxmatWfOuO1JMdJU7W/z7DsF X-Received: by 2002:a17:902:fe86:: with SMTP id x6mr25256701plm.67.1562222435043; Wed, 03 Jul 2019 23:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562222435; cv=none; d=google.com; s=arc-20160816; b=gr0FngYUT7oOB4TT70UTu+yOXQtkGJ3rJt2F4mgr4k3BEIpRs+960hfnuTjIpsKs0o vyV3lErz6ZSXCkRsyWsnAtqP1GpeHZl4mJDlp9kICCkV0roc9gN8p5kYWFGQHH27uXZ9 sPOGOMvj2QNGoKkH+jnK5H3T9WDxDpoaHHNcgfhZEafEGy+GVo/Fz+XlXl3hF2a5ZIHc C0V/pjy21Gt/4u0Zl7496cEzSSG2njzqBaufAK4xcutZUO35R2deBM4T2SYGPX4bGrj4 Dzpo4FEZCPDZLMNN6tgPL+b+tZo/7eOV/a72gerEEmbc3hbXpf8xt9ZHCE4b5TJURbuw qZ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=tCmZGBbqZk6h1eHVaAyvfSCvV1cESgxX9cwdBi3u2Ns=; b=RYiYJXrPBidoV05AEld6eRvYLeg5G+ncfOj74HOIzyuKbP5lHeNzDKs5Qolimfr3Ig Kpdj88FqG120Lu8fPe3xVcss2oMoMZ07YU7Y0FeWlHPNyCYiEwlqk0uKiBOOOFQUzgVw FBsZkWXLgEOuUdqgSAvfvctzeTrUzM5awOe/t4lRX1jme5DbpTbNNZQNoIDETzewOxm7 5X7E5hspdmlI1q+yfQ5MIjwpv0dbqOm4utY+CC806oQpS+4BgCaccOSrv2taWg8N8oP7 LidvPAbLBMR82Ql4cf+YnQhWOaxS46u0Pv9mCJcrnRVoQYB9dO16hgKQqA2/6u/oxlG6 KMlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sY1uF4Qm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k33si3122928pgi.563.2019.07.03.23.40.18; Wed, 03 Jul 2019 23:40:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=sY1uF4Qm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727209AbfGDGj7 (ORCPT + 99 others); Thu, 4 Jul 2019 02:39:59 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:48028 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbfGDGj6 (ORCPT ); Thu, 4 Jul 2019 02:39:58 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20190704063956euoutp02e0d6f417061df873a0aac67e63d7accc~uIP4gIc3o1199111991euoutp02M for ; Thu, 4 Jul 2019 06:39:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20190704063956euoutp02e0d6f417061df873a0aac67e63d7accc~uIP4gIc3o1199111991euoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1562222396; bh=tCmZGBbqZk6h1eHVaAyvfSCvV1cESgxX9cwdBi3u2Ns=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=sY1uF4Qm4KEqSVk5OBDHR4FL0B/TVTKbdN9IpDUmD4BY67fP7uMpugc7M6/iz/mPM Fqr3KHQBUlwG4gWsJ6r3hkHiFQA+RdFQMhnVTy85MTlPDgtoE9P9IaodAAXfi/ywPZ kZUL7aKHQXkQobB9YvXeSv2ig/Y1V27FAp8l+uzw= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190704063955eucas1p2fd225618c6259899b330722b5d345da7~uIP35ap5X2304523045eucas1p2U; Thu, 4 Jul 2019 06:39:55 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 12.F5.04298.B3F9D1D5; Thu, 4 Jul 2019 07:39:55 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20190704063955eucas1p2313041808cf25371e144d6c6e5c7d40a~uIP3Dt62m1201312013eucas1p2w; Thu, 4 Jul 2019 06:39:55 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20190704063954eusmtrp1a331c969901581b49a88260b6e4bffd7~uIP21mqGh1175011750eusmtrp1c; Thu, 4 Jul 2019 06:39:54 +0000 (GMT) X-AuditID: cbfec7f2-f13ff700000010ca-86-5d1d9f3b928f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 91.C2.04140.A3F9D1D5; Thu, 4 Jul 2019 07:39:54 +0100 (BST) Received: from [106.120.51.74] (unknown [106.120.51.74]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20190704063954eusmtip16beb14b0b4b73cb7bccd1431ba179a9f~uIP2YiMXf2030420304eusmtip1Z; Thu, 4 Jul 2019 06:39:54 +0000 (GMT) Subject: Re: [PATCH 3/3] drm/msm/dsi: make sure we have panel or bridge earlier To: Rob Clark , dri-devel@lists.freedesktop.org Cc: Rob Clark , David Airlie , linux-arm-msm@vger.kernel.org, Abhinav Kumar , linux-kernel@vger.kernel.org, Sean Paul , Sibi Sankar , freedreno@lists.freedesktop.org, Chandan Uddaraju From: Andrzej Hajda Message-ID: <8a88e865-68a1-37e2-93a1-efd50a778c47@samsung.com> Date: Thu, 4 Jul 2019 08:39:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <20190630131445.25712-4-robdclark@gmail.com> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0hTYRjHe3fOtuNqcpyaD2pKo0i7aFYfThiSIXaoL/VBqMR05UFFp7aj lhW0TMW7qUS4JipRakFempoLmpdymmjeMG9z1kyjEFOzElPbdpT89nue5/9c/i8vgUk6+M5E VGwCo4iVxUgFIryhfbnnkG/prpDD9W0e1PKnFIzK7enkUcNlYzg1uDQnoNQz3Ygq0HULqQGt WkANLZswaqb8D0YZit4iaqh8jn9yO/1I2YfTA3m5PLpJZRDSjb8m+bQxW8+j9dpRIb1Y53ZO eEl0IpyJiUpiFN5+YaLI57Xp/Pi0fTfe9y5hStTsnoVsCCCPgfbzOMpCIkJCViLQZb7gc8FP BIV/CzEuWETQbKjFNlu+r2fyLSwhKxDkZNOcaBZBf59JYCnYk+eh5t6cVeRABkBH/4p1LEa2 8aBKM4gsBQHpCasvR6wNYtIPPhR34hbGyT2Qnd9vzTuSF2BAo0Wcxg46i6esGhvyOLzTmIQW xkh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ltspFecmFtcmpeul5yfu4kRGLXbjv3c soOx613wIUYBDkYlHt4HW2RihVgTy4orcw8xSnAwK4nwfv8NFOJNSaysSi3Kjy8qzUktPsRo CvTcRGYp0eR8YELJK4k3NDU0t7A0NDc2NzazUBLn7RA4GCMkkJ5YkpqdmlqQWgTTx8TBKdXA WPX31juNFbW334jJLnu3lvfSNy2bVdKF4twvt7CF6t3/IOy2Xqmw3FogOyz9cPOPZ8W/Vqxc NCvt84ULjQ1frdmN+Ct0rZL4fb6uNv6QteMza1KH0ZOFm4+skHaf0THHevEm3ahpE7p6XdVj l4Z1TLryk/Vq/Smut+8n3bcIUrdw6dNWSdkvrsRSnJFoqMVcVJwIAHdZmjfwAgAA X-CMS-MailID: 20190704063955eucas1p2313041808cf25371e144d6c6e5c7d40a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20190630131612epcas1p22f241f3e6edc3976f7abedcb74f86e3a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20190630131612epcas1p22f241f3e6edc3976f7abedcb74f86e3a References: <20190630131445.25712-1-robdclark@gmail.com> <20190630131445.25712-4-robdclark@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30.06.2019 15:14, Rob Clark wrote: > From: Rob Clark > > If we are going to -EPROBE_DEFER due to panel/bridge not probed yet, we > want to do it before we start touching hardware. As the evidence shows, if the driver create bus (mipi-dsi), then it should not defer probing due to lack of sink (panel/bridge), because the sink will not appear without the bus. Instead of defer probing you can defer component binding, or if you like challenges you can implement dynamic sink binding :) Regards Andrzej > > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/dsi/dsi.h | 2 +- > drivers/gpu/drm/msm/dsi/dsi_host.c | 30 +++++++++++++-------------- > drivers/gpu/drm/msm/dsi/dsi_manager.c | 9 +++----- > 3 files changed, 19 insertions(+), 22 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h > index 53bb124e8259..e15e7534ccd9 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi.h > +++ b/drivers/gpu/drm/msm/dsi/dsi.h > @@ -171,7 +171,7 @@ int msm_dsi_host_set_display_mode(struct mipi_dsi_host *host, > struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host); > unsigned long msm_dsi_host_get_mode_flags(struct mipi_dsi_host *host); > struct drm_bridge *msm_dsi_host_get_bridge(struct mipi_dsi_host *host); > -int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer); > +int msm_dsi_host_register(struct mipi_dsi_host *host); > void msm_dsi_host_unregister(struct mipi_dsi_host *host); > int msm_dsi_host_set_src_pll(struct mipi_dsi_host *host, > struct msm_dsi_pll *src_pll); > diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c > index 1ae2f5522979..8e5b0ba9431e 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_host.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c > @@ -1824,6 +1824,20 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) > goto fail; > } > > + /* > + * Make sure we have panel or bridge early, before we start > + * touching the hw. If bootloader enabled the display, we > + * want to be sure to keep it running until the bridge/panel > + * is probed and we are all ready to go. Otherwise we'll > + * kill the display and then -EPROBE_DEFER > + */ > + if (IS_ERR(of_drm_find_panel(msm_host->device_node)) && > + !of_drm_find_bridge(msm_host->device_node)) { > + pr_err("%s: no panel or bridge yet\n", __func__); > + return -EPROBE_DEFER; > + } > + > + > msm_host->ctrl_base = msm_ioremap(pdev, "dsi_ctrl", "DSI CTRL"); > if (IS_ERR(msm_host->ctrl_base)) { > pr_err("%s: unable to map Dsi ctrl base\n", __func__); > @@ -1941,7 +1955,7 @@ int msm_dsi_host_modeset_init(struct mipi_dsi_host *host, > return 0; > } > > -int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer) > +int msm_dsi_host_register(struct mipi_dsi_host *host) > { > struct msm_dsi_host *msm_host = to_msm_dsi_host(host); > int ret; > @@ -1955,20 +1969,6 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer) > return ret; > > msm_host->registered = true; > - > - /* If the panel driver has not been probed after host register, > - * we should defer the host's probe. > - * It makes sure panel is connected when fbcon detects > - * connector status and gets the proper display mode to > - * create framebuffer. > - * Don't try to defer if there is nothing connected to the dsi > - * output > - */ > - if (check_defer && msm_host->device_node) { > - if (IS_ERR(of_drm_find_panel(msm_host->device_node))) > - if (!of_drm_find_bridge(msm_host->device_node)) > - return -EPROBE_DEFER; > - } > } > > return 0; > diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c > index ff39ce6150ad..cd3450dc3481 100644 > --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c > +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c > @@ -82,7 +82,7 @@ static int dsi_mgr_setup_components(int id) > int ret; > > if (!IS_DUAL_DSI()) { > - ret = msm_dsi_host_register(msm_dsi->host, true); > + ret = msm_dsi_host_register(msm_dsi->host); > if (ret) > return ret; > > @@ -101,14 +101,11 @@ static int dsi_mgr_setup_components(int id) > /* Register slave host first, so that slave DSI device > * has a chance to probe, and do not block the master > * DSI device's probe. > - * Also, do not check defer for the slave host, > - * because only master DSI device adds the panel to global > - * panel list. The panel's device is the master DSI device. > */ > - ret = msm_dsi_host_register(slave_link_dsi->host, false); > + ret = msm_dsi_host_register(slave_link_dsi->host); > if (ret) > return ret; > - ret = msm_dsi_host_register(master_link_dsi->host, true); > + ret = msm_dsi_host_register(master_link_dsi->host); > if (ret) > return ret; >