Modify

Opened 6 years ago

Last modified 4 years ago

#10480 new defect

USB hotplug scripts are run several times

Reported by: Rolf Leggewie <dev.openwrt.org@…> Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version: Backfire 10.03.1 RC6
Keywords: Cc:

Description

I'm not sure this is causing any real problems but it's certainly unexpected that the usb hotplug scripts are run around half a dozen times or more for every USB device upon plugging in or rebooting (the number of times the scripts are run also seems to vary from incidence to incidence). The router is a CatchTec CW5354U.

root@OpenWrt:/# cat /etc/banner 
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 Backfire (10.03.1-RC6, r29275) --------------------
  * 1/3 shot Kahlua    In a shot glass, layer Kahlua 
  * 1/3 shot Bailey's  on the bottom, then Bailey's, 
  * 1/3 shot Vodka     then Vodka.
 ---------------------------------------------------
root@OpenWrt:/# uname -a
Linux OpenWrt 2.6.32.27 #3 Tue Nov 22 19:45:04 PHT 2011 mips GNU/Linux
root@OpenWrt:/# lsusb 
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270 HSDPA/HSUPA Modem
root@OpenWrt:/# logread | grep run\\. | wc -l
10
root@OpenWrt:/# logread | grep run\\.
Sep  8 16:19:23 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/001. PRODUCT is 1d6b/1/206.
Sep  8 16:19:23 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/001. PRODUCT is 1d6b/1/206.
Sep  8 16:19:24 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/002. PRODUCT is 12d1/1003/0.
Sep  8 16:19:24 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/001. PRODUCT is 1d6b/1/206.
Sep  8 16:19:24 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/002. PRODUCT is 12d1/1003/0.
Sep  8 16:19:25 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/001. PRODUCT is 1d6b/1/206.
Sep  8 16:19:27 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/002. PRODUCT is 12d1/1003/0.
Sep  8 16:19:29 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/002. PRODUCT is 12d1/1003/0.
Sep  8 16:19:31 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/002. PRODUCT is 12d1/1003/0.
Sep  8 16:19:32 OpenWrt user.notice RL-Testing: Script is run. ACTION is add. DEVICE is /proc/bus/usb/001/002. PRODUCT is 12d1/1003/0.
root@OpenWrt:/# cat /etc/hotplug.d/usb/usb-test.sh 
#!/bin/sh

logger -t "RL-Testing" "Script is run. ACTION is" $ACTION". DEVICE is" $DEVICE". PRODUCT is "$PRODUCT"."

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by Kirill Kazakov <k@…>

Probably the reason is the following code inside /etc/init.d/boot:

# another round of USB coldplugging to kick devices into operation which lacked drivers before
for dev in /sys/bus/usb/devices/*/uevent; do           
    [ -e "$dev" ] && echo -n add > "$dev"          
done

On my router all the files /sys/bus/usb/devices/* actually link to either the only USB device, or EHCI/OHCI controllers (and they also contain the link to that USB device). That's why the script is invoked as many times as many files your router has under /sys/bus/usb/devices.

comment:2 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.