linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: zajec5@gmail.com (Rafał Miłecki)
To: linux-arm-kernel@lists.infradead.org
Subject: pcie-iproc: broken 2nd (& 3rd?) controller support by c3245a566400 ("PCI: iproc: Request host bridge window resources")
Date: Fri, 10 Mar 2017 17:02:48 +0100	[thread overview]
Message-ID: <04f747ef-0f39-33ec-0cea-2e9fb85d46e8@gmail.com> (raw)
In-Reply-To: <20170309182205.GB3685@bhelgaas-glaptop.roam.corp.google.com>

On 03/09/2017 07:22 PM, Bjorn Helgaas wrote:
> On Thu, Mar 09, 2017 at 08:39:07AM +0100, Rafa? Mi?ecki wrote:
>> On 03/08/2017 01:56 PM, Rafa? Mi?ecki wrote:
>>> I just tried upgrading BCM5301X from 4.4 to 4.9 and noticed I don't see card
>>> connected to the 2nd controller.
>>>
>>> pcie_iproc_bcma bcma0:7: PCI host bridge to bus 0000:00
>>> pci_bus 0000:00: root bus resource [mem 0x08000000-0x0fffffff]
>>> pcie_iproc_bcma bcma0:7: link: UP
>>> PCI: bus0: Fast back to back transfers disabled
>>> pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
>>> PCI: bus1: Fast back to back transfers disabled
>>> pci 0000:00:00.0: BAR 8: assigned [mem 0x08000000-0x080fffff]
>>> pci 0000:01:00.0: BAR 0: assigned [mem 0x08000000-0x08007fff 64bit]
>>> pci 0000:00:00.0: PCI bridge to [bus 01]
>>> pci 0000:00:00.0:   bridge window [mem 0x08000000-0x080fffff]
>>>
>>> pcie_iproc_bcma bcma0:8: resource collision: [mem 0x40000000-0x47ffffff] conflicts with PCIe MEM space [mem 0x40000000-0x47ffffff]
>>> pcie_iproc_bcma bcma0:8: PCIe controller setup failed
>>> pcie_iproc_bcma: probe of bcma0:8 failed with error -16
>>>
>>>
>>> This used to work with older kernels because there wasn't any collision check:
>>>
>>> pcie_iproc_bcma bcma0:7: PCI host bridge to bus 0000:00
>>> pci_bus 0000:00: root bus resource [mem 0x08000000-0x0fffffff]
>>> pcie_iproc_bcma bcma0:7: link: UP
>>> PCI: bus0: Fast back to back transfers disabled
>>> pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
>>> PCI: bus1: Fast back to back transfers disabled
>>> pci 0000:00:00.0: BAR 8: assigned [mem 0x08000000-0x080fffff]
>>> pci 0000:01:00.0: BAR 0: assigned [mem 0x08000000-0x08007fff 64bit]
>>> pci 0000:00:00.0: PCI bridge to [bus 01]
>>> pci 0000:00:00.0:   bridge window [mem 0x08000000-0x080fffff]
>>>
>>> pcie_iproc_bcma bcma0:8: PCI host bridge to bus 0001:00
>>> pci_bus 0001:00: root bus resource [mem 0x40000000-0x47ffffff]
>>> pcie_iproc_bcma bcma0:8: link: UP
>>> PCI: bus0: Fast back to back transfers disabled
>>> pci 0001:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
>>> PCI: bus1: Fast back to back transfers disabled
>>> pci 0001:00:00.0: BAR 8: assigned [mem 0x40000000-0x400fffff]
>>> pci 0001:01:00.0: BAR 0: assigned [mem 0x40000000-0x40007fff 64bit]
>>> pci 0001:00:00.0: PCI bridge to [bus 01]
>>> pci 0001:00:00.0:   bridge window [mem 0x40000000-0x400fffff]
>>>
>>>
>>> I guess the check is OK after all and the real problem is iproc driver assigning
>>> the same resource.
>>>
>>> Broadcom team: could you take a look at this, please?
>>
>> I found a reason of this conflict (and probably random crashes I started
>> seeing with 4.9). I believe we have a memory corruption.
>
> Yep, we're using a resource structure on the stack when we shouldn't.  Can
> you try the patch below?

Works great! Will you push it with
Cc: stable at vger.kernel.org # v4.8+
please?

Thanks for looking at this!

Also see below...


> (...)
>  	if (ret)
>  		dev_err(dev, "PCIe controller setup failed\n");
> -
> -	pci_free_resource_list(&res);
> +		pci_free_resource_list(&resources);
> +		return ret;
> +	}

Works great, except it doesn't compile (braces) ;)

  reply	other threads:[~2017-03-10 16:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 12:56 pcie-iproc: broken 2nd (& 3rd?) controller support by c3245a566400 ("PCI: iproc: Request host bridge window resources") Rafał Miłecki
2017-03-08 17:22 ` Ray Jui
2017-03-08 23:28   ` Rafał Miłecki
2017-03-09  0:31     ` Ray Jui
2017-03-09  7:39 ` Rafał Miłecki
2017-03-09 18:22   ` Bjorn Helgaas
2017-03-10 16:02     ` Rafał Miłecki [this message]
2017-03-10 17:21       ` Ray Jui
2017-03-10 17:47       ` Bjorn Helgaas
2017-03-10 21:11         ` Rafał Miłecki

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=04f747ef-0f39-33ec-0cea-2e9fb85d46e8@gmail.com \
    --to=zajec5@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).