linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/3] dma: mxs-dma: Cleanup interrupt handler
Date: Mon, 30 Sep 2013 16:30:47 +0200	[thread overview]
Message-ID: <20130930143047.GG4869@pengutronix.de> (raw)
In-Reply-To: <524983AE.8020706@pengutronix.de>

Hi,

On Mon, Sep 30, 2013 at 03:59:10PM +0200, Marc Kleine-Budde wrote:
> On 09/30/2013 03:54 PM, Lothar Wa?mann wrote:
> > Hi,
> > 
> > Markus Pargmann writes:
> >> The DMA interrupt handler uses its controll registers to handle all
> >> available channel interrupts it can find.
> >>
> >> This patch changes it to handle only one interrupt by directly mapping
> >> irq number to channel. It also includes a cleanup of the ctrl-register
> >> usage.
> >>
> >> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> >> ---
> >>  drivers/dma/mxs-dma.c | 95 ++++++++++++++++++++++++++++++++-------------------
> >>  1 file changed, 59 insertions(+), 36 deletions(-)
> >>
> >> diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> >> index ccd13df..bfca8dc 100644
> >> --- a/drivers/dma/mxs-dma.c
> >> +++ b/drivers/dma/mxs-dma.c
> >> @@ -272,58 +272,81 @@ static void mxs_dma_tasklet(unsigned long data)
> >>  		mxs_chan->desc.callback(mxs_chan->desc.callback_param);
> >>  }
> >>  
> >> +static int mxs_dma_irq_to_chan(struct mxs_dma_engine *mxs_dma, int irq)
> >> +{
> >> +	int i;
> >> +
> >> +	for (i = 0; i != mxs_dma->nr_channels; ++i)
> >> +		if (mxs_dma->mxs_chans[i].chan_irq == irq)
> >> +			return i;
> >>
> > You might use a linked list for all active channels so that you don't
> > have to check all unused channels when trying to find the channel
> > number for an irq.
> 
> Or an array of mxs_dma->nr_channels length for direct mapping.

We map irq to channel so an array of nr_channels won't work here.

I will use a linked list.

Thanks

Markus


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2013-09-30 14:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30 13:13 [PATCH v2 0/3] dma: mxs-dma bugfixes and cleanup Markus Pargmann
2013-09-30 13:13 ` [PATCH v2 1/3] dma: mxs-dma: Cleanup interrupt handler Markus Pargmann
2013-09-30 13:54   ` Lothar Waßmann
2013-09-30 13:59     ` Marc Kleine-Budde
2013-09-30 14:30       ` Markus Pargmann [this message]
2013-09-30 13:13 ` [PATCH v2 2/3] dma: mxs-dma: Pause channel while prep_dma_cyclic Markus Pargmann
2013-09-30 13:13 ` [PATCH v2 3/3] dma: mxs-dma: Report correct residue for cyclic DMA Markus Pargmann

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=20130930143047.GG4869@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).