Re: usb reset issue ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 25 Jun 2013, raespi wrote:

> Hi ... I'm using an ARM Samsung S3C24XX processor with a 3.1.10 kernel.  
> I'm interested in creating medical equipment using Linux and came onto 
> an issue today.  I've created an application that connects to two FTDI 
> devices and reads continuous data from a medical sensor.  I have a 
> custom based board ( no external ports ), and my FTDI devices go 
> directly to the S3C24xx USB pins and my app is configured to read from a 
> specific product, vendor and device address location.  I've been testing 
> it without problems and today it stopped working. Apparently, when 
> checking the *dmesg* messages, the kernel disconnected those two USB 
> devices and assigned them two new addresses ( 5 and 6 ) different from 
> the original 3 and 4.  I always noticed on PC's that this issue was 
> somehow related to hardware problems and/or disconnection from the USB 
> port.  Also both the /dev/ttyUSB0 and /dev/ttyUSB1 devices on the /dev 
> directory dissapeared ( for now not a problem since I don't access the 
> FTDI device this way ).  These are the kernel messages:
> 
> usb 1-1.3: USB disconnect, device number 3
> usb 1-1.4: USB disconnect, device number 4
> usb 1-1: reset full speed USB device number 2 using s3c2410-ohci
> usb 1-1.3: new full speed USB device number 5 using s3c2410-ohci
> usb 1-1.4: new full speed USB device number 6 using s3c2410-ohci

The disconnects happened because the hub that the two devices were 
plugged into needed to be reset.  So there's a problem related to that 
hub.

> On my board I can't hook up my application again to the new address 
> since it's the only parameter identifiable by it.  Both FTDI Devices 
> have the same product and vendor numbers:
> 
> Bus 001 Device 003: ID 0403:6001
> Bus 001 Device 004: ID 0403:6001
> 
> The address on which they are on is the only ID I've got.

That's not true; there's also the port number.  In this case, the log
messages above show one device plugged into port 3 of the hub and the
other device plugged into port 4.  Therefore the addresses are
available in the files

	/sys/bus/usb/devices/1-1.3/devnum
	/sys/bus/usb/devices/1-1.4/devnum

If you plug the devices into different ports, the file paths will 
change accordingly.

>   Is there 
> some way to disable the kernel usb reset policy or assign them a 
> specific address ??

If you disable the reset, the kernel will no longer be able to tell
when devices are plugged in or unplugged.  The devices may even stop 
working entirely.

You could force the address to be a particular value by hacking the 
kernel.  But why bother?  It's likely to be easier to change your 
program to get the addresses based on the port numbers.

> I'm using *mdev* from userspace but the type of 
> address assignment with mdev is the one concerning the device's name 
> under the /dev directory AFAIK ...

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux