LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] pci: of : fix BUG: unable to handle kernel
@ 2015-03-10 15:25 Murali Karicheri
  2015-03-11 12:35 ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Murali Karicheri @ 2015-03-10 15:25 UTC (permalink / raw)
  To: grant.likely, robh+dt, devicetree, linux-kernel, linux-pci,
	bhelgaas, arnd, Suravee.Suthikulpanit, will.deacon, joro, linux
  Cc: Murali Karicheri

On some platforms such as that based on x86, ia64 etc, root bus is
created with parent node passed in as NULL to pci_create_root_bus().
On these platforms, the patch series "PCI: get DMA configuration from
parent device" when applied causes kernel crash. So add a check for this
in of_pci_dma_configure()

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 drivers/of/of_pci.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
index 86d3c38..a8e485c 100644
--- a/drivers/of/of_pci.c
+++ b/drivers/of/of_pci.c
@@ -129,6 +129,10 @@ void of_pci_dma_configure(struct pci_dev *pci_dev)
 	struct device *dev = &pci_dev->dev;
 	struct device *bridge = pci_get_host_bridge_device(pci_dev);
 
+	/* Some platforms can have bridge->parent set to NULL */
+	if (!bridge->parent)
+		return;
+
 	of_dma_configure(dev, bridge->parent->of_node);
 	pci_put_host_bridge_device(bridge);
 }
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pci: of : fix BUG: unable to handle kernel
  2015-03-10 15:25 [PATCH] pci: of : fix BUG: unable to handle kernel Murali Karicheri
@ 2015-03-11 12:35 ` Rob Herring
  2015-03-11 12:49   ` Russell King - ARM Linux
  2015-03-11 15:25   ` Murali Karicheri
  0 siblings, 2 replies; 8+ messages in thread
From: Rob Herring @ 2015-03-11 12:35 UTC (permalink / raw)
  To: Murali Karicheri
  Cc: Grant Likely, Rob Herring, devicetree, linux-kernel, linux-pci,
	Bjorn Helgaas, Arnd Bergmann, Suravee Suthikulanit, Will Deacon,
	Joerg Roedel, Russell King - ARM Linux

On Tue, Mar 10, 2015 at 10:25 AM, Murali Karicheri <m-karicheri2@ti.com> wrote:
> On some platforms such as that based on x86, ia64 etc, root bus is
> created with parent node passed in as NULL to pci_create_root_bus().
> On these platforms, the patch series "PCI: get DMA configuration from
> parent device" when applied causes kernel crash. So add a check for this
> in of_pci_dma_configure()

Wouldn't these arches have OF disabled and call an empty function?
Regardless, we still need this.

> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>

I'm assuming Bjorn will apply this.

Acked-by: Rob Herring <robh@kernel.org>

> ---
>  drivers/of/of_pci.c |    4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
> index 86d3c38..a8e485c 100644
> --- a/drivers/of/of_pci.c
> +++ b/drivers/of/of_pci.c
> @@ -129,6 +129,10 @@ void of_pci_dma_configure(struct pci_dev *pci_dev)
>         struct device *dev = &pci_dev->dev;
>         struct device *bridge = pci_get_host_bridge_device(pci_dev);
>
> +       /* Some platforms can have bridge->parent set to NULL */
> +       if (!bridge->parent)
> +               return;
> +
>         of_dma_configure(dev, bridge->parent->of_node);
>         pci_put_host_bridge_device(bridge);
>  }
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pci: of : fix BUG: unable to handle kernel
  2015-03-11 12:35 ` Rob Herring
