From 5cdd4cb86860c1c3249daa3d49e7eb1b9feb4b03 Mon Sep 17 00:00:00 2001 From: Ronny Kotzschmar Date: Tue, 17 Aug 2021 15:13:07 +0200 Subject: [PATCH] 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 Signed-off-by: Tianling Shen (cherry picked from commit fd65ce6f322cd36be4e58e79581e7b65b28880a4) --- .../base-files/etc/hotplug.d/net/40-net-smp-affinity | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity index 882039b603..2279fbebeb 100644 --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity @@ -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/:.*//' }