2002-09-18 20:39:26

by Anton Altaparmakov

[permalink] [raw]
Subject: BUG: Current 2.5-BK tree dies on boot!

This is without preempt. I tried both with and without SMP, with and without
large TLB pages, with and without pte highmem, all die in the same place.

Here are the boot messages:

Linux version 2.5.36 ([email protected]) (gcc version 2.96 20000731 (Mandrake Linux 8.2 2.96-0.76mdk)) #11 SMP Thu Sep 12 21:11:41 BST 2002
Video mode to be used for restore is f06
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000003fff0000 (usable)
BIOS-e820: 000000003fff0000 - 000000003fff3000 (ACPI NVS)
BIOS-e820: 000000003fff3000 - 0000000040000000 (ACPI data)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
127MB HIGHMEM available.
896MB LOWMEM available.
On node 0 totalpages: 262128
DMA zone: 4096 pages
Normal zone: 225280 pages
HighMem zone: 32752 pages
ACPI: RSDP (v000 VIA694 ) @ 0x000f79f0
ACPI: RSDT (v001 VIA694 AWRDACPI 16944.11825) @ 0x3fff3000
ACPI: FADT (v001 VIA694 AWRDACPI 16944.11825) @ 0x3fff3040
Kernel command line: BOOT_IMAGE=l2536 ro root=301 console=ttyS1,115200n8 console=tty0 hdc=ide-scsi
ide_setup: hdc=ide-scsi
Initializing CPU#0
Detected 1336.509 MHz processor.
Console: colour VGA+ 80x34
Calibrating delay loop... 2629.63 BogoMIPS
Memory: 1033160k/1048512k available (2040k kernel code, 14968k reserved, 1230k data, 88k init, 131008k highmem)
Security Scaffold v1.0.0 initialized
Dentry-cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
Machine check exception polling timer started.
CPU: AMD Athlon(tm) processor stepping 04
Enabling fast FPU save and restore... done.
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
mtrr: v2.0 (20020519)
PCI: PCI BIOS revision 2.10 entry at 0xfb4a0, last bus=1
PCI: Using configuration type 1
ACPI: Subsystem revision 20020829
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: System [ACPI] (supports S0 S1 S4 S5)
ACPI: PCI Root Bridge [PCI0] (00:00)
PCI: Probing PCI hardware (bus 00)
ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 *5 6 7 10 11 12 14 15)
usb.c: registered new driver usbfs
usb.c: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: if you experience problems, try using option 'pci=noacpi'
Starting kswapd
highmem bounce pool size: 64 pages
BIO: pool of 256 setup, 14Kb (56 bytes/bio)
biovec pool[0]: 1 bvecs: 256 entries (12 bytes)
biovec pool[1]: 4 bvecs: 256 entries (48 bytes)
biovec pool[2]: 16 bvecs: 256 entries (192 bytes)
biovec pool[3]: 64 bvecs: 256 entries (768 bytes)
biovec pool[4]: 128 bvecs: 256 entries (1536 bytes)
biovec pool[5]: 256 bvecs: 256 entries (3072 bytes)
aio_setup: sizeof(struct page) = 44
Journalled Block Device driver loaded
Installing knfsd (copyright (C) 1996 [email protected]).
udf: registering filesystem
Capability LSM initialized
Applying VIA southbridge workaround.
ACPI: Power Button (FF) [PWRF]
ACPI: Processor [CPU0] (supports C1 C2, 2 throttling states)
Serial: 8250/16550 driver $Revision: 1.90 $ IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
i2c-core.o: i2c core module version 2.6.4 (20020719)
i2c-dev.o: i2c /dev entries driver module version 2.6.4 (20020719)
i2c-algo-bit.o: i2c bit algorithm module version 2.6.4 (20020719)
i2c-proc.o version 2.6.4 (20020719)
pty: 256 Unix98 ptys configured
Real Time Clock Driver v1.11
Non-volatile memory driver v1.2
Software Watchdog Timer: 0.06, soft_margin: 60 sec, nowayout: 0
Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 816M
agpgart: Detected Via Apollo Pro KT133 chipset
agpgart: AGP aperture is 256M @ 0xc0000000
[drm] AGP 0.99 on VIA Apollo KT133 @ 0xc0000000 256MB
[drm] Initialized mga 3.0.2 20010321 on minor 0
block: 256 slots per queue, batch=32
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
loop: loaded (max 8 devices)
3c59x: Donald Becker and others. http://www.scyld.com/network/vortex.html
00:09.0: 3Com PCI 3c905C Tornado at 0xe800. Vers LK1.1.18
phy=0, phyx=24, mii_status=0x782d
Linux video capture interface: v1.00
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:07.1
ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:DMA, hdd:DMA
hda: IC35L040AVER07-0, ATA DISK drive
hda: DMA disabled
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hdc: LITE-ON LTR-12102B, ATAPI CD/DVD-ROM drive
hdd: Maxtor 90288D2, ATA DISK drive
hdc: DMA disabled
hdd: DMA disabled
ide1 at 0x170-0x177,0x376 on irq 15
VP_IDE: IDE controller at PCI slot 00:07.1
PCI: Unable to reserve I/O region #5:[email protected] for device 00:07.1
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:07.1
VP_IDE: port 0x01f0 already claimed by ide0
VP_IDE: port 0x0170 already claimed by ide1
VP_IDE: neither IDE port enabled (BIOS)
hda: host protected area => 1
hda: 80418240 sectors (41174 MB) w/1916KiB Cache, CHS=5005/255/63, UDMA(100)
hda: hda1 hda2 < hda5 hda6 hda7 >
hdd: host protected area => 1
hdd: 5627664 sectors (2881 MB) w/256KiB Cache, CHS=5583/16/63, UDMA(33)
hdd: hdd1 hdd2 < hdd5 hdd6 hdd7 hdd8 hdd9 hdd10 >
SCSI subsystem driver Revision: 1.00
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: LITE-ON Model: LTR-12102B Rev: NS1D
Type: CD-ROM ANSI SCSI revision: 02
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12
uhci-hcd.c: USB Universal Host Controller Interface driver v2.0
hcd-pci.c: uhci-hcd @ 00:07.2, VIA Technologies, Inc. USB
hcd-pci.c: irq 5, io base 0000d400
hcd.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found at 0
hub.c: 2 ports detected
hcd-pci.c: uhci-hcd @ 00:07.3, VIA Technologies, Inc. USB (#2)
hcd-pci.c: irq 5, io base 0000d800
hcd.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found at 0
hub.c: 2 ports detected
usb.c: registered new driver hiddev
usb.c: registered new driver hid
hid-core.c: v2.0:USB HID core driver
mice: PS/2 mouse device common for all mice
input: PC Speaker
Advanced Linux Sound Architecture Driver Version 0.9.0rc2 (Wed Jun 19 08:56:25 2002 UTC).
ALSA device list:
#0: VIA 82C686A/B at 0xdc00, irq 12
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 8192 buckets, 64Kbytes
TCP: Hash tables configured (established 262144 bind 65536)
IPv4 over IPv4 tunneling driver
ip_conntrack version 2.1 (8191 buckets, 65528 max) - 292 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
arp_tables: (C) 2002 David S. Miller
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
hub.c: new USB device 00:07.2-1, assigned address 2
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
Freeing unused kernel memory: 88k freed
hub.c: USB hub found at 1
hub.c: 3 ports detected
----------it dies here--------

Note that if no usb devices are plugged in the last message is "Freeing
unused kernel memory...".

It seems to be not completely dead however since if I then plug in my
usb mouse and keyboard I get a message printed that a new usb device has
been found.

Any ideas anyone?

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/


2002-09-18 22:53:47

by Anton Blanchard

[permalink] [raw]
Subject: Re: BUG: Current 2.5-BK tree dies on boot!


> This is without preempt. I tried both with and without SMP, with and without
> large TLB pages, with and without pte highmem, all die in the same place.

I needed this to boot the latest BK on my ppc64 box. The question is
why we are suddenly ending up with prev == NULL, hch mentioned his
patch was only a cleanup in this area.

Anton

===== mm/mprotect.c 1.16 vs edited =====
--- 1.16/mm/mprotect.c Wed Sep 18 04:05:14 2002
+++ edited/mm/mprotect.c Wed Sep 18 22:44:40 2002
@@ -281,7 +281,7 @@
}
}

