s390/pci: improve handling of hotplug event 0x301
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Tue, 16 Jun 2015 16:58:37 +0000 (18:58 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 18 Jun 2015 13:45:54 +0000 (15:45 +0200)
Hypervisors may deliver event 0x301 not only for standby
but also for reserved devices.
Just handle event 0x301 regardless of the device's state.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/pci/pci_event.c

index 460fdb21cf61da215eba972cd75359d0be5d4b4e..ed2394dd14e92faf57ac34b63ef49731f08ade68 100644 (file)
@@ -75,7 +75,13 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
        zpci_err_hex(ccdf, sizeof(*ccdf));
 
        switch (ccdf->pec) {
-       case 0x0301: /* Standby -> Configured */
+       case 0x0301: /* Reserved|Standby -> Configured */
+               if (!zdev) {
+                       ret = clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
+                       if (ret)
+                               break;
+                       zdev = get_zdev_by_fid(ccdf->fid);
+               }
                if (!zdev || zdev->state != ZPCI_FN_STATE_STANDBY)
                        break;
                zdev->state = ZPCI_FN_STATE_CONFIGURED;