public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/2] dma/ipu: Interrupt cleanups
@ 2015-07-13 20:39 Thomas Gleixner
  2015-07-13 20:39 ` [patch 1/2] dma/ipu: Consolidate chained IRQ handler install/remove Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Gleixner @ 2015-07-13 20:39 UTC (permalink / raw)
  To: LKML; +Cc: Dan Williams, Vinod Koul, dmaengine

The following patches consolidate the setup/removal of chained
interrupt handlers and avoid redundant lookups of the irqdescriptor in
functions which have already a [in]direct reference to it.

The latter is also a preparation for the removal of the 'irq' argument
from interrupt flow handlers.

The series has no dependencies and is also available as a git branch
for your convenience:

 git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/dma

If you want me to carry the patches in the irq/core branch of tip,
please let me know.

Thanks,

	tglx



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

* [patch 1/2] dma/ipu: Consolidate chained IRQ handler install/remove
  2015-07-13 20:39 [patch 0/2] dma/ipu: Interrupt cleanups Thomas Gleixner
@ 2015-07-13 20:39 ` Thomas Gleixner
  2015-07-13 20:39 ` [patch 2/2] dma/ipu: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc Thomas Gleixner
  2015-07-16 13:12 ` [patch 0/2] dma/ipu: Interrupt cleanups Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2015-07-13 20:39 UTC (permalink / raw)
  To: LKML; +Cc: Dan Williams, Vinod Koul, dmaengine, Russell King, Julia Lawall

