From: Hans Zhang <hans.zhang@cixtech.com>
To: Rob Herring <robh@kernel.org>
Cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com,
manivannan.sadhasivam@linaro.org, krzk+dt@kernel.org,
conor+dt@kernel.org, linux-pci@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Manikandan K Pillai <mpillai@cadence.com>
Subject: Re: [PATCH v3 5/6] PCI: cadence: Add callback functions for RP and EP controller
Date: Sun, 13 Apr 2025 00:02:39 +0800 [thread overview]
Message-ID: <94d08e9b-9718-4ee2-be9f-469177f7e4db@cixtech.com> (raw)
In-Reply-To: <07457d00-82bb-4096-ba07-6cc7b7d118e3@cixtech.com>
On 2025/4/12 23:45, Hans Zhang wrote:
>>> + /*
>>> + * Clear AXI link-down status
>>> + */
>>
>> That is an odd thing to do in map_bus. Also, it is completely racy
>> because...
>>
>>> + regval = cdns_pcie_hpa_readl(pcie, REG_BANK_AXI_SLAVE,
>>> CDNS_PCIE_HPA_AT_LINKDOWN);
>>> + cdns_pcie_hpa_writel(pcie, REG_BANK_AXI_SLAVE,
>>> CDNS_PCIE_HPA_AT_LINKDOWN,
>>> + (regval & GENMASK(0, 0)));
>>> +
>>
>> What if the link goes down again here.
>>
>
> Hi Rob,
>
> Thanks your for reply. Compared to Synopsys PCIe IP, Cadence PCIe IP has
> one more register - CDNS_PCIE_HPA_AT_LINKDOWN. When the PCIe link
> appears link down, the register -CDNS_PCIE_HPA_AT_LINKDOWN bit0 is set
> to 1. Then, ECAM cannot access config space. You need to clear
> CDNS_PCIE_HPA_AT_LINKDOWN bit0 to continue the access.
>
> In my opinion, this is where Cadence PCIe IP doesn't make sense. As
> Cadence users, we had no choice, and the chip had already been posted to
> silicon.
Supplement: Prior to this series of patches, in the current linux master
branch, Cadence first generation PCIe IP has the following code:
void __iomem *cdns_pci_map_bus(struct pci_bus *bus, unsigned int devfn,
int where)
{
......
/* Clear AXI link-down status */
cdns_pcie_writel(pcie, CDNS_PCIE_AT_LINKDOWN, 0x0);
......
}
It seems that all Cadence PCIe IPs have this problem.
>
> Therefore, when we design the second-generation SOC, we will design an
> SPI interrupt. When link down occurs, an SPI interrupt is generated. We
> set CDNS_PCIE_HPA_AT_LINKDOWN bit0 to 0 in the interrupt function.
>
> If there are other reasons, please Manikandan add.
>
>
>
> In addition, by the way, ECAM is not accessible when the link is down.
> For example, if the RP is set to hot reset, the hot reset cannot be
> unreset. In this case, you need to use the APB to unreset. We mentioned
> an RTL bug to Cadence that we currently can't fix with our first or
> second generation chips. Cadence has not released RTL patch to us so far.
>
> This software workaround approach will also later appear in the Cixtech
> PCIe controller series patch.
>
>
> Best regards,
> Hans
next prev parent reply other threads:[~2025-04-12 16:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 10:36 [PATCH v3 0/6] Enhance the PCIe controller driver hans.zhang
2025-04-11 10:36 ` [PATCH v3 1/6] dt-bindings: pci: cadence: Extend compatible for new RP configuration hans.zhang
2025-04-11 19:56 ` Rob Herring
2025-04-14 3:05 ` Manikandan Karunakaran Pillai
2025-04-11 10:36 ` [PATCH v3 2/6] dt-bindings: pci: cadence: Extend compatible for new EP configurations hans.zhang
2025-04-11 10:36 ` [PATCH v3 3/6] PCI: cadence: Add header support for PCIe HPA controller hans.zhang
2025-04-11 20:31 ` Rob Herring
2025-04-12 15:19 ` Hans Zhang
2025-04-11 10:36 ` [PATCH v3 4/6] PCI: cadence: Add support for PCIe Endpoint " hans.zhang
2025-04-11 10:36 ` [PATCH v3 5/6] PCI: cadence: Add callback functions for RP and EP controller hans.zhang
2025-04-11 20:24 ` Rob Herring
2025-04-12 15:45 ` Hans Zhang
2025-04-12 16:02 ` Hans Zhang [this message]
2025-04-14 3:52 ` Manikandan Karunakaran Pillai
2025-04-24 2:58 ` Rob Herring
2025-04-24 3:53 ` Manikandan Karunakaran Pillai
2025-04-24 15:07 ` Rob Herring
2025-04-14 4:13 ` kernel test robot
2025-04-14 7:47 ` kernel test robot
2025-04-14 9:20 ` kernel test robot
2025-04-11 10:36 ` [PATCH v3 6/6] PCI: cadence: Update support for TI J721e boards hans.zhang
2025-04-11 20:25 ` Rob Herring
2025-04-14 3:12 ` Manikandan Karunakaran Pillai
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=94d08e9b-9718-4ee2-be9f-469177f7e4db@cixtech.com \
--to=hans.zhang@cixtech.com \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mpillai@cadence.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.