Re: USB device just moves



On Tue, 12 Feb 2008 07:19:31 GMT Tim Roberts <timr@xxxxxxxxx> wrote:
| phil-news-nospam@xxxxxxxx wrote:
|>
|>I had a case today where an external disk drive connected via USB just up
|>and moved to a new device location. The dmesg log looks like it came loose
|>on its own and reconnected immediately. But it seems the device name it
|>had before was not re-usabled and it got a new one. It was a mounted disk
|>so you can imagine the mess that caused.
|
| The "udev" subsystem seems to go a very long way towards solving this
| problem. I believe it would have prevented the issue you describe. Is
| your kernel new enough to support it?

The kernel is new enough ... 2.6.24 (no worry over vmsplice here).

So tell me how it is that "udev" can do better than the kernel itself to
make sure that when the USB device is re-attached that it will always get
exactly the same major/minor device number? I thought that what "udev"
did was automatically make a device node in the name space to refer to
the new major/minor. Remember, this involves an already mounted filesystem
with files still open.

The real culprit in this is the poor design of USB, which follows the poor
design of PC. There should be a hardware layer consistency of addresses
based on where something is plugged in (bus number, controller number, port
number, hub port number, hubbed hub port number, etc). Then on top of that
there should be consistent device ID numbers much like ethernet MAC (but at
least 64 bits). If the same device is plugged back into the same port, no
address should change. Nothing should need to be run to "change it back"
as it should just _be_ the same. If I move a drive from one port to another
that should be handled inside the kernel simply by having an association from
devices as the kernel sees them (major/minor number) to the consistent device
address (the one built into the device, not the port itself).

But since we have a poor hardware design, we have to bend over backwards in
the software to make things work at least reasonably most of the time.

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2008-02-12-0843@xxxxxxxx |
|------------------------------------/-------------------------------------|
.



Relevant Pages

  • USB on 4.11
    ... If I boot the GENERIC kernel, my USB drive is recognized. ... port 1 powered ... scbus0 on sym0 bus 0: ...
    (freebsd-questions)
  • Re: Devfs not creating da0, 1, etcetera on 5.2
    ... Preloaded elf kernel "/boot/kernel/kernel" at 0xc0868000. ... pci_cfgintr: 0:7 INTD BIOS irq 5 ... Acer Communications & Multimedia Inc. USB Optical ... <Parallel port bus> on ppc0 ...
    (freebsd-questions)
  • PROBLEM: MacBook makes whining noise when usb-uhci active
    ... Kernel .config file: ... # ACPI Support ... # USB Network Adapters ... # Non-8250 serial port support ...
    (Linux-Kernel)
  • problems with USB key on 2.6.6-1.435 kernel
    ... This machine has a USB keyboard with a couple of USB ports in the ... keyboard (which is the most convenient port to use!). ... in /var/log/messages with the 2.6.6-1.435 kernel ...
    (Fedora)
  • usb_insert_transfer panic with if_zyd
    ... When I use my ZyXEL G-220 Wireless USB Stick with the if_zyd driver, ... <ACPI PCI bus> on pcib0 ... device problem, disabling port 1 ... <Ethernet over FireWire> on firewire0 ...
    (freebsd-current)