public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.21-pre3 kernel crash
@ 2003-01-27 15:41 Martin MOKREJŠ
  2003-01-27 16:53 ` Ross Biro
  0 siblings, 1 reply; 25+ messages in thread
From: Martin MOKREJŠ @ 2003-01-27 15:41 UTC (permalink / raw)
  To: linux-kernel

Hi,
  yesterday I've hit a bug on my laptopo ASUS L3800C ;)
with linux kernel 2.4.21-pre3. I think the crash is related to my tunes
with hdparm() (enabling 32bit, enabling DMA, enabling udma5), but I'm not
sure, although I could check, if someone asks. Currently, I can 100%
reproduce the bug (i.e. cannot boot with that kernel).

  The crash I actually observe while booting. One of the init scripts starts up also
network and adds default gateway. That's where it crashes. Please Cc: me
in replies.

# ksymoops -K -o /lib/modules/2.4.21-pre3/ -m /boot/System.map-2.4.21-pre3 kernel.crash
ksymoops 2.4.8 on i686 2.4.19-gentoo-r10.  Options used
     -V (default)
     -K (specified)
     -l /proc/modules (default)
     -o /lib/modules/2.4.21-pre3/ (specified)
     -m /boot/System.map-2.4.21-pre3 (specified)

No modules in ksyms, skipping objects
No ksyms, skipping lsmod
Kernel BUG at panic.c: 141!
invalid operand: 0000
CPU:    0
EIP:    0010:[<c011a3e7>]  Not tainted
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010282
eax: 00000026   ebx: 00000000     ecx: 00000001       edx: 00000001
esi: c03e5920   edi: 00001000     ebp: 00000000       esp: f764fbf0
ds: 0018        es: 0018       ss: 0018
Process runscript.sh (pid: 1038, stackpage=f764f000)
Stack: c02fee40 0000009b c024dfc1 0000009b 00000000 00000014 00000014 00000001
       f7e32000 f7e35000 c03e59d0 00000000 c03e5920 c024e1b4 c03e5920 f7e2d700
       00000002 f79f6c80 00000000 c03e5920 c03e5920 c03e59d0 f7e2d700 c03e5920
Call trace: [<c024dfc1>] [<c024e1b4>] [<c024e6df>] [<c024a11d>] [<c01b2380>]
[<c023fc5e>] [<c01b2380>] [<c0248d71>] [<c0248eeb>] [<c024902a>] [<c021b186>]
[<c011f3ca>] [<c013f5bf>] [<c012c41d>] [<c012ccde>] [<c012d0d0>] [<c012d258>]
[<c012d0d0>] [<c0143312>] [<c01437a6>] [<c0143cb5>] [<c0105cc0>] [<c010744f>]
Code: 0f 0b 8d 00 5f fb 2f c0 90 eb fe 90 90 90 90 90 90 90 90 90


>>EIP; c011a3e7 <__out_of_line_bug+17/30>   <=====

>>esi; c03e5920 <ide_hwifs+0/2af8>

Trace; c024dfc1 <ide_build_sglist+181/1a0>
Trace; c024e1b4 <ide_build_dmatable+54/1a0>
Trace; c024e6df <__ide_dma_read+3f/150>
Trace; c024a11d <do_rw_disk+1ed/740>
Trace; c01b2380 <reiserfs_find_actor+0/20>
Trace; c023fc5e <ide_wait_stat+fe/140>
Trace; c01b2380 <reiserfs_find_actor+0/20>
Trace; c0248d71 <start_request+1c1/240>
Trace; c0248eeb <ide_do_request+ab/1a0>
Trace; c024902a <do_ide_request+1a/20>
Trace; c021b186 <generic_unplug_device+36/40>
Trace; c011f3ca <__run_task_queue+5a/70>
Trace; c013f5bf <block_sync_page+1f/30>
Trace; c012c41d <___wait_on_page+bd/c0>
Trace; c012ccde <do_generic_file_read+2fe/450>
Trace; c012d0d0 <file_read_actor+0/e0>
Trace; c012d258 <generic_file_read+a8/150>
Trace; c012d0d0 <file_read_actor+0/e0>
Trace; c0143312 <kernel_read+72/80>
Trace; c01437a6 <prepare_binprm+136/150>
Trace; c0143cb5 <do_execve+e5/220>
Trace; c0105cc0 <sys_execve+50/80>
Trace; c010744f <system_call+33/38>

Code;  c011a3e7 <__out_of_line_bug+17/30>
00000000 <_EIP>:
Code;  c011a3e7 <__out_of_line_bug+17/30>   <=====
   0:   0f 0b                     ud2a      <=====
Code;  c011a3e9 <__out_of_line_bug+19/30>
   2:   8d 00                     lea    (%eax),%eax
Code;  c011a3eb <__out_of_line_bug+1b/30>
   4:   5f                        pop    %edi
Code;  c011a3ec <__out_of_line_bug+1c/30>
   5:   fb                        sti
Code;  c011a3ed <__out_of_line_bug+1d/30>
   6:   2f                        das
Code;  c011a3ee <__out_of_line_bug+1e/30>
   7:   c0 90 eb fe 90 90 90      rclb   $0x90,0x9090feeb(%eax)
Code;  c011a3f5 <__out_of_line_bug+25/30>
   e:   90                        nop
Code;  c011a3f6 <__out_of_line_bug+26/30>
   f:   90                        nop
Code;  c011a3f7 <__out_of_line_bug+27/30>
  10:   90                        nop
Code;  c011a3f8 <__out_of_line_bug+28/30>
  11:   90                        nop
Code;  c011a3f9 <__out_of_line_bug+29/30>
  12:   90                        nop
Code;  c011a3fa <__out_of_line_bug+2a/30>
  13:   90                        nop

-- 
Martin Mokrejs <mmokrejs@natur.cuni.cz>, <m.mokrejs@gsf.de>
PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics <http://mips.gsf.de>
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3683 , fax: +49-89-3187 3585

^ permalink raw reply	[flat|nested] 25+ messages in thread
* RE: 2.4.21-pre3 kernel crash
@ 2003-01-28 16:41 Larry Sendlosky
  2003-01-28 22:06 ` Jens Axboe
  0 siblings, 1 reply; 25+ messages in thread
