Re: 2.6.23-rc9 boot failure (megaraid?)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <James.Bottomley@...>
Cc: <bunk@...>, <bwindle@...>, <linux-kernel@...>, <jens.axboe@...>, <fujita.tomonori@...>, <sumant.patro@...>, <megaraidlinux@...>, <linux-scsi@...>
Date: Tuesday, October 2, 2007 - 8:09 pm

On Tue, 02 Oct 2007 15:38:13 -0500
James Bottomley <James.Bottomley@SteelEye.com> wrote:


Sorry again. Needs to check sg count before dma mapping.


diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 3907f67..ae0b220 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -1737,9 +1737,12 @@ mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len)
 	Scsi_Cmnd	*cmd;
 	int	sgcnt;
 	int	idx;
+	int bulkdata;
 
 	cmd = scb->cmd;
 
+	bulkdata = (scsi_sg_count(cmd) == 1) ? 1 : 0;
+
 	/*
 	 * Copy Scatter-Gather list info into controller structure.
 	 *
@@ -1753,6 +1756,14 @@ mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len)
 
 	*len = 0;
 
+	if (bulkdata && !adapter->has_64bit_addr) {
+		sg = scsi_sglist(cmd);
+		scb->dma_h_bulkdata = sg_dma_address(sg);
+		*buf = (u32)scb->dma_h_bulkdata;
+		*len = sg_dma_len(sg);
+		return 0;
+	}
+
 	scsi_for_each_sg(cmd, sg, sgcnt, idx) {
 		if (adapter->has_64bit_addr) {
 			scb->sgl64[idx].address = sg_dma_address(sg);
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-rc9 boot failure (megaraid?), Burton Windle, (Tue Oct 2, 12:48 pm)
Re: 2.6.23-rc9 boot failure (megaraid?), Adrian Bunk, (Tue Oct 2, 2:15 pm)
Re: 2.6.23-rc9 boot failure (megaraid?), James Bottomley, (Tue Oct 2, 4:38 pm)
Re: 2.6.23-rc9 boot failure (megaraid?), FUJITA Tomonori, (Tue Oct 2, 8:00 pm)
RE: 2.6.23-rc9 boot failure (megaraid?), Patro, Sumant, (Wed Oct 3, 7:32 pm)
RE: 2.6.23-rc9 boot failure (megaraid?), FUJITA Tomonori, (Wed Oct 3, 7:46 pm)
Re: 2.6.23-rc9 boot failure (megaraid?), Jens Axboe, (Thu Oct 4, 3:28 am)
Re: 2.6.23-rc9 boot failure (megaraid?), Adrian Bunk, (Thu Oct 4, 6:48 am)
Re: 2.6.23-rc9 boot failure (megaraid?), FUJITA Tomonori, (Thu Oct 4, 6:55 am)
Re: 2.6.23-rc9 boot failure (megaraid?), Jens Axboe, (Thu Oct 4, 7:00 am)
Re: 2.6.23-rc9 boot failure (megaraid?), FUJITA Tomonori, (Thu Oct 4, 6:20 am)
Re: 2.6.23-rc9 boot failure (megaraid?), Jens Axboe, (Thu Oct 4, 6:36 am)
Re: 2.6.23-rc9 boot failure (megaraid?), James Bottomley, (Thu Oct 4, 8:50 am)
Re: 2.6.23-rc9 boot failure (megaraid?), FUJITA Tomonori, (Tue Oct 2, 8:09 pm)
Re: 2.6.23-rc9 boot failure (megaraid?), Burton Windle, (Tue Oct 2, 2:46 pm)
Re: 2.6.23-rc9 boot failure (megaraid?), Rafael J. Wysocki, (Tue Oct 2, 3:55 pm)