s390/pci: set error state for unavailable functions
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Thu, 12 Dec 2013 16:53:11 +0000 (17:53 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 16 Dec 2013 13:37:55 +0000 (14:37 +0100)
If we receive a notification that a pci function became unavailable we clean
up by removing the pci device. This can confuse the driver since the function
is already unaccessible. Improve this situation by setting an appropriate
error_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 65ea105f68a196790b7be4c03b70a32d3c4e1a51..7fc4c2c5708c8b5668e4fe6f99376bbda46280df 100644 (file)
@@ -102,8 +102,12 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
 
                break;
        case 0x0304: /* Configured -> Standby */
-               if (pdev)
+               if (pdev) {
+                       /* Give the driver a hint that the function is
+                        * already unusable. */
+                       pdev->error_state = pci_channel_io_perm_failure;
                        pci_stop_and_remove_bus_device(pdev);
+               }
 
                zpci_disable_device(zdev);
                zdev->state = ZPCI_FN_STATE_STANDBY;