Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp714756rdb; Tue, 31 Oct 2023 23:31:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJNvEDx7OMuMXuODZKiMtMK6zf4VaE7BfXIp8m9jbgybpWS2jr5+yMJyx8nsf2QjO9W+vB X-Received: by 2002:a05:6a00:3a0a:b0:692:6417:728a with SMTP id fj10-20020a056a003a0a00b006926417728amr2855645pfb.14.1698820291496; Tue, 31 Oct 2023 23:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698820291; cv=none; d=google.com; s=arc-20160816; b=rfqSirdssKafOZg/1PFWcY3peR1SNOLvZYCM/783LGVaKiePM0eNhES+sD/nUqy3Jq AavTaw99FtjsOfcaS+1V7Y4cLtVJawhaKHl2HAcgbNO4AFjQxePnhE+lhiTHtmsM0goi c8npShcf07FEK9uc6uiHYsjzVLpWwUU/aNAa8Bmxup+XLTbntP4Jfrc9MG+2PxM8s8Tk MxpeoQjC0QoN/cUrj0A6yf4O6o8cdHdH1caZ6IBVaXH/5q5uepXmGdxq5NfFlvtY0tdd EqFC/dkYrtfQJ/Huv/5ISgYeKfA6pCZtU7gFJVq/Yf3rngqqNIRyZlihvZMx7E0O2RU9 3hIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Bj3W3SXlg4nzxRhev16GkkEC7Hshr1WCudkagmwJvB8=; fh=BXEqGO7Fb5ceGovc8eHF1FFhSnP+R/gB9bLwPcQOdNk=; b=sLc0Q5+3kLL95q3FyOhQdsc7OSNfiQdnQPZzDWZ3AsAOl6xUk66mfBztVDgZeQun0K PsOLB5WciIKoBeKTtGYcePykntgWUta9o+h9O0qD5hjE7WSB7td4WvqA93JB5DXtmxX1 CSzrNizRT1NwsDwZD79vuRm0CcZoL5l5H2f2TMe5704hZjJ4zRt0u7MbdfLxH76ZNBTz gbqz/AoBA7Qfe37UlSUp8lcglaie60Yd7hej7TGZjR+t/lINUW5djkByOr31IEoCHd/W oomciTM66kwTbyeGILS5v4sBWCROxIACjOdfuuaNVfq61OJi9Og/xLmff2jQ9NiW6E5k K7ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lDCNle0s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f8-20020a056a00228800b006b2b53de986si1023459pfe.194.2023.10.31.23.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 23:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lDCNle0s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 27BBC8027F69; Tue, 31 Oct 2023 23:31:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233142AbjKAGbI (ORCPT + 99 others); Wed, 1 Nov 2023 02:31:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbjKAGbG (ORCPT ); Wed, 1 Nov 2023 02:31:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 335B8FC; Tue, 31 Oct 2023 23:31:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 290B6C433C8; Wed, 1 Nov 2023 06:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698820261; bh=Tf1WPErRBjYtbexKIcjo7Q56h19eb/MEk0UqAcX+kSA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lDCNle0sCyh4rlmoh9NwgJwrhorc2EbSBIBmIxnZsdYIMmMiVbh4gKjdYdGm1Nitt LMAVpVY9evvjDs+FXTeK2ZU7W2KqoWeM8Wjv34FeN6pY7ZGYLnpQSxWpbve2nJwMdT aZJPWyTZqqeiyYJOY2XK+dh5aFWjDKeLjV15kR3dZ2TU/6KXyjdG/m1JPI7e9Q2Wh4 EiMyWuTe3dgrUTRXb7eqoJlIpxItwGSHoUD9U5yXeiQK2uB5uJWC1/uC7rZ3JzgyFu AaBwFvCdwO/+LLlqQv2zs61/L8EU/Nf9wKOs7I+V3RXE/bzfc8q9qgxok8/7r33k2i gcudMdIgQe0FA== Date: Wed, 1 Nov 2023 12:00:41 +0530 From: Manivannan Sadhasivam To: Krishna chaitanya chundru Cc: agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, vireshk@kernel.org, nm@ti.com, sboyd@kernel.org, mani@kernel.org, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, rafael@kernel.org, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, quic_vbadigan@quicinc.com, quic_nitegupt@quicinc.com, quic_skananth@quicinc.com, quic_ramkri@quicinc.com, quic_parass@quicinc.com Subject: Re: [PATCH v5 4/5] PCI: qcom: Return error from 'qcom_pcie_icc_update' Message-ID: <20231101063041.GG2897@thinkpad> References: <1694066433-8677-1-git-send-email-quic_krichai@quicinc.com> <1694066433-8677-5-git-send-email-quic_krichai@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1694066433-8677-5-git-send-email-quic_krichai@quicinc.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 31 Oct 2023 23:31:29 -0700 (PDT) On Thu, Sep 07, 2023 at 11:30:32AM +0530, Krishna chaitanya chundru wrote: > Return error from the function if the icc path is specified in the > dt and icc_set_bw failed or link is not up. > > Signed-off-by: Krishna chaitanya chundru > --- > drivers/pci/controller/dwc/pcie-qcom.c | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c > index e2f2940..ca6350b 100644 > --- a/drivers/pci/controller/dwc/pcie-qcom.c > +++ b/drivers/pci/controller/dwc/pcie-qcom.c > @@ -1357,22 +1357,21 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) > return 0; > } > > -static void qcom_pcie_icc_update(struct qcom_pcie *pcie) > +static int qcom_pcie_icc_update(struct qcom_pcie *pcie) > { > struct dw_pcie *pci = pcie->pci; > u32 offset, status, bw; > int speed, width; > - int ret; > > if (!pcie->icc_mem) > - return; > + return 0; > > offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP); > status = readw(pci->dbi_base + offset + PCI_EXP_LNKSTA); > > /* Only update constraints if link is up. */ > if (!(status & PCI_EXP_LNKSTA_DLLLA)) > - return; > + return -ENODEV; Why would you want to fail if the link is not up? This will break the driver if device shows up later. - Mani > > speed = FIELD_GET(PCI_EXP_LNKSTA_CLS, status); > width = FIELD_GET(PCI_EXP_LNKSTA_NLW, status); > @@ -1392,11 +1391,7 @@ static void qcom_pcie_icc_update(struct qcom_pcie *pcie) > break; > } > > - ret = icc_set_bw(pcie->icc_mem, 0, width * bw); > - if (ret) { > - dev_err(pci->dev, "failed to set interconnect bandwidth: %d\n", > - ret); > - } > + return icc_set_bw(pcie->icc_mem, 0, width * bw); > } > > static int qcom_pcie_link_transition_count(struct seq_file *s, void *data) > @@ -1529,7 +1524,10 @@ static int qcom_pcie_probe(struct platform_device *pdev) > goto err_phy_exit; > } > > - qcom_pcie_icc_update(pcie); > + ret = qcom_pcie_icc_update(pcie); > + if (ret) > + dev_err(dev, "failed to update interconnect bandwidth: %d\n", > + ret); > > if (pcie->mhi) > qcom_pcie_init_debugfs(pcie); > @@ -1596,7 +1594,10 @@ static int qcom_pcie_resume_noirq(struct device *dev) > pcie->suspended = false; > } > > - qcom_pcie_icc_update(pcie); > + ret = qcom_pcie_icc_update(pcie); > + if (ret) > + dev_err(dev, "failed to update interconnect bandwidth: %d\n", > + ret); > > return 0; > } > -- > 2.7.4 > -- மணிவண்ணன் சதாசிவம்