From: Larry Sendlosky @ 2003-01-28 16:41 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel

I was glad to see the physical page support in 2.4.20.
(and also noticed that the current BK tree clobbered it
on a patch set from Alan).

One question, 

+		lastdataend = bh_phys(bh) + bh->b_size;

bh_phys(x) uses bh->b_page. Does it make a difference
if bh->b_page is zero? What if someone combines virt and phys
buffer addresses in bh list?

thanks
larry


-----Original Message-----
From: Jens Axboe [mailto:axboe@suse.de]
Sent: Monday, January 27, 2003 6:24 PM
To: J.A. Magallon
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.21-pre3 kernel crash


On Tue, Jan 28 2003, J.A. Magallon wrote:
> 
> On 2003.01.27 Jens Axboe wrote:
> > On Mon, Jan 27 2003, Martin MOKREJ? wrote:
> > > On Mon, 27 Jan 2003, Ross Biro wrote:
> > > 
> > > > This looks like the same problem I ran into with IDE and highmem not
> > > > getting along.  Try compiling your kernel with out highmem enabled and
> > > > see what happenes.
> > > 
> > > Yes, that "fixes" it. Any "better solution"? ;-)
> > > 
> > > > >Trace; c024dfc1 <ide_build_sglist+181/1a0>
> > > > >Trace; c024e1b4 <ide_build_dmatable+54/1a0>
> > > > >Trace; c024e6df <__ide_dma_read+3f/150>
> > 
> > Someone completely lost the highmem capable scatterlist setup, *boggle*.
> > This should fix it.
> > 
> 
> Applied on top of 2.4.21-pre3-aa (no highmem), it makes my box hang on drive
> detection:
> 
> PIIX4: IDE controller at PCI slot 00:07.1
> PIIX4: chipset revision 1
> PIIX4: not 100% native mode: will probe irqs later
>     ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA, hdb:DMA
>     ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:DMA, hdd:pio
> hda: 
> 
> <hangs here>
> 
> normal startup says:
> 
> hda: Conner Peripherals 1080MB - CFS1081A, ATA DISK drive
> hdb: TOSHIBA DVD-ROM SD-M1712, ATAPI CD/DVD-ROM drive
> blk: queue 403386e0, I/O limit 4095Mb (mask 0xffffffff)
> hdc: YAMAHA CRW8424E, ATAPI CD/DVD-ROM drive
> hdd: IOMEGA ZIP 250 ATAPI, ATAPI FLOPPY drive
> ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
> ide1 at 0x170-0x177,0x376 on irq 15
> hda: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }
> hda: task_no_data_intr: error=0x04 { DriveStatusError }
> hda: 2114180 sectors (1082 MB), CHS=524/64/63, DMA

