[PATCH] qmi-firmware-update: support USB3->USB2 mode changes during upgrade

Paul Gildea gildeap at tcd.ie
Wed Jan 24 11:12:32 UTC 2018


dmesg indicated SuperSpeed for 2-2. Here is the output of that command:

ls -ld /sys/bus/usb/devices/usb*/*-0:1.0/usb*-port*/peer
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb1/1-0:1.0/usb1-port11/peer ->
../../../usb2/2-0:1.0/usb2-port5/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb1/1-0:1.0/usb1-port6/peer ->
../../../usb2/2-0:1.0/usb2-port6/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb1/1-0:1.0/usb1-port7/peer ->
../../../usb2/2-0:1.0/usb2-port7/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb1/1-0:1.0/usb1-port8/peer ->
../../../usb2/2-0:1.0/usb2-port8/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb2/2-0:1.0/usb2-port5/peer ->
../../../usb1/1-0:1.0/usb1-port11/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb2/2-0:1.0/usb2-port6/peer ->
../../../usb1/1-0:1.0/usb1-port6/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb2/2-0:1.0/usb2-port7/peer ->
../../../usb1/1-0:1.0/usb1-port7/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb2/2-0:1.0/usb2-port8/peer ->
../../../usb1/1-0:1.0/usb1-port8/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb3/3-0:1.0/usb3-port1/peer ->
../../../usb4/4-0:1.0/usb4-port1/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb3/3-0:1.0/usb3-port2/peer ->
../../../usb4/4-0:1.0/usb4-port2/
lrwxrwxrwx    1 root     root             0 Jan 24 11:45
/sys/bus/usb/devices/usb3/3-0:1.0/usb3-port3/peer ->
../../../usb4/4-0:1.0/usb4-port3/
lrwxrwxrwx    1 root     root             0 Jan 24 11:46
/sys/bus/usb/devices/usb3/3-0:1.0/usb3-port4/peer ->
../../../usb4/4-0:1.0/usb4-port4/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb4/4-0:1.0/usb4-port1/peer ->
../../../usb3/3-0:1.0/usb3-port1/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb4/4-0:1.0/usb4-port2/peer ->
../../../usb3/3-0:1.0/usb3-port2/
lrwxrwxrwx    1 root     root             0 Jan 24 11:47
/sys/bus/usb/devices/usb4/4-0:1.0/usb4-port3/peer ->
../../../usb3/3-0:1.0/usb3-port3/
lrwxrwxrwx    1 root     root             0 Jan 24 11:46
/sys/bus/usb/devices/usb4/4-0:1.0/usb4-port4/peer ->
../../../usb3/3-0:1.0/usb3-port4/


and this is the mapping for my modems, USB3 -> USB2:


/sys/devices/pci0000:00/0000:00:14.0/usb2/2-1 ->
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-2 ->
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-3 ->
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-6
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-4 ->
/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8


My S/N is the same in all modes for MC7455's, useful at least as a backup
method if it is unreliable.

--
Paul


On 23 Jan 2018 18:06, "Bjørn Mork" <bjorn at mork.no> wrote:

