From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: lpieralisi@kernel.org, kw@linux.com, andersson@kernel.org,
konrad.dybcio@linaro.org, bhelgaas@google.com,
linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, abel.vesa@linaro.org
Subject: Re: [PATCH v3 2/3] PCI: qcom-ep: Make use of PCIE_SPEED2MBS_ENC() macro for encoding link speed
Date: Thu, 28 Sep 2023 20:48:08 +0200 [thread overview]
Message-ID: <20230928184808.GA12574@thinkpad> (raw)
In-Reply-To: <20230927175542.GA455424@bhelgaas>
On Wed, Sep 27, 2023 at 12:55:42PM -0500, Bjorn Helgaas wrote:
> On Wed, Sep 27, 2023 at 05:46:02PM +0200, Manivannan Sadhasivam wrote:
> > Instead of hardcoding the link speed in MBps, let's make use of the
> > existing PCIE_SPEED2MBS_ENC() macro that does the encoding of the
> > link speed for us. Also, let's Wrap it with QCOM_PCIE_LINK_SPEED_TO_BW()
> > macro to do the conversion to ICC speed.
>
> In subject, /Make use of/Use/ would make better use of the subject
> line. Lots of "uses" there :)
>
> Above, s/let's//, and also s/make use of/use/.
>
Ok, I will reword accordingly.
> > +#define QCOM_PCIE_LINK_SPEED_TO_BW(speed) \
> > + Mbps_to_icc(PCIE_SPEED2MBS_ENC(pcie_link_speed[speed]))
>
> It's a shame to have to duplicate this macro in pcie-qcom.c and in
> pcie-qcom-ep.c, especially since there's nothing qcom-specific in it.
>
> Would a macro like this fit in interconnect.h?
>
Unfortunately, no. This macro is neither interconnect specific nor PCI, but a
kind of both used by the driver. So it makes sense to keep it in the driver
itself for now.
If we happen to create a common header for host and ep drivers in the future, it
can be moved to that.
> > - ret = icc_set_bw(pcie_ep->icc_mem, 0, MBps_to_icc(PCIE_GEN1_BW_MBPS));
> > + ret = icc_set_bw(pcie_ep->icc_mem, 0, QCOM_PCIE_LINK_SPEED_TO_BW(1));
>
> "1" is not very informative here. Maybe PCIE_SPEED_2_5GT? (I didn't
> completely verify that this is equivalent.)
>
No. PCIE_SPEED_2_5GT is defined as 0x14 in pci.h. And I do not want to add a
macro for just "1" here.
- Mani
> Bjorn
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-09-28 18:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-27 15:46 [PATCH v3 1/3] PCI: qcom: Make use of PCIE_SPEED2MBS_ENC() macro for encoding link speed Manivannan Sadhasivam
2023-09-27 15:46 ` [PATCH v3 2/3] PCI: qcom-ep: " Manivannan Sadhasivam
2023-09-27 17:55 ` Bjorn Helgaas
2023-09-28 18:48 ` Manivannan Sadhasivam [this message]
2023-09-28 21:27 ` Bjorn Helgaas
2023-09-30 8:56 ` Manivannan Sadhasivam
2023-09-27 15:46 ` [PATCH v3 3/3] PCI: tegra194: Use Mbps_to_icc() macro for setting icc speed Manivannan Sadhasivam
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=20230928184808.GA12574@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=abel.vesa@linaro.org \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--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 \
/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;
as well as URLs for NNTP newsgroup(s).