Re: Same question, chorus for verse 28

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

 



On Sun, Sep 18, 2011 at 01:01:59AM -0400, gene heskett wrote:
> Hi all;
> 
> I just had to reboot in order to get my usb stuff properly enumerated 
> again, a power bump that killed an unprotected hub for 2 seconds caused 
> everthing on that hub to be lost.  And when I replugged the cables in order 
> to trigger new discovery, the ttyUSB# changed from 1 to 2, which in turn 
> killed 2 of my scripts.
> 
> So 3 questions:
> 
> 1. will we ever, what, 13 years after usb is everywhere, have a consistent 
> discovery & enumeration process?

No, that's not how it is designed.  If you are assuming that it somehow
is consistent, then your assumption is completly wrong.

Heck, PCI isn't consistent, how could USB ever be?

> 2. Is there some way I can rewrite my scripts to find the device regardless 
> of its being assigned /dev/ttyUSB1 or /dev/ttyUSB2, and can the same 
> technique reliably find an Epson NX515 and Brother HL2140 printers?

Yes, use the proper tools that give you this information.

For ttyUSB devices, use /dev/serial/ links that udev creates.

For your USB printers, use the usb printer symlinks that udev creates,
or that CUPS can create manually for you.

> 3. Is there a way to do a cold 'restart' the USB subsystem, to make it do 
> the equ of a reboot, without having to reboot the whole machine?  I have 
> enough custom scripts running here that a full restart takes at least an 
> extra 10-15 minutes for the stuff that can't be put in rc.local because X 
> isn't running when that file is sourced.

Unload the usb host controller drivers and then reload them.

Note, there are some well-known bugs when unloading some usb host
controller drivers that can cause oopses if data is flowing at the
moment, so you might not want to rely on this all that much.

good luck,

greg k-h
--
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