linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Praveenkumar I <quic_ipkumar@quicinc.com>
Cc: mani@kernel.org, agross@kernel.org, andersson@kernel.org,
	konrad.dybcio@linaro.org, lpieralisi@kernel.org, kw@linux.com,
	robh@kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	quic_varada@quicinc.com, quic_devipriy@quicinc.com
Subject: Re: [PATCH v2] PCI: qcom: Set max payload size 256 bytes for IPQ9574
Date: Mon, 20 Nov 2023 14:23:14 -0600	[thread overview]
Message-ID: <20231120202314.GA211658@bhelgaas> (raw)
In-Reply-To: <20230726104249.534210-1-quic_ipkumar@quicinc.com>

On Wed, Jul 26, 2023 at 04:12:49PM +0530, Praveenkumar I wrote:
> This patch sets 256 bytes as payload size for IPQ9574. This allows
> PCIe RC to use the max payload size when a capable link partner is
> connected.

I'm confused because this patch doesn't apply to v6.7-rc1, and I don't
see qcom_pcie_post_init_1_27_0() or IPQ9574 mentioned in the git
history.  Maybe this depends on some out-of-tree patch?

I think this commit log should explain why the existing code in the
PCI core doesn't do what's needed.  Is there something qcom-specific
about this issue?

Maybe an example including the DEVCAP Max_Payload_Size Supported and
the DEVCTL Max_Payload_Size for both ends of the link would help
understand what's going wrong.

Does this setting get lost after suspend?  Does it need to be updated
again after suspend/resume?

> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> ---
> [v2]:
> 	Dropped cover letter for this patch. Configured the max payload
> 	in the post_init of IPQ9574 instead for early fixup.
> 
>  drivers/pci/controller/dwc/pcie-qcom.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 8ee7c2b5de27..739c0d514a96 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1145,6 +1145,15 @@ static int qcom_pcie_post_init(struct qcom_pcie *pcie)
>  
>  static int qcom_pcie_post_init_1_27_0(struct qcom_pcie *pcie)
>  {
> +	struct dw_pcie *pci = pcie->pci;
> +	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
> +	u32 val;
> +
> +	val = readl(pci->dbi_base + offset + PCI_EXP_DEVCTL);
> +	val &= ~PCI_EXP_DEVCTL_PAYLOAD;
> +	val |= PCI_EXP_DEVCTL_PAYLOAD_256B;
> +	writel(val, pci->dbi_base + offset + PCI_EXP_DEVCTL);
> +
>  	writel(SLV_ADDR_SPACE_SZ_1_27_0,
>  	       pcie->parf + PARF_SLV_ADDR_SPACE_SIZE);
>  
> -- 
> 2.34.1
> 

      reply	other threads:[~2023-11-20 20:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26 10:42 [PATCH v2] PCI: qcom: Set max payload size 256 bytes for IPQ9574 Praveenkumar I
2023-11-20 20:23 ` Bjorn Helgaas [this message]

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=20231120202314.GA211658@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bhelgaas@google.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=quic_devipriy@quicinc.com \
    --cc=quic_ipkumar@quicinc.com \
    --cc=quic_varada@quicinc.com \
    --cc=robh@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).