- if (next && prev->vm_end == next->vm_start &&
+ if (prev && next && prev->vm_end == next->vm_start &&
can_vma_merge(next, prev->vm_flags) &&
!prev->vm_file && !(prev->vm_flags & VM_SHARED)) {
spin_lock(&prev->vm_mm->page_table_lock);

2002-09-19 08:43:09

by Jens Axboe

[permalink] [raw]
Subject: Re: BUG: Current 2.5-BK tree dies on boot!

On Wed, Sep 18 2002, Anton Altaparmakov wrote:
> This is without preempt. I tried both with and without SMP, with and without
> large TLB pages, with and without pte highmem, all die in the same place.

You have highmem, and bouncing does not get correctly enabled on the ide
drives. This, in combination with broken bouncing (woops), will probably
make it die fairly quickly.

I attach two patches, one fixes the bouncing, the other fixes IDE bounce
enable.

--
Jens Axboe


Attachments:
(No filename) (476.00 B)
ide-high-2 (2.72 kB)
bounce-end_io-2 (2.87 kB)
Download all attachments

2002-09-19 09:27:36

by Anton Altaparmakov

[permalink] [raw]
Subject: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

At 09:47 19/09/02, Jens Axboe wrote:
>On Wed, Sep 18 2002, Anton Altaparmakov wrote:
> > This is without preempt. I tried both with and without SMP, with and
> without
> > large TLB pages, with and without pte highmem, all die in the same place.
>
>You have highmem, and bouncing does not get correctly enabled on the ide
>drives. This, in combination with broken bouncing (woops), will probably
>make it die fairly quickly.
>
>I attach two patches, one fixes the bouncing, the other fixes IDE bounce
>enable.

BK as of this morning already contains the bounce patch, so I only applied
the IDE bounce enable and it worked fine. - Thanks!

Note there is something odd wrt IDE initialization. The driver seems to be
trying to initialize twice and there quite a few messages output which
don't reflect reality (probably a consequence of the double init). For
example it says DMA disabled but checking with hdparm and in /proc/ide/via
DMA is enabled just fine. And it says neither IDE port enabled (BIOS) which
isn't true either.

Here is the current IDE output on boot:

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:07.1
ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:DMA, hdd:DMA
hda: IC35L040AVER07-0, ATA DISK drive
hda: DMA disabled
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hdc: LITE-ON LTR-12102B, ATAPI CD/DVD-ROM drive
hdd: Maxtor 90288D2, ATA DISK drive
hdc: DMA disabled
hdd: DMA disabled
ide1 at 0x170-0x177,0x376 on irq 15
VP_IDE: IDE controller at PCI slot 00:07.1
PCI: Unable to reserve I/O region #5:[email protected] for device 00:07.1
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:07.1
VP_IDE: port 0x01f0 already claimed by ide0
VP_IDE: port 0x0170 already claimed by ide1
VP_IDE: neither IDE port enabled (BIOS)
hda: host protected area => 1
hda: 80418240 sectors (41174 MB) w/1916KiB Cache, CHS=5005/255/63, UDMA(100)
hda: hda1 hda2 < hda5 hda6 hda7 >
hdd: host protected area => 1
hdd: 5627664 sectors (2881 MB) w/256KiB Cache, CHS=5583/16/63, UDMA(33)
hdd: hdd1 hdd2 < hdd5 hdd6 hdd7 hdd8 hdd9 hdd10 >
SCSI subsystem driver Revision: 1.00
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: LITE-ON Model: LTR-12102B Rev: NS1D
Type: CD-ROM ANSI SCSI revision: 02
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
sr0: scsi3-mmc drive: 40x/40x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12

But it all seems to works just fine, despite the slightly confused init...

Best regards,

Anton


--
"I haven't lost my mind... it's backed up on tape." - Peter da Silva
--
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/

2002-09-19 09:40:29

by Jens Axboe

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

On Thu, Sep 19 2002, Anton Altaparmakov wrote:
> At 09:47 19/09/02, Jens Axboe wrote:
> >On Wed, Sep 18 2002, Anton Altaparmakov wrote:
> >> This is without preempt. I tried both with and without SMP, with and
> >without
> >> large TLB pages, with and without pte highmem, all die in the same place.
> >
> >You have highmem, and bouncing does not get correctly enabled on the ide
> >drives. This, in combination with broken bouncing (woops), will probably
> >make it die fairly quickly.
> >
> >I attach two patches, one fixes the bouncing, the other fixes IDE bounce
> >enable.
>
> BK as of this morning already contains the bounce patch, so I only applied
> the IDE bounce enable and it worked fine. - Thanks!

Good

> Note there is something odd wrt IDE initialization. The driver seems to be
> trying to initialize twice and there quite a few messages output which
> don't reflect reality (probably a consequence of the double init). For
> example it says DMA disabled but checking with hdparm and in /proc/ide/via
> DMA is enabled just fine. And it says neither IDE port enabled (BIOS) which
> isn't true either.

Yes you are right, it does seem to try and init twice. Wonder why. I'll
take a look at that.

--
Jens Axboe

2002-09-19 10:03:56

by Jens Axboe

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

On Thu, Sep 19 2002, Jens Axboe wrote:
> > Note there is something odd wrt IDE initialization. The driver seems to be
> > trying to initialize twice and there quite a few messages output which
> > don't reflect reality (probably a consequence of the double init). For
> > example it says DMA disabled but checking with hdparm and in /proc/ide/via
> > DMA is enabled just fine. And it says neither IDE port enabled (BIOS) which
> > isn't true either.
>
> Yes you are right, it does seem to try and init twice. Wonder why. I'll
> take a look at that.

Seems to be ide probe calling the pci probe functions, and then they get
called by the pci layer later when they register. Dunno what the best
way to handle this is. Alan quotes ordering constraints as the reason.
Then maybe the easiest fix is to just do

chipset_init(bla)
{
if (chipset already setup)
return;

do_init();
}

Alan?

--
Jens Axboe

2002-09-19 10:50:06

by Alan Cox

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

On Thu, 2002-09-19 at 11:08, Jens Axboe wrote:
> Seems to be ide probe calling the pci probe functions, and then they get
> called by the pci layer later when they register. Dunno what the best
> way to handle this is. Alan quotes ordering constraints as the reason.
> Then maybe the easiest fix is to just do

Something is very wrong if they initialize twice. Hacking chipset_init
is not a fix its an ugly hack.

They should end up on the ide queue to init, then transfer to the core
PCI hotplug layer. The hotplug layer won't call the setups again because
the device is already owned by the driver that grabbed it.

In 2.4 at least pci_register_driver checks that it doesnt do that

pci_for_each_dev(dev) {
if (!pci_dev_driver(dev))
count += pci_announce_device(drv, dev);
}


2.5 should do the same

Alan

2002-09-19 11:09:38

by Jens Axboe

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

On Thu, Sep 19 2002, Alan Cox wrote:
> On Thu, 2002-09-19 at 11:08, Jens Axboe wrote:
> > Seems to be ide probe calling the pci probe functions, and then they get
> > called by the pci layer later when they register. Dunno what the best
> > way to handle this is. Alan quotes ordering constraints as the reason.
> > Then maybe the easiest fix is to just do
>
> Something is very wrong if they initialize twice. Hacking chipset_init
> is not a fix its an ugly hack.

True :-)

> They should end up on the ide queue to init, then transfer to the core
> PCI hotplug layer. The hotplug layer won't call the setups again because
> the device is already owned by the driver that grabbed it.
>
> In 2.4 at least pci_register_driver checks that it doesnt do that
>
> pci_for_each_dev(dev) {
> if (!pci_dev_driver(dev))
> count += pci_announce_device(drv, dev);
> }
>
>
> 2.5 should do the same

2.5 is reorged big time it seems, pci_register_driver() ->
drier_attach() -> do_driver_attach() -> found_match() calls ->probe()
unconditionally...

--
Jens Axboe

2002-09-19 13:23:32

by Jens Axboe

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

On Thu, Sep 19 2002, Alan Cox wrote:
> On Thu, 2002-09-19 at 12:14, Jens Axboe wrote:
> > 2.5 is reorged big time it seems, pci_register_driver() ->
> > drier_attach() -> do_driver_attach() -> found_match() calls ->probe()
> > unconditionally...
>
> That would appear to be a bug in the 2.5 driver layer then. I'd suggest
> fixing it there. Attempting to probe a device that already has a driver
> attached to it doesn't seem to make sense.

Agree. Pat?

--
Jens Axboe

2002-09-19 13:22:16

by Alan Cox

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

On Thu, 2002-09-19 at 12:14, Jens Axboe wrote:
> 2.5 is reorged big time it seems, pci_register_driver() ->
> drier_attach() -> do_driver_attach() -> found_match() calls ->probe()
> unconditionally...

That would appear to be a bug in the 2.5 driver layer then. I'd suggest
fixing it there. Attempting to probe a device that already has a driver
attached to it doesn't seem to make sense.

2002-09-19 17:42:10

by Patrick Mochel

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!


On Thu, 19 Sep 2002, Jens Axboe wrote:

> On Thu, Sep 19 2002, Alan Cox wrote:
> > On Thu, 2002-09-19 at 12:14, Jens Axboe wrote:
> > > 2.5 is reorged big time it seems, pci_register_driver() ->
> > > drier_attach() -> do_driver_attach() -> found_match() calls ->probe()
> > > unconditionally...
> >
> > That would appear to be a bug in the 2.5 driver layer then. I'd suggest
> > fixing it there. Attempting to probe a device that already has a driver
> > attached to it doesn't seem to make sense.
>
> Agree. Pat?

Yes, and that's the way it's set up: we check if the device has a driver
before we bind to it. However, dev->driver doesn't get set before the
device is registered with the core for PCI devices. That's fixed easily
enough.

But, I'm a bit confused on where this is happening. The PCI layer will
probe for devices before any drivers are registered. The drivers are
registered, then they're attached to devices that were already discovered.
So, how are they getting init'ed twice?


-pat

2002-09-19 17:53:59

by Alan Cox

[permalink] [raw]
Subject: Re: ide double init? + Re: BUG: Current 2.5-BK tree dies on boot!

On Thu, 2002-09-19 at 18:48, Patrick Mochel wrote:
> Yes, and that's the way it's set up: we check if the device has a driver
> before we bind to it. However, dev->driver doesn't get set before the
> device is registered with the core for PCI devices. That's fixed easily
> enough.
>
> But, I'm a bit confused on where this is happening. The PCI layer will
> probe for devices before any drivers are registered. The drivers are
> registered, then they're attached to devices that were already discovered.
> So, how are they getting init'ed twice?

The IDE layer has to preserve ordering. It does that by doing pci device
ordered scans at boot then handing the driver registrations over to the
pci hotplug layer for new inserts.