mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kernel: irq: Call irq_chip->irq_mask in irq_disable
@ 2013-07-09 14:26 Laxman Dewangan
  2013-07-19 14:32 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Laxman Dewangan @ 2013-07-09 14:26 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, sreenivasulu velpula, Laxman Dewangan

From: sreenivasulu velpula <svelpula@nvidia.com>

If interrupt driver has implemented the irq_mask/irq_unmask
callbacks for disable/enable interrupt then call these APIs
from irq_disable/irq_enable.

Currently, on irq_disable(), it just look for the callback
irq_disable() implemented by chip interrupt driver not the
irq_mask().

Add check for the valid callback of irq_mask() and if it is
there then call it from irq_disable.

This is based on change done by:
	sreenivasulu velpula <svelpula@nvidia.com>

Signed-off-by: sreenivasulu velpula <svelpula@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 kernel/irq/chip.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index a3bb14f..b6efb92 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -232,6 +232,9 @@ void irq_disable(struct irq_desc *desc)
 	if (desc->irq_data.chip->irq_disable) {
 		desc->irq_data.chip->irq_disable(&desc->irq_data);
 		irq_state_set_masked(desc);
+	} else if (desc->irq_data.chip->irq_mask) {
+		desc->irq_data.chip->irq_mask(&desc->irq_data);
+		irq_state_set_masked(desc);
 	}
 }
 
-- 
1.7.1.1


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

* Re: [PATCH] kernel: irq: Call irq_chip->irq_mask in irq_disable
  2013-07-09 14:26 [PATCH] kernel: irq: Call irq_chip->irq_mask in irq_disable Laxman Dewangan
@ 2013-07-19 14:32 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2013-07-19 14:32 UTC (permalink / raw)
  To: Laxman Dewangan; +Cc: linux-kernel, sreenivasulu velpula

On Tue, 9 Jul 2013, Laxman Dewangan wrote:

> From: sreenivasulu velpula <svelpula@nvidia.com>
> 
> If interrupt driver has implemented the irq_mask/irq_unmask
> callbacks for disable/enable interrupt then call these APIs
> from irq_disable/irq_enable.
> 
> Currently, on irq_disable(), it just look for the callback
> irq_disable() implemented by chip interrupt driver not the
> irq_mask().
> 
> Add check for the valid callback of irq_mask() and if it is
> there then call it from irq_disable.

No. That changes the semantics of lazy irq disable and breaks
suspend/resume because we rely on NOT masking interrupts to detect a
wakeup.

The irq_disable() merily marks the interrupt disabled and only touches
the hardware when the interrupt controller provides an explicit
irq_disable() callback.

Thanks,

	tglx

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

end of thread, other threads:[~2013-07-19 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-09 14:26 [PATCH] kernel: irq: Call irq_chip->irq_mask in irq_disable Laxman Dewangan
2013-07-19 14:32 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®