Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6fd1b3f authored by Vineeth Vijayan's avatar Vineeth Vijayan Committed by Greg Kroah-Hartman
Browse files

s390/cio: unregister device when the only path is gone



[ Upstream commit 89c0c62e947a01e7a36b54582fd9c9e346170255 ]

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: default avatarVineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0de32d3d
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1385,6 +1385,7 @@ void ccw_device_set_notoper(struct ccw_device *cdev)
enum io_sch_action {
enum io_sch_action {
	IO_SCH_UNREG,
	IO_SCH_UNREG,
	IO_SCH_ORPH_UNREG,
	IO_SCH_ORPH_UNREG,
	IO_SCH_UNREG_CDEV,
	IO_SCH_ATTACH,
	IO_SCH_ATTACH,
	IO_SCH_UNREG_ATTACH,
	IO_SCH_UNREG_ATTACH,
	IO_SCH_ORPH_ATTACH,
	IO_SCH_ORPH_ATTACH,
@@ -1417,7 +1418,7 @@ static enum io_sch_action sch_get_action(struct subchannel *sch)
	}
	}
	if ((sch->schib.pmcw.pam & sch->opm) == 0) {
	if ((sch->schib.pmcw.pam & sch->opm) == 0) {
		if (ccw_device_notify(cdev, CIO_NO_PATH) != NOTIFY_OK)
		if (ccw_device_notify(cdev, CIO_NO_PATH) != NOTIFY_OK)
			return IO_SCH_UNREG;
			return IO_SCH_UNREG_CDEV;
		return IO_SCH_DISC;
		return IO_SCH_DISC;
	}
	}
	if (device_is_disconnected(cdev))
	if (device_is_disconnected(cdev))
@@ -1479,6 +1480,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
	case IO_SCH_ORPH_ATTACH:
	case IO_SCH_ORPH_ATTACH:
		ccw_device_set_disconnected(cdev);
		ccw_device_set_disconnected(cdev);
		break;
		break;
	case IO_SCH_UNREG_CDEV:
	case IO_SCH_UNREG_ATTACH:
	case IO_SCH_UNREG_ATTACH:
	case IO_SCH_UNREG:
	case IO_SCH_UNREG:
		if (!cdev)
		if (!cdev)
@@ -1512,6 +1514,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
		if (rc)
		if (rc)
			goto out;
			goto out;
		break;
		break;
	case IO_SCH_UNREG_CDEV:
	case IO_SCH_UNREG_ATTACH:
	case IO_SCH_UNREG_ATTACH:
		spin_lock_irqsave(sch->lock, flags);
		spin_lock_irqsave(sch->lock, flags);
		if (cdev->private->flags.resuming) {
		if (cdev->private->flags.resuming) {