Re: [Libusb-devel] libusb silently ignores permission errors

"Xiaofan Chen" <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.comp.lib.libusb.devel.general
Message-ID <[email protected]>
Add linux-usb-devel in CC. Hopefully this is ok.
Problem: USBview can see the device but not libusb/lsusb.

On 9/22/07, Xiaofan Chen <[email protected]> wrote:
> > Just yesterday I tried the PICDEM FS USB bootloader under
> > Ubuntu 7.04 and it is not working well under it. dmesg shows
> > the device but lsusb does not show it.
> >
> > So I am thinking that there is a problem with the Debian kernel
> > which Ubuntu kernel is based on. I have also saw similar report
> > on the Microchip forum. The same device works fine under the
> > older Ubuntu 6.06. I also heard that Debian Sid users suffer the
> > same problem.
> > http://forum.microchip.com/tm.aspx?m=283378
> >
> > I then tried Greg KH's USBView and it actually list the device.
> > Strange. Maybe you can try USBView and see if it actually helps.
> > http://www.kroah.com/linux/usb/
> >
> > USBView is available for many distributions including Ubuntu.
> > It seem to me that it does not use libusb.
>
> More details on Ubuntu 7.04:
> mcuee@mcuee-desktop:~$ sudo lsusb (same result without sudo)
> Bus 003 Device 001: ID 0000:0000
> Bus 002 Device 001: ID 0000:0000
> Bus 001 Device 001: ID 0000:0000
>
> mcuee@mcuee-desktop:~$ dmesg | tail
> [  920.824000] usb 2-1: new full speed USB device using ohci_hcd and address 24
> [  921.040000] usb 2-1: configuration #1 chosen from 1 choice
>
> mcuee@mcuee-desktop:~$ ls -la /dev/bus/usb/002/024
> crw-rw-r-- 1 root root 189, 151 2007-09-22 11:01 /dev/bus/usb/002/024
>
> mcuee@mcuee-desktop:~$ cat /proc/bus/usb/devices
> <only the 04d8:000b usb device is shown here>
> T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 23 Spd=12  MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=04d8 ProdID=000b Rev= 0.00
> C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
> I:  If#= 0 Alt= 0 #EPs= 2 Cls=00(>ifc ) Sub=00 Prot=00 Driver=(none)
> E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>
> USBView output for the PICDEM FS USB bootlaoder:
> Oops I can not copy paste from  USBview.
> Maybe a console version of USBview can replace lsusb very well.
>
> And from this experience, it seems to me that the OP does have a point.
> But I am still think Debian kernel has something to do with this. It randomly
> disconnects the bootloader device.
>
> mcuee@mcuee-desktop:~$ uname -a
> Linux mcuee-desktop 2.6.20-16-generic #2 SMP Fri Aug 31 00:55:27 UTC
> 2007 i686 GNU/Linux
>
> And this has nothing to do with udev. I set up the correct udev rule
> and unplug and
> plug in the device again.
>
> mcuee@mcuee-desktop:~$ dmesg | tail
> [  523.424000] usb 2-1: configuration #1 chosen from 1 choice
> [  920.644000] usb 2-1: USB disconnect, address 23
> [  920.824000] usb 2-1: new full speed USB device using ohci_hcd and address 24
> [  921.040000] usb 2-1: configuration #1 chosen from 1 choice
> [ 1430.328000] usb 2-1: USB disconnect, address 24
> [ 1437.640000] usb 2-1: new full speed USB device using ohci_hcd and address 25
> [ 1437.848000] usb 2-1: configuration #1 chosen from 1 choice
> [ 1450.116000] usb 2-1: USB disconnect, address 25
> [ 1450.360000] usb 2-1: new full speed USB device using ohci_hcd and address 26
> [ 1450.572000] usb 2-1: configuration #1 chosen from 1 choice
>
> mcuee@mcuee-desktop:~$ ls -la /dev/bus/usb/002/026
> crw-rw-r-- 1 root microchip 189, 153 2007-09-22 11:10 /dev/bus/usb/002/026
> mcuee@mcuee-desktop:~$ groups mcuee
> mcuee : mcuee adm dialout cdrom floppy audio dip video plugdev lpadmin
> scanner admin microchip
>
> mcuee@mcuee-desktop:~$ lsusb
> Bus 003 Device 001: ID 0000:0000
> Bus 002 Device 001: ID 0000:0000
> Bus 001 Device 001: ID 0000:0000
>
> And USBview still can see the device.
>
> Now I am thinking this is not a lsusb problem, not a usb kernel problem
> but a Debian/ubuntu problem.
>

