]> Git Repo - linux.git/commitdiff
s390/cio: dont unregister subchannel from child-drivers
authorVineeth Vijayan <[email protected]>
Sun, 25 Apr 2021 08:41:59 +0000 (10:41 +0200)
committerHeiko Carstens <[email protected]>
Tue, 31 Aug 2021 12:54:14 +0000 (14:54 +0200)
The devices owned by the parent-driver (css) was getting unregistered
from the io-subchannel driver is clearly a layering violation.
Remove the subchannel unregistration from the child-drivers.

This also means, if the device connected to the subchannel is not
operational, or not accessible, the subchannel will not be unregistered.
Instead the CIO layer will allow valid subchannels without any operational
devices in sysfs. And the userspace tooling might need to be modified to
optimally handle this new situation.

Signed-off-by: Vineeth Vijayan <[email protected]>
Reviewed-by: Peter Oberparleiter <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
drivers/s390/cio/blacklist.c
drivers/s390/cio/device.c

index 4dd2eb6348569965dc4df362e8a6a6f689976f3a..f3c656975e054ec5ce0d2ec95ab7ee7d9aae3feb 100644 (file)
@@ -262,7 +262,10 @@ static int blacklist_parse_proc_parameters(char *buf)
 
        if (strcmp("free", parm) == 0) {
                rc = blacklist_parse_parameters(buf, free, 0);
-               css_schedule_eval_all_unreg(0);
+               /* There could be subchannels without proper devices connected.
+                * evaluate all the entries
+                */
+               css_schedule_eval_all();
        } else if (strcmp("add", parm) == 0)
                rc = blacklist_parse_parameters(buf, add, 0);
        else if (strcmp("purge", parm) == 0)
index 84f659cafe7665f9ae4401a88da24d8222b55140..dcd06806ba3d3299db5f1731940edae27ec80fa4 100644 (file)
@@ -867,19 +867,6 @@ out_err:
                wake_up(&ccw_device_init_wq);
 }
 
-static void ccw_device_call_sch_unregister(struct ccw_device *cdev)
-{
-       struct subchannel *sch;
-
-       /* Get subchannel reference for local processing. */
-       if (!get_device(cdev->dev.parent))
-               return;
-       sch = to_subchannel(cdev->dev.parent);
-       css_sch_device_unregister(sch);
-       /* Release subchannel reference for local processing. */
-       put_device(&sch->dev);
-}
-
 /*
  * subchannel recognition done. Called from the state machine.
  */
@@ -1860,10 +1847,10 @@ static void ccw_device_todo(struct work_struct *work)
                        css_schedule_eval(sch->schid);
                fallthrough;
        case CDEV_TODO_UNREG:
-               if (sch_is_pseudo_sch(sch))
-                       ccw_device_unregister(cdev);
-               else
-                       ccw_device_call_sch_unregister(cdev);
+               spin_lock_irq(sch->lock);
+               sch_set_cdev(sch, NULL);
+               spin_unlock_irq(sch->lock);
+               ccw_device_unregister(cdev);
                break;
        default:
                break;
This page took 0.060771 seconds and 4 git commands to generate.