All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: "Hans Beckérus" <hans.beckerus@gmail.com>
Cc: yocto@yoctoproject.org
Subject: Re: USB Ethernet problems
Date: Fri, 05 Apr 2013 07:59:38 -0600	[thread overview]
Message-ID: <515ED8CA.60601@mlbassoc.com> (raw)
In-Reply-To: <CAFyqS9rR-vb3K8DGrcp=cFwRt2mTQRTQ=cYoJZ3g6AFzhMUqEw@mail.gmail.com>

On 2013-04-05 07:50, Hans Beckérus wrote:
>
>
> On Fri, Apr 5, 2013 at 3:27 PM, Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com>> wrote:
>
>     On 2013-04-05 07:23, Gary Thomas wrote:
>
>         On 2013-04-05 06:57, Hans Beckérus wrote:
>
>
>
>             On Fri, Apr 5, 2013 at 2:48 PM, Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com> <mailto:gary@mlbassoc.com <mailto:gary@mlbassoc.com>>> wrote:
>
>                  On 2013-04-05 06:38, Hans Beckérus wrote:
>
>
>
>                      On Fri, Apr 5, 2013 at 12:16 PM, Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com> <mailto:gary@mlbassoc.com <mailto:gary@mlbassoc.com>>
>             <mailto:gary@mlbassoc.com <mailto:gary@mlbassoc.com> <mailto:gary@mlbassoc.com <mailto:gary@mlbassoc.com>>>> wrote:
>
>                           On 2013-04-05 03:08, Hans Beckérus wrote:
>
>                               Hi. In our configuration we do not have an on-board Ethernet device. It connected to the USB-host adapter.
>                               It seems that probing of such devices are done very late in the kernel boot-up which means it gets out of sync with the network init script(s)
>                               and the NIC thus has to be brought up manually after boot.
>
>                               ...
>                               usb 1-1: new high-speed USB device number 2 using xusbps-ehci
>                               hub 1-1:1.0: USB hub found
>                               hub 1-1:1.0: 4 ports detected
>                               VFS: Mounted root (ext2 filesystem) on device 1:0.
>                               devtmpfs: mounted
>                               Freeing init memory: 152K
>                               INIT: version 2.88 booting
>                               usb 1-1.4: new high-speed USB device number 3 using xusbps-ehci
>                               Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
>                               bootlogd.
>                               Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device
>                               INIT: Entering runlevel: 5
>                               Starting Dropbear SSH server: NET: Registered protocol family 10
>                               dropbear.
>                               Starting syslogd/klogd: done
>                               Stopping Bootlog daemon: bootlogd.
>                               asix 1-1.4:1.0: eth0: register 'asix' at usb-xusbps-ehci.0-1.4, ASIX AX88772 USB 2.0 Ethernet, fc:75:16:cf:6a:86
>                               ...
>
>                               Is there some way to configure a system through Yocto to handle this scenario?
>
>
>                           I run exactly this setup on many different platforms with no issues
>                           so it can definitely be done with Poky/Yocto.
>
>                           What system (target) are you using?
>                           What version of the metadata (Poky/Yocto) are you using?  master?  danny?  etc
>                           How is your network device configured?
>
>                      I am on branch master.
>                      My network device is *not* configured. That is the whole point/?problem?. The kernel knowns nothing about the NIC at boot.
>                      It is not detected until it first detects the USB 2.0 host adapter. Then after a few moments the NIC is probed and eth0 becomes available through the ASIX
>             driver. But its
>                      too late,
>                      the /etc/init.d/networking is already done trying ifup :(
>                      Is there some configuration on network level I can do to fix this? Right now I have an ugly patch in /etc/init.d/networking that spins until eth0 comes up. It
>             solves the
>             sync
>                      issue, but also requires some sort of timeout to not get stuck forever if the device is never inserted :(
>
>
>                  Is your ethernet driver compiled in or a kernel module?
>
>                  I'm using a compiled in driver (the same one BTW) and it works fine.
>
>
>             It is compiled into the kernel. If you look at boot log I sent in the initial mail you can see that the actual ASIX device (D-Link DUB-E100) is detected much later than
>             the host
>             adapter :( How is it in your case?
>             Maybe it is the actual device that is not responding quickly enough? Are you pre-configuring anything in your bootargs prepared from U-Boot for eth?
>
>
>         No, I don't do anything special at all.  My boot log is attached.
>         You can see that the interface (on the USB) is found quite early.
>         That said, the system works fine even if I plug it in later on.
>
>         You still did not show us your '/etc/network/interfaces' file.
>         Mine contains these lines which make it handle the network device
>         coming and going:
>             # Wired interface (on optional board)
>             auto eth0
>             iface eth0 inet dhcp
>
>
> That is what I have. I use whatever default poky gave me ;)
> But looking at your log makes me wonder if your system simply are running a lot more other stuff causing networking to be delayed enough for the ASIX device to be probed before
> /etc/init.d/networking is executed?
> Also, this
> [    1.999420]  gadget: Ethernet Gadget, version: Memorial Day 2008
> [    2.005798]  gadget: g_ether ready
> I have not added USB gadget interface support for Ethernet in my kernel. Do I really need it? I don't think that the ASIX is using that interface, is it not using the old classic
> USB device modell?

No, this is only for OTG support which is not needed for you to use
the ASIX device.

As for the timing, maybe I've just been very lucky :-)  I can see that
if the device isn't present when the system runs 'ifup eth0' (or the
equivalent) you'll have a problem.  That's what connman is for - I don't
use it, but it might help you out.

>
>
>     Sorry for the extra noise in the log - I didn't realize that it
>     was still on while I was checking the /etc/network/interfaces file...
>
> No problem ;)
>
> Hans
>

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


  reply	other threads:[~2013-04-05 13:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  9:08 USB Ethernet problems Hans Beckérus
2013-04-05 10:08 ` Iorga, Cristian
2013-04-05 10:31   ` Hans Beckérus
2013-04-05 10:16 ` Gary Thomas
2013-04-05 12:38   ` Hans Beckérus
2013-04-05 12:48     ` Gary Thomas
2013-04-05 12:57       ` Hans Beckérus
2013-04-05 13:23         ` Gary Thomas
     [not found]           ` <515ED14E.7010102@mlbassoc.com>
2013-04-05 13:50             ` Hans Beckérus
2013-04-05 13:59               ` Gary Thomas [this message]
2013-04-05 14:13                 ` Hans Beckérus
2013-04-05 15:51                   ` Paul Eggleton
2013-04-05 16:16                     ` Hans Beckérus
2013-04-05 16:26                       ` Hans Beckérus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515ED8CA.60601@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=hans.beckerus@gmail.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.