ata: pata_octeon_cf: Use correct byte order for DMA in when built little-endian.
authorDavid Daney <david.daney@cavium.com>
Fri, 3 Feb 2012 17:36:57 +0000 (09:36 -0800)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 13 Dec 2012 17:15:25 +0000 (18:15 +0100)
We need to set the 'endian' bit in this case.

Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David Daney <david.daney@cavium.com>
drivers/ata/pata_octeon_cf.c

index 652d035aa833ab6bf34b49dc57c67e559d5299a6..4e1194b4c27128a9c6cb0671552ffaba4f97c681 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/platform_device.h>
 #include <scsi/scsi_host.h>
 
+#include <asm/byteorder.h>
 #include <asm/octeon/octeon.h>
 
 /*
@@ -589,6 +590,9 @@ static void octeon_cf_dma_start(struct ata_queued_cmd *qc)
 
        /* Set the direction of the DMA */
        mio_boot_dma_cfg.u64 = 0;
+#ifdef __LITTLE_ENDIAN
+       mio_boot_dma_cfg.s.endian = 1;
+#endif
        mio_boot_dma_cfg.s.en = 1;
        mio_boot_dma_cfg.s.rw = ((qc->tf.flags & ATA_TFLAG_WRITE) != 0);