Skip to contentSkip to conversation

mptsas: fix dma alignment

PATCH In review Vitaly Bordug 4 participants 6 messages Sep 1, 2009 – Sep 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mptsas: fix dma alignment

From: Yuri Tikhonov <[email protected]>

fusion mptsas: fix dma alignment

Since the 465ff.. commit from James Bottomley relaxes the default SCSI DMA alignment from 512 bytes to 4 bytes, then, in the mptsas driver, we should explicitly set the alignment to the workable 512 bytes value.

---

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

b/drivers/message/fusion/mptsas.c index 55ff252..2334f26 100644

drivers/message/fusion/mptsas.c +1 -0
@@ -1843,6 +1843,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 lore raw

Can you send an exact link for "465ff.. commit"?

Thanks,
Kashyap

-----Original Message-----
From: Vitaly Bordug [mailto:[email protected]]
Sent: Wednesday, September 02, 2009 2:34 AM
To: Moore, Eric
Cc: DL-MPT Fusion Linux; [email protected]
Subject: [PATCH] mptsas: fix dma alignment

From: Yuri Tikhonov <[email protected]>

fusion mptsas: fix dma alignment

Since the 465ff.. commit from James Bottomley relaxes the default SCSI DMA alignment from 512 bytes to 4 bytes, then, in the mptsas driver, we should explicitly set the alignment to the workable 512 bytes value.

---

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

b/drivers/message/fusion/mptsas.c index 55ff252..2334f26 100644

drivers/message/fusion/mptsas.c +1 -0
@@ -1843,6 +1843,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;
#2 lore raw

В Mon, 7 Sep 2009 16:42:54 +0530
"Desai, Kashyap" <[email protected]> пишет:

Quoted 2 lines

Can you send an exact link for "465ff.. commit"?

Sure,
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=465ff3185e0cb76d46137335a4d21d0d9d3ac8a2

Quoted 35 lines

Thanks,
Kashyap

-----Original Message-----
From: Vitaly Bordug [mailto:[email protected]]
Sent: Wednesday, September 02, 2009 2:34 AM
To: Moore, Eric
Cc: DL-MPT Fusion Linux; [email protected]
Subject: [PATCH] mptsas: fix dma alignment

From: Yuri Tikhonov <[email protected]>

fusion mptsas: fix dma alignment

Since the 465ff.. commit from James Bottomley relaxes the default SCSI DMA alignment from 512 bytes to 4 bytes, then, in the mptsas driver, we should explicitly set the alignment to the workable 512 bytes value.

---

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

b/drivers/message/fusion/mptsas.c index 55ff252..2334f26 100644

drivers/message/fusion/mptsas.c mptsas_slave_alloc(struct scsi_device *sdev) · line 1849

Quoted 7 lines
drivers/message/fusion/mptsas.c +1 -0
@@ -1843,6 +1843,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;

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

#3 lore raw

After seeing original commit from James, this patch looks OK to me. Please consider this patch as ACKed by me.

Thanks,
Kashyap

-----Original Message-----
From: Vitaly Bordug [mailto:[email protected]]
Sent: Monday, September 07, 2009 7:16 PM
To: Desai, Kashyap
Cc: Moore, Eric; DL-MPT Fusion Linux; [email protected]
Subject: Re: [PATCH] mptsas: fix dma alignment

В Mon, 7 Sep 2009 16:42:54 +0530
"Desai, Kashyap" <[email protected]> пишет:

Quoted 2 lines

Can you send an exact link for "465ff.. commit"?

Sure,
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=465ff3185e0cb76d46137335a4d21d0d9d3ac8a2

Quoted 35 lines

Thanks,
Kashyap

-----Original Message-----
From: Vitaly Bordug [mailto:[email protected]]
Sent: Wednesday, September 02, 2009 2:34 AM
To: Moore, Eric
Cc: DL-MPT Fusion Linux; [email protected]
Subject: [PATCH] mptsas: fix dma alignment

From: Yuri Tikhonov <[email protected]>

fusion mptsas: fix dma alignment

Since the 465ff.. commit from James Bottomley relaxes the default SCSI DMA alignment from 512 bytes to 4 bytes, then, in the mptsas driver, we should explicitly set the alignment to the workable 512 bytes value.

---

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

b/drivers/message/fusion/mptsas.c index 55ff252..2334f26 100644

drivers/message/fusion/mptsas.c mptsas_slave_alloc(struct scsi_device *sdev) · line 1849

Quoted 7 lines
drivers/message/fusion/mptsas.c +1 -0
@@ -1843,6 +1843,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;

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

#4 lore raw
Quoted 2 lines · Kashyap

After seeing original commit from James, this patch looks OK to me. Please consider this patch as ACKed by me.

If you're sure it's a problem. The reason for the original was that all DMA engines (including the old LSI 1010) can transfer on word boundaries. I didn't realise the 1030 had regressed in terms of DMA alignment requirements.

James

#5 lore raw
Quoted 10 lines · James Bottomley
Quoted 2 lines · Kashyap

After seeing original commit from James, this patch looks OK to me. Please consider this patch as ACKed by me.

If you're sure it's a problem. The reason for the original was that all
DMA engines (including the old LSI 1010) can transfer on word boundaries. I didn't realise the 1030 had regressed in terms of DMA alignment requirements.

James, correct. The scatter gather elements themselfs have to be on 4 byte boundary. Thus I don't believe this patch is required.

However the alignment restrictions are for Request Message Frames, chains, and sense buffer can't cross 4GB boundary. The reason is the driver reports the upper 32bit address in the ioc_init request at driver load time.

Eric