Re: [PATCH 2/2] MUSB: add CPPI interrupt handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Mar 20, 2009 at 06:56:55PM +0100, Sergei Shtylyov wrote:
> As DaVinci DM646x has a dedicated CPPI DMA interrupt, replace cppi_completion()
> (which has always been kind of layering violation) by a complete CPPI interrupt
> handler.
> 
> Signed-off-by: Dmitry Krivoschekov <dkrivoschekov@xxxxxxxxxxxxx>
> Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>
> 
> ---
> The patch is against the recent DaVinci tree; untested...
> 
>  drivers/usb/musb/cppi_dma.c |   33 ++++++++++++++++++++++++++++++---
>  drivers/usb/musb/cppi_dma.h |    7 +++++--
>  drivers/usb/musb/davinci.c  |   14 ++++----------
>  3 files changed, 39 insertions(+), 15 deletions(-)
> 
> Index: linux-davinci/drivers/usb/musb/cppi_dma.c
> ===================================================================
> --- linux-davinci.orig/drivers/usb/musb/cppi_dma.c
> +++ linux-davinci/drivers/usb/musb/cppi_dma.c
> @@ -1144,17 +1144,27 @@ static bool cppi_rx_scan(struct cppi *cp
>  	return completed;
>  }
>  
> -void cppi_completion(struct musb *musb, u32 rx, u32 tx)
> +irqreturn_t cppi_interrupt(int irq, void *dev_id)

static ??

> @@ -282,16 +283,9 @@ static irqreturn_t davinci_interrupt(int
>  	/* CPPI interrupts share the same IRQ line, but have their own
>  	 * mask, state, "vector", and EOI registers.
>  	 */
> -	if (is_cppi_enabled()) {
> -		u32 cppi_tx = musb_readl(tibase, DAVINCI_TXCPPI_MASKED_REG);
> -		u32 cppi_rx = musb_readl(tibase, DAVINCI_RXCPPI_MASKED_REG);
> -
> -		if (cppi_tx || cppi_rx) {
> -			DBG(4, "CPPI IRQ t%x r%x\n", cppi_tx, cppi_rx);
> -			cppi_completion(musb, cppi_rx, cppi_tx);
> -			retval = IRQ_HANDLED;
> -		}
> -	}
> +	cppi = container_of(musb->dma_controller, struct cppi, controller);
> +	if (is_cppi_enabled() && musb->dma_controller && !cppi->irq)
> +		retval = cppi_interrupt(irq, __hci);

Now that you call request_irq() during controller create, this should be
unnecessary. You should probably call musb_dma_completion() from your
cppi_interrupt() though.

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux