lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240228-mbly-gpio-v2-26-3ba757474006@bootlin.com>
Date: Wed, 28 Feb 2024 12:28:24 +0100
From: Théo Lebrun <theo.lebrun@...tlin.com>
To: Linus Walleij <linus.walleij@...aro.org>, 
 Bartosz Golaszewski <brgl@...ev.pl>, Rob Herring <robh+dt@...nel.org>, 
 Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, 
 Conor Dooley <conor+dt@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de>, 
 Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc: linux-gpio@...r.kernel.org, devicetree@...r.kernel.org, 
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
 linux-mips@...r.kernel.org, Gregory CLEMENT <gregory.clement@...tlin.com>, 
 Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>, 
 Thomas Petazzoni <thomas.petazzoni@...tlin.com>, 
 Tawfik Bayouk <tawfik.bayouk@...ileye.com>, 
 Théo Lebrun <theo.lebrun@...tlin.com>, 
 Stephen Warren <swarren@...dotorg.org>, Jonathan Corbet <corbet@....net>, 
 linux-doc@...r.kernel.org
Subject: [PATCH v2 26/30] Documentation: gpio: mention
 generic_handle_irq_safe()

generic_handle_irq() must be called from a no-IRQ context. Documentation
advices on using a fake raw lock to call generic_handle_irq() from any
context.

Since 509853f9e1e7 ("genirq: Provide generic_handle_irq_safe()"), a
better alternative is available.

To: Stephen Warren <swarren@...dotorg.org>
To: Jonathan Corbet <corbet@....net>
Cc: linux-doc@...r.kernel.org
Signed-off-by: Théo Lebrun <theo.lebrun@...tlin.com>
---
 Documentation/driver-api/gpio/driver.rst | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/Documentation/driver-api/gpio/driver.rst b/Documentation/driver-api/gpio/driver.rst
index bf6319cc531b..550d167a82ed 100644
--- a/Documentation/driver-api/gpio/driver.rst
+++ b/Documentation/driver-api/gpio/driver.rst
@@ -339,15 +339,8 @@ Cascaded GPIO irqchips usually fall in one of three categories:
 
   The generic_handle_irq() is expected to be called with IRQ disabled,
   so the IRQ core will complain if it is called from an IRQ handler which is
-  forced to a thread. The "fake?" raw lock can be used to work around this
-  problem::
-
-    raw_spinlock_t wa_lock;
-    static irqreturn_t omap_gpio_irq_handler(int irq, void *gpiobank)
-        unsigned long wa_lock_flags;
-        raw_spin_lock_irqsave(&bank->wa_lock, wa_lock_flags);
-        generic_handle_irq(irq_find_mapping(bank->chip.irq.domain, bit));
-        raw_spin_unlock_irqrestore(&bank->wa_lock, wa_lock_flags);
+  forced to a thread. generic_handle_irq_safe() can be used to work around
+  this problem; it can safely be called from any context.
 
 - GENERIC CHAINED GPIO IRQCHIPS: these are the same as "CHAINED GPIO irqchips",
   but chained IRQ handlers are not used. Instead GPIO IRQs dispatching is

-- 
2.44.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