Commit 7c4d964f authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Martin Schwidefsky

[S390] cio: handle error during path verification consistently

Handle verification errors consistently through the existing
callback ccw_device_done to reduce cleanup code duplication.
Signed-off-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 736b5db8
...@@ -549,9 +549,8 @@ ccw_device_verify_done(struct ccw_device *cdev, int err) ...@@ -549,9 +549,8 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
sch = to_subchannel(cdev->dev.parent); sch = to_subchannel(cdev->dev.parent);
/* Update schib - pom may have changed. */ /* Update schib - pom may have changed. */
if (cio_update_schib(sch)) { if (cio_update_schib(sch)) {
cdev->private->flags.donotify = 0; err = -ENODEV;
ccw_device_done(cdev, DEV_STATE_NOT_OPER); goto callback;
return;
} }
/* Update lpm with verified path mask. */ /* Update lpm with verified path mask. */
sch->lpm = sch->vpm; sch->lpm = sch->vpm;
...@@ -561,9 +560,8 @@ ccw_device_verify_done(struct ccw_device *cdev, int err) ...@@ -561,9 +560,8 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
ccw_device_verify_start(cdev); ccw_device_verify_start(cdev);
return; return;
} }
callback:
switch (err) { switch (err) {
case -EOPNOTSUPP: /* path grouping not supported, just set online. */
cdev->private->options.pgroup = 0;
case 0: case 0:
ccw_device_done(cdev, DEV_STATE_ONLINE); ccw_device_done(cdev, DEV_STATE_ONLINE);
/* Deliver fake irb to device driver, if needed. */ /* Deliver fake irb to device driver, if needed. */
...@@ -586,14 +584,15 @@ ccw_device_verify_done(struct ccw_device *cdev, int err) ...@@ -586,14 +584,15 @@ ccw_device_verify_done(struct ccw_device *cdev, int err)
cdev->private->flags.donotify = 0; cdev->private->flags.donotify = 0;
ccw_device_done(cdev, DEV_STATE_BOXED); ccw_device_done(cdev, DEV_STATE_BOXED);
break; break;
case -EACCES:
/* Reset oper notify indication after verify error. */
cdev->private->flags.donotify = 0;
ccw_device_done(cdev, DEV_STATE_DISCONNECTED);
break;
default: default:
/* Reset oper notify indication after verify error. */ /* Reset oper notify indication after verify error. */
cdev->private->flags.donotify = 0; cdev->private->flags.donotify = 0;
if (cdev->online) { ccw_device_done(cdev, DEV_STATE_NOT_OPER);
ccw_device_set_timeout(cdev, 0);
dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
} else
ccw_device_done(cdev, DEV_STATE_NOT_OPER);
break; break;
} }
} }
......
...@@ -423,7 +423,7 @@ __ccw_device_verify_start(struct ccw_device *cdev) ...@@ -423,7 +423,7 @@ __ccw_device_verify_start(struct ccw_device *cdev)
/* Permanent path failure, try next. */ /* Permanent path failure, try next. */
} }
/* Done with all paths. */ /* Done with all paths. */
ccw_device_verify_done(cdev, (sch->vpm != 0) ? 0 : -ENODEV); ccw_device_verify_done(cdev, (sch->vpm != 0) ? 0 : -EACCES);
} }
/* /*
......
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