mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 01:22:25 +00:00
37 lines
1.6 KiB
Diff
37 lines
1.6 KiB
Diff
From c3a5b35f6971a4c6daed3674badb6718058f5ebe Mon Sep 17 00:00:00 2001
|
|
From: Adrian Schmutzler <freifunk@adrianschmutzler.de>
|
|
Date: Tue, 16 Feb 2021 23:16:00 +0100
|
|
Subject: [PATCH 05/22] kernel: 5.10: fix busy wait loop in mediatek PPE code
|
|
|
|
Reapply changes added to 5.4 but not copied to 5.10:
|
|
3da4acaa7bba ("kernel: fix busy wait loop in mediatek PPE code")
|
|
|
|
The intention is for the loop to timeout if the body does not succeed.
|
|
The current logic calls time_is_before_jiffies(timeout) which is false
|
|
until after the timeout, so the loop body never executes.
|
|
|
|
time_is_after_jiffies(timeout) will return true until timeout is less
|
|
than jiffies, which is the intended behavior here.
|
|
|
|
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
|
|
---
|
|
...5-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/target/linux/generic/pending-5.10/770-15-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch b/target/linux/generic/pending-5.10/770-15-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch
|
|
index fa4803211a..09282175b0 100644
|
|
--- a/target/linux/generic/pending-5.10/770-15-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch
|
|
+++ b/target/linux/generic/pending-5.10/770-15-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch
|
|
@@ -185,7 +185,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
+{
|
|
+ unsigned long timeout = jiffies + HZ;
|
|
+
|
|
-+ while (time_is_before_jiffies(timeout)) {
|
|
++ while (time_is_after_jiffies(timeout)) {
|
|
+ if (!(ppe_r32(ppe, MTK_PPE_GLO_CFG) & MTK_PPE_GLO_CFG_BUSY))
|
|
+ return 0;
|
|
+
|
|
--
|
|
2.25.1
|
|
|