[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240821173318.GA260075@bhelgaas>
Date: Wed, 21 Aug 2024 12:33:18 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Shashank Babu Chinta Venkata <quic_schintav@...cinc.com>
Cc: agross@...nel.org, andersson@...nel.org, konrad.dybcio@...aro.org,
mani@...nel.org, quic_msarkar@...cinc.com,
quic_kraravin@...cinc.com,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Jingoo Han <jingoohan1@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Serge Semin <fancer.lancer@...il.com>,
Niklas Cassel <cassel@...nel.org>,
Conor Dooley <conor.dooley@...rochip.com>,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v5 1/3] PCI: qcom: Refactor common code
On Wed, Aug 21, 2024 at 10:08:42AM -0700, Shashank Babu Chinta Venkata wrote:
> Refactor common code from RC(Root Complex) and EP(End Point)
> drivers and move them to a common driver. This acts as placeholder
> for common source code for both drivers, thus avoiding duplication.
Much of this seems to be replacing qcom_pcie_icc_opp_update() and
qcom_pcie_ep_icc_update() with qcom_pcie_common_icc_update().
That seems worthwhile and it would be helpful if the commit log called
that out so we'd know what to look for in the patch.
I think the qcom_pcie_common_icc_init() rework would be more
understandable if it were in its own patch and not mixed in here.
> +++ b/drivers/pci/controller/dwc/pcie-qcom-common.c
> @@ -0,0 +1,88 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2014-2015, 2020 The Linux Foundation. All rights reserved.
> + * Copyright (c) 2015, 2021 Linaro Limited.
> + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
> + *
Spurious blank line.
> + */
> +struct icc_path *qcom_pcie_common_icc_get_resource(struct dw_pcie *pci, const char *path)
> +{
> + struct icc_path *icc_p;
> +
> + icc_p = devm_of_icc_get(pci->dev, path);
> + return icc_p;
return devm_of_icc_get(pci->dev, path);
> +}
> +EXPORT_SYMBOL_GPL(qcom_pcie_common_icc_get_resource);
> +
> +int qcom_pcie_common_icc_init(struct dw_pcie *pci, struct icc_path *icc, u32 bandwidth)
> +{
> + int ret;
> +
> + ret = icc_set_bw(icc, 0, bandwidth);
> + if (ret) {
> + dev_err(pci->dev, "Failed to set interconnect bandwidth: %d\n",
> + ret);
> + return ret;
> + }
The callers also check and log similar messages. I don't see the
point.
> +
> + return 0;
> +}
> +EXPORT_SYMBOL_GPL(qcom_pcie_common_icc_init);
These both seem of dubious value.
> +++ b/drivers/pci/controller/dwc/pcie-qcom-common.h
Do we need "-common" in the filename? Seems like "pcie-qcom.h" would
be enough. I *hope* we don't someday need both a "pcie-qcom.h and a
"pcie-qcom-common.h"; that seems like it would really be overkill.
Bjorn
Powered by blists - more mailing lists