From 628ef827142db1c18a5c661ee64164e3d4734be4 Mon Sep 17 00:00:00 2001 From: Ronny Kotzschmar Date: Wed, 6 Jul 2022 15:14:21 +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 --- .../armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 2822e4890..2491dc8c3 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 @@ -5,12 +5,13 @@ get_device_irq() { local device="$1" local line - local seconds + local seconds="0" # wait up to 10 seconds for the irq/device to appear - for seconds in $(seq 0 9); do + while [ "${seconds}" -le 10 ]; do line=$(grep -m 1 "${device}\$" /proc/interrupts) && break - sleep 1 + seconds="$(( seconds + 2 ))" + sleep 2 done echo ${line} | sed 's/:.*//' }