Hmm, I built a new kernel 2.6.22.7 from kernel.org and the problem
remains. So maybe this is still a libusb/lsusb problem. I will dig further.

For lsusb replacement, I think a console version of usbview will do.
However I can not get the bootloader host application to work
since libusb does not see the device.

mcuee@mcuee-desktop:~$ uname -a
Linux mcuee-desktop 2.6.22.7 #1 SMP Sat Sep 22 22:40:02 SGT 2007 i686 GNU/Linux
mcuee@mcuee-desktop:~$ groups mcuee
mcuee : mcuee adm dialout cdrom floppy audio dip video plugdev lpadmin
scanner admin microchip

mcuee@mcuee-desktop:~$ ls -la /dev/bus/usb/002
total 0
drwxr-xr-x 2 root root            80 2007-09-23 10:11 .
drwxr-xr-x 6 root root           140 2007-09-23 09:40 ..
crw-rw-r-- 1 root root      189, 128 2007-09-23 17:40 001
crw-rw-r-- 1 root microchip 189, 149 2007-09-23 10:11 022

mcuee@mcuee-desktop:~$ ls -la /proc/bus/usb/002
total 0
drwxr-xr-x 2 root root            80 2007-09-23 10:11 .
drwxr-xr-x 6 root root           140 2007-09-23 09:40 ..
crw-rw-r-- 1 root root      189, 128 2007-09-23 17:40 001
crw-rw-r-- 1 root microchip 189, 149 2007-09-23 10:11 022

mcuee@mcuee-desktop:~/Desktop/build/fsusb/fsusb-0.1.11-2$ ./fsusb
--read test.hex
Locating USB Microchip(tm) PICDEM-FS USB(tm) (vendor 0x04d8/product 0x000b)
Fatal error> Could not find USB PICDEM device--
you might try lsusb to see if it's actually there.

mcuee@mcuee-desktop:~/Desktop/build/fsusb/fsusb-0.1.11-2$ lsusb
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

This is really strange!

This is the dmesg output. Maybe this has something to do with the
problem but I am not sure.

