Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/pci: remove pdev during unplug

The disable slot implementation on s390 currently just detaches the
pci function from the partition - without informing the pci layer.
Fix this by calling pci_stop_and_remove_bus_device prior to the
operation.

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>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
8b2a7e60 4bee2a5d

+4 -4
-1
arch/s390/pci/pci_clp.c
··· 236 236 if (!zdev_enabled(zdev)) 237 237 return 0; 238 238 239 - dev_info(&zdev->pdev->dev, "disabling fn handle: 0x%x\n", fh); 240 239 rc = clp_set_pci_fn(&fh, 0, CLP_SET_DISABLE_PCI_FN); 241 240 if (!rc) 242 241 /* Success -> store disabled handle in zdev */
+4 -3
drivers/pci/hotplug/s390_pci_hpc.c
··· 99 99 if (!zpci_fn_configured(slot->zdev->state)) 100 100 return -EIO; 101 101 102 + if (slot->zdev->pdev) 103 + pci_stop_and_remove_bus_device(slot->zdev->pdev); 104 + 102 105 rc = zpci_disable_device(slot->zdev); 103 106 if (rc) 104 107 return rc; 105 - /* TODO: we rely on the user to unbind/remove the device, is that plausible 106 - * or do we need to trigger that here? 107 - */ 108 + 108 109 return slot_deconfigure(slot); 109 110 } 110 111