suspend/resume kills usb0

Harald Welte laforge at openmoko.org
Wed Nov 5 09:35:43 CET 2008


On Sun, Nov 02, 2008 at 10:27:48PM +0100, Michael 'Mickey' Lauer wrote:
> Am Sunday 02 November 2008 22:17:06 schrieb Andy Green:
> > Somebody in the thread at some point said:
> > | Is there a way to prevent suspend/resume from killing usb0? It only
> >
> > happens
> >
> > | when there is traffic on usb0 (i.e. shell output during suspend/resume).
> >
> > The USB stack on the host correctly notices that the USB device it was
> > talking to has gone (it's dead during suspend) and takes it down.
> >
> > But on resume, if you have arrangements on the host that the ip address
> > and routing for host usb0 will be autoallocated, it should recover the
> > ssh session OK after a short delay.
> 
> Unfortunately this only works here if the ssh session is idle.

this is only due to your other addressing + routing setup.  If you have a
lower-preference route to 192.168.0.200/x (whatever the address range for usb0
is) to something like a dummy interface, the problem won't occur.

What's happening is that you probably have 192.168.0.0/16 route to your router
or local network, and then as soon as the usb0 route disappears, the packets
intended for the openmoko go to your router, who legitimately claims that it
doesn't know such an address, has no route or doesn't get an ARP response to
it.

So if you ensure that those packets just 'disappear', either by having a
low-preference route to a dummy device that never generates any ARP timeouts or
ICMP error messages, you're fine.

Alternatively, just use 'iptables -A OUTPUT -j DROP -d 192.168.0.200/x -o !
usb0' or something along those lines on your PC, to ensure you never actually
route those packets to the non-usb0 network

This kind of setup (route based or iptables based) can be in your hotplug/udev
script executed when you attach your neo.

-- 
- Harald Welte <laforge at openmoko.org>          	        http://openmoko.org/
============================================================================
Software for the world's first truly open Free Software mobile phone



More information about the openmoko-kernel mailing list