Author Topic: Restablishing Usb Networking After A Suspend  (Read 1064 times)

Armagon

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • http://
Restablishing Usb Networking After A Suspend
« on: November 10, 2006, 11:19:14 pm »
First, I'd like to thank the developers of OZ, GPE, and Opie, and also give a big round of applause to CoreDump.  The software is so much better than when I tried it a year ago!

My Z is a C1000 running hentges gpe 1.0.0-wip-20061029.  My PC is running Kubuntu 6.06.  I got TCP/IP over USB working, mostly following the instructions at http://wiki.openzaurus.org/HowTos/Bridging_with_Ubuntu .  My Z is set to connect with usb0 using dhcp, and it works.  (Yay!)

Well, mostly.  I have to

Quote
# modprobe g_ether

on the Z to make it connect.  Indeed, judging from the system logs, my PC doesn't even see the Z until I do that.  

Now then, I was surprized to see that the network connection was lost and could not be re-established after the Z suspended.  I unplugged and replugged the USB cable; I tried 'ifdown'ing then 'ifup'ing usb0 on the Z, and doing the same with br0 on the PC, but it didn't work.

I finally found that I could

Quote
# modprobe -r g_ether
# modprobe g_ether

on the Z to restore the connection.  This seems very much like a hack -- surely I am doing something wrong, and there is a more elegant way to recover from suspending.  Isn't there?

BTW, how do I view the system logs under GPE?  Utilities | System Info | Log Display | System Log does not appear to show usb kernel messages.  dmesg shows some usb stuff, but I don't know how to 'tail' it, and don't know if it is only boot-time info.  /var/log does not contain 'messages'.

Thank you,
Armagon
Sharp Zaurus SL-C1000 -- 2 GB SD Card -- Zippy Slim Mini Keyboard -- Loving pdaXii13!

CoreDump

  • Hero Member
  • *****
  • Posts: 713
    • View Profile
    • http://www.hentges.net
Restablishing Usb Networking After A Suspend
« Reply #1 on: November 11, 2006, 06:33:30 am »
Quote
First, I'd like to thank the developers of OZ, GPE, and Opie, and also give a big round of applause to CoreDump.  The software is so much better than when I tried it a year ago!

Well, my round of applause goes to the countless anonymous developers working on OpenEmbedded  

Quote
My Z is a C1000 running hentges gpe 1.0.0-wip-20061029. 

There are updates available to -wip-20061108 or so (use the dist-upgrade script to..err..upgrade the distro) However, these updates to not mess w/ USB at all IIRC

Quote
My PC is running Kubuntu 6.06.  I got TCP/IP over USB working, mostly following the instructions at http://wiki.openzaurus.org/HowTos/Bridging_with_Ubuntu .  My Z is set to connect with usb0 using dhcp, and it works.  (Yay!)

Well, mostly.  I have to

Quote
# modprobe g_ether

on the Z to make it connect.  Indeed, judging from the system logs, my PC doesn't even see the Z until I do that.  

Last time I checked, it was impossible to auto-load g_ether on cable-insertion (udev didn't pick up the client cable). And since g_ether conflicts with other client and host modules, we can not load it by default.

Quote
Now then, I was surprized to see that the network connection was lost and could not be re-established after the Z suspended.  I unplugged and replugged the USB cable; I tried 'ifdown'ing then 'ifup'ing usb0 on the Z, and doing the same with br0 on the PC, but it didn't work.

I finally found that I could

Quote
# modprobe -r g_ether
# modprobe g_ether

on the Z to restore the connection.  This seems very much like a hack -- surely I am doing something wrong, and there is a more elegant way to recover from suspending.  Isn't there?

No there isn't  
USB pretty much dies during a suspend / resume cycle and indeed the only way to ressurect it is to rmmod / modprobe some modules. IIRC hentges already has such a work-around in place (check /etc/apm.d) but it is likely to not touch the g_ether module. You may want to have a look at /etc/hutils.conf if the USB work-around on resume is enabled for akita, and which modules are unloaded / reloaded.

Quote
BTW, how do I view the system logs under GPE?  Utilities | System Info | Log Display | System Log does not appear to show usb kernel messages.  dmesg shows some usb stuff, but I don't know how to 'tail' it, and don't know if it is only boot-time info.  /var/log does not contain 'messages'.

sys-logging to /var/log has been disabled to reduce disk-access on NAND storage.

Code: [Select]
dmesg | less
should work fine on hentges at least  
Webmaster of hentges.net & Embedded Linux Developer.

Armagon

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • http://
Restablishing Usb Networking After A Suspend
« Reply #2 on: November 11, 2006, 10:40:39 pm »
Wow.  I really appreciate your informative reply.  I've upgraded and will play with it some more.  It's good to know I haven't just overlooked something.

Thanks,
Armagon
Sharp Zaurus SL-C1000 -- 2 GB SD Card -- Zippy Slim Mini Keyboard -- Loving pdaXii13!