Skip to content

Commit

Permalink
rockchip: reliably distribute net interrupts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
k-ronny authored and Ansuel committed Jul 7, 2022
1 parent 3872b42 commit 9b00e97
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -4,8 +4,15 @@

get_device_irq() {
local device="$1"

local line=$(grep -m 1 "${device}\$" /proc/interrupts)
local line
local seconds="0"

# wait up to 10 seconds for the irq/device to appear
while [ "${seconds}" -le 10 ]; do
line=$(grep -m 1 "${device}\$" /proc/interrupts) && break
seconds="$(( seconds + 2 ))"
sleep 2
done
echo ${line} | sed 's/:.*//'
}

Expand Down

0 comments on commit 9b00e97

Please sign in to comment.