Commit ca25f564 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

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: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent d3a73acb
...@@ -76,7 +76,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) ...@@ -76,7 +76,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
switch (ccdf->pec) { switch (ccdf->pec) {
case 0x0301: /* Standby -> Configured */ case 0x0301: /* Standby -> Configured */
if (!zdev || zdev->state == ZPCI_FN_STATE_CONFIGURED) if (!zdev || zdev->state != ZPCI_FN_STATE_STANDBY)
break; break;
zdev->state = ZPCI_FN_STATE_CONFIGURED; zdev->state = ZPCI_FN_STATE_CONFIGURED;
zdev->fh = ccdf->fh; zdev->fh = ccdf->fh;
...@@ -86,6 +86,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) ...@@ -86,6 +86,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
pci_rescan_bus(zdev->bus); pci_rescan_bus(zdev->bus);
break; break;
case 0x0302: /* Reserved -> Standby */ case 0x0302: /* Reserved -> Standby */
if (!zdev)
clp_add_pci_device(ccdf->fid, ccdf->fh, 0); clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
break; break;
case 0x0303: /* Deconfiguration requested */ case 0x0303: /* Deconfiguration requested */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment