lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <432e4026-208f-459e-82dc-e74ef5da6a87@oss.qualcomm.com>
Date: Fri, 17 Oct 2025 17:13:17 +0530
From: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>
To: Manivannan Sadhasivam <mani@...nel.org>, Ron Economos <re@...z.net>
Cc: Bjorn Helgaas <helgaas@...nel.org>, Conor Dooley <conor@...nel.org>,
        bhelgaas@...gle.com, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        Paul Walmsley <pjw@...nel.org>, Greentime Hu <greentime.hu@...ive.com>,
        Samuel Holland <samuel.holland@...ive.com>,
        regressions@...ts.linux.dev
Subject: Re: SiFive FU740 PCI driver fails on 6.18-rc1



On 10/15/2025 7:33 PM, Manivannan Sadhasivam wrote:
> On Tue, Oct 14, 2025 at 03:41:39PM -0700, Ron Economos wrote:
>> On 10/14/25 09:25, Manivannan Sadhasivam wrote:
>>> On Mon, Oct 13, 2025 at 10:52:48PM -0700, Ron Economos wrote:
>>>> On 10/13/25 22:36, Krishna Chaitanya Chundru wrote:
>>>>>
>>>>> On 10/14/2025 10:56 AM, Ron Economos wrote:
>>>>>> On 10/13/25 22:20, Krishna Chaitanya Chundru wrote:
>>>>>>>
>>>>>>> On 10/14/2025 2:58 AM, Bjorn Helgaas wrote:
>>>>>>>> [+cc FU740 driver folks, Conor, regressions]
>>>>>>>>
>>>>>>>> On Mon, Oct 13, 2025 at 12:14:54AM -0700, Ron Economos wrote:
>>>>>>>>> The SiFive FU740 PCI driver fails on the HiFive
>>>>>>>>> Unmatched board with Linux
>>>>>>>>> 6.18-rc1. The error message is:
>>>>>>>>>
>>>>>>>>> [    3.166624] fu740-pcie e00000000.pcie: host bridge
>>>>>>>>> /soc/pcie@...000000
>>>>>>>>> ranges:
>>>>>>>>> [    3.166706] fu740-pcie e00000000.pcie:       IO
>>>>>>>>> 0x0060080000..0x006008ffff -> 0x0060080000
>>>>>>>>> [    3.166767] fu740-pcie e00000000.pcie:      MEM
>>>>>>>>> 0x0060090000..0x007fffffff -> 0x0060090000
>>>>>>>>> [    3.166805] fu740-pcie e00000000.pcie:      MEM
>>>>>>>>> 0x2000000000..0x3fffffffff -> 0x2000000000
>>>>>>>>> [    3.166950] fu740-pcie e00000000.pcie: ECAM at [mem
>>>>>>>>> 0xdf0000000-0xdffffffff] for [bus 00-ff]
>>>>>>>>> [    3.579500] fu740-pcie e00000000.pcie: No iATU regions found
>>>>>>>>> [    3.579552] fu740-pcie e00000000.pcie: Failed to
>>>>>>>>> configure iATU in ECAM
>>>>>>>>> mode
>>>>>>>>> [    3.579655] fu740-pcie e00000000.pcie: probe with
>>>>>>>>> driver fu740-pcie
>>>>>>>>> failed with error -22
>>>>>>>>>
>>>>>>>>> The normal message (on Linux 6.17.2) is:
>>>>>>>>>
>>>>>>>>> [    3.381487] fu740-pcie e00000000.pcie: host bridge
>>>>>>>>> /soc/pcie@...000000
>>>>>>>>> ranges:
>>>>>>>>> [    3.381584] fu740-pcie e00000000.pcie:       IO
>>>>>>>>> 0x0060080000..0x006008ffff -> 0x0060080000
>>>>>>>>> [    3.381682] fu740-pcie e00000000.pcie:      MEM
>>>>>>>>> 0x0060090000..0x007fffffff -> 0x0060090000
>>>>>>>>> [    3.381724] fu740-pcie e00000000.pcie:      MEM
>>>>>>>>> 0x2000000000..0x3fffffffff -> 0x2000000000
>>>>>>>>> [    3.484809] fu740-pcie e00000000.pcie: iATU: unroll
>>>>>>>>> T, 8 ob, 8 ib, align
>>>>>>>>> 4K, limit 4096G
>>>>>>>>> [    3.683678] fu740-pcie e00000000.pcie: PCIe Gen.1 x8 link up
>>>>>>>>> [    3.883674] fu740-pcie e00000000.pcie: PCIe Gen.3 x8 link up
>>>>>>>>> [    3.987678] fu740-pcie e00000000.pcie: PCIe Gen.3 x8 link up
>>>>>>>>> [    3.988164] fu740-pcie e00000000.pcie: PCI host
>>>>>>>>> bridge to bus 0000:00
>>>>>>>>>
>>>>>>>>> Reverting the following commits solves the issue.
>>>>>>>>>
>>>>>>>>> 0da48c5b2fa731b21bc523c82d927399a1e508b0 PCI: dwc:
>>>>>>>>> Support ECAM mechanism by
>>>>>>>>> enabling iATU 'CFG Shift Feature'
>>>>>>>>>
>>>>>>>>> 4660e50cf81800f82eeecf743ad1e3e97ab72190 PCI: qcom:
>>>>>>>>> Prepare for the DWC ECAM
>>>>>>>>> enablement
>>>>>>>>>
>>>>>>>>> f6fd357f7afbeb34a633e5688a23b9d7eb49d558 PCI: dwc:
>>>>>>>>> Prepare the driver for
>>>>>>>>> enabling ECAM mechanism using iATU 'CFG Shift Feature'
>>>>>>>> As Conor pointed out, we can't fix a code regression with a DT change.
>>>>>>>>
>>>>>>>> #regzbot introduced: f6fd357f7afb ("PCI: dwc: Prepare the
>>>>>>>> driver for enabling ECAM mechanism using iATU 'CFG Shift
>>>>>>>> Feature'")
>>>>>>> Hi Conor,
>>>>>>>
>>>>>>> Can you try with this patch and see if it is fixing the issue.
>>>>>>> diff --git a/drivers/pci/controller/dwc/pcie-fu740.c
>>>>>>> b/drivers/pci/controller/dwc/pcie-fu740.c
>>>>>>> index 66367252032b..b5e0f016a580 100644
>>>>>>> --- a/drivers/pci/controller/dwc/pcie-fu740.c
>>>>>>> +++ b/drivers/pci/controller/dwc/pcie-fu740.c
>>>>>>> @@ -328,6 +328,8 @@ static int fu740_pcie_probe(struct
>>>>>>> platform_device *pdev)
>>>>>>>
>>>>>>>           platform_set_drvdata(pdev, afp);
>>>>>>>
>>>>>>> +       pci->pp.native_ecam = true;
>>>>>>> +
>>>>>>>           return dw_pcie_host_init(&pci->pp);
>>>>>>>    }
>>>>>>>
>>>>>>> - Krishna Chaitanya.
>>>>>>>
>>>>>> I've already tried it. It doesn't work. Same error message as before.
>>>>> Can you share us dmesg logs for this change.
>>>>>
>>>>> - Krishna Chaitanya.
>>>> [    3.159763] fu740-pcie e00000000.pcie: host bridge /soc/pcie@...000000
>>>> ranges:
>>>> [    3.159853] fu740-pcie e00000000.pcie:       IO
>>>> 0x0060080000..0x006008ffff -> 0x0060080000
>>>> [    3.159916] fu740-pcie e00000000.pcie:      MEM
>>>> 0x0060090000..0x007fffffff -> 0x0060090000
>>>> [    3.159953] fu740-pcie e00000000.pcie:      MEM
>>>> 0x2000000000..0x3fffffffff -> 0x2000000000
>>>> [    3.160039] fu740-pcie e00000000.pcie: ECAM at [mem
>>>> 0xdf0000000-0xdffffffff] for [bus 00-ff]
>>>> [    3.571421] fu740-pcie e00000000.pcie: No iATU regions found
>>>> [    3.571472] fu740-pcie e00000000.pcie: Failed to configure iATU in ECAM
>>>> mode
>>>> [    3.571529] fu740-pcie e00000000.pcie: probe with driver fu740-pcie
>>>> failed with error -22
>>>>
>>>> Same as before the change. The entire log is here:
>>>>
>>>> https://www.w6rz.net/dmesg.txt
>>>>
>>> Weird that the driver still creates ECAM even after skipping it using the flag.
>>> The flag is not meant for that purpose, but it should've worked anyway.
>>>
>>> Can you try this diff and share the dmesg log?
>>>
>>> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
>>> index 20c9333bcb1c..58080928df9f 100644
>>> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
>>> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
>>> @@ -523,8 +523,12 @@ static int dw_pcie_host_get_resources(struct dw_pcie_rp *pp)
>>>           pp->cfg0_size = resource_size(res);
>>>           pp->cfg0_base = res->start;
>>>
>>> +       dev_info(dev, "%s: %d native_ecam: %d", __func__, __LINE__,
>>> +pp->native_ecam);
>>> +
>>>           pp->ecam_enabled = dw_pcie_ecam_enabled(pp, res);
>>>           if (pp->ecam_enabled) {
>>> +               dev_info(dev, "%s: %d ECAM ENABLED", __func__, __LINE__);
>>>                   ret = dw_pcie_create_ecam_window(pp, res);
>>>                   if (ret)
>>>                           return ret;
>>> @@ -533,6 +537,7 @@ static int dw_pcie_host_get_resources(struct dw_pcie_rp *pp)
>>>                   pp->bridge->sysdata = pp->cfg;
>>>                   pp->cfg->priv = pp;
>>>           } else {
>>> +               dev_info(dev, "%s: %d ECAM DISABLED", __func__, __LINE__);
>>>                   pp->va_cfg0_base = devm_pci_remap_cfg_resource(dev, res);
>>>                   if (IS_ERR(pp->va_cfg0_base))
>>>                           return PTR_ERR(pp->va_cfg0_base);
>>>
>>> - Mani
>>>
>> After testing with this patch, I must have transferred the wrong image to
>> the target when testing before. The "pci->pp.native_ecam = true;" patch to
>> pcie-fu740.c does work.
> 
> Thanks! However, it was not a proper fix. The issue seems to be due the
> assumption that the whole DBI space (Root Port + misc registers) lies at the
> start of the ECAM region. This is true for Qcom, but not for all DWC glue
> platforms.
> 
> Krishna is working on a patch that decouples the DBI region from ECAM so that
> the driver will continue using DBI for accessing Root Port config space and ECAM
> for bus > 0.
> 
> This is one step backwards for ECAM since the driver is supposed to use ECAM for
> accessing all devices starting from the Root Port. But since DWC has clubbed
> non-Root Port specific registers in the DBI space, we have to live with this
> limitation as ECAM is supposed to access only Root Port specific registers.
> 
> The patch will be posted after internal validation asap.
> 
Hi Ron,

Can you try with this series and let us know if it is helping you or
not.

https://lore.kernel.org/all/20251017-ecam_fix-v1-0-f6faa3d0edf3@oss.qualcomm.com/

- Krishna Chaitanya.

> - Mani
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