summaryrefslogtreecommitdiffstats
path: root/arch/s390/pci
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2014-04-16 16:09:23 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-05-20 08:58:48 +0200
commitca25f564c484b4f32eec1e667926dcf87ec03234 (patch)
tree877c6732ca6ee8563a2fe032d21a2a0e0dd41337 /arch/s390/pci
parentd3a73acbc26a4a81a01a35fd162973e53d0386f5 (diff)
downloadlinux-ca25f564c484b4f32eec1e667926dcf87ec03234.tar.bz2
s390/pci: improve state check when processing hotplug events
Processing pci hotplug events can fail when a pci function is in an unexpected state. This can happen when we already processed the change associated with the hotplug event (especially when receiving hotplug events during early boot). Just ignore the event in this case. 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>
Diffstat (limited to 'arch/s390/pci')
-rw-r--r--arch/s390/pci/pci_event.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
index 01e251b1da0c..6d7f5a3016ca 100644
--- a/arch/s390/pci/pci_event.c
+++ b/arch/s390/pci/pci_event.c
@@ -76,7 +76,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
switch (ccdf->pec) {
case 0x0301: /* Standby -> Configured */
- if (!zdev || zdev->state == ZPCI_FN_STATE_CONFIGURED)
+ if (!zdev || zdev->state != ZPCI_FN_STATE_STANDBY)
break;
zdev->state = ZPCI_FN_STATE_CONFIGURED;
zdev->fh = ccdf->fh;
@@ -86,7 +86,8 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
pci_rescan_bus(zdev->bus);
break;
case 0x0302: /* Reserved -> Standby */
- clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
+ if (!zdev)
+ clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
break;
case 0x0303: /* Deconfiguration requested */
if (pdev)