public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13)
  2001-10-25 17:32   ` Jens Axboe
@ 2001-10-26  0:25     ` David S. Miller
  2001-10-26  2:26       ` Jeff V. Merkey
  2001-10-28  1:34       ` Pete Harlan
  0 siblings, 2 replies; 8+ messages in thread
From: David S. Miller @ 2001-10-26  0:25 UTC (permalink / raw)
  To: axboe; +Cc: ch, harlan, linux-kernel

   From: Jens Axboe <axboe@suse.de>
   Date: Thu, 25 Oct 2001 19:32:48 +0200

   On Thu, Oct 25 2001, Christian Hammers wrote:
   > This patch did not prevent the crash. Again immediately after rewinding the
   > tape when it began to write. I'll try now the 2.4.12-ac6... and it works.
   
   Ok, someone else is meddling with the scatterlist then. I'll take a 2nd
   look.

Can people try out this patch?  I believe this will fix the bug.

--- drivers/scsi/st.c.~1~	Sun Oct 21 02:47:53 2001
+++ drivers/scsi/st.c	Thu Oct 25 17:23:45 2001
@@ -3233,6 +3233,7 @@
 				break;
 			}
 		}
+		tb->sg[0].page = NULL;
 		if (tb->sg[segs].address == NULL) {
 			kfree(tb);
 			tb = NULL;
@@ -3264,6 +3265,7 @@
 					tb = NULL;
 					break;
 				}
+				tb->sg[segs].page = NULL;
 				tb->sg[segs].length = b_size;
 				got += b_size;
 				segs++;
@@ -3337,6 +3339,7 @@
 			normalize_buffer(STbuffer);
 			return FALSE;
 		}
+		STbuffer->sg[segs].page = NULL;
 		STbuffer->sg[segs].length = b_size;
 		STbuffer->sg_segs += 1;
 		got += b_size;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13)
  2001-10-26  2:26       ` Jeff V. Merkey
@ 2001-10-26  1:33         ` Christian Hammers
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Hammers @ 2001-10-26  1:33 UTC (permalink / raw)
  To: Jeff V. Merkey; +Cc: David S. Miller, axboe, harlan, linux-kernel

Hi

Some addition: the kernel (at least the 2.4.11-pre6 worked well with the 
tape streamer before the day I replaced the external RAID chassis (broken
display) with a new one. My personal guess in this case is that the 
new RAID has a different firmware and maybe a bug that triggers the crash-
condition whenever a second device (here the scsi tape) tries to use the
bus, too.

Would this scenario fit into your idea of the bug?  

bye,

 -christian-

On Thu, Oct 25, 2001 at 07:26:48PM -0700, Jeff V. Merkey wrote:
> >    Ok, someone else is meddling with the scatterlist then. I'll take a 2nd
> >    look.
> > 
> > Can people try out this patch?  I believe this will fix the bug.
> > 
> > --- drivers/scsi/st.c.~1~	Sun Oct 21 02:47:53 2001
> > +++ drivers/scsi/st.c	Thu Oct 25 17:23:45 2001
> > @@ -3233,6 +3233,7 @@

-- 
Christian Hammers    WESTEND GmbH - Aachen und Dueren     Tel 0241/701333-0
ch@westend.com     Internet & Security for Professionals    Fax 0241/911879
           WESTEND ist CISCO Systems Partner - Premium Certified


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13)
  2001-10-26  0:25     ` SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13) David S. Miller
@ 2001-10-26  2:26       ` Jeff V. Merkey
  2001-10-26  1:33         ` Christian Hammers
  2001-10-28  1:34       ` Pete Harlan
  1 sibling, 1 reply; 8+ messages in thread
From: Jeff V. Merkey @ 2001-10-26  2:26 UTC (permalink / raw)
  To: David S. Miller; +Cc: axboe, ch, harlan, linux-kernel


David,

Is this waht's causing the earlier bug I reported in 2.4.10?  If so 
where is this patch so I can see if it fixes the problem.

Thanks,

Jeff


