@@ -9,6 +9,7 @@
#include <linux/init.h>
#include <linux/device.h>
#include <linux/mempolicy.h>
+#include <linux/pkernfs.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/sched.h>
@@ -519,7 +520,8 @@ static void pci_device_shutdown(struct device *dev)
* If it is not a kexec reboot, firmware will hit the PCI
* devices with big hammer and stop their DMA any way.
*/
- if (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot))
+ if (kexec_in_progress && (pci_dev->current_state <= PCI_D3hot)
+ && !pkernfs_enabled())
pci_clear_master(pci_dev);
}