[PATCH] PCI dev node without an OF node

Benjamin Herrenschmidt benh at kernel.crashing.org
Wed Oct 5 08:08:05 EST 2005


On Tue, 2005-10-04 at 15:35 -0400, Jimi Xenidis wrote:
> Handing the pSeries_iommu*LP logic the device tree from a Maple-D results
> in PCI dev  nodes that do not have a corresponding OF node.
> 
> I cannot be certain if this is a bug with the devtree in PIBS, or if
> this case is normally possible, I believe it is the latter.

Yes, it's accepted to have only OF nodes for bridges.

> The check for dn==NULL used to happen in iommu_dev_setup_pSeries() but
> that is no longer called as of:
>    http://kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;h=d17f0108a03200c0437146f199acaab21ca6f678;hp=f0fd7fbd6531cd01fb8984d2c81e82a25825b484;hb=1635317facea3094ddf34082cd86797efb1d9f7e;f=arch/ppc64/kernel/pSeries_iommu.c
> 
> so the following patch catches it.

I'm not sure your patch is 100% correct, but then, we also shouldn't
have called pSeries_iommu.c code on Maple neither in the first place
unless you have put some kind of PAPR-like hypervisor on it (but still,
the Maple has no TCEs so it shouldn't call this code).

One must make sure that the dma_map* routines always get the closest
parent device node though if the device has NULL. We used to populate
all PCI devices wih the PHB node by default but that may have been
broken.

Ben.

> Signed-off-by: Jimi Xenidis <jimix at watson.ibm.com>
> 
> 
> diff -r fbe71a6b8d00 arch/ppc64/kernel/pSeries_iommu.c
> --- a/arch/ppc64/kernel/pSeries_iommu.c	Tue Oct  4 19:14:08 2005
> +++ b/arch/ppc64/kernel/pSeries_iommu.c	Tue Oct  4 15:15:32 2005
> @@ -513,6 +513,11 @@
>  	 * already allocated.
>  	 */
>  	dn = pci_device_to_OF_node(dev);
> +	if (dn == NULL) {
> +		DBG("%s, dev %p (%s) has no iommu table\n",
> +		    dev, pci_name(dev));
> +		return;
> +	}
>  
>  	for (pdn = dn; pdn && pdn->data && !PCI_DN(pdn)->iommu_table;
>  	     pdn = pdn->parent) {
> 




More information about the Linuxppc64-dev mailing list