如何防止添加/删除 udev 循环

如何防止添加/删除 udev 循环

我想在 udoo(某种树莓板)上使用 midi 键盘(eagletone tinykey)。插入设备时,无法正确设置。

做一个

udevadm monitor

显示了一种添加/删除循环:

KERNEL[1174.215632] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1 (usb)
KERNEL[1174.218337] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0 (usb)
KERNEL[1174.222021] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2 (sound)
KERNEL[1174.222417] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/midiC2D0 (sound)
KERNEL[1174.222708] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/midi2 (sound)
KERNEL[1174.223329] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/dmmidi2 (sound)
KERNEL[1174.223700] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/controlC2 (sound)
KERNEL[1174.224050] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1 (usb)
KERNEL[1174.225644] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/midi2 (sound)
KERNEL[1174.226290] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/dmmidi2 (sound)
KERNEL[1174.226739] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/midiC2D0 (sound)
KERNEL[1174.227161] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/controlC2 (sound)
KERNEL[1174.227637] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2 (sound)
KERNEL[1174.227889] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0 (usb)
KERNEL[1174.228311] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1 (usb)
KERNEL[1174.229425] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1 (usb)
UDEV  [1174.232087] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1 (usb)
UDEV  [1174.238406] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0 (usb)
UDEV  [1174.242659] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1 (usb)
UDEV  [1174.243523] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2 (sound)
UDEV  [1174.244195] remove   /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.1 (usb)
UDEV  [1174.253150] add      /devices/soc0/soc.0/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.1/1-1.1:1.0/sound/card2/midi2 (sound)
...

在桌面系统 ubuntu 上,我几个月前观察到了同样的问题,现在已经解决了(可能是通过更新),设备在不到 2 秒的时间内就设置好了。

lsusb 

在我的桌面上提取:

Bus 003 Device 004: ID 0218:0401 Hangzhou Worlde 

有什么建议来解决此类问题吗?我想知道答案是否是修改一些 udev 规则,或者修改内核中的更多规则,甚至修改一些初始化脚本?

相关内容