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

s390/pci: do not modify function handles

Don't modify function handles to get a disabled handle - call
clp_disable_fh. With this change we also do no longer deconfigure
enabled functions.
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 a2ab8333
...@@ -140,6 +140,7 @@ static inline bool zdev_enabled(struct zpci_dev *zdev) ...@@ -140,6 +140,7 @@ static inline bool zdev_enabled(struct zpci_dev *zdev)
struct zpci_dev *zpci_alloc_device(void); struct zpci_dev *zpci_alloc_device(void);
int zpci_create_device(struct zpci_dev *); int zpci_create_device(struct zpci_dev *);
int zpci_enable_device(struct zpci_dev *); int zpci_enable_device(struct zpci_dev *);
int zpci_disable_device(struct zpci_dev *);
void zpci_stop_device(struct zpci_dev *); void zpci_stop_device(struct zpci_dev *);
void zpci_free_device(struct zpci_dev *); void zpci_free_device(struct zpci_dev *);
int zpci_scan_device(struct zpci_dev *); int zpci_scan_device(struct zpci_dev *);
......
...@@ -955,6 +955,13 @@ int zpci_enable_device(struct zpci_dev *zdev) ...@@ -955,6 +955,13 @@ int zpci_enable_device(struct zpci_dev *zdev)
} }
EXPORT_SYMBOL_GPL(zpci_enable_device); EXPORT_SYMBOL_GPL(zpci_enable_device);
int zpci_disable_device(struct zpci_dev *zdev)
{
zpci_dma_exit_device(zdev);
return clp_disable_fh(zdev);
}
EXPORT_SYMBOL_GPL(zpci_disable_device);
int zpci_create_device(struct zpci_dev *zdev) int zpci_create_device(struct zpci_dev *zdev)
{ {
int rc; int rc;
......
...@@ -68,17 +68,16 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) ...@@ -68,17 +68,16 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
if (!zpci_fn_configured(slot->zdev->state)) if (!zpci_fn_configured(slot->zdev->state))
return -EIO; return -EIO;
rc = zpci_disable_device(slot->zdev);
if (rc)
return rc;
/* TODO: we rely on the user to unbind/remove the device, is that plausible /* TODO: we rely on the user to unbind/remove the device, is that plausible
* or do we need to trigger that here? * or do we need to trigger that here?
*/ */
rc = sclp_pci_deconfigure(slot->zdev->fid); rc = sclp_pci_deconfigure(slot->zdev->fid);
zpci_dbg(3, "deconf fid:%x, rc:%d\n", slot->zdev->fid, rc); zpci_dbg(3, "deconf fid:%x, rc:%d\n", slot->zdev->fid, rc);
if (!rc) { if (!rc)
/* Fixme: better call List-PCI to find the disabled FH
for the FID since the FH should be opaque... */
slot->zdev->fh &= 0x7fffffff;
slot->zdev->state = ZPCI_FN_STATE_STANDBY; slot->zdev->state = ZPCI_FN_STATE_STANDBY;
}
return rc; return rc;
} }
......
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