[ 2343.820000] usb usb2: usb resume
[ 2343.820000] usb usb2: finish resume
[ 2343.820000] hub 2-0:1.0: hub_resume
[ 2343.832000] ohci_hcd 0000:00:02.1: wakeup root hub
[ 2343.912000] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000
[ 2343.912000] ohci_hcd 0000:00:02.1: GetStatus roothub.portstatus [0]
= 0x00030100 PESC CSC PPS
[ 2343.912000] hub 2-0:1.0: port 1, status 0100, change 0003, 12 Mb/s
[ 2343.912000] usb 2-1: USB disconnect, address 26
[ 2343.912000] usb 2-1: unregistering device
[ 2343.912000] usb 2-1: usb_disable_device nuking all URBs
[ 2343.912000] usb 2-1: unregistering interface 2-1:1.0
[ 2343.912000] DEV: Unregistering device. ID = 'usbdev2.26_ep01'
[ 2343.912000] PM: Removing info for No Bus:usbdev2.26_ep01
[ 2343.912000] usb_endpoint usbdev2.26_ep01: ep_device_release called
for usbdev2.26_ep01
[ 2343.912000] DEV: Unregistering device. ID = 'usbdev2.26_ep81'
[ 2343.912000] PM: Removing info for No Bus:usbdev2.26_ep81
[ 2343.912000] usb_endpoint usbdev2.26_ep81: ep_device_release called
for usbdev2.26_ep81
[ 2343.912000] bus usb: remove device 2-1:1.0
[ 2343.912000] PM: Removing info for usb:2-1:1.0
[ 2343.912000] usb 2-1:1.0: uevent
[ 2343.912000] usb 2-1:1.0: uevent
[ 2343.912000] bus usb: remove device 2-1
[ 2343.912000] DEV: Unregistering device. ID = 'usbdev2.26'
[ 2343.912000] PM: Removing info for No Bus:usbdev2.26
[ 2343.912000] device_create_release called for usbdev2.26
[ 2343.912000] DEV: Unregistering device. ID = 'usbdev2.26_ep00'
[ 2343.912000] PM: Removing info for No Bus:usbdev2.26_ep00
[ 2343.912000] usb_endpoint usbdev2.26_ep00: ep_device_release called
for usbdev2.26_ep00
[ 2343.912000] PM: Removing info for usb:2-1
[ 2343.912000] usb 2-1: uevent
[ 2344.040000] hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms
status 0x100
[ 2344.492000] usb usb3: usb resume
[ 2344.492000] usb usb3: finish resume
[ 2344.492000] hub 3-0:1.0: hub_resume
[ 2344.492000] ehci_hcd 0000:00:02.2: resume root hub
[ 2344.512000] hub 3-0:1.0: state 7 ports 8 chg 0000 evt 0000
[ 2344.512000] ehci_hcd 0000:00:02.2: GetStatus port 3 status 001803
POWER sig=j CSC CONNECT
[ 2344.512000] hub 3-0:1.0: port 3, status 0501, change 0001, 480 Mb/s
[ 2344.640000] hub 3-0:1.0: debounce: port 3: total 100ms stable 100ms
status 0x501
[ 2344.696000] ehci_hcd 0000:00:02.2: port 3 full speed --> companion
[ 2344.696000] ehci_hcd 0000:00:02.2: GetStatus port 3 status 003001
POWER OWNER sig=se0 CONNECT
[ 2344.696000] hub 3-0:1.0: port 3 not reset yet, waiting 50ms
[ 2344.752000] ehci_hcd 0000:00:02.2: GetStatus port 3 status 003802
POWER OWNER sig=j CSC
[ 2344.752000] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0002
[ 2344.752000] ohci_hcd 0000:00:02.1: GetStatus roothub.portstatus [0]
= 0x00010101 CSC PPS CCS
[ 2344.752000] hub 2-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
[ 2344.880000] hub 2-0:1.0: debounce: port 1: total 100ms stable 100ms
status 0x101
[ 2345.000000] ohci_hcd 0000:00:02.1: GetStatus roothub.portstatus [0]
= 0x00100103 PRSC PPS PES CCS
[ 2345.056000] usb 2-1: new full speed USB device using ohci_hcd and address 27
[ 2345.176000] ohci_hcd 0000:00:02.1: GetStatus roothub.portstatus [0]
= 0x00100103 PRSC PPS PES CCS
[ 2345.252000] usb 2-1: ep0 maxpacket = 8
[ 2345.268000] usb 2-1: new device strings: Mfr=0, Product=0, SerialNumber=0
[ 2345.268000] DEV: registering device: ID = '2-1'
[ 2345.268000] PM: Adding info for usb:2-1
[ 2345.268000] bus usb: add device 2-1
[ 2345.268000] usb 2-1: uevent
[ 2345.268000] usb: Matched Device 2-1 with Driver usb
[ 2345.268000] usb: Probing driver usb with device 2-1
[ 2345.268000] usb 2-1: usb_probe_device
[ 2345.268000] DEV: registering device: ID = 'usbdev2.27_ep00'
[ 2345.268000] PM: Adding info for No Bus:usbdev2.27_ep00
[ 2345.268000] usb 2-1: configuration #1 chosen from 1 choice
[ 2345.268000] usb 2-1: adding 2-1:1.0 (config #1, interface 0)
[ 2345.268000] DEV: registering device: ID = '2-1:1.0'
[ 2345.268000] PM: Adding info for usb:2-1:1.0
[ 2345.268000] bus usb: add device 2-1:1.0
[ 2345.268000] usb 2-1:1.0: uevent
[ 2345.272000] usb 2-1:1.0: uevent
[ 2345.272000] DEV: registering device: ID = 'usbdev2.27_ep01'
[ 2345.272000] PM: Adding info for No Bus:usbdev2.27_ep01
[ 2345.272000] DEV: registering device: ID = 'usbdev2.27_ep81'
[ 2345.272000] PM: Adding info for No Bus:usbdev2.27_ep81
[ 2345.272000] DEV: registering device: ID = 'usbdev2.27'
[ 2345.272000] PM: Adding info for No Bus:usbdev2.27
[ 2345.272000] drivers/usb/core/inode.c: creating file '027'
[ 2345.272000] bound device '2-1' to driver 'usb'
[ 2345.272000] usb: Bound Device 2-1 to Driver usb
[ 2345.272000] hub 3-0:1.0: state 7 ports 8 chg 0000 evt 0008
[ 2345.272000] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0002
[ 2347.272000] usb 2-1: usb auto-suspend
[ 2347.288000] hub 3-0:1.0: hub_suspend
[ 2347.288000] ehci_hcd 0000:00:02.2: suspend root hub
[ 2347.288000] usb usb3: usb auto-suspend
[ 2349.288000] hub 2-0:1.0: hub_suspend
[ 2349.288000] ohci_hcd 0000:00:02.1: suspend root hub
[ 2349.288000] usb usb2: usb auto-suspend

Regards,
Xiaofan
http://mcuee.blogspot.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.