@@ -498,6 +498,8 @@ static void pci_device_shutdown(struct device *dev)
*/
if (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot))
pci_clear_master(pci_dev);
+
+ pci_fixup_device(pci_fixup_shutdown, pci_dev);
}
#ifdef CONFIG_PM
@@ -93,6 +93,8 @@ extern struct pci_fixup __start_pci_fixups_suspend[];
extern struct pci_fixup __end_pci_fixups_suspend[];
extern struct pci_fixup __start_pci_fixups_suspend_late[];
extern struct pci_fixup __end_pci_fixups_suspend_late[];
+extern struct pci_fixup __start_pci_fixups_shutdown[];
+extern struct pci_fixup __end_pci_fixups_shutdown[];
static bool pci_apply_fixup_final_quirks;
@@ -143,6 +145,11 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev)
end = __end_pci_fixups_suspend_late;
break;
+ case pci_fixup_shutdown:
+ start = __start_pci_fixups_shutdown;
+ end = __end_pci_fixups_shutdown;
+ break;
+
default:
/* stupid compiler warning, you would think with an enum... */
return;
@@ -472,6 +472,9 @@
__start_pci_fixups_suspend_late = .; \
KEEP(*(.pci_fixup_suspend_late)) \
__end_pci_fixups_suspend_late = .; \
+ __start_pci_fixups_shutdown = .; \
+ KEEP(*(.pci_fixup_shutdown)) \
+ __end_pci_fixups_shutdown = .; \
} \
\
/* Built-in firmware blobs */ \
@@ -1923,6 +1923,7 @@ enum pci_fixup_pass {
pci_fixup_suspend, /* pci_device_suspend() */
pci_fixup_resume_early, /* pci_device_resume_early() */
pci_fixup_suspend_late, /* pci_device_suspend_late() */
+ pci_fixup_shutdown, /* pci_device_shutdown() */
};
#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
@@ -2028,6 +2029,9 @@ enum pci_fixup_pass {
#define DECLARE_PCI_FIXUP_SUSPEND_LATE(vendor, device, hook) \
DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend_late, \
suspend_late##hook, vendor, device, PCI_ANY_ID, 0, hook)
+#define DECLARE_PCI_FIXUP_SHUTDOWN(vendor, device, hook) \
+ DECLARE_PCI_FIXUP_SECTION(.pci_fixup_shutdown, \
+ shutdown##hook, vendor, device, PCI_ANY_ID, 0, hook)
#ifdef CONFIG_PCI_QUIRKS
void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev);