rockchip: reliably distribute net interrupts

On the NanoPI R4S it takes an average of 3..5 seconds for the network devices
to appear in '/proc/interrupts'.
Wait up to 10 seconds to ensure that the distribution of the interrupts
really happens.

Signed-off-by: Ronny Kotzschmar <ro.ok@me.com>
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit fd65ce6f322cd36be4e58e79581e7b65b28880a4)
This commit is contained in:
Ronny Kotzschmar 2021-08-17 15:13:07 +02:00 committed by Tianling Shen
parent 09574e88b9
commit 5cdd4cb868
No known key found for this signature in database
GPG Key ID: 6850B6345C862176

View File

@ -4,8 +4,14 @@
get_device_irq() {
local device="$1"
local line
local seconds
local line=$(grep -m 1 "${device}\$" /proc/interrupts)
# wait up to 10 seconds for the irq/device to appear
for seconds in $(seq 0 9); do
line=$(grep -m 1 "${device}\$" /proc/interrupts) && break
sleep 1
done
echo ${line} | sed 's/:.*//'
}