Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-28 Thread Bjorn Helgaas
On Fri, Jan 13, 2017 at 03:20:17AM +0300, Abylay Ospan wrote: > pcie->dev->of_node not always defined (NULL) and can cause crash: > > [ 19.053195] Unable to handle kernel NULL pointer dereference at > virtual address 0020 > [] (of_n_addr_cells) from [] > (iproc_pcie_setup+0x30c/0xce0) > >

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-28 Thread Bjorn Helgaas
On Fri, Jan 13, 2017 at 03:20:17AM +0300, Abylay Ospan wrote: > pcie->dev->of_node not always defined (NULL) and can cause crash: > > [ 19.053195] Unable to handle kernel NULL pointer dereference at > virtual address 0020 > [] (of_n_addr_cells) from [] > (iproc_pcie_setup+0x30c/0xce0) > >

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-16 Thread Florian Fainelli
+Rafal, On 01/12/2017 08:55 PM, Abylay Ospan wrote: > Hi Florian, > >> Still, upstream Linux support for Northstar is Device Tree, and BCMA bus >> should fill in of_nodes accordingly, if not, that's a bug that must be >> fixed at the BCMA layer. > > yes, this is a source of the problem. Devices

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-16 Thread Florian Fainelli
+Rafal, On 01/12/2017 08:55 PM, Abylay Ospan wrote: > Hi Florian, > >> Still, upstream Linux support for Northstar is Device Tree, and BCMA bus >> should fill in of_nodes accordingly, if not, that's a bug that must be >> fixed at the BCMA layer. > > yes, this is a source of the problem. Devices

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Abylay Ospan
FYI, here is my tree (based on linux-next): https://github.com/aospan/linux-next-bcm4708-edgecore-ecw7220-l/commits/master last patches adding defconfig and dts I'm using for this device. This files are draft yet. 2017-01-12 19:22 GMT-05:00 Florian Fainelli : > On

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Abylay Ospan
FYI, here is my tree (based on linux-next): https://github.com/aospan/linux-next-bcm4708-edgecore-ecw7220-l/commits/master last patches adding defconfig and dts I'm using for this device. This files are draft yet. 2017-01-12 19:22 GMT-05:00 Florian Fainelli : > On 01/12/2017 04:20 PM, Abylay

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Abylay Ospan
Hi Florian, > Still, upstream Linux support for Northstar is Device Tree, and BCMA bus > should fill in of_nodes accordingly, if not, that's a bug that must be > fixed at the BCMA layer. yes, this is a source of the problem. Devices allocated in 'bcma_bus_scan' but of_node doesn't assigned. Is

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Abylay Ospan
Hi Florian, > Still, upstream Linux support for Northstar is Device Tree, and BCMA bus > should fill in of_nodes accordingly, if not, that's a bug that must be > fixed at the BCMA layer. yes, this is a source of the problem. Devices allocated in 'bcma_bus_scan' but of_node doesn't assigned. Is

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Florian Fainelli
On 01/12/2017 04:48 PM, Ray Jui wrote: > Hi Florian, > > On 1/12/2017 4:22 PM, Florian Fainelli wrote: >> On 01/12/2017 04:20 PM, Abylay Ospan wrote: >>> pcie->dev->of_node not always defined (NULL) and can cause crash: >>> >>> [ 19.053195] Unable to handle kernel NULL pointer dereference at

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Florian Fainelli
On 01/12/2017 04:48 PM, Ray Jui wrote: > Hi Florian, > > On 1/12/2017 4:22 PM, Florian Fainelli wrote: >> On 01/12/2017 04:20 PM, Abylay Ospan wrote: >>> pcie->dev->of_node not always defined (NULL) and can cause crash: >>> >>> [ 19.053195] Unable to handle kernel NULL pointer dereference at

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Ray Jui
Hi Florian, On 1/12/2017 4:22 PM, Florian Fainelli wrote: > On 01/12/2017 04:20 PM, Abylay Ospan wrote: >> pcie->dev->of_node not always defined (NULL) and can cause crash: >> >> [ 19.053195] Unable to handle kernel NULL pointer dereference at >> virtual address 0020 >> [] (of_n_addr_cells)

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Ray Jui
Hi Florian, On 1/12/2017 4:22 PM, Florian Fainelli wrote: > On 01/12/2017 04:20 PM, Abylay Ospan wrote: >> pcie->dev->of_node not always defined (NULL) and can cause crash: >> >> [ 19.053195] Unable to handle kernel NULL pointer dereference at >> virtual address 0020 >> [] (of_n_addr_cells)

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Ray Jui
On 1/12/2017 4:20 PM, Abylay Ospan wrote: > pcie->dev->of_node not always defined (NULL) and can cause crash: Ah I guess this can happen with the BCMA based platforms that do not use device tree for PCIe? > > [ 19.053195] Unable to handle kernel NULL pointer dereference at > virtual address

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Ray Jui
On 1/12/2017 4:20 PM, Abylay Ospan wrote: > pcie->dev->of_node not always defined (NULL) and can cause crash: Ah I guess this can happen with the BCMA based platforms that do not use device tree for PCIe? > > [ 19.053195] Unable to handle kernel NULL pointer dereference at > virtual address

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Florian Fainelli
On 01/12/2017 04:20 PM, Abylay Ospan wrote: > pcie->dev->of_node not always defined (NULL) and can cause crash: > > [ 19.053195] Unable to handle kernel NULL pointer dereference at > virtual address 0020 > [] (of_n_addr_cells) from [] > (iproc_pcie_setup+0x30c/0xce0) > > this patch adds

Re: [PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Florian Fainelli
On 01/12/2017 04:20 PM, Abylay Ospan wrote: > pcie->dev->of_node not always defined (NULL) and can cause crash: > > [ 19.053195] Unable to handle kernel NULL pointer dereference at > virtual address 0020 > [] (of_n_addr_cells) from [] > (iproc_pcie_setup+0x30c/0xce0) > > this patch adds

[PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Abylay Ospan
pcie->dev->of_node not always defined (NULL) and can cause crash: [ 19.053195] Unable to handle kernel NULL pointer dereference at virtual address 0020 [] (of_n_addr_cells) from [] (iproc_pcie_setup+0x30c/0xce0) this patch adds sanity check to prevent crash. Signed-off-by: Abylay Ospan

[PATCH] PCI: iproc: fix kernel crash if dev->of_node not defined

2017-01-12 Thread Abylay Ospan
pcie->dev->of_node not always defined (NULL) and can cause crash: [ 19.053195] Unable to handle kernel NULL pointer dereference at virtual address 0020 [] (of_n_addr_cells) from [] (iproc_pcie_setup+0x30c/0xce0) this patch adds sanity check to prevent crash. Signed-off-by: Abylay Ospan