Re: BAD_SG_DMA panic in aha1542

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bob Tracy <rct@...>
Cc: <linux-kernel@...>, <linux-scsi@...>
Date: Friday, April 27, 2007 - 6:21 pm

On Fri, 2007-04-27 at 16:47 -0500, Bob Tracy wrote:

Knowing what these messages are is would be helpful; it tells me what
point in the initialisation it got to. 


I'm interested.

This is clearly a use_sg==1 path that has failed to bounce the buffer
for some reason ... and I was contemplating eliminating the GFP_DMA from
our sr driver because I thought the block bouncing had it covered.

It might also be helpful to apply this patch.  It should give a stack
trace of the problem command and not immediately panic the box.

Thanks,

James

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 1d239f6..4ee7d99 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -75,7 +75,7 @@ static void BAD_SG_DMA(Scsi_Cmnd * SCpnt,
 	/*
 	 * Not safe to continue.
 	 */
-	panic("Buffer at physical address > 16Mb used for aha1542");
+	WARN_ON(1);
 }
 
 #include<linux/stat.h>
@@ -725,8 +725,12 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 				panic("Foooooooood fight!");
 			};
 			any2scsi(cptr[i].dataptr, SCSI_SG_PA(&sgpnt[i]));
-			if (SCSI_SG_PA(&sgpnt[i]) + sgpnt[i].length - 1 > ISA_DMA_THRESHOLD)
+			if (SCSI_SG_PA(&sgpnt[i]) + sgpnt[i].length - 1 > ISA_DMA_THRESHOLD) {
 				BAD_SG_DMA(SCpnt, sgpnt, SCpnt->use_sg, i);
+				SCpnt->result = DID_ERROR << 16;
+				done(SCpnt);
+				return 0;
+			}
 			any2scsi(cptr[i].datalen, sgpnt[i].length);
 		};
 		any2scsi(ccb[mbo].datalen, SCpnt->use_sg * sizeof(struct chain));




-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
BAD_SG_DMA panic in aha1542, Bob Tracy, (Fri Apr 27, 5:47 pm)
Re: BAD_SG_DMA panic in aha1542, James Bottomley, (Fri Apr 27, 6:21 pm)
Re: BAD_SG_DMA panic in aha1542, Jens Axboe, (Mon Apr 30, 1:32 pm)
Re: BAD_SG_DMA panic in aha1542, Christoph Hellwig, (Mon Apr 30, 1:39 pm)
Re: BAD_SG_DMA panic in aha1542, Jens Axboe, (Mon Apr 30, 1:52 pm)
Re: BAD_SG_DMA panic in aha1542, Bob Tracy, (Mon Apr 30, 10:33 am)
Re: BAD_SG_DMA panic in aha1542, Bob Tracy, (Fri Apr 27, 7:53 pm)
Re: BAD_SG_DMA panic in aha1542, Alan Cox, (Fri Apr 27, 6:13 pm)
Re: BAD_SG_DMA panic in aha1542, Bob Tracy, (Fri Apr 27, 7:56 pm)