remarkable-linux/drivers/pci
Feng Tang b9443f401b PCI: Use pci_device_id on stack for pci_get_subsys/class() to avoid kmalloc
This fixes a kernel warning https://lkml.org/lkml/2012/7/31/682

pci_get_subsys() may get called in late system reboot stage, using
a sleepable kmalloc() sounds fragile and will cause a kernel warning
with my recent commmit 55c844a "x86/reboot: Fix a warning message
triggered by stop_other_cpus()" which disable local interrupt in
late system shutdown/reboot phase. Using a local parameter instead
will fix it and make it eligible for calling from atomic context.

Do the same change for the pci_get_class() as suggested by Bjorn Helgaas.

Initializing the on-stack struct pci_device_id suggested by Fengguang Wu
and Jiri Slaby.  Section 6.7.8 of the C99 standard guarantees that when we
initialize some of the struct members, the rest of the struct is implicitly
initialized the same as objects with static storage duration, i.e., to zero
in this case.

[bhelgaas: changelog, incorporate Fengguang/Jiri initialization fix]
Bisected-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Fengguang Wu <fengguang.wu@intel.com>
2012-08-24 12:33:13 -06:00
..
hotplug PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
pcie Merge branch 'topic/huang-d3cold-v7' into next 2012-06-23 11:59:43 -06:00
.gitignore
access.c PCI: export pci_user functions for use by other drivers 2012-06-12 09:21:42 -06:00
ats.c
bus.c PCI: fix undefined reference to 'pci_fixup_final_inited' 2012-07-16 09:14:49 -06:00
host-bridge.c
hotplug-pci.c PCI: hotplug: remove pci_do_scan_bus() 2012-06-13 15:42:27 -06:00
hotplug.c
htirq.c
ioapic.c
iov.c PCI: register busn_res for iov bus 2012-06-13 15:42:25 -06:00
irq.c
Kconfig
Makefile PCI: build resource code for M68K architecture 2012-07-13 09:40:37 -06:00
msi.c
msi.h
of.c
pci-acpi.c Merge branch 'topic/huang-d3cold-v7' into next 2012-06-23 11:59:43 -06:00
pci-driver.c PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
pci-label.c
pci-stub.c
pci-sysfs.c Merge branch 'topic/huang-d3cold-v7' into next 2012-06-23 11:59:43 -06:00
pci.c PCI: EHCI: fix crash during suspend on ASUS computers 2012-07-10 09:52:05 -07:00
pci.h Merge branch 'pci/rafael-pci_set_power_state-rebase' into next 2012-07-05 16:29:52 -06:00
probe.c Merge branch 'pci/bjorn-p2p-bridge-windows' into next 2012-07-10 08:36:09 -06:00
proc.c
quirks.c PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
remove.c PCI: release busn_res when removing bus 2012-06-13 15:42:22 -06:00
rom.c
search.c PCI: Use pci_device_id on stack for pci_get_subsys/class() to avoid kmalloc 2012-08-24 12:33:13 -06:00
setup-bus.c PCI changes for the 3.6 merge window: 2012-07-24 16:17:07 -07:00
setup-irq.c
setup-res.c Merge branch 'pci/nikhil-big-bar-fixes' into next 2012-07-18 14:06:20 -06:00
slot.c
syscall.c
vpd.c
xen-pcifront.c