From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 AAEA7C433E1 for ; Wed, 15 Jul 2020 20:05:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 87C232065D for ; Wed, 15 Jul 2020 20:05:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="kpaKS2pL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgGOUFf (ORCPT ); Wed, 15 Jul 2020 16:05:35 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:50517 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726715AbgGOUFf (ORCPT ); Wed, 15 Jul 2020 16:05:35 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1594843534; h=In-Reply-To: Content-Type: MIME-Version: References: Message-ID: Subject: Cc: To: From: Date: Sender; bh=fvwWPJ4nfvf5fMLrZzvo42MkdKAWewsiREaDmkMYpTg=; b=kpaKS2pLJxZCHP7NemaqM7QoG9DMnMXITlTlnuOPqvJ56UZuGLw+5Twv1a+6SowurEctc3OP XvJ+iXR8hWgJ6Wk5dQq8Zo+p2tLnyq2u/KhUJkOjh+m5bJQ0gp90wT+n6A5uO1pQO2//NhdA ppCls2ZaJjMCmOCXZrynrZt+8c0= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5f0f618b65270fa5953173e0 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 15 Jul 2020 20:05:31 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id A7842C433A1; Wed, 15 Jul 2020 20:05:29 +0000 (UTC) Received: from jcrouse1-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse) by smtp.codeaurora.org (Postfix) with ESMTPSA id B37ADC433C9; Wed, 15 Jul 2020 20:05:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B37ADC433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org Date: Wed, 15 Jul 2020 14:05:24 -0600 From: Jordan Crouse To: Rob Clark Cc: dri-devel@lists.freedesktop.org, Jonathan Marek , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Bjorn Andersson , Brian Masney , Fabio Estevam , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list Subject: Re: [PATCH] drm/msm/adreno: fix gpu probe if no interconnect-names Message-ID: <20200715200523.GA26861@jcrouse1-lnx.qualcomm.com> Mail-Followup-To: Rob Clark , dri-devel@lists.freedesktop.org, Jonathan Marek , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Bjorn Andersson , Brian Masney , Fabio Estevam , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list References: <20200715190732.3116556-1-robdclark@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200715190732.3116556-1-robdclark@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 15, 2020 at 12:07:30PM -0700, Rob Clark wrote: > From: Rob Clark > > If there is no interconnect-names, but there is an interconnects > property, then of_icc_get(dev, "gfx-mem"); would return an error > rather than NULL. > > Also, if there is no interconnect-names property, there will never > be a ocmem path. But of_icc_get(dev, "ocmem") would return -EINVAL > instead of -ENODATA. Just don't bother trying in this case. > > v2: explicity check for interconnect-names property > > Fixes: 8e29fb37b301 ("drm/msm: handle for EPROBE_DEFER for of_icc_get") > Fixes: 00bb9243d346 ("drm/msm/gpu: add support for ocmem interconnect path") > Signed-off-by: Rob Clark > --- > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c > index 0527e85184e1..e23641a5ec84 100644 > --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c > +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c > @@ -1003,22 +1003,23 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, > if (ret) > return ret; > > - /* Check for an interconnect path for the bus */ > - gpu->icc_path = of_icc_get(dev, "gfx-mem"); > - if (!gpu->icc_path) { > - /* > - * Keep compatbility with device trees that don't have an > - * interconnect-names property. > - */ > + /* > + * The legacy case, before "interconnect-names", only has a > + * single interconnect path which is equivalent to "gfx-mem" > + */ > + if (!of_find_property(dev->of_node, "interconnect-names", NULL)) { > gpu->icc_path = of_icc_get(dev, NULL); > + } else { > + gpu->icc_path = of_icc_get(dev, "gfx-mem"); > + gpu->ocmem_icc_path = of_icc_get(dev, "ocmem"); > } > + > if (IS_ERR(gpu->icc_path)) { > ret = PTR_ERR(gpu->icc_path); > gpu->icc_path = NULL; > return ret; > } > > - gpu->ocmem_icc_path = of_icc_get(dev, "ocmem"); > if (IS_ERR(gpu->ocmem_icc_path)) { > ret = PTR_ERR(gpu->ocmem_icc_path); > gpu->ocmem_icc_path = NULL; > @@ -1026,6 +1027,7 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, > if (ret != -ENODATA) > return ret; > } > + Nit for an extra blank line but otherwise looks fine. I like this workaround. With that, Reviewed-by: Jordan Crouse > return 0; > } > > -- > 2.26.2 > -- The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project