[SRU][J][PATCH 1/1] s390/cio: derive cdev information only for IO-subchannels

frank.heimes at canonical.com frank.heimes at canonical.com
Thu Jul 7 16:23:13 UTC 2022


From: Vineeth Vijayan <vneethv at linux.ibm.com>

BugLink: https://bugs.launchpad.net/bugs/1980951

cdev->online for the purge function must not be checked for the
non-IO subchannel type. Make sure that we are deriving the cdev only
from sch-type SUBCHANNEL_TYPE_IO.

Signed-off-by: Vineeth Vijayan <vneethv at linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar at linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor at linux.ibm.com>
(cherry picked from commit 0c3812c347bfb0dc213556a195e79850c55702f5)
Signed-off-by: Frank Heimes <frank.heimes at canonical.com>
---
 drivers/s390/cio/css.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index c27809792609..ce9e7517430f 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -792,10 +792,13 @@ static int __unset_online(struct device *dev, void *data)
 {
 	struct idset *set = data;
 	struct subchannel *sch = to_subchannel(dev);
-	struct ccw_device *cdev = sch_get_cdev(sch);
+	struct ccw_device *cdev;
 
-	if (cdev && cdev->online)
-		idset_sch_del(set, sch->schid);
+	if (sch->st == SUBCHANNEL_TYPE_IO) {
+		cdev = sch_get_cdev(sch);
+		if (cdev && cdev->online)
+			idset_sch_del(set, sch->schid);
+	}
 
 	return 0;
 }
-- 
2.25.1




More information about the kernel-team mailing list