[PATCH 2.6.20-rc2-git1] PCI: prevent down_read when pci_devices is empty

2006-12-30 Thread Ard -kwaak- van Breemen
The pci_find_subsys gets called very early by obsolete ide setup parameters. This is a bogus call since pci is not initialized yet, so the list is empty. But in the mean time, interrupts get enabled by down_read. This can result in a kernel panic when the irq controller gets initialized. This pat

[PATCH 2.6.20-rc2-git1] kernelparams: detect if and which parameter parsing enabled irq's

2006-12-30 Thread Ard -kwaak- van Breemen
The parsing of some kernel parameters seem to enable irq's at a stage that irq's are not supposed to be enabled (Particularly the ide kernel parameters). Having irq's enabled before the irq controller is initialized might lead to a kernel panic. This patch only detects this behaviour and warns abo

[PATCH 2.6.20-rc2-git1] start_kernel: Test if irq's got enabled early, barf, and disable them again

2006-12-30 Thread Ard -kwaak- van Breemen
The calls made by parse_parms to other initialization code might enable interrupts again way too early. Having interrupts on this early can make systems PANIC when they initialize the IRQ controllers (which happens later in the code). This patch detects that irq's are enabled again, barfs about it

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
Hello, On Fri, Dec 29, 2006 at 04:01:32PM +0100, Ard -kwaak- van Breemen wrote: > On Fri, Dec 29, 2006 at 03:10:58PM +0100, Ard -kwaak- van Breemen wrote: > > Preliminary patches: > > - pci fix of Andrews patches > The printk might be too verbose. I think removing them is ok

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
On Fri, Dec 29, 2006 at 04:01:32PM +0100, Ard -kwaak- van Breemen wrote: > > - parse-one detection of Yanmin > It doesn't flag it. I am working on that. As said: it was doing a callback to obsolete_... This replaces the patch into not being bloated and still gives enough info. It wo

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
On Fri, Dec 22, 2006 at 03:35:20PM +0100, Ard -kwaak- van Breemen wrote: > On Fri, Dec 22, 2006 at 12:30:29AM -0800, Andrew Morton wrote: > > I expect that you'll find that the ide code ends up doing > > down_write(pci_bus_sem), which will enable interrupts. > will:

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
On Fri, Dec 29, 2006 at 04:01:32PM +0100, Ard -kwaak- van Breemen wrote: > > - parse-one detection of Yanmin > It doesn't flag it. I am working on that. Since it goes to a callback to obsolete_checksetup() Argh... my calltree was a little flawed :-(... -- program si

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
On Fri, Dec 29, 2006 at 03:10:58PM +0100, Ard -kwaak- van Breemen wrote: > Preliminary patches: > - pci fix of Andrews patches The printk might be too verbose. I think removing them is ok since the only thing that has happened is that it prevents entering the loop and the semaphores. Th

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
On Fri, Dec 29, 2006 at 02:27:59PM +0100, Ard -kwaak- van Breemen wrote: > I will clean up the patches found on this list to fix and detect this. Preliminary patches: - pci fix of Andrews patches - parse-one detection of Yanmin - start_kernel detection and workaround (disable them again) Th

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
On Fri, Dec 29, 2006 at 01:51:08PM +0100, Ard -kwaak- van Breemen wrote: > I will try it on the right function, and see what we get. In function: 186 static struct pci_dev * pci_find_subsys(unsigned int vendor, 203if (unlikely(list_empty(&pci_devices))) { 204 prin

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-29 Thread Ard -kwaak- van Breemen
Hello Andrew, On Thu, Dec 28, 2006 at 03:51:48PM -0800, Andrew Morton wrote: > Could someone please test this? Without testing I declare it won't fix it 8-D > Ard has worked out the call tree: > > init/main.c start_kernel > kernel/params.c parse_args("Booting kernel" > kernel/params.c

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
Hello, On Thu, Dec 21, 2006 at 04:04:04PM +0800, Zhang, Yanmin wrote: > I couldn't reproduce it on my EM64T machine. I instrumented function > start_kernel and > didn't find irq was enabled before calling init_IRQ. It'll be better if the > reporter could > instrument function start_kernel to capt

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
On Fri, Dec 22, 2006 at 03:41:34PM +0100, Ard -kwaak- van Breemen wrote: > Repeating: I am very stupid, so I don't know if saving the irq state is ok or > not in down_read. The Andrew Morton patch but the rewritten for down_read makes the symptoms go away. The problem obviously

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
On Fri, Dec 22, 2006 at 12:30:29AM -0800, Andrew Morton wrote: > To whom do I have to pay how much to get this darn patch tested? I've altered your patch to do the spin_lock_irqsave in down_read. I am very ignorant and stupid. That's why I am doing it without thinking why or why not de irqsave is o

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
On Fri, Dec 22, 2006 at 12:30:29AM -0800, Andrew Morton wrote: > I expect that you'll find that the ide code ends up doing > down_write(pci_bus_sem), which will enable interrupts. will: down_read(&pci_bus_sem); also enable interrupts? Since that is called: init/main.c start_kernel k

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
On Fri, Dec 22, 2006 at 03:00:59PM +0100, Ard -kwaak- van Breemen wrote: > 262 if (!irqs_disabled()) printk(__FILE__ "%s(): blaat: > interrupts were enabled [EMAIL PROTECTED]",__FUNCTION__,__LINE__); > 263 > 264 ide_init_hwif_ports(&hw, ide

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
On Fri, Dec 22, 2006 at 11:30:05AM +0100, Ard -kwaak- van Breemen wrote: > Anyway: on to the ide_setup tracking > (I've noticed that the notifier of this problem als has idebus=66 > or something similar, so that explains in his case the > early call to ide_setup.) Aaarrgh...

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
Hello, On Fri, Dec 22, 2006 at 12:30:29AM -0800, Andrew Morton wrote: > To whom do I have to pay how much to get this darn patch tested? I've already tested that (as I said somewhere in the bugzilla so it probably got lost somehow :-) ): It doesn't solve the booting problem, and I really don't have

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-22 Thread Ard -kwaak- van Breemen
Hello, On Fri, Dec 22, 2006 at 12:41:46PM +0800, Zhang, Yanmin wrote: > I think parse_args enables irq when it calls callbacks. > Could you try below? > 1) Test Andrew's patch of sema down_write; > 2) Apply below patch and see what the output is when booting. If the output > has > "[BUG]..address.

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-21 Thread Ard -kwaak- van Breemen
On Thu, Dec 21, 2006 at 04:04:04PM +0800, Zhang, Yanmin wrote: > I couldn't reproduce it on my EM64T machine. I instrumented function > start_kernel and > didn't find irq was enabled before calling init_IRQ. It'll be better if the > reporter could > instrument function start_kernel to capture whi

Re: [Bug 7505] Linux-2.6.18 fails to boot on AMD64 machine

2006-12-21 Thread Ard -kwaak- van Breemen
Hello, On Thu, Dec 21, 2006 at 04:04:04PM +0800, Zhang, Yanmin wrote: > I couldn't reproduce it on my EM64T machine. I instrumented function > start_kernel and > didn't find irq was enabled before calling init_IRQ. It'll be better if the > reporter could > instrument function start_kernel to cap