@ 2015-03-11 12:49   ` Russell King - ARM Linux
  2015-03-11 15:28     ` Murali Karicheri
  2015-03-11 15:25   ` Murali Karicheri
  1 sibling, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2015-03-11 12:49 UTC (permalink / raw)
  To: Rob Herring
  Cc: Murali Karicheri, Grant Likely, Rob Herring, devicetree,
	linux-kernel, linux-pci, Bjorn Helgaas, Arnd Bergmann,
	Suravee Suthikulanit, Will Deacon, Joerg Roedel

On Wed, Mar 11, 2015 at 07:35:45AM -0500, Rob Herring wrote:
> On Tue, Mar 10, 2015 at 10:25 AM, Murali Karicheri <m-karicheri2@ti.com> wrote:
> > On some platforms such as that based on x86, ia64 etc, root bus is
> > created with parent node passed in as NULL to pci_create_root_bus().
> > On these platforms, the patch series "PCI: get DMA configuration from
> > parent device" when applied causes kernel crash. So add a check for this
> > in of_pci_dma_configure()
> 
> Wouldn't these arches have OF disabled and call an empty function?
> Regardless, we still need this.
> 
> > Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> 
> I'm assuming Bjorn will apply this.
> 
> Acked-by: Rob Herring <robh@kernel.org>

It might be an idea to read the subject line...

"fix BUG: unable to handle kernel"

which is meaningless.  It needs a much better subject line before it can
be committed.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pci: of : fix BUG: unable to handle kernel
  2015-03-11 12:35 ` Rob Herring
  2015-03-11 12:49   ` Russell King - ARM Linux
@ 2015-03-11 15:25   ` Murali Karicheri
  1 sibling, 0 replies; 8+ messages in thread
From: Murali Karicheri @ 2015-03-11 15:25 UTC (permalink / raw)
  To: Rob Herring
  Cc: Grant Likely, Rob Herring, devicetree, linux-kernel, linux-pci,
	Bjorn Helgaas, Arnd Bergmann, Suravee Suthikulanit, Will Deacon,
	Joerg Roedel, Russell King - ARM Linux

On 03/11/2015 08:35 AM, Rob Herring wrote:
> On Tue, Mar 10, 2015 at 10:25 AM, Murali Karicheri<m-karicheri2@ti.com>  wrote:
>> On some platforms such as that based on x86, ia64 etc, root bus is
>> created with parent node passed in as NULL to pci_create_root_bus().
>> On these platforms, the patch series "PCI: get DMA configuration from
>> parent device" when applied causes kernel crash. So add a check for this
>> in of_pci_dma_configure()
>
> Wouldn't these arches have OF disabled and call an empty function?
The current patch series does have a empty function if OF is disabled.
> Regardless, we still need this.
These archs have OF enabled, but they call  pci_create_root_bus() with 
NULL parent node passed in. That is why the crash happens.

Murali
>
>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>
> I'm assuming Bjorn will apply this.
>
> Acked-by: Rob Herring<robh@kernel.org>
>
>> ---
>>   drivers/of/of_pci.c |    4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
>> index 86d3c38..a8e485c 100644
>> --- a/drivers/of/of_pci.c
>> +++ b/drivers/of/of_pci.c
>> @@ -129,6 +129,10 @@ void of_pci_dma_configure(struct pci_dev *pci_dev)
>>          struct device *dev =&pci_dev->dev;
>>          struct device *bridge = pci_get_host_bridge_device(pci_dev);
>>
>> +       /* Some platforms can have bridge->parent set to NULL */
>> +       if (!bridge->parent)
>> +               return;
>> +
>>          of_dma_configure(dev, bridge->parent->of_node);
>>          pci_put_host_bridge_device(bridge);
>>   }
>> --
>> 1.7.9.5
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Murali Karicheri
Linux Kernel, Texas Instruments

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pci: of : fix BUG: unable to handle kernel
  2015-03-11 12:49   ` Russell King - ARM Linux
@ 2015-03-11 15:28     ` Murali Karicheri
  2015-03-11 15:59       ` Rob Herring
  0 siblings, 1 reply; 8+ messages in thread
From: Murali Karicheri @ 2015-03-11 15:28 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Rob Herring, Grant Likely, Rob Herring, devicetree, linux-kernel,
	linux-pci, Bjorn Helgaas, Arnd Bergmann, Suravee Suthikulanit,
	Will Deacon, Joerg Roedel

On 03/11/2015 08:49 AM, Russell King - ARM Linux wrote:
> On Wed, Mar 11, 2015 at 07:35:45AM -0500, Rob Herring wrote:
>> On Tue, Mar 10, 2015 at 10:25 AM, Murali Karicheri<m-karicheri2@ti.com>  wrote:
>>> On some platforms such as that based on x86, ia64 etc, root bus is
>>> created with parent node passed in as NULL to pci_create_root_bus().
>>> On these platforms, the patch series "PCI: get DMA configuration from
>>> parent device" when applied causes kernel crash. So add a check for this
>>> in of_pci_dma_configure()
>>
>> Wouldn't these arches have OF disabled and call an empty function?
>> Regardless, we still need this.
>>
>>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>>
>> I'm assuming Bjorn will apply this.
>>
>> Acked-by: Rob Herring<robh@kernel.org>
>
> It might be an idea to read the subject line...
>
> "fix BUG: unable to handle kernel"
Russell,

I will fix the subject as "fix BUG: unable to handle kernel NULL 
pointer" and re-send.

Thanks

Murali
>
> which is meaningless.  It needs a much better subject line before it can
> be committed.
>


-- 
Murali Karicheri
Linux Kernel, Texas Instruments

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pci: of : fix BUG: unable to handle kernel
  2015-03-11 15:28     ` Murali Karicheri
