Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4656711yba; Mon, 20 May 2019 01:07:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEIn6+PmsjHWkyLH5ET9iGR05XVgoIghO6QEKweop/7vLjT43P8f9DWYkcw3JzTdHfVQyJ X-Received: by 2002:a62:65c1:: with SMTP id z184mr59726904pfb.130.1558339667048; Mon, 20 May 2019 01:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558339667; cv=none; d=google.com; s=arc-20160816; b=acAn51rT3EZH1zMacFRqs1vZBZhosQAp+mcA8mKzMoJ9OkKPLm3OOu2+M9rPfB+drb +34CjXoRNRlpRiPjeLBVN/0p293mvHvZwpMwgxlPPo0OyV37jNtiXb6buDq3GoEymQf3 ZGq0HFmKptttMO7eJLNZ5UqAx3AUtAljfFSyir8jiBoKHFnzV8Q80wT3JktjuohUCAQ/ vSpMcaH2HeBp6guYZVCzrKAWPTcJu/guDpqmAIcOb5jLMeScUuGroanU9YlfPVmBUzAn jAG4oJdN2N1UymSR5BWlSR5eaEdhc4+DuwkT7H4U0UYXZedkTyhvVQtV7OepDskDuK3E VsEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Js5dQG0thEx0hbbbr9/q+qi6/pZpBvrkkOT6TPKxXnY=; b=Fk+dpjmII5poA9wDLGF+y+dyJySNII0rlXdgqY6nEcz1zkeu8xbJTgv7+yPWLZGIG9 x8EdaO1lg9DWF//E2vtOf4neBY99HYaaRDQ0m6VbX/wDjuu2/90VHgpR5xRT4Ibsjwxm usSYYWoCbjaQjUtVbjgq/rsbhHibJMUU/gT02+xLM1V2ahczOLx/GLgx3jp1/Hc+XhxH SJM531pZNV33C6fi2lkHG9+Q23p2Ggnr/gK6mS+xqv/Azv7ilsr604wAPU8hsoqSMJBV fQ/bOXGTCUKf2rsBrRhDFW29QU/tI52CPrMEN7i41zenp7ugeTU4FZfExR7Keyu/y+PK c55A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z31si18292849plb.219.2019.05.20.01.07.32; Mon, 20 May 2019 01:07:47 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730652AbfETHGf (ORCPT + 99 others); Mon, 20 May 2019 03:06:35 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:2597 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730488AbfETHGf (ORCPT ); Mon, 20 May 2019 03:06:35 -0400 X-UUID: 545b483f887e4af1bf9374d578975ef1-20190520 X-UUID: 545b483f887e4af1bf9374d578975ef1-20190520 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 804019200; Mon, 20 May 2019 15:06:30 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by MTKMBS33DR.mediatek.inc (172.27.6.106) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 20 May 2019 15:06:28 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 20 May 2019 15:06:28 +0800 Message-ID: <1558335988.7311.34.camel@mtksdaap41> Subject: Re: [v2 1/5] drm/mediatek: move mipi_dsi_host_register to probe From: CK Hu To: Jitao Shi CC: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , Kumar Gala , , David Airlie , "Matthias Brugger" , Thierry Reding , "Ajay Kumar" , Inki Dae , "Rahul Sharma" , Sean Paul , Vincent Palatin , Andy Yan , Philipp Zabel , "Russell King" , , , , , , , Sascha Hauer , , , , , Date: Mon, 20 May 2019 15:06:28 +0800 In-Reply-To: <1558258588.367.5.camel@mszsdaap41> References: <20190416060501.76276-1-jitao.shi@mediatek.com> <20190416060501.76276-2-jitao.shi@mediatek.com> <1557222735.3498.11.camel@mtksdaap41> <1558258588.367.5.camel@mszsdaap41> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2019-05-19 at 17:36 +0800, Jitao Shi wrote: > On Tue, 2019-05-07 at 17:52 +0800, CK Hu wrote: > > Hi, Jitao: > > > > On Tue, 2019-04-16 at 14:04 +0800, Jitao Shi wrote: > > > DSI panel driver need attach function which is inculde in > > > mipi_dsi_host_ops. > > > > > > If mipi_dsi_host_register is not in probe, dsi panel will > > > probe fail or more delay. > > > > I think this patch just prevent delay, not to prevent dsi panel probe > > fail. In [1], you mention mipi_dsi_attach() is called in > > panel_simple_dsi_probe(), but panel_simple_dsi_probe() is trigger by > > mipi_dsi_host_register(), so the probe would success. > > > > [1] > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/panel/panel-simple.c?h=v5.0-rc6#n2987 > > > > > > Yes, this just prevent delay. > > > > > > > So move the mipi_dsi_host_register to probe from bind. > > > > > > Signed-off-by: Jitao Shi > > > --- > > > drivers/gpu/drm/mediatek/mtk_dsi.c | 50 ++++++++++++++++++------------ > > > 1 file changed, 30 insertions(+), 20 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > > > index b00eb2d2e086..6c4ac37f983d 100644 > > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > > @@ -1045,12 +1045,6 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data) > > > return ret; > > > } > > > > > > - ret = mipi_dsi_host_register(&dsi->host); > > > - if (ret < 0) { > > > - dev_err(dev, "failed to register DSI host: %d\n", ret); > > > - goto err_ddp_comp_unregister; > > > - } > > > - > > > ret = mtk_dsi_create_conn_enc(drm, dsi); > > > if (ret) { > > > DRM_ERROR("Encoder create failed with %d\n", ret); > > > @@ -1060,8 +1054,6 @@ static int mtk_dsi_bind(struct device *dev, struct device *master, void *data) > > > return 0; > > > > > > err_unregister: > > > - mipi_dsi_host_unregister(&dsi->host); > > > -err_ddp_comp_unregister: > > > mtk_ddp_comp_unregister(drm, &dsi->ddp_comp); > > > return ret; > > > } > > > @@ -1097,31 +1089,37 @@ static int mtk_dsi_probe(struct platform_device *pdev) > > > > > > dsi->host.ops = &mtk_dsi_ops; > > > dsi->host.dev = dev; > > > + dsi->dev = dev; > > > > Why do this? > > > > Regards, > > CK > > > > There are some error message require this poweron(). So this should not be in this patch. This patch is related to the timing of mipi_dsi_host_register(). Regards, CK > > > > + ret = mipi_dsi_host_register(&dsi->host); > > > + if (ret < 0) { > > > + dev_err(dev, "failed to register DSI host: %d\n", ret); > > > + return ret; > > > + } > > > > > > ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, > > > &dsi->panel, &dsi->bridge); > > > if (ret) > > > - return ret; > > > + goto err_unregister_host; > > > > > > dsi->engine_clk = devm_clk_get(dev, "engine"); > > > if (IS_ERR(dsi->engine_clk)) { > > > ret = PTR_ERR(dsi->engine_clk); > > > dev_err(dev, "Failed to get engine clock: %d\n", ret); > > > - return ret; > > > + goto err_unregister_host; > > > } > > > > > > dsi->digital_clk = devm_clk_get(dev, "digital"); > > > if (IS_ERR(dsi->digital_clk)) { > > > ret = PTR_ERR(dsi->digital_clk); > > > dev_err(dev, "Failed to get digital clock: %d\n", ret); > > > - return ret; > > > + goto err_unregister_host; > > > } > > > > > > dsi->hs_clk = devm_clk_get(dev, "hs"); > > > if (IS_ERR(dsi->hs_clk)) { > > > ret = PTR_ERR(dsi->hs_clk); > > > dev_err(dev, "Failed to get hs clock: %d\n", ret); > > > - return ret; > > > + goto err_unregister_host; > > > } > > > > > > regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > > > > > > >