s390/pci: adapt events for zbus
Simplify the event handling. Set the zpci state explicitly. Signed-off-by: Pierre Morel <pmorel@linux.ibm.com> Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
05bc1be6db
commit
f606b3ef47
|
@ -89,25 +89,19 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
|
||||||
switch (ccdf->pec) {
|
switch (ccdf->pec) {
|
||||||
case 0x0301: /* Reserved|Standby -> Configured */
|
case 0x0301: /* Reserved|Standby -> Configured */
|
||||||
if (!zdev) {
|
if (!zdev) {
|
||||||
ret = clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
|
ret = clp_add_pci_device(ccdf->fid, ccdf->fh, 1);
|
||||||
if (ret)
|
break;
|
||||||
break;
|
|
||||||
zdev = get_zdev_by_fid(ccdf->fid);
|
|
||||||
}
|
}
|
||||||
if (!zdev || zdev->state != ZPCI_FN_STATE_STANDBY)
|
|
||||||
break;
|
|
||||||
zdev->state = ZPCI_FN_STATE_CONFIGURED;
|
|
||||||
zdev->fh = ccdf->fh;
|
zdev->fh = ccdf->fh;
|
||||||
ret = zpci_enable_device(zdev);
|
zdev->state = ZPCI_FN_STATE_CONFIGURED;
|
||||||
if (ret)
|
zpci_create_device(zdev);
|
||||||
break;
|
|
||||||
pci_lock_rescan_remove();
|
|
||||||
pci_rescan_bus(zdev->zbus->bus);
|
|
||||||
pci_unlock_rescan_remove();
|
|
||||||
break;
|
break;
|
||||||
case 0x0302: /* Reserved -> Standby */
|
case 0x0302: /* Reserved -> Standby */
|
||||||
if (!zdev)
|
if (!zdev) {
|
||||||
clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
|
clp_add_pci_device(ccdf->fid, ccdf->fh, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
zdev->fh = ccdf->fh;
|
||||||
break;
|
break;
|
||||||
case 0x0303: /* Deconfiguration requested */
|
case 0x0303: /* Deconfiguration requested */
|
||||||
if (!zdev)
|
if (!zdev)
|
||||||
|
@ -135,8 +129,6 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf)
|
||||||
pci_stop_and_remove_bus_device_locked(pdev);
|
pci_stop_and_remove_bus_device_locked(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
zdev->fh = ccdf->fh;
|
|
||||||
zpci_disable_device(zdev);
|
|
||||||
zdev->state = ZPCI_FN_STATE_STANDBY;
|
zdev->state = ZPCI_FN_STATE_STANDBY;
|
||||||
if (!clp_get_state(ccdf->fid, &state) &&
|
if (!clp_get_state(ccdf->fid, &state) &&
|
||||||
state == ZPCI_FN_STATE_RESERVED) {
|
state == ZPCI_FN_STATE_RESERVED) {
|
||||||
|
|
Loading…
Reference in New Issue