@ 2015-03-11 15:59       ` Rob Herring
  2015-03-11 16:37         ` Murali Karicheri
  2015-03-11 20:27         ` Murali Karicheri
  0 siblings, 2 replies; 8+ messages in thread
From: Rob Herring @ 2015-03-11 15:59 UTC (permalink / raw)
  To: Murali Karicheri
  Cc: Russell King - ARM Linux, Grant Likely, Rob Herring, devicetree,
	linux-kernel, linux-pci, Bjorn Helgaas, Arnd Bergmann,
	Suravee Suthikulanit, Will Deacon, Joerg Roedel

On Wed, Mar 11, 2015 at 10:28 AM, Murali Karicheri <m-karicheri2@ti.com> wrote:
> On 03/11/2015 08:49 AM, Russell King - ARM Linux wrote:
>>
>> On Wed, Mar 11, 2015 at 07:35:45AM -0500, Rob Herring wrote:
>>>
>>> On Tue, Mar 10, 2015 at 10:25 AM, Murali Karicheri<m-karicheri2@ti.com>
>>> wrote:
>>>>
>>>> On some platforms such as that based on x86, ia64 etc, root bus is
>>>> created with parent node passed in as NULL to pci_create_root_bus().
>>>> On these platforms, the patch series "PCI: get DMA configuration from
>>>> parent device" when applied causes kernel crash. So add a check for this
>>>> in of_pci_dma_configure()
>>>
>>>
>>> Wouldn't these arches have OF disabled and call an empty function?
>>> Regardless, we still need this.
>>>
>>>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>>>
>>>
>>> I'm assuming Bjorn will apply this.
>>>
>>> Acked-by: Rob Herring<robh@kernel.org>
>>
>>
>> It might be an idea to read the subject line...
>>
>> "fix BUG: unable to handle kernel"
>
> Russell,
>
> I will fix the subject as "fix BUG: unable to handle kernel NULL pointer"
> and re-send.

Russell's point is the subject applies to every fix for a BUG.
Something like "of/pci: fix of_pci_dma_configure parent ptr NULL
dereference".

Rob

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pci: of : fix BUG: unable to handle kernel
  2015-03-11 15:59       ` Rob Herring
@ 2015-03-11 16:37         ` Murali Karicheri
  2015-03-11 20:27         ` Murali Karicheri
  1 sibling, 0 replies; 8+ messages in thread
From: Murali Karicheri @ 2015-03-11 16:37 UTC (permalink / raw)
  To: Rob Herring
  Cc: Russell King - ARM Linux, Grant Likely, Rob Herring, devicetree,
	linux-kernel, linux-pci, Bjorn Helgaas, Arnd Bergmann,
	Suravee Suthikulanit, Will Deacon, Joerg Roedel

