]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/cio: Purge based on the cdev's online status
authorVineeth Vijayan <vneethv@linux.ibm.com>
Tue, 28 Apr 2026 08:43:41 +0000 (10:43 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Tue, 5 May 2026 08:12:47 +0000 (10:12 +0200)
Ensure that all devices currently offline are purged correctly.

Previously, purging logic relied on the internal FSM state to
determine whether a device was offline. However, devices with a
target state of offline could be skipped if CIO internal
processing was still ongoing during the purge operation.

Update the purge decision logic to rely on the online variable
in the cdev structure instead of the internal FSM state,
providing a more reliable indication of actual device
availability.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
drivers/s390/cio/device.c

index 5bbb112b1619abbe7f49765ee4ac1f941d341f0a..fb591118ecb2aeb0753831d16dadd9bdc0c4127a 100644 (file)
@@ -1328,7 +1328,7 @@ static int purge_fn(struct subchannel *sch, void *data)
 
        cdev = sch_get_cdev(sch);
        if (cdev) {
-               if (cdev->private->state != DEV_STATE_OFFLINE)
+               if (cdev->online)
                        goto unlock;
 
                if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0)