From: Imre Kaloz <kaloz@kernel.org>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] w1: add a scheduling point to the slave search
Date: Tue, 13 Oct 2026 20:22:21 +0200 [thread overview]
Message-ID: <20261013182221.11963-1-kaloz@kernel.org> (raw)
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@kernel.org>
---
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
reply other threads:[~2026-10-13 18:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261013182221.11963-1-kaloz@kernel.org \
--to=kaloz@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®