mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-kernel@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net, adaplas@gmail.com,
	linux-arm-kernel@lists.arm.linux.org.uk,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and IRQ drivers
Date: Tue, 23 Dec 2008 17:33:11 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0812231727460.5188@axis700.grange> (raw)
In-Reply-To: <20081223160942.GJ1614@pengutronix.de>

On Tue, 23 Dec 2008, Sascha Hauer wrote:

> You're still not getting it. Consider an implementation of the chained
> interrupt handler like this:
> 
> static struct ipu_irq_bank irq_bank_fn[IPU_IRQ_NR_FN_BANKS] = {
>         {
>                 .nr_irqs        = 1,	/* IDMAC EOF and NF irq */
>         }, {
>                 .nr_irqs        = 24,	/* misc interrupts the IPU is not
> 					 * interested in, but clients drivers
> 					 * may be.
> 					 */
>         },
> };
> 
> static struct ipu_irq_bank irq_bank_err[IPU_IRQ_NR_ERR_BANKS] = {
>         /* 2 groups of error interrupts */
>         {
>                 .nr_irqs        = 1,	/* IDMAC channel error irq */
>         }, {
>                 .nr_irqs        = 17,	/* misc interrupts the IPU is not
>                                          * interested in, but clients drivers
>                                          * may be.
>                                          */
>         },
> };
> 
> /* Chained IRQ handler for IPU error interrupt */
> static void ipu_irq_err(unsigned int irq, struct irq_desc *desc)
> {
>         struct ipu *ipu = get_irq_data(irq);
>         u32 status;
>         int i, line;
> 
> 	/* These interrupts are handled exclusively by the IPU code */
> 	if (ipu_read_reg(ipu, IPU_INT_STAT_4))
> 		generic_handle_irq(IPU_IRQ);
> 
> 	status = ipu_read_reg(ipu, IPU_INT_STAT_5);
>         while ((line = ffs(status))) {
>                 status &= ~(1UL << (line - 1));
>                 generic_handle_irq(irq_bank_err[i].irq_base + line - 1);
>         }
> }
> 
> /* Chained IRQ handler for IPU function interrupt */
> static void ipu_irq_fn(unsigned int irq, struct irq_desc *desc)
> {
>         struct ipu *ipu = get_irq_data(irq);
>         u32 status;
>         int i, line;
> 
>         /* These interrupts are handled exclusively by the IPU code */
>         if (ipu_read_reg(ipu, IPU_INT_STAT_1) || ipu_read_reg(ipu, IPU_INT_STAT_2))
>                 generic_handle_irq(IPU_ERR_IRQ);
> 
>         status = ipu_read_reg(ipu, IPU_INT_STAT_3);
>         while ((line = ffs(status))) {
>                 status &= ~(1UL << (line - 1));
>                 generic_handle_irq(irq_bank_err[i].irq_base + line - 1);
>         }
> }
> 
> 
> and in ipu_idmac.c:
> 
> request_irq(IPU_ERR_IRQ, &ipu_err_handler);
> request_irq(IPU_IRQ, &ipu_irq);

These all are just slightly different variations - with this one you'd 
have to scan dma channels in your dma irq handler, which I currently don't 
have to do.

> That said I'm not sure whether we need a chained interrupt handler at all.
> Looking at the remaining interrupts it seems that for example the
> CSI_EOF (IPU_INT_STAT3 bit 5) interrupt is redundant to the corresponding
> channels interrupt. In the camera driver you already realized that it's
> the dma end event you're interested in, not the CSI_EOF event. Not sure
> if that holds for the other interrupts though.

I think the version with a lookup table is optimal - it uses standard 
mechanisms for irq handling and doesn't waste RAM. The disadvantage - 
every addition will need driver modification...

But ok, this is taking way too long. Just tell me which way you'd like to 
have it and I'll do it.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

  reply	other threads:[~2008-12-23 16:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18 13:26 [PATCH 0/4 v4] i.MX31: dmaengine and framebuffer drivers Guennadi Liakhovetski
2008-12-18 13:26 ` [PATCH 1/4 v4] dmaengine: add async_tx_clear_ack() macro Guennadi Liakhovetski
2008-12-18 13:26 ` [PATCH 2/4 v4] i.MX31: Image Processing Unit DMA and IRQ drivers Guennadi Liakhovetski
2008-12-18 22:58   ` Sascha Hauer
2008-12-22 11:56     ` Guennadi Liakhovetski
2008-12-22 18:37       ` Sascha Hauer
2008-12-22 20:03         ` Robert Schwebel
2008-12-23 10:09           ` Dmitry Krivoschekov
2008-12-23 10:52             ` Sascha Hauer
2008-12-23 11:32               ` Dmitry Krivoschekov
2008-12-23 12:08                 ` Sascha Hauer
2008-12-22 20:10         ` Guennadi Liakhovetski
2008-12-23 10:50           ` Sascha Hauer
2008-12-23 11:21             ` Guennadi Liakhovetski
2008-12-23 12:50               ` Sascha Hauer
2008-12-23 13:14                 ` Guennadi Liakhovetski
2008-12-23 14:03                   ` Sascha Hauer
2008-12-23 14:55                     ` Guennadi Liakhovetski
2008-12-23 16:09                       ` Sascha Hauer
2008-12-23 16:33                         ` Guennadi Liakhovetski [this message]
2008-12-23 17:14                           ` Sascha Hauer
2008-12-23 12:13             ` Robert Schwebel
2008-12-23 12:45               ` Guennadi Liakhovetski
2008-12-23 12:56                 ` Sascha Hauer
2008-12-23 12:56             ` Valentin Longchamp
2008-12-18 13:26 ` [PATCH 3/4 v4] i.MX31: framebuffer driver Guennadi Liakhovetski
2008-12-18 13:27 ` [PATCH 4/4 v4] i.MX31: platform bindings and initialisation for IPU and framebuffer drivers Guennadi Liakhovetski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0812231727460.5188@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=adaplas@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®