[PATCH] qmi-firmware-update: support USB3->USB2 mode changes during upgrade
Bjørn Mork
bjorn at mork.no
Tue Jan 23 18:06:27 UTC 2018
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
More information about the libqmi-devel
mailing list