Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2018 16:50:57 -0700
From:      Kevin Oberman <rkoberman@gmail.com>
To:        Masachika ISHIZUKA <ish@amail.plala.or.jp>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: usb ethernet adapter does not work after reboot
Message-ID:  <CAN6yY1syiS84b8pRRc9uqBT_OEDGQHKVBGsBR2H-Sx6_F=1jQQ@mail.gmail.com>
In-Reply-To: <20180625.234518.743785892819344523.ish@amail.plala.or.jp>
References:  <20180625.234518.743785892819344523.ish@amail.plala.or.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 25, 2018 at 7:45 AM, Masachika ISHIZUKA <ish@amail.plala.or.jp>
wrote:

>   Hi.
>
>   I'm using DELL XPS12 notebook pc.
>   This machine has not ethernet card and I use AX88179 usb ethernet
> adapter.
>   This works well on 11.2-RC3 and 12-current after first bootup.
>   But if I reboot pc, this adapter is not seen any more.
>
>   So I was using 'shutdown and bootup' instead of reboot.
>
>   I found that I can use this usb ethernet adapter after reboot with
> the following sequence .
>
> (1) sync the disks
> (2) usbconfig -d ugenX.Y power_off
> (3) wait for a few seconds
> (4) usbconfig -d ugenX.Y power_off
> (5) reboot
>
> I wrote this sequence to shell script as follows.
>
> ugen=`/usr/sbin/usbconfig list | /usr/bin/sed -n
> 's/^\(ugen[0-9]*\.[0-9]*\): .* AX88179\>.*/\1/p'`
> /bin/sync
> /bin/sync
> /bin/sync
> /usr/sbin/usbconfig -d $ugen power_off
> /bin/sleep 3
> /usr/sbin/usbconfig -d $ugen power_off
> /sbin/shutdown -r now
> --
> Masachika ISHIZUKA
>

Many people seem to not understand the difference between "shutdown -r" and
"reboot". For most cases, it makes little difference, but in some the
difference can be very significant.

reboot(8) is a brute force shutdown. It does the bare minimum to shutdown
the system fairly safely. It's step up from pulling the plug, but not by
much. It is fine from a standalone system, but is really ill advised to use
it from multi-user mode. It does not run the "stop" scripts in all of the
rc.d scripts to cleanly stop things. "shutdown -r" does run all rc.d
scripts that contain "stop" routines. This is especially critical for
database users to avoid corrupt DBs, but many other things also work best
if cleanly stopped before the system goes down.

BTW, the triple "sync" is a waste of... well, not much except your time in
typing it into your script. The rule to sync discs three times assumes that
you are actually typing it. It is to allow enough time for the file
system(s) to complete syncing before the system is halted (halt(8)) or
power is removed. Both reboot(8) and shutdown(8) now take care of this.
Only the first sync(8) really does anything. Typing it three times on a
teletype takes long enough for metadata to be written.

The man page for sync(8) really needs updating. It is unchanged other than
fixing wording and formatting since 4.4-lite and probably that was largely
unchanged from AT&T V4. I probably should open a ticket.
--
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN6yY1syiS84b8pRRc9uqBT_OEDGQHKVBGsBR2H-Sx6_F=1jQQ>