- Update Xen patches to 3.3-rc5 and c/s 1157.
[linux-flexiantxendom0-3.2.10.git] / drivers / ide / ide-lib.c
index d9c9829..6ca6423 100644 (file)
@@ -19,6 +19,7 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)
 {
        u64 addr = BLK_BOUNCE_HIGH;     /* dma64_addr_t */
 
+#ifndef CONFIG_XEN
        if (!PCI_DMA_BUS_IS_PHYS) {
                addr = BLK_BOUNCE_ANY;
        } else if (on && drive->media == ide_disk) {
@@ -27,6 +28,16 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)
                if (dev && dev->dma_mask)
                        addr = *dev->dma_mask;
        }
+#else
+       if (on && drive->media == ide_disk) {
+               struct device *dev = drive->hwif->dev;
+
+               if (!PCI_DMA_BUS_IS_PHYS)
+                       addr = BLK_BOUNCE_ANY;
+               else if (dev && dev->dma_mask)
+                       addr = *dev->dma_mask;
+       }
+#endif
 
        if (drive->queue)
                blk_queue_bounce_limit(drive->queue, addr);