提交 6593178d 编写于 作者: J James Bottomley 提交者: Bartlomiej Zolnierkiewicz

[PATCH] ide: fix ide_toggle_bounce() to not try to bounce if we have an IOMMU

The following patch fixes a crash caused by attempting to bounce buffer
when an IDE CD-ROM is used on a machine with an IO-MMU. [At least, this
patch fixes things so I can use my IDE CD-ROM behind an ns87415 on a 
HP PA-RISC workstation.]
Signed-off-by: NJames Bottomley <jejb@parisc-linux.org>
Signed-off-by: NKyle McMartin <kyle@parisc-linux.org>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 c37ea218
......@@ -410,10 +410,10 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)
{
u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */
if (on && drive->media == ide_disk) {
if (!PCI_DMA_BUS_IS_PHYS)
addr = BLK_BOUNCE_ANY;
else if (HWIF(drive)->pci_dev)
if (!PCI_DMA_BUS_IS_PHYS) {
addr = BLK_BOUNCE_ANY;
} else if (on && drive->media == ide_disk) {
if (HWIF(drive)->pci_dev)
addr = HWIF(drive)->pci_dev->dma_mask;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册