On Wed, Apr 12, 2006 at 05:16:34PM +1000, Benjamin Herrenschmidt wrote: > > > +static inline unsigned long device_to_mask(struct device *hwdev) > > +{ > > + struct pci_dev *pdev; > > + > > + if (!hwdev) { > > + pdev = ppc64_isabridge_dev; > > + if (!pdev) /* This is the best guess we can do */ > > + return 0xfffffffful; > > + } else > > + pdev = to_pci_dev(hwdev); > > + > > + if (pdev->dma_mask) > > + return pdev->dma_mask; > > + > > + /* Assume devices without mask can take 32 bit addresses */ > > + return 0xfffffffful; > > +} > > Won't that blow up in flames with non-PCI devices like ... vio ? >
Why would vio use pci_iommu_map_.*()? That's where the above change is. The change to the vio code (arch/powerpc/kernel/vio.c) will pass in ~0ul as the mask. Or did I misunderstand your comment? > We really need the kernel to move the dma mask to struct device instead > of struct pci_dev but that's a different debate ... I'm not so sure. Besides the awkwardness above, it's not like it's a huge penalty to go to the pci_dev. We have to do it to get to the table anyway, so caches are hot, etc. -Olof _______________________________________________ Bcm43xx-dev mailing list Bcm43xx-dev@lists.berlios.de http://lists.berlios.de/mailman/listinfo/bcm43xx-dev