从 Fedora 换到 Debian 后,我无法通过热插拔连接 Casio EX-ZR700 相机。我希望像往常一样看到大容量存储设备的分区。但是有一个 USB 连接和断开循环。
[20558.913275] usb 6-4: new high-speed USB device number 26 using ehci-pci
[20559.071692] usb 6-4: New USB device found, idVendor=07cf, idProduct=117a, bcdDevice=10.00
[20559.071696] usb 6-4: New USB device strings: Mfr=1, Product=2, SerialNumber=4
[20559.071698] usb 6-4: Product: CASIO QV DIGITAL
[20559.071700] usb 6-4: Manufacturer: CASIO COMPUTER
[20559.071702] usb 6-4: SerialNumber: 1013651216023336
[20559.072266] usb-storage 6-4:1.0: USB Mass Storage device detected
[20559.077593] scsi host4: usb-storage 6-4:1.0
[20560.101966] scsi 4:0:0:0: Direct-Access CASIO DIGITAL_CAMERA 1.00 PQ: 0 ANSI: 0 CCS
[20560.103246] sd 4:0:0:0: Attached scsi generic sg2 type 0
[20560.103957] sd 4:0:0:0: [sdb] 60874752 512-byte logical blocks: (31.2 GB/29.0 GiB)
[20560.104668] sd 4:0:0:0: [sdb] Write Protect is off
[20560.104671] sd 4:0:0:0: [sdb] Mode Sense: 00 46 02 00
[20560.109562] sd 4:0:0:0: [sdb] No Caching mode page found
[20560.109568] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[20560.116609] sdb: sdb1
[20560.121257] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[20570.863660] usb-storage 6-4:1.0: USB Mass Storage device detected
[20570.863979] scsi host4: usb-storage 6-4:1.0
[20602.833249] usb 6-4: reset high-speed USB device number 26 using ehci-pci
[20603.605440] usb 6-4: USB disconnect, device number 26
[20740.257338] usb 6-4: new high-speed USB device number 27 using ehci-pci
[20740.418600] usb 6-4: New USB device found, idVendor=07cf, idProduct=117a, bcdDevice=10.00
[20740.418606] usb 6-4: New USB device strings: Mfr=1, Product=2, SerialNumber=4
[20740.418609] usb 6-4: Product: CASIO QV DIGITAL
[20740.418612] usb 6-4: Manufacturer: CASIO COMPUTER
[20740.418614] usb 6-4: SerialNumber: 1013651216023336
[20740.420074] usb-storage 6-4:1.0: USB Mass Storage device detected
[20740.427342] scsi host4: usb-storage 6-4:1.0
[20741.445843] scsi 4:0:0:0: Direct-Access CASIO DIGITAL_CAMERA 1.00 PQ: 0 ANSI: 0 CCS
[20741.446985] sd 4:0:0:0: Attached scsi generic sg2 type 0
[20741.447736] sd 4:0:0:0: [sdb] 60874752 512-byte logical blocks: (31.2 GB/29.0 GiB)
[20741.448313] sd 4:0:0:0: [sdb] Write Protect is off
[20741.448315] sd 4:0:0:0: [sdb] Mode Sense: 00 46 02 00
[20741.448942] sd 4:0:0:0: [sdb] No Caching mode page found
[20741.448948] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[20741.456965] sdb: sdb1
[20741.462199] sd 4:0:0:0: [sdb] Attached SCSI removable disk
[20749.783725] usb-storage 6-4:1.0: USB Mass Storage device detected
[20749.784035] scsi host4: usb-storage 6-4:1.0
[20781.777274] usb 6-4: reset high-speed USB device number 27 using ehci-pci
[20782.549420] usb 6-4: USB disconnect, device number 27
我尝试在 /etc/udev/rules.d/57-photo.rules 插入一条包含...的 udev 规则
KERNEL=="sd?1", SUBSYSTEMS=="scsi", ATTR{idProduct}=="117a", ATTR{idVendor}=="07cf", NAME="Casio EX-ZR700"
但什么都没有改变。我的错误在哪里?
这是设备信息...
udevadm 信息 -a -p /设备/pci0000:00/0000:00:1d.7/usb6/6-4
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '//devices/pci0000:00/0000:00:1d.7/usb6/6-4':
KERNEL=="6-4"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{devnum}=="48"
ATTR{removable}=="removable"
ATTR{bDeviceClass}=="00"
ATTR{bDeviceSubClass}=="00"
ATTR{bNumInterfaces}==" 1"
ATTR{bmAttributes}=="80"
ATTR{bDeviceProtocol}=="00"
ATTR{product}=="CASIO QV DIGITAL"
ATTR{idVendor}=="07cf"
ATTR{bMaxPacketSize0}=="64"
ATTR{serial}=="1013651216023336"
ATTR{configuration}==""
ATTR{rx_lanes}=="1"
ATTR{tx_lanes}=="1"
ATTR{bConfigurationValue}=="1"
ATTR{authorized}=="1"
ATTR{urbnum}=="79"
ATTR{bNumConfigurations}=="2"
ATTR{idProduct}=="117a"
ATTR{quirks}=="0x0"
ATTR{bcdDevice}=="1000"
ATTR{version}==" 2.00"
ATTR{ltm_capable}=="no"
ATTR{bMaxPower}=="500mA"
ATTR{devpath}=="4"
ATTR{speed}=="480"
ATTR{maxchild}=="0"
ATTR{manufacturer}=="CASIO COMPUTER"
ATTR{busnum}=="6"
ATTR{avoid_reset_quirk}=="0"
looking at parent device '//devices/pci0000:00/0000:00:1d.7/usb6':
KERNELS=="usb6"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{product}=="EHCI Host Controller"
ATTRS{maxchild}=="6"
ATTRS{bcdDevice}=="0419"
ATTRS{interface_authorized_default}=="1"
ATTRS{version}==" 2.00"
ATTRS{removable}=="unknown"
ATTRS{busnum}=="6"
ATTRS{quirks}=="0x0"
ATTRS{devpath}=="0"
ATTRS{authorized_default}=="1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bNumConfigurations}=="1"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devnum}=="1"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceSubClass}=="00"
ATTRS{configuration}==""
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bDeviceClass}=="09"
ATTRS{ltm_capable}=="no"
ATTRS{rx_lanes}=="1"
ATTRS{urbnum}=="1538"
ATTRS{serial}=="0000:00:1d.7"
ATTRS{bmAttributes}=="e0"
ATTRS{bMaxPower}=="0mA"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{tx_lanes}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{manufacturer}=="Linux 4.19.0-18-amd64 ehci_hcd"
ATTRS{authorized}=="1"
looking at parent device '//devices/pci0000:00/0000:00:1d.7':
KERNELS=="0000:00:1d.7"
SUBSYSTEMS=="pci"
DRIVERS=="ehci-pci"
ATTRS{local_cpulist}=="0-1"
ATTRS{class}=="0x0c0320"
ATTRS{revision}=="0x03"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{uframe_periodic_max}=="100"
ATTRS{d3cold_allowed}=="1"
ATTRS{irq}=="23"
ATTRS{ari_enabled}=="0"
ATTRS{msi_bus}=="1"
ATTRS{vendor}=="0x8086"
ATTRS{dma_mask_bits}=="32"
ATTRS{numa_node}=="-1"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{local_cpus}=="3"
ATTRS{subsystem_vendor}=="0x1043"
ATTRS{companion}==""
ATTRS{driver_override}=="(null)"
ATTRS{device}=="0x293a"
ATTRS{subsystem_device}=="0x1867"
looking at parent device '//devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
答案1
部分答案:
您的设备已被检测到两次(一次是在 20559,一次是在 10 秒后,中间没有错误消息或分离消息)。我认为这会导致问题,然后导致重置,从而导致循环。
因此,问题是找出系统中配置错误的地方,以便获得两个检测结果。使用本网站上的问答很难进行远程调试,但您可以udevd
手动重新启动udevd --debug-trace --verbose
,以便了解发生了什么。
日志摘录:
Oct 20 14:05:24 defi systemd-udevd[267]: target4:0:0: Device (SEQNUM=3294, ACTION=add) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: 4:0:0:0: Device (SEQNUM=3295, ACTION=add) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: 4:0:0:0: Device (SEQNUM=3296, ACTION=add) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: 4:0:0:0: Device (SEQNUM=3297, ACTION=bind) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: 4:0:0:0: Device (SEQNUM=3298, ACTION=add) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: sg2: Device (SEQNUM=3299, ACTION=add) is queued
Oct 20 14:05:24 defi kernel: scsi 4:0:0:0: Direct-Access CASIO DIGITAL_CAMERA 1.00 PQ: 0 ANSI: 0 CCS
Oct 20 14:05:24 defi kernel: sd 4:0:0:0: Attached scsi generic sg2 type 0
Oct 20 14:05:24 defi systemd-udevd[267]: 4:0:0:0: Device (SEQNUM=3300, ACTION=add) is queued
Oct 20 14:05:24 defi kernel: sd 4:0:0:0: [sdb] 60874752 512-byte logical blocks: (31.2 GB/29.0 GiB)
Oct 20 14:05:24 defi kernel: sd 4:0:0:0: [sdb] Write Protect is off
Oct 20 14:05:24 defi kernel: sd 4:0:0:0: [sdb] Mode Sense: 00 46 02 00
Oct 20 14:05:24 defi kernel: sd 4:0:0:0: [sdb] No Caching mode page found
Oct 20 14:05:24 defi kernel: sd 4:0:0:0: [sdb] Assuming drive cache: write through
Oct 20 14:05:24 defi systemd-udevd[267]: 8:16: Device (SEQNUM=3301, ACTION=add) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: Successfully forked off 'n/a' as PID 2992.
Oct 20 14:05:24 defi systemd-udevd[267]: 8:16: Worker [2992] is forked for processing SEQNUM=3301.
Oct 20 14:05:24 defi systemd-udevd[2992]: 8:16: Processing device (SEQNUM=3301, ACTION=add)
Oct 20 14:05:24 defi systemd-udevd[2992]: 8:16: Device (SEQNUM=3301, ACTION=add) processed
Oct 20 14:05:24 defi systemd-udevd[2992]: 8:16: sd-device-monitor: Passed 140 byte to netlink monitor
Oct 20 14:05:24 defi kernel: sdb: sdb1
Oct 20 14:05:24 defi systemd-udevd[267]: sdb: Device (SEQNUM=3302, ACTION=add) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: sdb1: Device (SEQNUM=3303, ACTION=add) is queued
Oct 20 14:05:24 defi kernel: sd 4:0:0:0: [sdb] Attached SCSI removable disk
Oct 20 14:05:24 defi systemd-udevd[1721]: Process 'lmt-udev force' succeeded.
Oct 20 14:05:24 defi systemd-udevd[1721]: 6-4: Device (SEQNUM=3288, ACTION=add) processed
Oct 20 14:05:24 defi systemd-udevd[1721]: 6-4: sd-device-monitor: Passed 844 byte to netlink monitor
Oct 20 14:05:24 defi systemd-udevd[267]: 6-4:1.0: sd-device-monitor: Passed 295 byte to netlink monitor
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: Processing device (SEQNUM=3289, ACTION=add)
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/50-udev-default.rules:14
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: IMPORT builtin 'usb_id' /usr/lib/udev/rules.d/60-libgphoto2-6.rules:9
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: Failed to access usb_interface: No such file or directory
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: IMPORT builtin 'usb_id' fails: No such file or directory
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: RUN 'kmod load $env{MODALIAS}' /usr/lib/udev/rules.d/80-drivers.rules:5
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: RUN 'lmt-udev force' /usr/lib/udev/rules.d/99-laptop-mode.rules:3
Oct 20 14:05:24 defi systemd-udevd[2992]: 6-4:1.0: sd-device: Created db file '/run/udev/data/+usb:6-4:1.0' for '/devices/pci0000:00/0000:00:1d.7/usb6/6-4/6-4:1.0'
Oct 20 14:05:24 defi systemd-udevd[2992]: Loading module: usb:v07CFp117Ad1000dc00dsc00dp00ic08isc05ip50in00
Oct 20 14:05:24 defi systemd-udevd[2992]: Module 'usb_storage' is already loaded
Oct 20 14:05:24 defi systemd-udevd[2992]: Starting 'lmt-udev force'
Oct 20 14:05:24 defi systemd-udevd[2992]: Successfully forked off '(spawn)' as PID 3275.
Oct 20 14:05:24 defi systemd-udevd[267]: 4:0:0:0: Device (SEQNUM=3304, ACTION=remove) is queued
Oct 20 14:05:24 defi systemd-udevd[267]: sg2: Device (SEQNUM=3305, ACTION=remove) is queued
因此,您可以看到附加工作正常,然后在日志提取结束时,它决定再次移除设备。在此之前我唯一能看到的是,usb_id
由于不可用而失败usb_interface
,然后它开始重新加载模块。这可能触发了移除。
向 udev 开发人员提交一个错误,看看他们是否知道这里发生了什么。