From: Denis V. Lunev Date: Tue, 7 Aug 2007 09:13:18 +0000 (+0400) Subject: PCI: pci_get_device call from interrupt in reboot fixups X-Git-Tag: v2.6.24-rc1~1393^2~22 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d034aecd8b70d34388a4e40ca50af0d014223e1;p=linux-2.6 PCI: pci_get_device call from interrupt in reboot fixups The following calltrace is possible now: handle_sysrq machine_emergency_restart mach_reboot_fixups pci_get_device pci_get_subsys down_read The patch skips reboot fixup if called from sysrq-B code. Signed-off-by: Denis V. Lunev Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kernel/reboot_fixups_32.c b/arch/x86/kernel/reboot_fixups_32.c index 03e1cce58f..139eb03490 100644 --- a/arch/x86/kernel/reboot_fixups_32.c +++ b/arch/x86/kernel/reboot_fixups_32.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -56,6 +57,11 @@ void mach_reboot_fixups(void) struct pci_dev *dev; int i; + /* we can be called from sysrq-B code. In such a case it is + * prohibited to dig PCI */ + if (in_interrupt()) + return; + for (i=0; i < ARRAY_SIZE(fixups_table); i++) { cur = &(fixups_table[i]); dev = pci_get_device(cur->vendor, cur->device, NULL);