summaryrefslogtreecommitdiff
path: root/lib/sbitmap.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-07-23 23:33:05 +0100
committerMark Brown <broonie@kernel.org>2023-07-23 23:33:05 +0100
commitde1b43a57aff8b1808bbfe0402932f9e373d1172 (patch)
tree699c828946223aab18a0aab5175e6902a8ce2e42 /lib/sbitmap.c
parent8cf2e3b1961e59dabc75e9e917d58439164a8f84 (diff)
parent6eaae198076080886b9e7d57f4ae06fa782f90ef (diff)
ASoC: Merge up fixes from mainline
There's several things here that will really help my CI.
Diffstat (limited to 'lib/sbitmap.c')
-rw-r--r--lib/sbitmap.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c
index eff4e42c425a..d0a5081dfd12 100644
--- a/lib/sbitmap.c
+++ b/lib/sbitmap.c
@@ -550,7 +550,7 @@ EXPORT_SYMBOL_GPL(sbitmap_queue_min_shallow_depth);
static void __sbitmap_queue_wake_up(struct sbitmap_queue *sbq, int nr)
{
- int i, wake_index;
+ int i, wake_index, woken;
if (!atomic_read(&sbq->ws_active))
return;
@@ -567,13 +567,12 @@ static void __sbitmap_queue_wake_up(struct sbitmap_queue *sbq, int nr)
*/
wake_index = sbq_index_inc(wake_index);
- /*
- * It is sufficient to wake up at least one waiter to
- * guarantee forward progress.
- */
- if (waitqueue_active(&ws->wait) &&
- wake_up_nr(&ws->wait, nr))
- break;
+ if (waitqueue_active(&ws->wait)) {
+ woken = wake_up_nr(&ws->wait, nr);
+ if (woken == nr)
+ break;
+ nr -= woken;
+ }
}
if (wake_index != atomic_read(&sbq->wake_index))