All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap-irq: set IRQF_ONESHOT flag to ensure IRQ request
@ 2015-02-11 14:55 Valentin Rothberg
  2015-02-11 15:37 ` [PATCH v2] " Valentin Rothberg
  0 siblings, 1 reply; 3+ messages in thread
From: Valentin Rothberg @ 2015-02-11 14:55 UTC (permalink / raw)
  To: broonie, gregkh; +Cc: linux-kernel, Valentin Rothberg, Valentin Rothberg

From: Valentin Rothberg <valentinrothberg@gmail.com>

Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject
bogus threaded irq requests") threaded IRQs without a primary handler
need to be requested with IRQF_ONESHOT, otherwise the request will fail.

The %irq_flags flag is used to request the threaded IRQ and is also a
parameter of the caller.  Hence, we cannot be sure that IRQF_ONESHOT is
set.  This change avoids the potentially missing flag by setting
IRQF_ONESHOT when requesting the threaded IRQ.

Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci

Signed-off-by: Valentin Rothberg <Valentin.Rothberg@lip6.fr>
---
 drivers/base/regmap/regmap-irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 6299a50..a6c3f75 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -499,7 +499,8 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
 		goto err_alloc;
 	}
 
-	ret = request_threaded_irq(irq, NULL, regmap_irq_thread, irq_flags,
+	ret = request_threaded_irq(irq, NULL, regmap_irq_thread,
+				   irq_flags | IRQF_ONESHOT,
 				   chip->name, d);
 	if (ret != 0) {
 		dev_err(map->dev, "Failed to request IRQ %d for %s: %d\n",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] regmap-irq: set IRQF_ONESHOT flag to ensure IRQ request
  2015-02-11 14:55 [PATCH] regmap-irq: set IRQF_ONESHOT flag to ensure IRQ request Valentin Rothberg
@ 2015-02-11 15:37 ` Valentin Rothberg
  2015-02-14  5:27   ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Valentin Rothberg @ 2015-02-11 15:37 UTC (permalink / raw)
  To: broonie, gregkh; +Cc: linux-kernel, Valentin Rothberg

Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject
bogus threaded irq requests") threaded IRQs without a primary handler
need to be requested with IRQF_ONESHOT, otherwise the request will fail.

The %irq_flags flag is used to request the threaded IRQ and is also a
parameter of the caller.  Hence, we cannot be sure that IRQF_ONESHOT is
set.  This change avoids the potentially missing flag by setting
IRQF_ONESHOT when requesting the threaded IRQ.

Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci

Signed-off-by: Valentin Rothberg <Valentin.Rothberg@lip6.fr>
---
Changelog:
v2:  The first line of the commit message of v1 was "FROM: ..." due to
changing my email address after committing the change.  I reset the
author which solved the problem.  Sorry for my mistake.
---
 drivers/base/regmap/regmap-irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 6299a50..a6c3f75 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -499,7 +499,8 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
 		goto err_alloc;
 	}
 
-	ret = request_threaded_irq(irq, NULL, regmap_irq_thread, irq_flags,
+	ret = request_threaded_irq(irq, NULL, regmap_irq_thread,
+				   irq_flags | IRQF_ONESHOT,
 				   chip->name, d);
 	if (ret != 0) {
 		dev_err(map->dev, "Failed to request IRQ %d for %s: %d\n",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] regmap-irq: set IRQF_ONESHOT flag to ensure IRQ request
  2015-02-11 15:37 ` [PATCH v2] " Valentin Rothberg
@ 2015-02-14  5:27   ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2015-02-14  5:27 UTC (permalink / raw)
  To: Valentin Rothberg; +Cc: gregkh, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

On Wed, Feb 11, 2015 at 04:37:57PM +0100, Valentin Rothberg wrote:
> Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject
> bogus threaded irq requests") threaded IRQs without a primary handler
> need to be requested with IRQF_ONESHOT, otherwise the request will fail.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-14  5:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-11 14:55 [PATCH] regmap-irq: set IRQF_ONESHOT flag to ensure IRQ request Valentin Rothberg
2015-02-11 15:37 ` [PATCH v2] " Valentin Rothberg
2015-02-14  5:27   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.