]> git.ipfire.org Git - people/arne_f/kernel.git/blobdiff - lib/dump_stack.c
i2c: i801: Fix resume bug
[people/arne_f/kernel.git] / lib / dump_stack.c
index 625375e7f11f98f2468002772265e30e753345fb..287ea178f0fa951a225032a4ebc84030cca5cdcb 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Provide a default dump_stack() function for architectures
  * which don't implement their own.
@@ -45,7 +46,12 @@ retry:
                was_locked = 1;
        } else {
                local_irq_restore(flags);
-               cpu_relax();
+               /*
+                * Wait for the lock to release before jumping to
+                * atomic_cmpxchg() in order to mitigate the thundering herd
+                * problem.
+                */
+               do { cpu_relax(); } while (atomic_read(&dump_lock) != -1);
                goto retry;
        }