On Thu, Oct 25, 2001 at 05:25:41PM -0700, David S. Miller wrote:
>    From: Jens Axboe <axboe@suse.de>
>    Date: Thu, 25 Oct 2001 19:32:48 +0200
> 
>    On Thu, Oct 25 2001, Christian Hammers wrote:
>    > This patch did not prevent the crash. Again immediately after rewinding the
>    > tape when it began to write. I'll try now the 2.4.12-ac6... and it works.
>    
>    Ok, someone else is meddling with the scatterlist then. I'll take a 2nd
>    look.
> 
> Can people try out this patch?  I believe this will fix the bug.
> 
> --- drivers/scsi/st.c.~1~	Sun Oct 21 02:47:53 2001
> +++ drivers/scsi/st.c	Thu Oct 25 17:23:45 2001
> @@ -3233,6 +3233,7 @@
>  				break;
>  			}
>  		}
> +		tb->sg[0].page = NULL;
>  		if (tb->sg[segs].address == NULL) {
>  			kfree(tb);
>  			tb = NULL;
> @@ -3264,6 +3265,7 @@
>  					tb = NULL;
>  					break;
>  				}
> +				tb->sg[segs].page = NULL;
>  				tb->sg[segs].length = b_size;
>  				got += b_size;
>  				segs++;
> @@ -3337,6 +3339,7 @@
>  			normalize_buffer(STbuffer);
>  			return FALSE;
>  		}
> +		STbuffer->sg[segs].page = NULL;
>  		STbuffer->sg[segs].length = b_size;
>  		STbuffer->sg_segs += 1;
>  		got += b_size;
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13)
  2001-10-26  0:25     ` SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13) David S. Miller
  2001-10-26  2:26       ` Jeff V. Merkey
@ 2001-10-28  1:34       ` Pete Harlan
  1 sibling, 0 replies; 8+ messages in thread
From: Pete Harlan @ 2001-10-28  1:34 UTC (permalink / raw)
  To: David S. Miller; +Cc: axboe, ch, linux-kernel

On Thu, Oct 25, 2001 at 05:25:41PM -0700, David S. Miller wrote:
>    From: Jens Axboe <axboe@suse.de>
>    Date: Thu, 25 Oct 2001 19:32:48 +0200
> 
>    On Thu, Oct 25 2001, Christian Hammers wrote:
>    > This patch did not prevent the crash. Again immediately after
>    > rewinding the 
>    > tape when it began to write. I'll try now the 2.4.12-ac6... and
>    > it works.
>    
>    Ok, someone else is meddling with the scatterlist then. I'll take a 2nd
>    look.
> 
> Can people try out this patch?  I believe this will fix the bug.

Yessiree, that fixed the scsi tape lockups we had in 2.4.13.

Many thanks,

--Pete harlan@artselect.com


> --- drivers/scsi/st.c.~1~	Sun Oct 21 02:47:53 2001
> +++ drivers/scsi/st.c	Thu Oct 25 17:23:45 2001
> @@ -3233,6 +3233,7 @@
>  				break;
>  			}
>  		}
> +		tb->sg[0].page = NULL;
>  		if (tb->sg[segs].address == NULL) {
>  			kfree(tb);
>  			tb = NULL;
> @@ -3264,6 +3265,7 @@
>  					tb = NULL;
>  					break;
>  				}
> +				tb->sg[segs].page = NULL;
>  				tb->sg[segs].length = b_size;
>  				got += b_size;
>  				segs++;
> @@ -3337,6 +3339,7 @@
>  			normalize_buffer(STbuffer);
>  			return FALSE;
>  		}
> +		STbuffer->sg[segs].page = NULL;
>  		STbuffer->sg[segs].length = b_size;
>  		STbuffer->sg_segs += 1;
>  		got += b_size;

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13)
       [not found] ` <fa.j17q3gv.m6e1ju@ifi.uio.no>
@ 2001-10-30 16:58   ` Dan Maas
  2001-10-31  8:33     ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Maas @ 2001-10-30 16:58 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-kernel

> Can people try out this patch?  I believe this will fix the bug.
> + tb->sg[0].page = NULL;
>   if (tb->sg[segs].address == NULL) {

For the sake of making this clear to other kernel hackers (I got bitten by
it too) - starting with 2.4.13 you must zero out the fields of struct
scatterlist that you are not using. i.e. it is no longer sufficient to
simply set sg.address and sg.length, because junk might still be present in
the new sg.page field, and pci_map_*() will BUG() if both sg.address and
sg.page are non-zero.

Regards,
Dan



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13)
  2001-10-30 16:58   ` SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13) Dan Maas
