Skip to content

Commit

Permalink
s390/pci: improve state check when processing hotplug events
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed May 20, 2014
1 parent d3a73ac commit ca25f56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/s390/pci/pci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit ca25f56

Please sign in to comment.