LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL
@ 2015-03-11 16:40 Murali Karicheri
2015-03-12 15:03 ` Murali Karicheri
2015-03-19 15:01 ` Bjorn Helgaas
0 siblings, 2 replies; 4+ messages in thread
From: Murali Karicheri @ 2015-03-11 16:40 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>
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] 4+ messages in thread
* Re: [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL
2015-03-11 16:40 [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL Murali Karicheri
@ 2015-03-12 15:03 ` Murali Karicheri
2015-03-19 15:01 ` Bjorn Helgaas
1 sibling, 0 replies; 4+ messages in thread
From: Murali Karicheri @ 2015-03-12 15:03 UTC (permalink / raw)
To: Murali Karicheri, bhelgaas
Cc: grant.likely, robh+dt, devicetree, linux-kernel, linux-pci, arnd,
Suravee.Suthikulpanit, will.deacon, joro, linux
On 03/11/2015 12:40 PM, Murali Karicheri 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()
>
> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
> 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);
> }
BJorn,
Just wondering if you can apply this to pci/iommu to help provide enough
baking time for this series to make into next kernel merge window.
As always, thanks for all your help.
Regards,
--
Murali Karicheri
Linux Kernel, Texas Instruments
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL
2015-03-11 16:40 [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL Murali Karicheri
2015-03-12 15:03 ` Murali Karicheri
@ 2015-03-19 15:01 ` Bjorn Helgaas
2015-03-20 20:16 ` Murali Karicheri
1 sibling, 1 reply; 4+ messages in thread
From: Bjorn Helgaas @ 2015-03-19 15:01 UTC (permalink / raw)
To: Murali Karicheri
Cc: grant.likely, robh+dt, devicetree, linux-kernel, linux-pci, arnd,
Suravee.Suthikulpanit, will.deacon, joro, linux
On Wed, Mar 11, 2015 at 12:40:03PM -0400, Murali Karicheri 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()
>
> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
> Acked-by: Rob Herring<robh@kernel.org>
Since I hadn't merged the original patch yet, I just folded this fix into
it. The series is on pci/iommu, and I merged it for "next". Thanks for
your patience.
Bjorn
> ---
> 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] 4+ messages in thread
* Re: [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL
2015-03-19 15:01 ` Bjorn Helgaas
@ 2015-03-20 20:16 ` Murali Karicheri
0 siblings, 0 replies; 4+ messages in thread
From: Murali Karicheri @ 2015-03-20 20:16 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: grant.likely, robh+dt, devicetree, linux-kernel, linux-pci, arnd,
Suravee.Suthikulpanit, will.deacon, joro, linux
On 03/19/2015 11:01 AM, Bjorn Helgaas wrote:
> On Wed, Mar 11, 2015 at 12:40:03PM -0400, Murali Karicheri 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()
>>
>> Signed-off-by: Murali Karicheri<m-karicheri2@ti.com>
>> Acked-by: Rob Herring<robh@kernel.org>
>
> Since I hadn't merged the original patch yet, I just folded this fix into
> it. The series is on pci/iommu, and I merged it for "next". Thanks for
> your patience.
>
> Bjorn
Thanks!
Murali
>
>> ---
>> 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
>>
--
Murali Karicheri
Linux Kernel, Texas Instruments
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-20 20:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 16:40 [PATCH v1] of/pci : fix of_pci_dma_configure parent ptr NULL Murali Karicheri
2015-03-12 15:03 ` Murali Karicheri
2015-03-19 15:01 ` Bjorn Helgaas
2015-03-20 20:16 ` 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).