docs: locking: Discourage from calling disable_irq() in atomic
[linux-block.git] / Documentation / kernel-hacking / locking.rst
index c756786e17aea3d9081a61720611e898c846bb3d..dff0646a717bff27f6b82d3a8090876e99d23cec 100644 (file)
@@ -1277,11 +1277,11 @@ Manfred Spraul points out that you can still do this, even if the data
 is very occasionally accessed in user context or softirqs/tasklets. The
 irq handler doesn't use a lock, and all other accesses are done as so::
 
-        spin_lock(&lock);
+        mutex_lock(&lock);
         disable_irq(irq);
         ...
         enable_irq(irq);
-        spin_unlock(&lock);
+        mutex_unlock(&lock);
 
 The disable_irq() prevents the irq handler from running
 (and waits for it to finish if it's currently running on other CPUs).