[-- Attachment #1: dma-ipu-Consolidate-chained-IRQ-handler-install-remo.patch --]
[-- Type: text/plain, Size: 1663 bytes --]

Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc->lock. Replace the two calls
with one.

Search and conversion was done with coccinelle.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: dmaengine@vger.kernel.org
---
 drivers/dma/ipu/ipu_irq.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Index: tip/drivers/dma/ipu/ipu_irq.c
===================================================================
--- tip.orig/drivers/dma/ipu/ipu_irq.c
+++ tip/drivers/dma/ipu/ipu_irq.c
@@ -382,11 +382,9 @@ int __init ipu_irq_attach_irq(struct ipu
 #endif
 	}
 
-	irq_set_handler_data(ipu->irq_fn, ipu);
-	irq_set_chained_handler(ipu->irq_fn, ipu_irq_fn);
+	irq_set_chained_handler_and_data(ipu->irq_fn, ipu_irq_fn, ipu);
 
-	irq_set_handler_data(ipu->irq_err, ipu);
-	irq_set_chained_handler(ipu->irq_err, ipu_irq_err);
+	irq_set_chained_handler_and_data(ipu->irq_err, ipu_irq_err, ipu);
 
 	ipu->irq_base = irq_base;
 
@@ -399,11 +397,9 @@ void ipu_irq_detach_irq(struct ipu *ipu,
 
 	irq_base = ipu->irq_base;
 
-	irq_set_chained_handler(ipu->irq_fn, NULL);
-	irq_set_handler_data(ipu->irq_fn, NULL);
+	irq_set_chained_handler_and_data(ipu->irq_fn, NULL, NULL);
 
-	irq_set_chained_handler(ipu->irq_err, NULL);
-	irq_set_handler_data(ipu->irq_err, NULL);
+	irq_set_chained_handler_and_data(ipu->irq_err, NULL, NULL);
 
 	for (irq = irq_base; irq < irq_base + CONFIG_MX3_IPU_IRQS; irq++) {
 #ifdef CONFIG_ARM



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

* [patch 2/2] dma/ipu: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc
  2015-07-13 20:39 [patch 0/2] dma/ipu: Interrupt cleanups Thomas Gleixner
  2015-07-13 20:39 ` [patch 1/2] dma/ipu: Consolidate chained IRQ handler install/remove Thomas Gleixner
@ 2015-07-13 20:39 ` Thomas Gleixner
  2015-07-16 13:12 ` [patch 0/2] dma/ipu: Interrupt cleanups Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2015-07-13 20:39 UTC (permalink / raw)
  To: LKML; +Cc: Dan Williams, Vinod Koul, dmaengine, Jiang Liu

[-- Attachment #1: dma-ipu-Use-irq_desc_get_xxx-to-avoid-redundant-lookup-o.patch --]
[-- Type: text/plain, Size: 2058 bytes --]

From: Jiang Liu <jiang.liu@linux.intel.com>

Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.

This is also a preparation for the removal of the 'irq' argument from
interrupt flow handlers.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: dmaengine@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/dma/ipu/ipu_irq.c       |    2 +-
 drivers/gpu/ipu-v3/ipu-common.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Index: tip/drivers/dma/ipu/ipu_irq.c
===================================================================
--- tip.orig/drivers/dma/ipu/ipu_irq.c
+++ tip/drivers/dma/ipu/ipu_irq.c
@@ -268,7 +268,7 @@ int ipu_irq_unmap(unsigned int source)
 /* Chained IRQ handler for IPU error interrupt */
 static void ipu_irq_err(unsigned int irq, struct irq_desc *desc)
 {
-	struct ipu *ipu = irq_get_handler_data(irq);
+	struct ipu *ipu = irq_desc_get_handler_data(desc);
 	u32 status;
 	int i, line;
 
Index: tip/drivers/gpu/ipu-v3/ipu-common.c
===================================================================
--- tip.orig/drivers/gpu/ipu-v3/ipu-common.c
+++ tip/drivers/gpu/ipu-v3/ipu-common.c
@@ -915,8 +915,8 @@ static void ipu_irq_handle(struct ipu_so
 static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
 	struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
+	struct irq_chip *chip = irq_desc_get_chip(desc);
 	const int int_reg[] = { 0, 1, 2, 3, 10, 11, 12, 13, 14};
-	struct irq_chip *chip = irq_get_chip(irq);
 
 	chained_irq_enter(chip, desc);
 
@@ -928,8 +928,8 @@ static void ipu_irq_handler(unsigned int
 static void ipu_err_irq_handler(unsigned int irq, struct irq_desc *desc)
 {
 	struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
+	struct irq_chip *chip = irq_desc_get_chip(desc);
 	const int int_reg[] = { 4, 5, 8, 9};
-	struct irq_chip *chip = irq_get_chip(irq);
 
 	chained_irq_enter(chip, desc);
 



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

* Re: [patch 0/2] dma/ipu: Interrupt cleanups
  2015-07-13 20:39 [patch 0/2] dma/ipu: Interrupt cleanups Thomas Gleixner
  2015-07-13 20:39 ` [patch 1/2] dma/ipu: Consolidate chained IRQ handler install/remove Thomas Gleixner
  2015-07-13 20:39 ` [patch 2/2] dma/ipu: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc Thomas Gleixner
@ 2015-07-16 13:12 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2015-07-16 13:12 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, Dan Williams, dmaengine

On Mon, Jul 13, 2015 at 08:39:51PM +0000, Thomas Gleixner wrote:
> The following patches consolidate the setup/removal of chained
> interrupt handlers and avoid redundant lookups of the irqdescriptor in
> functions which have already a [in]direct reference to it.
> 
> The latter is also a preparation for the removal of the 'irq' argument
> from interrupt flow handlers.
> 
> The series has no dependencies and is also available as a git branch
> for your convenience:
> 
>  git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/dma
> 
> If you want me to carry the patches in the irq/core branch of tip,
> please let me know.

Applied now, though have fixed up the subsystem name

-- 
~Vinod


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

end of thread, other threads:[~2015-07-16 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 20:39 [patch 0/2] dma/ipu: Interrupt cleanups Thomas Gleixner
2015-07-13 20:39 ` [patch 1/2] dma/ipu: Consolidate chained IRQ handler install/remove Thomas Gleixner
2015-07-13 20:39 ` [patch 2/2] dma/ipu: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc Thomas Gleixner
2015-07-16 13:12 ` [patch 0/2] dma/ipu: Interrupt cleanups Vinod Koul

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