diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-18 19:20:51 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-26 14:37:25 +1000 |
commit | 3514141aedc16c7344117d5bd79ec1310edf8fb3 (patch) | |
tree | cb5ec643b9e201f353fd764d22b9942324f85fd1 /drivers/macintosh | |
parent | 850f6ac316cf84bba63fdb775c897834eccbfaa3 (diff) | |
download | blackbird-op-linux-3514141aedc16c7344117d5bd79ec1310edf8fb3.tar.gz blackbird-op-linux-3514141aedc16c7344117d5bd79ec1310edf8fb3.zip |
powerpc/pmac: Fix DMA ops for MacIO devices
The macio_dev's created to map devices inside the MacIO ASICs
don't have proper dma_ops. This causes crashes on some machines
since the SCSI code calls dma_map_* on our behalf using the
device we hang from.
This fixes it by copying the parent PCI device dma_ops into
the macio_dev when creating it.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/macio_asic.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 6e149f4a1fff..a0f68386c12f 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c @@ -378,6 +378,17 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, dev->ofdev.dev.bus = &macio_bus_type; dev->ofdev.dev.release = macio_release_dev; +#ifdef CONFIG_PCI + /* Set the DMA ops to the ones from the PCI device, this could be + * fishy if we didn't know that on PowerMac it's always direct ops + * or iommu ops that will work fine + */ + dev->ofdev.dev.archdata.dma_ops = + chip->lbus.pdev->dev.archdata.dma_ops; + dev->ofdev.dev.archdata.dma_data = + chip->lbus.pdev->dev.archdata.dma_data; +#endif /* CONFIG_PCI */ + #ifdef DEBUG printk("preparing mdev @%p, ofdev @%p, dev @%p, kobj @%p\n", dev, &dev->ofdev, &dev->ofdev.dev, &dev->ofdev.dev.kobj); |