MPT Fusion SAS dma alignment problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, All.

We've experienced problem with MPT Fusion SAS driver: running smartctl
program from smartmontools package resulted in memory corruption after
ioctl(SG_IO) call. My investigation showed that problem was introduced by

Commit: 465ff3185e0cb76d46137335a4d21d0d9d3ac8a2
Author: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> Tue, 01
Jan 2008

    [SCSI] relax scsi dma alignment

    This patch relaxes the default SCSI DMA alignment from 512 bytes to 4
    bytes.  I remember from previous discussions that usb and firewire have
    sector size alignment requirements, so I upped their alignments in the
    respective slave allocs.

    The reason for doing this is so that we don't get such a huge amount of
    copy overhead in bio_copy_user() for udev.  (basically all inquiries it
    issues can now be directly mapped).

    Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>

so I've just added call to blk_queue_update_dma_alignment() (see patch
below) but I'm not sure that it'a right (or full) solution. Maybe
someone more familiar with this driver can comment?

--
Ilya

---
 drivers/message/fusion/mptsas.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/message/fusion/mptsas.c
b/drivers/message/fusion/mptsas.c
index 4684807..bbb6186 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1000,6 +1000,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
     return -ENXIO;
 
  out:
+    blk_queue_update_dma_alignment(sdev->request_queue, 511);
     vdevice->vtarget->num_luns++;
     sdev->hostdata = vdevice;
     return 0;
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux