Skip to content

Commit 89c0c62

Browse files
vneethvAlexander Gordeev
authored andcommitted
s390/cio: unregister device when the only path is gone
Currently, if the device is offline and all the channel paths are either configured or varied offline, the associated subchannel gets unregistered. Don't unregister the subchannel, instead unregister offline device. Signed-off-by: Vineeth Vijayan <[email protected]> Reviewed-by: Peter Oberparleiter <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 0f1cbf9 commit 89c0c62

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/s390/cio/device.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,7 @@ void ccw_device_set_notoper(struct ccw_device *cdev)
13761376
enum io_sch_action {
13771377
IO_SCH_UNREG,
13781378
IO_SCH_ORPH_UNREG,
1379+
IO_SCH_UNREG_CDEV,
13791380
IO_SCH_ATTACH,
13801381
IO_SCH_UNREG_ATTACH,
13811382
IO_SCH_ORPH_ATTACH,
@@ -1408,7 +1409,7 @@ static enum io_sch_action sch_get_action(struct subchannel *sch)
14081409
}
14091410
if ((sch->schib.pmcw.pam & sch->opm) == 0) {
14101411
if (ccw_device_notify(cdev, CIO_NO_PATH) != NOTIFY_OK)
1411-
return IO_SCH_UNREG;
1412+
return IO_SCH_UNREG_CDEV;
14121413
return IO_SCH_DISC;
14131414
}
14141415
if (device_is_disconnected(cdev))
@@ -1470,6 +1471,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
14701471
case IO_SCH_ORPH_ATTACH:
14711472
ccw_device_set_disconnected(cdev);
14721473
break;
1474+
case IO_SCH_UNREG_CDEV:
14731475
case IO_SCH_UNREG_ATTACH:
14741476
case IO_SCH_UNREG:
14751477
if (!cdev)
@@ -1503,6 +1505,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
15031505
if (rc)
15041506
goto out;
15051507
break;
1508+
case IO_SCH_UNREG_CDEV:
15061509
case IO_SCH_UNREG_ATTACH:
15071510
spin_lock_irqsave(sch->lock, flags);
15081511
sch_set_cdev(sch, NULL);

0 commit comments

Comments
 (0)