* Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset
2026-09-16 12:37 [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset Konrad Dybcio
@ 2026-09-16 12:45 ` sashiko-bot
2026-09-16 13:37 ` Krishna Chaitanya Chundru
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-09-16 12:45 UTC (permalink / raw)
To: Konrad Dybcio; +Cc: linux-pci
> Root Port recovery may race with a device hot-unplug. In that case,
> dw_pcie_wait_for_link() returns -ENODEV because no device is detected
> after the controller has been successfully reset.
>
> This is a valid outcome and should not cause Root Port recovery to
> fail. Ignore -ENODEV while continuing to propagate other link-training
> errors.
>
> Assisted-by: LLM
> Fixes: 4d88cb82a6d9 ("PCI: qcom: Implement .reset_root_port() and use for link down")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916-topic-pcie_portrec_enodev-v1-1-5dc7bde39552@oss.qualcomm.com?part=1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset
2026-09-16 12:37 [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset Konrad Dybcio
2026-09-16 12:45 ` sashiko-bot
@ 2026-09-16 13:37 ` Krishna Chaitanya Chundru
2026-09-16 15:53 ` Niklas Cassel
2026-10-14 12:51 ` Manivannan Sadhasivam
3 siblings, 0 replies; 8+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-09-16 13:37 UTC (permalink / raw)
To: Konrad Dybcio, Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas
Cc: linux-arm-msm, linux-pci, linux-kernel, Manivannan Sadhasivam
On 9/16/2026 6:07 PM, Konrad Dybcio wrote:
> Root Port recovery may race with a device hot-unplug. In that case,
> dw_pcie_wait_for_link() returns -ENODEV because no device is detected
> after the controller has been successfully reset.
>
> This is a valid outcome and should not cause Root Port recovery to
> fail. Ignore -ENODEV while continuing to propagate other link-training
> errors.
>
> Assisted-by: LLM
> Fixes: 4d88cb82a6d9 ("PCI: qcom: Implement .reset_root_port() and use for link down")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
- Krishna Chaitanya.
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index ee63a6ec99de4d07c16b8d6cb68df0d92f822cd8..3d3be9bf798b7c247d69969d6570385b8648123f 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1880,6 +1880,9 @@ static int qcom_pcie_reset_root_port(struct pci_host_bridge *bridge,
> qcom_pcie_start_link(pci);
>
> ret = dw_pcie_wait_for_link(pci);
> + /* This linkdown might have been a hot-unplug */
> + if (ret == -ENODEV)
> + ret = 0;
> if (ret)
> return ret;
>
>
> ---
> base-commit: e6e35979777d646fe3c7c94dca7dd32fb25d45f4
> change-id: 20260916-topic-pcie_portrec_enodev-cc576ea927f9
>
> Best regards,
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset
2026-09-16 12:37 [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset Konrad Dybcio
2026-09-16 12:45 ` sashiko-bot
2026-09-16 13:37 ` Krishna Chaitanya Chundru
@ 2026-09-16 15:53 ` Niklas Cassel
2026-09-16 16:13 ` Konrad Dybcio
2026-10-14 8:11 ` Manivannan Sadhasivam
2026-10-14 12:51 ` Manivannan Sadhasivam
3 siblings, 2 replies; 8+ messages in thread
From: Niklas Cassel @ 2026-09-16 15:53 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krishna Chaitanya Chundru, linux-arm-msm, linux-pci, linux-kernel,
Manivannan Sadhasivam
Hello Konrad,
On Wed, Sep 16, 2026 at 02:37:49PM +0200, Konrad Dybcio wrote:
> Root Port recovery may race with a device hot-unplug. In that case,
> dw_pcie_wait_for_link() returns -ENODEV because no device is detected
> after the controller has been successfully reset.
>
> This is a valid outcome and should not cause Root Port recovery to
> fail. Ignore -ENODEV while continuing to propagate other link-training
> errors.
>
> Assisted-by: LLM
> Fixes: 4d88cb82a6d9 ("PCI: qcom: Implement .reset_root_port() and use for link down")
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index ee63a6ec99de4d07c16b8d6cb68df0d92f822cd8..3d3be9bf798b7c247d69969d6570385b8648123f 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1880,6 +1880,9 @@ static int qcom_pcie_reset_root_port(struct pci_host_bridge *bridge,
> qcom_pcie_start_link(pci);
>
> ret = dw_pcie_wait_for_link(pci);
> + /* This linkdown might have been a hot-unplug */
> + if (ret == -ENODEV)
> + ret = 0;
> if (ret)
> return ret;
I did not know that pcie-qcom supported hotplug.
Last when I was discussing this with Mani, I'm quite sure that he said that
it doesn't, see:
https://lore.kernel.org/all/20251222064207.3246632-8-cassel@kernel.org/
If that is the case, perhaps the commit message and code comment should be
clarified, so it is more clear what it actually means.
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset
2026-09-16 15:53 ` Niklas Cassel
@ 2026-09-16 16:13 ` Konrad Dybcio
2026-09-16 16:24 ` Niklas Cassel
2026-10-14 8:11 ` Manivannan Sadhasivam
1 sibling, 1 reply; 8+ messages in thread
From: Konrad Dybcio @ 2026-09-16 16:13 UTC (permalink / raw)
To: Niklas Cassel
Cc: Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krishna Chaitanya Chundru, linux-arm-msm, linux-pci, linux-kernel,
Manivannan Sadhasivam
On 9/16/26 5:53 PM, Niklas Cassel wrote:
> Hello Konrad,
>
> On Wed, Sep 16, 2026 at 02:37:49PM +0200, Konrad Dybcio wrote:
>> Root Port recovery may race with a device hot-unplug. In that case,
>> dw_pcie_wait_for_link() returns -ENODEV because no device is detected
>> after the controller has been successfully reset.
>>
>> This is a valid outcome and should not cause Root Port recovery to
>> fail. Ignore -ENODEV while continuing to propagate other link-training
>> errors.
>>
>> Assisted-by: LLM
>> Fixes: 4d88cb82a6d9 ("PCI: qcom: Implement .reset_root_port() and use for link down")
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>> ---
>> drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
>> index ee63a6ec99de4d07c16b8d6cb68df0d92f822cd8..3d3be9bf798b7c247d69969d6570385b8648123f 100644
>> --- a/drivers/pci/controller/dwc/pcie-qcom.c
>> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
>> @@ -1880,6 +1880,9 @@ static int qcom_pcie_reset_root_port(struct pci_host_bridge *bridge,
>> qcom_pcie_start_link(pci);
>>
>> ret = dw_pcie_wait_for_link(pci);
>> + /* This linkdown might have been a hot-unplug */
>> + if (ret == -ENODEV)
>> + ret = 0;
>> if (ret)
>> return ret;
>
>
> I did not know that pcie-qcom supported hotplug.
>
> Last when I was discussing this with Mani, I'm quite sure that he said that
> it doesn't, see:
> https://lore.kernel.org/all/20251222064207.3246632-8-cassel@kernel.org/
I don't know if native ports still don't, but the ones used for USB4
tunneling certainly do
see e.g.:
65ccb2203ef8 ("PCI: qcom: Clear Attention Button Present in Slot Capabilities")
Konrad
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset
2026-09-16 16:13 ` Konrad Dybcio
@ 2026-09-16 16:24 ` Niklas Cassel
0 siblings, 0 replies; 8+ messages in thread
From: Niklas Cassel @ 2026-09-16 16:24 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krishna Chaitanya Chundru, linux-arm-msm, linux-pci, linux-kernel,
Manivannan Sadhasivam
On Wed, Sep 16, 2026 at 06:13:29PM +0200, Konrad Dybcio wrote:
> On 9/16/26 5:53 PM, Niklas Cassel wrote:
> > Hello Konrad,
> >
> > On Wed, Sep 16, 2026 at 02:37:49PM +0200, Konrad Dybcio wrote:
> >> Root Port recovery may race with a device hot-unplug. In that case,
> >> dw_pcie_wait_for_link() returns -ENODEV because no device is detected
> >> after the controller has been successfully reset.
> >>
> >> This is a valid outcome and should not cause Root Port recovery to
> >> fail. Ignore -ENODEV while continuing to propagate other link-training
> >> errors.
> >>
> >> Assisted-by: LLM
> >> Fixes: 4d88cb82a6d9 ("PCI: qcom: Implement .reset_root_port() and use for link down")
> >> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> >> ---
> >> drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
> >> 1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> >> index ee63a6ec99de4d07c16b8d6cb68df0d92f822cd8..3d3be9bf798b7c247d69969d6570385b8648123f 100644
> >> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> >> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> >> @@ -1880,6 +1880,9 @@ static int qcom_pcie_reset_root_port(struct pci_host_bridge *bridge,
> >> qcom_pcie_start_link(pci);
> >>
> >> ret = dw_pcie_wait_for_link(pci);
> >> + /* This linkdown might have been a hot-unplug */
> >> + if (ret == -ENODEV)
> >> + ret = 0;
> >> if (ret)
> >> return ret;
> >
> >
> > I did not know that pcie-qcom supported hotplug.
> >
> > Last when I was discussing this with Mani, I'm quite sure that he said that
> > it doesn't, see:
> > https://lore.kernel.org/all/20251222064207.3246632-8-cassel@kernel.org/
>
> I don't know if native ports still don't, but the ones used for USB4
> tunneling certainly do
>
> see e.g.:
> 65ccb2203ef8 ("PCI: qcom: Clear Attention Button Present in Slot Capabilities")
Ok, nice to see :)
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset
2026-09-16 15:53 ` Niklas Cassel
2026-09-16 16:13 ` Konrad Dybcio
@ 2026-10-14 8:11 ` Manivannan Sadhasivam
1 sibling, 0 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2026-10-14 8:11 UTC (permalink / raw)
To: Niklas Cassel
Cc: Konrad Dybcio, Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krishna Chaitanya Chundru, linux-arm-msm, linux-pci, linux-kernel,
Manivannan Sadhasivam
On 2026-09-16 17:53 +0200, Niklas Cassel wrote:
> Hello Konrad,
>
> On Wed, Sep 16, 2026 at 02:37:49PM +0200, Konrad Dybcio wrote:
> > Root Port recovery may race with a device hot-unplug. In that case,
> > dw_pcie_wait_for_link() returns -ENODEV because no device is detected
> > after the controller has been successfully reset.
> >
> > This is a valid outcome and should not cause Root Port recovery to
> > fail. Ignore -ENODEV while continuing to propagate other link-training
> > errors.
> >
> > Assisted-by: LLM
> > Fixes: 4d88cb82a6d9 ("PCI: qcom: Implement .reset_root_port() and use for link down")
> > Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> > ---
> > drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> > index ee63a6ec99de4d07c16b8d6cb68df0d92f822cd8..3d3be9bf798b7c247d69969d6570385b8648123f 100644
> > --- a/drivers/pci/controller/dwc/pcie-qcom.c
> > +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> > @@ -1880,6 +1880,9 @@ static int qcom_pcie_reset_root_port(struct pci_host_bridge *bridge,
> > qcom_pcie_start_link(pci);
> >
> > ret = dw_pcie_wait_for_link(pci);
> > + /* This linkdown might have been a hot-unplug */
> > + if (ret == -ENODEV)
> > + ret = 0;
> > if (ret)
> > return ret;
>
>
> I did not know that pcie-qcom supported hotplug.
>
> Last when I was discussing this with Mani, I'm quite sure that he said that
> it doesn't, see:
> https://lore.kernel.org/all/20251222064207.3246632-8-cassel@kernel.org/
>
That was my understanding at that time as the hotplug command completions were
getting timedout even though the RP claimed that it supported hotplug:
pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
Then I asked around internally within Qcom and they claimed that nobody tested
hotplug on Qcom SoCs as the usecases were mostly mobile at that time (soldered
EPs), so hotplug may not work and we should not claim it to be supported.
So I went ahead and disabled hotplug capability of the RPs with:
a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0
and v1.9.0")
Then after some time, we started getting form factors with hotpluggable slots
and when we tested hotplug with the above commit reverted, it actually worked,
despite the command completion timeouts. So we finally added hotplug capability
back with:
33a76fc3c3e6 ("PCI: qcom: Advertise Hotplug Slot Capability with no Command
Completion support")
- Mani
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset
2026-09-16 12:37 [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset Konrad Dybcio
` (2 preceding siblings ...)
2026-09-16 15:53 ` Niklas Cassel
@ 2026-10-14 12:51 ` Manivannan Sadhasivam
3 siblings, 0 replies; 8+ messages in thread
From: Manivannan Sadhasivam @ 2026-10-14 12:51 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krishna Chaitanya Chundru, Konrad Dybcio
Cc: linux-arm-msm, linux-pci, linux-kernel, Manivannan Sadhasivam
On Wed, 16 Sep 2026 14:37:49 +0200, Konrad Dybcio wrote:
> PCI: qcom: Ignore -ENODEV after Root Port reset
Applied, thanks!
[1/1] PCI: qcom: Ignore -ENODEV after Root Port reset
commit: 78f27ea27d9870806f51b6f44db7ef6df62f7891
Best regards,
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 8+ messages in thread