Re: [PATCH] PCI: qcom: Ignore -ENODEV after Root Port reset

From: Konrad Dybcio

Date: Wed Sep 16 2026 - 13:55:48 EST


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@xxxxxxxxxxxxxxxx>
>> ---
>> 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@xxxxxxxxxx/

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