All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Yanok <ilya.yanok@gmail.com>
To: linux-scsi@vger.kernel.org, DL-MPTFusionLinux@lsi.com
Subject: MPT Fusion SAS dma alignment problem
Date: Wed, 28 May 2008 12:14:34 +0400	[thread overview]
Message-ID: <483D146A.10301@gmail.com> (raw)

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@HansenPartnership.com> 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@rowland.harvard.edu>
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

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


                 reply	other threads:[~2008-05-28  8:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=483D146A.10301@gmail.com \
    --to=ilya.yanok@gmail.com \
    --cc=DL-MPTFusionLinux@lsi.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.