Messages in this thread Patch in this message | | | From | Deepa Dinamani <> | Subject | [PATCH] pci: Warn if BME cannot be turned off during kexec | Date | Sat, 4 Jan 2020 14:50:52 -0800 |
| |
BME not being off is a security risk, so for whatever reason if we cannot disable it, print a warning.
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> --- drivers/pci/pci-driver.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 0454ca0e4e3f..6c866a81f46c 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -491,8 +491,12 @@ 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)) - pci_clear_master(pci_dev); + if (kexec_in_progress) { + if (likely(pci_dev->current_state <= PCI_D3hot)) + pci_clear_master(pci_dev); + else + dev_warn(dev, "Unable to turn off BME during kexec"); + } } #ifdef CONFIG_PM -- 2.17.1
| |