Skip to content

Commit 2297791

Browse files
vneethvhcahca
authored andcommitted
s390/cio: dont unregister subchannel from child-drivers
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 <vneethv@linux.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
1 parent c7a5238 commit 2297791

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

drivers/s390/cio/blacklist.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@ static int blacklist_parse_proc_parameters(char *buf)
262262

263263
if (strcmp("free", parm) == 0) {
264264
rc = blacklist_parse_parameters(buf, free, 0);
265-
css_schedule_eval_all_unreg(0);
265+
/* There could be subchannels without proper devices connected.
266+
* evaluate all the entries
267+
*/
268+
css_schedule_eval_all();
266269
} else if (strcmp("add", parm) == 0)
267270
rc = blacklist_parse_parameters(buf, add, 0);
268271
else if (strcmp("purge", parm) == 0)

drivers/s390/cio/device.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -867,19 +867,6 @@ static void io_subchannel_register(struct ccw_device *cdev)
867867
wake_up(&ccw_device_init_wq);
868868
}
869869

870-
static void ccw_device_call_sch_unregister(struct ccw_device *cdev)
871-
{
872-
struct subchannel *sch;
873-
874-
/* Get subchannel reference for local processing. */
875-
if (!get_device(cdev->dev.parent))
876-
return;
877-
sch = to_subchannel(cdev->dev.parent);
878-
css_sch_device_unregister(sch);
879-
/* Release subchannel reference for local processing. */
880-
put_device(&sch->dev);
881-
}
882-
883870
/*
884871
* subchannel recognition done. Called from the state machine.
885872
*/
@@ -1860,10 +1847,10 @@ static void ccw_device_todo(struct work_struct *work)
18601847
css_schedule_eval(sch->schid);
18611848
fallthrough;
18621849
case CDEV_TODO_UNREG:
1863-
if (sch_is_pseudo_sch(sch))
1864-
ccw_device_unregister(cdev);
1865-
else
1866-
ccw_device_call_sch_unregister(cdev);
1850+
spin_lock_irq(sch->lock);
1851+
sch_set_cdev(sch, NULL);
1852+
spin_unlock_irq(sch->lock);
1853+
ccw_device_unregister(cdev);
18671854
break;
18681855
default:
18691856
break;

0 commit comments

Comments
 (0)