On Sat, 21 Apr 2007, Julien BLACHE wrote:

> Brad Sawatzky <[EMAIL PROTECTED]> wrote:
> 
> > Changing the line to
> >   SUBSYSTEM!="usb_endpoint", GOTO="libsane_rules_end"
> > allows the rule to match and fixes the problem for me.
> >
> > I assume that this is a change in how kernel 2.6.20.7 reports this device?
> > I've attached a udevinfo dump for the curious.
> 
> OK, looks like udev changed again... gotta love this.
> 
> Can you unplug your scanner, run udevmonitor (as root), plug it in and
> send me the output ?

Alright.  Now I'm confused...

The scanner now works correctly with the original rule:
   SUBSYSTEM!="usb_device", GOTO="libsane_rules_end"
and not with the 'usb_endpoint' rule...

I don't understand what's changed.  When I last debugged this I got the
scanner to work using
  % chgrp scanner /dev/usbdev3.4_ep*
where /dev/usbdev3.4_ep* are the devices generated by udev for the scanner.
(With the original rule they are created with user:group = root:root.)
If I changed the group back to 'root' then saned would fail.  This was
tested several times.  The modified 'usb_endpoint' rule allowed those
devices to be created with the scanner group and the problem was fixed -- I
thought.


Now I try it this afternoon and it no longer works.  Examination with
'lsof' showed saned was trying to open /dev/bus/usb/003/004 and failed.
The 'usb_endpoint' version of the rule doesn't match for that node so it
was created with the 'root' group and saned failed with a permission error.

Changing the udev rule back to the original version (SUBSYSTEM!="usb_device")
causes udev to create the /dev/bus/usb/003/004 node with group 'scanner'
(and the /dev/usbdev3.4_ep* devices with group 'root').  saned apparently
doesn't care about the /dev/usbdev3.4_ep* devs (now?) so it works...
Unfortunately I didn't run lsof in my earlier debugging effort so I guess
don't know for certain what device was ultimately being opened at that
time.

The original rule continues to work after several unplug/plugin cycles and
a reboot.  At the moment I have to assume I screwed up my earlier analysis
and the original rule is correct.

Is it possible for the autoprobed scanner device to be indeterminate?  The
CX6600 is a multifunction printer/scanner unit with built-in card reader so
many different devices are created when it's plugged in -- could there be
some weird race condition?  Arrgh.

Feel free to close the bug.  If it happens again I'll do some more thorough
tests.

FWIW, I've attached the udevmonitor output you requested.  It probably
isn't very interesting anymore.

-- Brad
-----------
## udevmonitor output for Epson CX6600 under kernel 2.6.20.7 ##
-----------

udevmonitor prints the received event from the kernel [UEVENT]
and the event which udev sends out after rule processing [UDEV]

UEVENT[1177190375.848031] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4
UEVENT[1177190375.848123] add@/class/usb_endpoint/usbdev3.6_ep00
UEVENT[1177190375.848608] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.0
UEVENT[1177190375.849082] add@/class/usb_endpoint/usbdev3.6_ep01
UEVENT[1177190375.849103] add@/class/usb_endpoint/usbdev3.6_ep82
UEVENT[1177190375.849114] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.1
UEVENT[1177190375.849480] add@/class/usb_endpoint/usbdev3.6_ep04
UEVENT[1177190375.849496] add@/class/usb_endpoint/usbdev3.6_ep85
UDEV  [1177190375.856662] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4
UDEV  [1177190375.868321] add@/class/usb_endpoint/usbdev3.6_ep00
UDEV  [1177190375.880210] add@/class/usb_endpoint/usbdev3.6_ep01
UDEV  [1177190375.892093] add@/class/usb_endpoint/usbdev3.6_ep82
UDEV  [1177190375.907295] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.0
UDEV  [1177190375.911890] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.1
UDEV  [1177190375.920133] add@/class/usb_endpoint/usbdev3.6_ep04
UDEV  [1177190375.923739] add@/class/usb_endpoint/usbdev3.6_ep85
UEVENT[1177190380.847810] add@/class/usb/lp0
UEVENT[1177190380.847864] remove@/class/usb_endpoint/usbdev3.6_ep04
UEVENT[1177190380.847876] remove@/class/usb_endpoint/usbdev3.6_ep85
UEVENT[1177190380.848139] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.2
UEVENT[1177190380.848154] add@/class/scsi_host/host2
UEVENT[1177190380.848164] add@/class/usb_endpoint/usbdev3.6_ep07
UEVENT[1177190380.848174] add@/class/usb_endpoint/usbdev3.6_ep88
UEVENT[1177190380.848184] add@/class/usb_device/usbdev3.6
UDEV  [1177190380.867483] remove@/class/usb_endpoint/usbdev3.6_ep04
UDEV  [1177190380.868897] remove@/class/usb_endpoint/usbdev3.6_ep85
UDEV  [1177190380.870578] add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.2
UDEV  [1177190380.908789] add@/class/usb/lp0
UDEV  [1177190380.929759] add@/class/usb_endpoint/usbdev3.6_ep07
UDEV  [1177190380.938513] add@/class/usb_endpoint/usbdev3.6_ep88
UDEV  [1177190380.940261] add@/class/scsi_host/host2
UDEV  [1177190381.007999] add@/class/usb_device/usbdev3.6
UEVENT[1177190385.849832] 
add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.2/host2/target2:0:0/2:0:0:0
UEVENT[1177190385.849898] add@/class/scsi_disk/2:0:0:0
UEVENT[1177190385.851775] add@/block/sdc
UEVENT[1177190385.851814] add@/class/scsi_device/2:0:0:0
UDEV  [1177190385.853679] 
add@/devices/pci0000:00/0000:00:09.2/usb3/3-4/3-4:1.2/host2/target2:0:0/2:0:0:0
UDEV  [1177190385.856859] add@/class/scsi_disk/2:0:0:0
UDEV  [1177190385.885263] add@/class/scsi_device/2:0:0:0
UDEV  [1177190385.929670] add@/block/sdc

Reply via email to