ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
63 stars 60 forks source link

vmur devices fail to enable on boot, missing driver stanzas in udev rules #37

Closed xnox closed 5 years ago

xnox commented 5 years ago
$ sudo chzdev -e 000c 000d 000e
$ sudo update-initramfs -u
$ sudo reboot
$ lszdev # 000c 000d 000e are not active
$ sudo systemctl restart systemd-udev-trigger # onlines the missing devices, as vmur module is loaded now

vmur devices such as 000c, 000d, 000e are treated as generic_ccw_subtype devices by zdev. This leads to generating stock udev rules that are only triggered upon devices additions.

The rules are not triggered when a vmur driver is bound to them.

Typically on Ubuntu systems, vmur driver is loaded after systemd-udev-trigger.service is already inflight, and thus 000c, 000d, 000e are not activated on boot.

However, adding

ACTION=="add", SUBSYSTEM=="drivers", KERNEL=="vmur", TEST=="[ccw/0.0.000c]", GOTO="cfg_generic_ccw_0.0.000c"`

Just before GOTO="end_ makes the device be activated.

I'm not sure if we want to create a new vmur subtype in zdev, or somehow extend generic_ccw_subtype to inject vmur data instead of &generic_ccw_data.

Ubuntu bug report is: https://bugs.launchpad.net/ubuntu-z-systems/+bug/1794308

xnox commented 5 years ago

I think vmur devices need to become either a top level type, or a subtype of generic. Getting a bit lost in the code, as to where it is the easiest to override this.

hoeppnerj commented 5 years ago

@oberpar and @hbrueckner can you guys have a look at it?

oberpar commented 5 years ago

A new subtype for vmur seems like overkill to me (and would need to be repeated for every other generic-ccw device type).

I can think of an easy way to handle this within the existing generic-ccw subtype:

This will result in a udev rule that will try to enable the device whenever any driver is loaded. There are some side-effects:

I'm not sure when I will get to work on implementing this approach though.

xnox commented 5 years ago

That's a good and easy start. Plus I hope that generic_ccw devices are not that many / are not typical to have enabled like that.

Also, if we are on the system and onlining the device, should we not attempt to read the actual driver with ccw_get_driver() and encode whatever that says?

xnox commented 5 years ago

ehm.... doesn't all of the above simply then reduces to simply setting generic_ccw_data.ccwdrv = "*" without a need to actually add the any_driver bool.