From 623bd44d3f277b7bbe16e0e091bd361e75964b5d Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Tue, 9 May 2017 12:27:30 +0200 Subject: s390/pci: improve pci hotplug PCI hotplug events basically notify about the new state of a function. Unfortunately some hypervisors implement hotplug events in a way where it is not clear what the new state of the function should be. Use clp_get_state to find the current state of the function and handle accordingly. Signed-off-by: Sebastian Ott Reviewed-by: Gerald Schaefer Signed-off-by: Martin Schwidefsky --- arch/s390/pci/pci.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/s390/pci/pci.c') diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 6a44a68efb81..f4928bc57773 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -855,6 +855,15 @@ void zpci_stop_device(struct zpci_dev *zdev) } EXPORT_SYMBOL_GPL(zpci_stop_device); +void zpci_remove_device(struct zpci_dev *zdev) +{ + if (!zdev->bus) + return; + + pci_stop_root_bus(zdev->bus); + pci_remove_root_bus(zdev->bus); +} + int zpci_report_error(struct pci_dev *pdev, struct zpci_report_error_header *report) { -- cgit v1.2.3