lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240825060926.jup7l47uo76gdvff@thinkpad>
Date: Sun, 25 Aug 2024 11:39:26 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Shashank Babu Chinta Venkata <quic_schintav@...cinc.com>,
	agross@...nel.org, andersson@...nel.org, konrad.dybcio@...aro.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 12:33:18PM -0500, Bjorn Helgaas wrote:
> 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.
> 

I suggested the -common suffix since pcie-qcom is historically meant for RC
driver. So creating a common header with that name will create confusion since
we have a separate EP driver.

- Mani

-- 
மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