public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Shashank Babu Chinta Venkata <quic_schintav@quicinc.com>
Cc: agross@kernel.org, andersson@kernel.org,
	konrad.dybcio@linaro.org, mani@kernel.org,
	quic_msarkar@quicinc.com, quic_kraravin@quicinc.com,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Rob Herring" <robh@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Serge Semin" <fancer.lancer@gmail.com>,
	"Niklas Cassel" <cassel@kernel.org>,
	"Conor Dooley" <conor.dooley@microchip.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v5 1/3] PCI: qcom: Refactor common code
Date: Wed, 21 Aug 2024 12:33:18 -0500	[thread overview]
Message-ID: <20240821173318.GA260075@bhelgaas> (raw)
In-Reply-To: <20240821170917.21018-2-quic_schintav@quicinc.com>

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

  reply	other threads:[~2024-08-21 17:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 17:08 [PATCH v5 0/3] pci: qcom: Add 16GT/s equalization and margining settings Shashank Babu Chinta Venkata
2024-08-21 17:08 ` [PATCH v5 1/3] PCI: qcom: Refactor common code Shashank Babu Chinta Venkata
2024-08-21 17:33   ` Bjorn Helgaas [this message]
2024-08-25  6:09     ` Manivannan Sadhasivam
2024-08-24 16:15   ` kernel test robot
2024-08-24 18:06   ` kernel test robot
2024-08-25  6:06   ` Manivannan Sadhasivam
2024-08-26 12:11   ` Johan Hovold
2024-08-21 17:08 ` [PATCH v5 2/3] PCI: qcom: Add equalization settings for 16 GT/s Shashank Babu Chinta Venkata
2024-08-21 17:34   ` Bjorn Helgaas
2024-08-26  7:55   ` Manivannan Sadhasivam
2024-09-03 18:32     ` Shashank Babu Chinta Venkata
2024-08-21 17:08 ` [PATCH v5 3/3] PCI: qcom: Add RX margining " Shashank Babu Chinta Venkata
2024-08-26 11:46 ` [PATCH v5 0/3] pci: qcom: Add 16GT/s equalization and margining settings Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240821173318.GA260075@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=fancer.lancer@gmail.com \
    --cc=jingoohan1@gmail.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=quic_kraravin@quicinc.com \
    --cc=quic_msarkar@quicinc.com \
    --cc=quic_schintav@quicinc.com \
    --cc=robh@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox