[POWERPC] Cell IOMMU fixed mapping support
[sfrench/cifs-2.6.git] / drivers / ieee1394 / sbp2.c
index 1b353b964b33fff6c5cfe609c9acc1b6be09f20b..1eda11abeb1e0b3cb912cb7e0c9bcac196b79810 100644 (file)
 #include <linux/types.h>
 #include <linux/wait.h>
 #include <linux/workqueue.h>
+#include <linux/scatterlist.h>
 
 #include <asm/byteorder.h>
 #include <asm/errno.h>
 #include <asm/param.h>
-#include <asm/scatterlist.h>
 #include <asm/system.h>
 #include <asm/types.h>
 
@@ -1466,7 +1466,7 @@ static void sbp2_prep_command_orb_sg(struct sbp2_command_orb *orb,
                cmd->dma_size = sgpnt[0].length;
                cmd->dma_type = CMD_DMA_PAGE;
                cmd->cmd_dma = dma_map_page(hi->host->device.parent,
-                                           sgpnt[0].page, sgpnt[0].offset,
+                                           sg_page(&sgpnt[0]), sgpnt[0].offset,
                                            cmd->dma_size, cmd->dma_dir);
 
                orb->data_descriptor_lo = cmd->cmd_dma;
@@ -1963,6 +1963,12 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
        lu->sdev = sdev;
        sdev->allow_restart = 1;
 
+       /*
+        * Update the dma alignment (minimum alignment requirements for
+        * start and end of DMA transfers) to be a sector
+        */
+       blk_queue_update_dma_alignment(sdev->request_queue, 511);
+
        if (lu->workarounds & SBP2_WORKAROUND_INQUIRY_36)
                sdev->inquiry_len = 36;
        return 0;