> Paul Gildea <gildeap at tcd.ie> writes:
>
> > Checking 2-2 there is no such peer file inside port for some reason.
>
> OK, at least that explains the failure.  And the 2-2 device is of course
> running at SuperSpeed?
>
> Tried to read drivers/usb/core/port.c , but not sure I understand if/how
> this is supposed to work.  Looks like there are plenty of possible
> failure modes. And most will be silently ignored unless you enable
> kernel debug messages. Yuck.
>
> Could you do a 'ls -ld /sys/bus/usb/devices/usb*/*-0:1.0/usb*-port*/peer'?
>
> I tried finding examples of missing peers, but all my Linux systems with
> USB3 look fine. My laptop:
>
>
> bjorn at miraculix:~$ ls -ld /sys/bus/usb/devices/usb*/*-0:
> 1.0/usb*-port*/peer
> lrwxrwxrwx 1 root root 0 Jan 12 09:59 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port1/peer
> -> ../../../usb2/2-0:1.0/usb2-port1
> lrwxrwxrwx 1 root root 0 Jan 11 13:53 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port2/peer
> -> ../../../usb2/2-0:1.0/usb2-port2
> lrwxrwxrwx 1 root root 0 Jan 12 09:58 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port3/peer
> -> ../../../usb2/2-0:1.0/usb2-port3
> lrwxrwxrwx 1 root root 0 Jan 12 09:12 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port6/peer
> -> ../../../usb2/2-0:1.0/usb2-port6
> lrwxrwxrwx 1 root root 0 Jan 11 13:52 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port1/peer
> -> ../../../usb1/1-0:1.0/usb1-port1
> lrwxrwxrwx 1 root root 0 Jan 12 09:55 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port2/peer
> -> ../../../usb1/1-0:1.0/usb1-port2
> lrwxrwxrwx 1 root root 0 Jan 12 09:58 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port3/peer
> -> ../../../usb1/1-0:1.0/usb1-port3
> lrwxrwxrwx 1 root root 0 Jan 12 09:12 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port6/peer
> -> ../../../usb1/1-0:1.0/usb1-port6
>
>
> A desktop:
>
> bjorn at canardo:~$ ls -ld /sys/bus/usb/devices/usb*/*-0:1.0/usb*-port*/peer
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port10/peer
> -> ../../../usb2/2-0:1.0/usb2-port10
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port1/peer
> -> ../../../usb2/2-0:1.0/usb2-port1
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port2/peer
> -> ../../../usb2/2-0:1.0/usb2-port2
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port3/peer
> -> ../../../usb2/2-0:1.0/usb2-port3
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port4/peer
> -> ../../../usb2/2-0:1.0/usb2-port4
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port5/peer
> -> ../../../usb2/2-0:1.0/usb2-port5
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port6/peer
> -> ../../../usb2/2-0:1.0/usb2-port6
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port7/peer
> -> ../../../usb2/2-0:1.0/usb2-port7
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port8/peer
> -> ../../../usb2/2-0:1.0/usb2-port8
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port9/peer
> -> ../../../usb2/2-0:1.0/usb2-port9
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port10/peer
> -> ../../../usb1/1-0:1.0/usb1-port10
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port1/peer
> -> ../../../usb1/1-0:1.0/usb1-port1
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port2/peer
> -> ../../../usb1/1-0:1.0/usb1-port2
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port3/peer
> -> ../../../usb1/1-0:1.0/usb1-port3
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port4/peer
> -> ../../../usb1/1-0:1.0/usb1-port4
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port5/peer
> -> ../../../usb1/1-0:1.0/usb1-port5
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port6/peer
> -> ../../../usb1/1-0:1.0/usb1-port6
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port7/peer
> -> ../../../usb1/1-0:1.0/usb1-port7
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port8/peer
> -> ../../../usb1/1-0:1.0/usb1-port8
> lrwxrwxrwx 1 root root 0 Jan 23 18:44 /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port9/peer
> -> ../../../usb1/1-0:1.0/usb1-port9
>
> A Linksys router:
>
> root at wrt1900ac-1:~# ls -ld /sys/bus/usb/devices/usb*/*-0:
> 1.0/usb*-port*/peer
> lrwxrwxrwx    1 root     root             0 Jan 12 09:50
> /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port1/peer ->
> ../../../usb3/3-0:1.0/usb3-port1
> lrwxrwxrwx    1 root     root             0 Jan 12 09:51
> /sys/bus/usb/devices/usb2/2-0:1.0/usb2-port2/peer ->
> ../../../usb3/3-0:1.0/usb3-port2
> lrwxrwxrwx    1 root     root             0 Jan 12 09:50
> /sys/bus/usb/devices/usb3/3-0:1.0/usb3-port1/peer ->
> ../../../usb2/2-0:1.0/usb2-port1
> lrwxrwxrwx    1 root     root             0 Jan 12 09:51
> /sys/bus/usb/devices/usb3/3-0:1.0/usb3-port2/peer ->
> ../../../usb2/2-0:1.0/usb2-port2
>
>
> I was really hoping we could use these peer links, because I cannot see
> how else we're supposed to make the EM7455 upgrade work on SuperSpeed
> capable ports.
>
> OK, I see one alternative: The MC7455/EM7455 serial number is the same
> in bootloader and application mode (at least on my modems...).  We could
> save it and accept the bootloader QDL device on any USB port if the
> serial number matches.
>
> Note that this particular serial number behaviour is in no way
> guaranteed anywhere. So it does feel somewhat less safe than matching
> USB ports. My EM7565 will change the serial number, for example. But its
> bootloader use SuperSpeed so it doesn't have the same upgrade issue.
>
>
> Bjørn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libqmi-devel/attachments/20180124/49b0791f/attachment-0001.html>


More information about the libqmi-devel mailing list