Reviewing the patch, it did have a nasty bug, didn't iterate
buffer_heads at all so a clustered request will fail. Attached version
should work.

===== drivers/ide/ide-dma.c 1.7 vs edited =====
--- 1.7/drivers/ide/ide-dma.c	Wed Nov 20 18:46:24 2002
+++ edited/drivers/ide/ide-dma.c	Tue Jan 28 00:23:45 2003
@@ -249,6 +249,7 @@
 {
 	struct buffer_head *bh;
 	struct scatterlist *sg = hwif->sg_table;
+	unsigned long lastdataend = ~0UL;
 	int nents = 0;
 
 	if (hwif->sg_dma_active)
@@ -256,24 +257,30 @@
 
 	bh = rq->bh;
 	do {
-		unsigned char *virt_addr = bh->b_data;
-		unsigned int size = bh->b_size;
+		if (bh_phys(bh) == lastdataend) {
+			sg[nents - 1].length += bh->b_size;
+			lastdataend += bh->b_size;
+			continue;
+		}
 
 		if (nents >= PRD_ENTRIES)
 			return 0;
 
-		while ((bh = bh->b_reqnext) != NULL) {
-			if ((virt_addr + size) != (unsigned char *) bh->b_data)
-				break;
-			size += bh->b_size;
-		}
 		memset(&sg[nents], 0, sizeof(*sg));
-		sg[nents].address = virt_addr;
-		sg[nents].length = size;
-		if(size == 0)
-			BUG();
+		if (bh->b_page) {
+			sg[nents].page = bh->b_page;
+			sg[nents].offset = bh_offset(bh);
+		} else {
+			if (((unsigned long) bh->b_data) < PAGE_SIZE)
+				BUG();
+
+			sg[nents].address = bh->b_data;
+		}
+
+		sg[nents].length = bh->b_size;
+		lastdataend = bh_phys(bh) + bh->b_size;
 		nents++;
-	} while (bh != NULL);
+	} while ((bh = bh->b_reqnext) != NULL);
 
 	if(nents == 0)
 		BUG();

-- 
Jens Axboe

-
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] 25+ messages in thread
* Re: 2.4.21-pre3 kernel crash
@ 2003-01-29  8:23 Benjamin Herrenschmidt
  0 siblings, 0 replies; 25+ messages in thread
From: Benjamin Herrenschmidt @ 2003-01-29  8:23 UTC (permalink / raw)
  To: axboe, linux-kernel, Larry.Sendlosky



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

end of thread, other threads:[~2003-01-29 10:07 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-27 15:41 2.4.21-pre3 kernel crash Martin MOKREJŠ
2003-01-27 16:53 ` Ross Biro
2003-01-27 17:13   ` Martin MOKREJŠ
2003-01-27 19:23     ` Jens Axboe
2003-01-27 20:27       ` Edward Tandi
2003-01-27 20:36         ` Jeff Garzik
2003-01-27 20:47           ` Edward Tandi
2003-01-27 20:57             ` Jeff Garzik
2003-01-28  9:08               ` Alan Cox
2003-01-28 10:50         ` Martin MOKREJŠ
2003-01-27 23:18       ` J.A. Magallon
2003-01-27 23:24         ` Jens Axboe
2003-01-28  0:02           ` J.A. Magallon
2003-01-27 19:03   ` Benjamin Herrenschmidt
2003-01-27 19:21     ` Benjamin Herrenschmidt
2003-01-27 19:25     ` Jens Axboe
2003-01-27 19:45     ` Alan Cox
2003-01-27 19:49       ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2003-01-28 16:41 Larry Sendlosky
2003-01-28 22:06 ` Jens Axboe
2003-01-29  8:23   ` Benjamin Herrenschmidt
2003-01-29  8:53     ` Jens Axboe
2003-01-29  9:44       ` Benjamin Herrenschmidt
2003-01-29 10:16         ` Jens Axboe
2003-01-29  8:23 Benjamin Herrenschmidt

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