On 03/11/2015 11:59 AM, Rob Herring wrote:
> On Wed, Mar 11, 2015 at 10:28 AM, Murali Karicheri<m-karicheri2@ti.com>  wrote:
>> On 03/11/2015 08:49 AM, Russell King - ARM Linux wrote:
>>>
>>> On Wed, Mar 11, 2015 at 07:35:45AM -0500, Rob Herring wrote:
>>>>
>>>> On Tue, Mar 10, 2015 at 10:25 AM, Murali Karicheri<m-karicheri2@ti.com>
>>>> wrote:
>>>>>
>>>>> On some platforms such as that based on x86, ia64 etc, root bus is
>>>>> created with parent node passed in as NULL to pci_create_root_bus().
>>>>> On these platforms, the patch series "PCI: get DMA configuration from
>>>>> parent device" when applied causes kernel crash. So add a check for this
>>>>> in of_pci_dma_configure()
>>>>
>>>>
>>>> Wouldn't these arches have OF disabled and call an empty function?
>>>> Regardless, we still need this.
>>>>
>>>>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>>>>
>>>>
>>>> I'm assuming Bjorn will apply this.
>>>>
>>>> Acked-by: Rob Herring<robh@kernel.org>
>>>
>>>
>>> It might be an idea to read the subject line...
>>>
>>> "fix BUG: unable to handle kernel"
>>
>> Russell,
>>
>> I will fix the subject as "fix BUG: unable to handle kernel NULL pointer"
>> and re-send.
>
> Russell's point is the subject applies to every fix for a BUG.
> Something like "of/pci: fix of_pci_dma_configure parent ptr NULL
> dereference".
Ok. Got it.
>
> Rob


-- 
Murali Karicheri
Linux Kernel, Texas Instruments

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pci: of : fix BUG: unable to handle kernel
  2015-03-11 15:59       ` Rob Herring
  2015-03-11 16:37         ` Murali Karicheri
@ 2015-03-11 20:27         ` Murali Karicheri
  1 sibling, 0 replies; 8+ messages in thread
From: Murali Karicheri @ 2015-03-11 20:27 UTC (permalink / raw)
  To: Rob Herring, Bjorn Helgaas
  Cc: Russell King - ARM Linux, Grant Likely, Rob Herring, devicetree,
	linux-kernel, linux-pci, Arnd Bergmann, Suravee Suthikulanit,
	Will Deacon, Joerg Roedel

On 03/11/2015 11:59 AM, Rob Herring wrote:
> On Wed, Mar 11, 2015 at 10:28 AM, Murali Karicheri<m-karicheri2@ti.com>  wrote:
>> On 03/11/2015 08:49 AM, Russell King - ARM Linux wrote:
>>>
>>> On Wed, Mar 11, 2015 at 07:35:45AM -0500, Rob Herring wrote:
>>>>
>>>> On Tue, Mar 10, 2015 at 10:25 AM, Murali Karicheri<m-karicheri2@ti.com>
>>>> wrote:
>>>>>
>>>>> On some platforms such as that based on x86, ia64 etc, root bus is
>>>>> created with parent node passed in as NULL to pci_create_root_bus().
>>>>> On these platforms, the patch series "PCI: get DMA configuration from
>>>>> parent device" when applied causes kernel crash. So add a check for this
>>>>> in of_pci_dma_configure()
>>>>
>>>>
>>>> Wouldn't these arches have OF disabled and call an empty function?
>>>> Regardless, we still need this.
>>>>
>>>>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>>>>
>>>>
>>>> I'm assuming Bjorn will apply this.
>>>>

Yes. That is my understanding as well. I missed to answer this in my 
earlier email.

>>>> Acked-by: Rob Herring<robh@kernel.org>
>>>


-- 
Murali Karicheri
Linux Kernel, Texas Instruments

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-03-11 20:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-10 15:25 [PATCH] pci: of : fix BUG: unable to handle kernel Murali Karicheri
2015-03-11 12:35 ` Rob Herring
2015-03-11 12:49   ` Russell King - ARM Linux
2015-03-11 15:28     ` Murali Karicheri
2015-03-11 15:59       ` Rob Herring
2015-03-11 16:37         ` Murali Karicheri
2015-03-11 20:27         ` Murali Karicheri
2015-03-11 15:25   ` Murali Karicheri

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).