Skip to contentSkip to conversation

s390/cio: Remove the invalid condition on IO_SCH_UNREG

PATCH In review Vineeth Vijayan 4 participants 4 messages Apr 23, 2021 – Apr 26, 2021

Subsystems (2)
lore
Share & tools
lore

Vineeth Vijayan

author maintainer
#0 lore raw

PATCH 1/1 s390/cio: Remove the invalid condition on IO_SCH_UNREG

The condition to check the cdev pointer validity on css_sch_device_unregister() is a leftover from the 'commit c97cd8c81d4a ("s390/cio: Remove pm support from ccw bus driver")'. This could lead to a situation, where detaching the disk is not happening completely. Remove this invalid condition in the IO_SCH_UNREG case.

Fixes 8cc0dcfdc1c0 ("s390/cio: remove pm support from ccw bus driver")
---
 drivers/s390/cio/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/cio/device.c +1 -2
index 3f026021e95e..84f659cafe76 100644
@@ -1532,8 +1532,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
 	switch (action) {
 	case IO_SCH_ORPH_UNREG:
 	case IO_SCH_UNREG:
-		if (!cdev)
-			css_sch_device_unregister(sch);
+		css_sch_device_unregister(sch);
 		break;
 	case IO_SCH_ORPH_ATTACH:
 	case IO_SCH_UNREG_ATTACH:
Signature · 1 line
2.25.1
Tested-by on v1 1/1
#1 lore raw
Quoted 4 lines · Vineeth Vijayan

The condition to check the cdev pointer validity on css_sch_device_unregister() is a leftover from the 'commit c97cd8c81d4a ("s390/cio: Remove pm support from ccw bus driver")'. This could lead to a situation, where detaching the disk is not happening completely. Remove

s/disk/device

Quoted 5 lines

this invalid condition in the IO_SCH_UNREG case.

Fixes 8cc0dcfdc1c0 ("s390/cio: remove pm support from ccw bus driver")

Thanks! This seems to fix the hot-unplug troubles with qeth devices.

Quoted 21 lines
---
 drivers/s390/cio/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/cio/device.c +1 -2
index 3f026021e95e..84f659cafe76 100644
@@ -1532,8 +1532,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
 	switch (action) {
 	case IO_SCH_ORPH_UNREG:
 	case IO_SCH_UNREG:
-		if (!cdev)
-			css_sch_device_unregister(sch);
+		css_sch_device_unregister(sch);
 		break;
 	case IO_SCH_ORPH_ATTACH:
 	case IO_SCH_UNREG_ATTACH:
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Vineeth Vijayan
Quoted 4 lines · Vineeth Vijayan

The condition to check the cdev pointer validity on css_sch_device_unregister() is a leftover from the 'commit c97cd8c81d4a ("s390/cio: Remove pm support from ccw bus driver")'. This could lead to a situation, where detaching the disk is not happening completely. Remove

This applies to all devices types, not just disks. So replace "disk" with either "device" or "subchannel".

Quoted 7 lines

this invalid condition in the IO_SCH_UNREG case.

Fixes 8cc0dcfdc1c0 ("s390/cio: remove pm support from ccw bus driver")
Signature · 2 lines
Peter Oberparleiter
Linux on Z Development - IBM Germany
#3 lore raw
In reply to Vineeth Vijayan
Quoted 10 lines · Vineeth Vijayan

The condition to check the cdev pointer validity on css_sch_device_unregister() is a leftover from the 'commit c97cd8c81d4a ("s390/cio: Remove pm support from ccw bus driver")'. This could lead to a situation, where detaching the disk is not happening completely. Remove this invalid condition in the IO_SCH_UNREG case.

Fixes 8cc0dcfdc1c0 ("s390/cio: remove pm support from ccw bus driver")

Thanks, and if you want for a hattrick now also
Tested-by Christian Ehrhardt <[email protected]>

Quoted 23 lines
---
 drivers/s390/cio/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/cio/device.c +1 -3
index 3f026021e95e..84f659cafe76 100644
@@ -1532,8 +1532,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
        switch (action) {
        case IO_SCH_ORPH_UNREG:
        case IO_SCH_UNREG:
-               if (!cdev)
-                       css_sch_device_unregister(sch);
+               css_sch_device_unregister(sch);
                break;
        case IO_SCH_ORPH_ATTACH:
        case IO_SCH_UNREG_ATTACH:
--

2.25.1

Signature · 3 lines
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd