aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/pci/pci.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2017-06-20 15:56:05 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-06-28 07:32:13 +0200
commit01553d9a2ba7c658bf9e9e5c65466508c1bd6db5 (patch)
treee36c325b156531f878a7556b28ac35bd84132909 /arch/s390/pci/pci.c
parents390/pci: improve pci hotplug (diff)
downloadlinux-dev-01553d9a2ba7c658bf9e9e5c65466508c1bd6db5.tar.xz
linux-dev-01553d9a2ba7c658bf9e9e5c65466508c1bd6db5.zip
s390/pci: fix handling of PEC 306
In contrast to other hotplug events PEC 0x306 isn't about a single but multiple devices. Also there's no information on what happened to these devices. We correctly handled hotplug that way but failed to handle hot-unplug. This patch addresses that and implements hot-unplug of multiple devices via PEC 306. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/pci/pci.c')
-rw-r--r--arch/s390/pci/pci.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index f4928bc57773..114b390d80f9 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -86,6 +86,25 @@ struct zpci_dev *get_zdev_by_fid(u32 fid)
return zdev;
}
+void zpci_remove_reserved_devices(void)
+{
+ struct zpci_dev *tmp, *zdev;
+ enum zpci_state state;
+ LIST_HEAD(remove);
+
+ spin_lock(&zpci_list_lock);
+ list_for_each_entry_safe(zdev, tmp, &zpci_list, entry) {
+ if (zdev->state == ZPCI_FN_STATE_STANDBY &&
+ !clp_get_state(zdev->fid, &state) &&
+ state == ZPCI_FN_STATE_RESERVED)
+ list_move_tail(&zdev->entry, &remove);
+ }
+ spin_unlock(&zpci_list_lock);
+
+ list_for_each_entry_safe(zdev, tmp, &remove, entry)
+ zpci_remove_device(zdev);
+}
+
static struct zpci_dev *get_zdev_by_bus(struct pci_bus *bus)
{
return (bus && bus->sysdata) ? (struct zpci_dev *) bus->sysdata : NULL;
@@ -845,16 +864,6 @@ out:
return rc;
}
-void zpci_stop_device(struct zpci_dev *zdev)
-{
- zpci_dma_exit_device(zdev);
- /*
- * Note: SCLP disables fh via set-pci-fn so don't
- * do that here.
- */
-}
-EXPORT_SYMBOL_GPL(zpci_stop_device);
-
void zpci_remove_device(struct zpci_dev *zdev)
{
if (!zdev->bus)