PCI MSI breaks when booting with nosmp

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: LKML <linux-kernel@...>, <linux-pci@...>
Cc: Pavel Machek <pavel@...>, Tejun Heo <htejun@...>, Tom Long Nguyen <tom.l.nguyen@...>, Randy Dunlap <rdunlap@...>, Reuben Farrelly <reuben-lkml@...>, Jeff Garzik <jgarzik@...>
Date: Thursday, April 17, 2008 - 3:40 pm

Hi all,

My Thinkpad T60p laptop won't boot any recent kernel with nosmp.
I investigated the issue because many people have been complaining
lately that nosmp was breaking their system, and that's unfortunate
because nosmp is a valuable debugging tool.

The actual problem is that the ahci driver fails during probe.
It's essentially the same problem that has been reported here over
3 years ago:
http://marc.info/?l=linux-ide&m=112729386600155&w=2

The post above gave me the idea to try booting with "nosmp pci=nomsi",
and that worked. This makes me believe that the problem is that PCI MSI
makes expectations that are no longer valid when booting with nomsp.

So, I have come up with the following naive patch:

* * * * *

Booting with "nosmp" doesn't work on my Thinkpad T60p laptop while
booting with "nosmp pci=nomsi" works. Forcibly disabling PCI MSI
when booting with nosmp fixes the problem. I'm not sure if it's the
correct fix though.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 drivers/pci/pci.c |    4 ++++
 1 file changed, 4 insertions(+)

--- linux-2.6.25-rc9.orig/drivers/pci/pci.c
+++ linux-2.6.25-rc9/drivers/pci/pci.c
@@ -1635,6 +1635,10 @@ static int __devinit pci_init(void)
 	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		pci_fixup_device(pci_fixup_final, dev);
 	}
+#ifdef CONFIG_SMP
+	if (setup_max_cpus == 0)
+		pci_no_msi();
+#endif	
 	return 0;
 }
 

* * * * *

I would welcome comments on the patch above. Is it even remotely
correct? Or is the bug more likely in the ahci driver and the PCI MSI
code is innocent?

FWIW, booting with noapic or nolapic without disabling PCI MSI works
fine for me, so it doesn't seem to be an APIC problem (although this was
my first suspect originally.)

Thanks,
-- 
Jean Delvare
Suse L3
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
PCI MSI breaks when booting with nosmp, Jean Delvare, (Thu Apr 17, 3:40 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Thu Apr 17, 4:08 pm)
Re: PCI MSI breaks when booting with nosmp, Jean Delvare, (Thu Apr 17, 4:25 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Mon Apr 21, 1:43 pm)
Re: PCI MSI breaks when booting with nosmp, Andi Kleen, (Mon Apr 21, 2:45 pm)
Re: PCI MSI breaks when booting with nosmp, Jean Delvare, (Mon Apr 21, 4:20 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Mon Apr 21, 4:40 pm)
Re: PCI MSI breaks when booting with nosmp, Andi Kleen, (Mon Apr 21, 4:46 pm)
Re: PCI MSI breaks when booting with nosmp, Jean Delvare, (Mon Apr 21, 4:48 pm)
Re: PCI MSI breaks when booting with nosmp, Andi Kleen, (Mon Apr 21, 5:09 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Mon Apr 21, 5:14 pm)
Re: PCI MSI breaks when booting with nosmp, Jean Delvare, (Wed Apr 23, 10:38 am)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Wed Apr 23, 11:12 am)
Re: PCI MSI breaks when booting with nosmp, Maciej W. Rozycki, (Wed Apr 23, 2:13 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Wed Apr 23, 2:23 pm)
Re: PCI MSI breaks when booting with nosmp, Maciej W. Rozycki, (Wed Apr 23, 2:38 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Wed Apr 23, 2:32 pm)
Re: PCI MSI breaks when booting with nosmp, Jean Delvare, (Wed Apr 23, 2:32 pm)
Re: PCI MSI breaks when booting with nosmp, Jean Delvare, (Tue Apr 22, 9:27 am)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Tue Apr 22, 11:50 am)
Re: PCI MSI breaks when booting with nosmp, Pavel Machek, (Mon Apr 21, 3:43 pm)
Re: PCI MSI breaks when booting with nosmp, Andi Kleen, (Mon Apr 21, 3:44 pm)
Re: PCI MSI breaks when booting with nosmp, Pavel Machek, (Tue Apr 22, 5:25 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Tue Apr 22, 7:07 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Mon Apr 21, 3:06 pm)
Re: PCI MSI breaks when booting with nosmp, Andi Kleen, (Mon Apr 21, 3:41 pm)
Re: PCI MSI breaks when booting with nosmp, Jesse Barnes, (Mon Apr 21, 3:35 pm)