Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3493 - hotplug firmware scripts run twice for each device, for ACTION=add, and ACTION=remove #8362

Open
openwrt-bot opened this issue Dec 8, 2020 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

johnth:

Test device: ath79 mikrotik wap-g on snapshot r15165-66d12ce667

Reproduce:
Modify /etc/hotplug.d/firmware/*, or called settings to log to a file:

root@OpenWrt:# grep -r hotplug.log /etc/hotplug.d/firmware/
/etc/hotplug.d/firmware/10-ath9k-eeprom: echo "$(date +%s): 10-ath9k-eeprom $ACTION" >> /tmp/hotplug.log
/etc/hotplug.d/firmware/11-ath10k-caldata: echo "$(date +%s): 11-ath10k-eeprom $ACTION" >> /tmp/hotplug.log
root@OpenWrt:
# grep -r hotplug.log /lib/functions/caldata.sh
echo "$(date +%s): caldata sysfsload_from_file $ACTION" >> /tmp/hotplug.log

root@OpenWrt:~# cat /tmp/hotplug.log 1607349214: caldata sysfsload_from_file add 1607349214: 11-ath10k-eeprom add 1607349214: caldata sysfsload_from_file remove 1607349214: 11-ath10k-eeprom remove 1607349218: 10-ath9k-eeprom add 1607349218: caldata sysfsload_from_file add 1607349219: 10-ath9k-eeprom remove 1607349219: caldata sysfsload_from_file remove
@openwrt-bot
Copy link
Author

jow-:

Uhm, so it works as expected? I am unable to deduce what is wrong from your description.

@openwrt-bot
Copy link
Author

johnth:

It works, but I would not expect the caldata extraction functions to be run for $ACTION=remove?
logread has an error for it: Tue Dec 8 03:49:22 2020 daemon.err procd: Failed to write to /sys//devices/pci0000:00/0000:00:00.0/firmware/ath10k!cal-pci-0000:00:00.0.bin/loading: Bad file descriptor

We should be able to save some cpu cycles if we only run on $ACTION=add for functions where we modify the caldata (like ath9k_patch_mac) before loading it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant