Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2489189rbb; Wed, 28 Feb 2024 03:35:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU77H4QpB3qigyZUGQ3xiyJmALgblZ720/b3ylYGUg4o7Bg5/7bBSJ5I606OF1YxOEMDroL7J+5UH0TlnD0zJBwpiPqxWkCeDdn8jzRvA== X-Google-Smtp-Source: AGHT+IF9ZBldEFlTn2IKhnOsUHZZxmt8JnUMhYkm7aJi+aBg2MCk6+7FMoKVvHOwDoxo2fQ+HMo/ X-Received: by 2002:a05:620a:28ca:b0:787:3f0e:ee22 with SMTP id l10-20020a05620a28ca00b007873f0eee22mr5268179qkp.55.1709120141233; Wed, 28 Feb 2024 03:35:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709120141; cv=pass; d=google.com; s=arc-20160816; b=WcbH5u2yPDQwLDNk7wQUl2/IP+PdSQVnAAYcv8TdGjb7RTF2Enp8rPyb2P3f9Iycmu vOVW7jMFimlHn/TwEJMM/lQbS5AOh/icmeKhMNsZ3HkM3TBTeF82hTEebDyL4wh8mKPU Dr27po8GRHe6n7759vuEgHmpCHvB0L4yR9tII7Zbcg54lh/3KfoxvWoxieoyOB/r3aRK sB9WXsVCY+vvpj9U4zZ4OmFoPQUWCz5QqqEFLl7zffc/6qIFW8VPgd7KaNbX1MTvS4w0 VTTbER4gLiXJ1hv535LFq479bS+7Eozv3SDvQn5rayI1uUQcQwlxPUsBAGhA7sxy2ty+ fgVw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=FNoO6vmJ9el3v5aN6NX8aYKdgPlN5duDCePRMfT5iF0=; fh=n7XGc60qr+bhE+23iumYKk4CHvQA06ClFbqKYWc01x4=; b=yEcc0R47Qn/A9RDrz7MYlycB182K92LP8SuIXBuBbd/EgDGm8e268eA01Q41DTaZ5G nSX1f72F6rl9koQkwJq6OHA3xug5u5udegLKXu8wZsR0dwDxC5KfuCSAXOJJo9WUq712 WR6egf3jBCUg1x3k7G5JGwb1OE5KlfGtx4tATDT8OsPx51mcwqmjLZ2+HiTR0vxin7rc 4GS+Ficor1OmH6hCYES6tilmsEY8aUltv1Li9FW8Dn0tOurOMfenXcpcFsbnH2Nebw6t tRn5eIunNAdUjsnI8jiPDfUKQm7aT8u36gSjDORG2OHa67XaAwsf0AWLkCaXqIInsgC2 dnFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FPs4A+FS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i7-20020a37c207000000b00787c0e79d2dsi9582642qkm.572.2024.02.28.03.35.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 03:35:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=FPs4A+FS; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84903-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 01CC61C22805 for ; Wed, 28 Feb 2024 11:35:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A32115D5C0; Wed, 28 Feb 2024 11:28:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="FPs4A+FS" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46A3215B100; Wed, 28 Feb 2024 11:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709119714; cv=none; b=QjY2t4z/+VFfCHPzFNZcucB7BPGtDA46gH2aMOT8B2tJ0Nc4I4D1M3BWR1pAaS4J9uRuYDY3rIALtQLtGiBu/LcnJ7hSm1kkhw4QmwQ888gv7gv71NXR1VYHFtck9qFDaVWcWUM4Lyo0lAG9IuNi4HGKc7IU9UQJGk4Avqta1FM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709119714; c=relaxed/simple; bh=CuQIZkGPYKfwIxHjL83ks3D5WIvU+cFZKGpyf39cIfk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ETMMRDvFqotPBiK1YgXGcIp7qjlhHFQf0VG0T4H/ij15rn1rf1ycNydbl+Bg9k5ZJQ48AjCSfdyaKsLHyCehQQEJwi9aAe9w+AkjQ7eJ/fCafcQYxszaU7uczXZ6cKLUZDskrD2qgNq3MtR92KfTWwk2h9Xv/tGT8iLOX0L94ds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=FPs4A+FS; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 7DEAD1BF216; Wed, 28 Feb 2024 11:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709119710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FNoO6vmJ9el3v5aN6NX8aYKdgPlN5duDCePRMfT5iF0=; b=FPs4A+FSUsI1jbmC5iRp/YjJ5AetOfXSFRU/BbEMB8tPtEzk8ghIPZvPVYoEE9QrzAALr7 PYLOp+tdssftRzOGsKPmKwsiDsp8lJbtqsjXyQRE1xx48ZBJfuNngfeqKmp0cxN7LeFbJ6 9SPUDb2BYKToI3Mic91+gTQOtqA8ZbBa4SC/wC1pyK51coWhuwH5sohz/QtA2m2R133V03 /NUUU8qlZtHa4bC76oGxJ5cK/0FezljCo7PWfIJPBG2EgrdfMk/ND049CjHnTa0u8Xi/t0 TgiE4MWdX0mBJ98RYVzABKHdHhzWKQhaSFiWAsXLSGMoMtzmq9uvFHGazvYWKA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 28 Feb 2024 12:28:24 +0100 Subject: [PATCH v2 26/30] Documentation: gpio: mention generic_handle_irq_safe() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240228-mbly-gpio-v2-26-3ba757474006@bootlin.com> References: <20240228-mbly-gpio-v2-0-3ba757474006@bootlin.com> In-Reply-To: <20240228-mbly-gpio-v2-0-3ba757474006@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Thomas Bogendoerfer Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Gregory CLEMENT , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= , Stephen Warren , Jonathan Corbet , linux-doc@vger.kernel.org X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com 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 To: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Théo Lebrun --- 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