Score:0

how to force an USB reset when rebooting?

my flag

on 2 of my NUCs (10i7FNH) operated by Ubuntu 22.04.1 workstation USB peripherals don't seem to be reset properly when a reboot / shutdown -r is used to reboot the system. poweroff or shutdown -P followed by a hardware power on is doing the job, but 100% of reboot or shutdown -r failed when system is coming back: Each time it is detected at network level as netplan is not able to apply its configuration du to interface name or strange configuration.

Before Reboot:

satan@hell:~$ ip -4 address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    altname enp0s31f6
    inet 192.168.0.150/24 brd 192.168.0.255 scope global dynamic noprefixroute eno1
       valid_lft 42060sec preferred_lft 42060sec
8: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
9: lag4: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 4000 qdisc noqueue state UP group default qlen 1000
    inet 169.254.15.17/16 brd 169.254.255.255 scope link noprefixroute lag4
       valid_lft forever preferred_lft forever
10: lag4.2100@lag4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 4000 qdisc noqueue state UP group default qlen 1000
    inet 10.0.4.150/24 brd 10.0.4.255 scope global noprefixroute lag4.2100
       valid_lft forever preferred_lft forever
11: lag4.2000@lag4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 4000 qdisc noqueue state UP group default qlen 1000
    inet 10.0.3.150/24 brd 10.0.3.255 scope global noprefixroute lag4.2000
       valid_lft forever preferred_lft forever
12: lag3: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 4000 qdisc noqueue state UP group default qlen 1000
    inet 169.254.147.108/16 brd 169.254.255.255 scope link noprefixroute lag3
       valid_lft forever preferred_lft forever
13: lag3.1100@lag3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 4000 qdisc noqueue state UP group default qlen 1000
    inet 10.0.2.150/24 brd 10.0.2.255 scope global noprefixroute lag3.1100
       valid_lft forever preferred_lft forever
14: lag3.1000@lag3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 4000 qdisc noqueue state UP group default qlen 1000
    inet 10.0.1.150/24 brd 10.0.1.255 scope global noprefixroute lag3.1000
       valid_lft forever preferred_lft forever


atan@hell:~$ more /etc/netplan/50-hell-init.yaml 
network:
  version: 2
  ethernets:
    eno1:
      #mtu: 4000
      dhcp4: true
      dhcp6: no
    enx000acd390c25:
      mtu: 4000
      dhcp4: true
      dhcp6: no
    enx000acd390c26:
      mtu: 4000
      dhcp4: true
      dhcp6: no
    enx000acd3b1f9a:
      mtu: 4000
      dhcp4: true
      dhcp6: no
    enx000acd3b1f9b:
      mtu: 4000
      dhcp4: true
      dhcp6: no
  bonds:
    lag3:
      interfaces: [enx000acd390c25, enx000acd390c26]
      #interfaces: [enx000acd3b1f9a, enx000acd3b1f9b]
      #interfaces: [enx000acd390c25, enx000acd390c26, enx000acd3b1f9a, enx000acd3b1f9b]
      mtu: 4000
      parameters: 
        mode: 802.3ad
        transmit-hash-policy: layer3+4
        mii-monitor-interval: 100
    lag4:
      #interfaces: [enx000acd390c25, enx000acd390c26]
      interfaces: [enx000acd3b1f9a, enx000acd3b1f9b]
      #interfaces: [enx000acd390c25, enx000acd390c26, enx000acd3b1f9a, enx000acd3b1f9b]
      mtu: 4000
      parameters: 
        mode: 802.3ad
        transmit-hash-policy: layer3+4
        mii-monitor-interval: 100
  vlans:
    lag3.1000:
      id: 1000
      link: lag3
      addresses: [10.0.1.150/24]
    lag3.1100:
      id: 1100
      link: lag3
      addresses: [10.0.2.150/24]
    lag4.2000:
      id: 2000
      link: lag4
      addresses: [10.0.3.150/24]
    lag4.2100:
      id: 2100
      link: lag4
      addresses: [10.0.4.150/24]


satan@hell:~$ lsusb 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 007: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 002 Device 005: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 002 Device 003: ID 2109:8110 VIA Labs, Inc. Hub
Bus 002 Device 006: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 002 Device 004: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
Bus 002 Device 002: ID 2109:8110 VIA Labs, Inc. Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 2109:2811 VIA Labs, Inc. Hub
Bus 001 Device 004: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 001 Device 002: ID 2109:2811 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

satan@hell:~$ sudo systemctl status | head -n 5 ● hell
    State: running
     Jobs: 0 queued    Failed: 0 units
    Since: Sat 2022-12-10 14:07:46 CET; 29min ago

After reboot:

 satan@hell:~$ sudo systemctl status | head -n 5
[sudo] Mot de passe de satan : 
● hell
    State: degraded
     Jobs: 0 queued
   Failed: 1 units
    Since: Sat 2022-12-10 14:40:22 CET; 2min 1s ago

satan@hell:~$ ip -4 address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    altname enp0s31f6
    inet 192.168.0.150/24 brd 192.168.0.255 scope global dynamic noprefixroute eno1
       valid_lft 42978sec preferred_lft 42978sec
8: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever

satan@hell:~$ ifconfig -a
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.150  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 2a01:e0a:ec:aa20:1e69:7aff:fe6e:93f7  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::1e69:7aff:fe6e:93f7  prefixlen 64  scopeid 0x20<link>
        inet6 2a01:e0a:ec:aa20:6620:943c:1142:1f9d  prefixlen 64  scopeid 0x0<global>
        ether 1c:69:7a:6e:93:f7  txqueuelen 1000  (Ethernet)
        RX packets 425  bytes 59748 (59.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 377  bytes 56756 (56.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0x56300000-56320000  

enx7a52af282214: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 7a:52:af:28:22:14  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 752 (752.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 85  bytes 13849 (13.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enxaae2d7e6436b: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether aa:e2:d7:e6:43:6b  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 752 (752.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 90  bytes 14764 (14.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether aa:e2:d7:e6:43:6b  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 752 (752.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 88  bytes 14400 (14.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 7a:52:af:28:22:14  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 752 (752.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 88  bytes 14480 (14.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lag3: flags=5123<UP,BROADCAST,MASTER,MULTICAST>  mtu 4000
        ether 7a:52:af:28:22:14  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lag4: flags=5123<UP,BROADCAST,MASTER,MULTICAST>  mtu 4000
        ether aa:e2:d7:e6:43:6b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lag3.1000: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 7a:52:af:28:22:14  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lag3.1100: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 7a:52:af:28:22:14  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lag4.2000: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether aa:e2:d7:e6:43:6b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lag4.2100: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether aa:e2:d7:e6:43:6b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Boucle locale)
        RX packets 437  bytes 60105 (60.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 437  bytes 60105 (60.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:ca:be:d4  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp0s20f3: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 34:2e:b7:a8:81:99  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I think that a "hard reset of USB devices at reboot will help to fix this issue, how can I do that and with init?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.