Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1713546
| From | Michael Ellerman <mpe@ellerman.id.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device |
| Date | 2017-08-17 07:20 +0200 |
| Message-ID | <uflnP-es-11@gated-at.bofh.it> (permalink) |
| References | <ueLX4-30v-3@gated-at.bofh.it> <ueNvP-443-3@gated-at.bofh.it> <ufcky-2IV-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Thierry Reding <thierry.reding@gmail.com> writes:
...
>
> In case of Tegra, dev actually points to the root port. Now if I read
> the above code correctly, highest_pcie_bridge will still be NULL in that
> case, which in turn will return NULL from pci_find_pcie_root_port(). But
> shouldn't it really return dev?
>
> The patch that I used to fix the issue is this:
>
> --->8---
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 2c712dcfd37d..dd56c1c05614 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -514,7 +514,7 @@ EXPORT_SYMBOL(pci_find_resource);
> */
> struct pci_dev *pci_find_pcie_root_port(struct pci_dev *dev)
> {
> - struct pci_dev *bridge, *highest_pcie_bridge = NULL;
> + struct pci_dev *bridge, *highest_pcie_bridge = dev;
>
> bridge = pci_upstream_bridge(dev);
> while (bridge && pci_is_pcie(bridge)) {
> --->8---
>
> That works correctly if this function ends up being called on the PCIe
> root port, though perhaps that's not what this function is supposed to
> do. It's somewhat unclear from the kerneldoc what the function should
> be doing when called on a root port device itself.
That also works for me on powerpc (oops reported up thread).
cheers
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device Ding Tianhong <dingtianhong@huawei.com> - 2017-08-15 17:30 +0200
Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device Bjorn Helgaas <helgaas@kernel.org> - 2017-08-15 19:10 +0200
Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device David Miller <davem@davemloft.net> - 2017-08-16 02:30 +0200
Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device Thierry Reding <thierry.reding@gmail.com> - 2017-08-16 21:40 +0200
Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device Bjorn Helgaas <helgaas@kernel.org> - 2017-08-16 22:10 +0200
Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device David Miller <davem@davemloft.net> - 2017-08-16 23:10 +0200
Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device Ding Tianhong <dingtianhong@huawei.com> - 2017-08-17 03:20 +0200
Re: [PATCH net RESEND] PCI: fix oops when try to find Root Port for a PCI device Michael Ellerman <mpe@ellerman.id.au> - 2017-08-17 07:20 +0200
csiph-web