@ 2001-10-31  8:33     ` Jens Axboe
       [not found]       ` <20011031.004311.85410732.davem@redhat.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Jens Axboe @ 2001-10-31  8:33 UTC (permalink / raw)
  To: Dan Maas; +Cc: David S. Miller, linux-kernel

On Tue, Oct 30 2001, Dan Maas wrote:
> > Can people try out this patch?  I believe this will fix the bug.
> > + tb->sg[0].page = NULL;
> >   if (tb->sg[segs].address == NULL) {
> 
> For the sake of making this clear to other kernel hackers (I got bitten by
> it too) - starting with 2.4.13 you must zero out the fields of struct
> scatterlist that you are not using. i.e. it is no longer sufficient to
> simply set sg.address and sg.length, because junk might still be present in
> the new sg.page field, and pci_map_*() will BUG() if both sg.address and
> sg.page are non-zero.

True, perhaps we should add a init_sg or something like that.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: SCSI tape crashes
       [not found]         ` <20011031094650.H631@suse.de>
@ 2001-10-31  8:49           ` David S. Miller
  2001-10-31  8:53             ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: David S. Miller @ 2001-10-31  8:49 UTC (permalink / raw)
  To: axboe; +Cc: dmaas, linux-kernel

   From: Jens Axboe <axboe@suse.de>
   Date: Wed, 31 Oct 2001 09:46:50 +0100
   
   How is this different from my init_sg proposal? :-). The above looks
   fine to me, I just think it is important that we take care of this.
   
My impression was that you wanted to do something like:

	sgl = kmalloc();
	init_sg(sgl, nents);

	for_each_ent() {
		... existing code ..
	}

If what you really meant was semantically identicaly to what I have
proposed, I'm completely in agreement with it.  Please submit patches.

Franks a lot,
David S. Miller
davem@redhat.com


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: SCSI tape crashes
  2001-10-31  8:49           ` SCSI tape crashes David S. Miller
@ 2001-10-31  8:53             ` Jens Axboe
  0 siblings, 0 replies; 8+ messages in thread
From: Jens Axboe @ 2001-10-31  8:53 UTC (permalink / raw)
  To: David S. Miller; +Cc: dmaas, linux-kernel

On Wed, Oct 31 2001, David S. Miller wrote:
>    From: Jens Axboe <axboe@suse.de>
>    Date: Wed, 31 Oct 2001 09:46:50 +0100
>    
>    How is this different from my init_sg proposal? :-). The above looks
>    fine to me, I just think it is important that we take care of this.
>    
> My impression was that you wanted to do something like:
> 
> 	sgl = kmalloc();
> 	init_sg(sgl, nents);
> 
> 	for_each_ent() {
> 		... existing code ..
> 	}
> 
> If what you really meant was semantically identicaly to what I have
> proposed, I'm completely in agreement with it.  Please submit patches.

Yep, init_sg_entry is probably a better name... I'll hack up and submit
soonish.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-10-31  8:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.cdhetrv.1828dgd@ifi.uio.no>
     [not found] ` <fa.j17q3gv.m6e1ju@ifi.uio.no>
2001-10-30 16:58   ` SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13) Dan Maas
2001-10-31  8:33     ` Jens Axboe
     [not found]       ` <20011031.004311.85410732.davem@redhat.com>
     [not found]         ` <20011031094650.H631@suse.de>
2001-10-31  8:49           ` SCSI tape crashes David S. Miller
2001-10-31  8:53             ` Jens Axboe
2001-10-25 11:11 BUG() in asm/pci.h:142 with 2.4.13 Jens Axboe
2001-10-25 17:23 ` Christian Hammers
2001-10-25 17:32   ` Jens Axboe
2001-10-26  0:25     ` SCSI tape crashes (was Re: BUG() in asm/pci.h:142 with 2.4.13) David S. Miller
2001-10-26  2:26       ` Jeff V. Merkey
2001-10-26  1:33         ` Christian Hammers
2001-10-28  1:34       ` Pete Harlan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox