Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and IRQ drivers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Guennadi Liakhovetski
Date: Tuesday, December 23, 2008 - 7:55 am

On Tue, 23 Dec 2008, Sascha Hauer wrote:


Ok, fair enough, you can see all *_EOF interrupts as being consumed by one 
user - the dma channel driver. So then it is similar to a serial (or 
whatever else) driver handling multiple instances of the hardware on one 
system.

Let's consider what we would get, if we don't use the irq chip API:

1. we request two interrupts - function and error - normally using 
   request_irq in the ipu irq driver

2. in the dma channel driver you have to register new clients with the ipu 
   irq driver so it can call the dma channel driver EOF irq handler with 
   the correct argument - the number of interrupting DMA channel

3. on an interrupt you have to implement masking / unmasking / acking of 
   interrupts, list locking, whatever it takes yourself

so you end up with an API similar to ipu_request_irq() from Freescale... 
Yes, you can allocate your interrupt descriptors dynamically, you can save 
a few more bytes in every descriptor object... But is it all worth it?

Ok, we can make this differently:

1. I create a static constant array of virtual irq number <-> ipu irq bit 
   maps, with currently only two elements - for the framebuffer and the 
   camera, and use it in irq demultiplexing.

2. I increment NR_IRQS by two and put a comment explaining where to look 
   for implementing support for more IPU interrupts.

3. as new users come and implement support for more IPU interrupts, they 
   add entries to the array and increment NR_IRQS.

This way we add only as many irq descriptors as we really use, but the 
mapping becomes absolutely internal, so looking in /proc/interupts gives 
you little understanding of whose interrupts you see there.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/4 v4] i.MX31: dmaengine and framebuffer drivers, Guennadi Liakhovetski, (Thu Dec 18, 6:26 am)
[PATCH 1/4 v4] dmaengine: add async_tx_clear_ack() macro, Guennadi Liakhovetski, (Thu Dec 18, 6:26 am)
[PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and IRQ d ..., Guennadi Liakhovetski, (Thu Dec 18, 6:26 am)
[PATCH 3/4 v4] i.MX31: framebuffer driver, Guennadi Liakhovetski, (Thu Dec 18, 6:26 am)
[PATCH 4/4 v4] i.MX31: platform bindings and initialisatio ..., Guennadi Liakhovetski, (Thu Dec 18, 6:27 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Guennadi Liakhovetski, (Mon Dec 22, 4:56 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Guennadi Liakhovetski, (Mon Dec 22, 1:10 pm)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Dmitry Krivoschekov, (Tue Dec 23, 3:09 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Guennadi Liakhovetski, (Tue Dec 23, 4:21 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Dmitry Krivoschekov, (Tue Dec 23, 4:32 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Guennadi Liakhovetski, (Tue Dec 23, 5:45 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Valentin Longchamp, (Tue Dec 23, 5:56 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Guennadi Liakhovetski, (Tue Dec 23, 6:14 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Guennadi Liakhovetski, (Tue Dec 23, 7:55 am)
Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and I ..., Guennadi Liakhovetski, (Tue Dec 23, 9:33 am)