[PATCH] w1: add a scheduling point to the slave search

From: Imre Kaloz

Date: Tue Oct 13 2026 - 16:12:44 EST


sgi_w1 busy-waits through each time slot and has no triplet operation,
so one 64-bit search pass holds the CPU for more than 20 ms. Without
full preemption that delays every task woken meanwhile on a single CPU,
enough to underrun an audio ring while the bus is searched.

Call cond_resched() once per triplet.

Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
---
drivers/w1/w1.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index c16946642789..6f6651e44c42 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -1055,6 +1055,9 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
dev_dbg(&dev->dev, "Abort w1_search\n");
return;
}
+
+ /* Busy-waiting masters can hold the CPU for a whole pass */
+ cond_resched();
}
mutex_unlock(&dev->bus_mutex);


base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
--
2.47.3