linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] at_hdmac: bugfix for enabling channel irq
@ 2012-01-17  9:28 Nikolaus Voss
  2012-01-17 15:28 ` Nicolas Ferre
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolaus Voss @ 2012-01-17  9:28 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, Nicolas Ferre; +Cc: linux-kernel

commit 463894705e4089d0ff69e7d877312d496ac70e5b deleted redundant
chan_id and chancnt initialization in dma drivers as this is done
in dma_async_device_register().

However, atc_enable_irq() relied on chan_id set before registering
the device, what left only channel 0 functional for this driver.

This patch introduces atc_enable/disable_chan_irq() as a variant
of atc_enable/disable_irq() with the channel as explicit argument.

Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
---
 drivers/dma/at_hdmac.c      |    4 ++--
 drivers/dma/at_hdmac_regs.h |   17 ++++++++---------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index fcfa0a8..a60adbf 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1286,7 +1286,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 
 		tasklet_init(&atchan->tasklet, atc_tasklet,
 				(unsigned long)atchan);
-		atc_enable_irq(atchan);
+		atc_enable_chan_irq(atdma, i);
 	}
 
 	/* set base routines */
@@ -1353,7 +1353,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
 		struct at_dma_chan	*atchan = to_at_dma_chan(chan);
 
 		/* Disable interrupts */
-		atc_disable_irq(atchan);
+		atc_disable_chan_irq(atdma, chan->chan_id);
 		tasklet_disable(&atchan->tasklet);
 
 		tasklet_kill(&atchan->tasklet);
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
index aa4c9ae..5aa82b4 100644
--- a/drivers/dma/at_hdmac_regs.h
+++ b/drivers/dma/at_hdmac_regs.h
@@ -326,28 +326,27 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
 }
 
 
-static void atc_setup_irq(struct at_dma_chan *atchan, int on)
+static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on)
 {
-	struct at_dma	*atdma = to_at_dma(atchan->chan_common.device);
-	u32		ebci;
+	u32 ebci;
 
 	/* enable interrupts on buffer transfer completion & error */
-	ebci =    AT_DMA_BTC(atchan->chan_common.chan_id)
-		| AT_DMA_ERR(atchan->chan_common.chan_id);
+	ebci =    AT_DMA_BTC(chan_id)
+		| AT_DMA_ERR(chan_id);
 	if (on)
 		dma_writel(atdma, EBCIER, ebci);
 	else
 		dma_writel(atdma, EBCIDR, ebci);
 }
 
-static inline void atc_enable_irq(struct at_dma_chan *atchan)
+static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id)
 {
-	atc_setup_irq(atchan, 1);
+	atc_setup_irq(atdma, chan_id, 1);
 }
 
-static inline void atc_disable_irq(struct at_dma_chan *atchan)
+static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id)
 {
-	atc_setup_irq(atchan, 0);
+	atc_setup_irq(atdma, chan_id, 0);
 }
 
 
-- 
1.7.5.4


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

* Re: [PATCH] at_hdmac: bugfix for enabling channel irq
  2012-01-17  9:28 [PATCH] at_hdmac: bugfix for enabling channel irq Nikolaus Voss
@ 2012-01-17 15:28 ` Nicolas Ferre
  2012-01-30  9:01   ` Nicolas Ferre
  2012-01-31  3:43   ` Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Nicolas Ferre @ 2012-01-17 15:28 UTC (permalink / raw)
  To: Nikolaus Voss, Vinod Koul, Dan Williams; +Cc: linux-kernel, linux-arm-kernel

On 01/17/2012 10:28 AM, Nikolaus Voss :
> commit 463894705e4089d0ff69e7d877312d496ac70e5b deleted redundant
> chan_id and chancnt initialization in dma drivers as this is done
> in dma_async_device_register().
> 
> However, atc_enable_irq() relied on chan_id set before registering
> the device, what left only channel 0 functional for this driver.
> 
> This patch introduces atc_enable/disable_chan_irq() as a variant
> of atc_enable/disable_irq() with the channel as explicit argument.
> 
> Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: stable <stable@vger.kernel.org>

Vinod, can you please queue it in a "fixes" branch for 3.3. The stable
tag is needed to address errors in 3.2 kernel series.

Nikolaus, thanks for your fix.

Best regards,

> ---
>  drivers/dma/at_hdmac.c      |    4 ++--
>  drivers/dma/at_hdmac_regs.h |   17 ++++++++---------
>  2 files changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index fcfa0a8..a60adbf 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -1286,7 +1286,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
>  
>  		tasklet_init(&atchan->tasklet, atc_tasklet,
>  				(unsigned long)atchan);
> -		atc_enable_irq(atchan);
> +		atc_enable_chan_irq(atdma, i);
>  	}
>  
>  	/* set base routines */
> @@ -1353,7 +1353,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
>  		struct at_dma_chan	*atchan = to_at_dma_chan(chan);
>  
>  		/* Disable interrupts */
> -		atc_disable_irq(atchan);
> +		atc_disable_chan_irq(atdma, chan->chan_id);
>  		tasklet_disable(&atchan->tasklet);
>  
>  		tasklet_kill(&atchan->tasklet);
> diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
> index aa4c9ae..5aa82b4 100644
> --- a/drivers/dma/at_hdmac_regs.h
> +++ b/drivers/dma/at_hdmac_regs.h
> @@ -326,28 +326,27 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
>  }
>  
>  
> -static void atc_setup_irq(struct at_dma_chan *atchan, int on)
> +static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on)
>  {
> -	struct at_dma	*atdma = to_at_dma(atchan->chan_common.device);
> -	u32		ebci;
> +	u32 ebci;
>  
>  	/* enable interrupts on buffer transfer completion & error */
> -	ebci =    AT_DMA_BTC(atchan->chan_common.chan_id)
> -		| AT_DMA_ERR(atchan->chan_common.chan_id);
> +	ebci =    AT_DMA_BTC(chan_id)
> +		| AT_DMA_ERR(chan_id);
>  	if (on)
>  		dma_writel(atdma, EBCIER, ebci);
>  	else
>  		dma_writel(atdma, EBCIDR, ebci);
>  }
>  
> -static inline void atc_enable_irq(struct at_dma_chan *atchan)
> +static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id)
>  {
> -	atc_setup_irq(atchan, 1);
> +	atc_setup_irq(atdma, chan_id, 1);
>  }
>  
> -static inline void atc_disable_irq(struct at_dma_chan *atchan)
> +static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id)
>  {
> -	atc_setup_irq(atchan, 0);
> +	atc_setup_irq(atdma, chan_id, 0);
>  }
>  
>  


-- 
Nicolas Ferre

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

* Re: [PATCH] at_hdmac: bugfix for enabling channel irq
  2012-01-17 15:28 ` Nicolas Ferre
@ 2012-01-30  9:01   ` Nicolas Ferre
  2012-01-31  3:43   ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Ferre @ 2012-01-30  9:01 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Nikolaus Voss, Dan Williams, linux-kernel, linux-arm-kernel

On 01/17/2012 04:28 PM, Nicolas Ferre :
> On 01/17/2012 10:28 AM, Nikolaus Voss :
>> commit 463894705e4089d0ff69e7d877312d496ac70e5b deleted redundant
>> chan_id and chancnt initialization in dma drivers as this is done
>> in dma_async_device_register().
>>
>> However, atc_enable_irq() relied on chan_id set before registering
>> the device, what left only channel 0 functional for this driver.
>>
>> This patch introduces atc_enable/disable_chan_irq() as a variant
>> of atc_enable/disable_irq() with the channel as explicit argument.
>>
>> Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: stable <stable@vger.kernel.org>
> 
> Vinod, can you please queue it in a "fixes" branch for 3.3. The stable
> tag is needed to address errors in 3.2 kernel series.


Vinod, ping?


> Nikolaus, thanks for your fix.
> 
> Best regards,
> 
>> ---
>>  drivers/dma/at_hdmac.c      |    4 ++--
>>  drivers/dma/at_hdmac_regs.h |   17 ++++++++---------
>>  2 files changed, 10 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
>> index fcfa0a8..a60adbf 100644
>> --- a/drivers/dma/at_hdmac.c
>> +++ b/drivers/dma/at_hdmac.c
>> @@ -1286,7 +1286,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
>>  
>>  		tasklet_init(&atchan->tasklet, atc_tasklet,
>>  				(unsigned long)atchan);
>> -		atc_enable_irq(atchan);
>> +		atc_enable_chan_irq(atdma, i);
>>  	}
>>  
>>  	/* set base routines */
>> @@ -1353,7 +1353,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
>>  		struct at_dma_chan	*atchan = to_at_dma_chan(chan);
>>  
>>  		/* Disable interrupts */
>> -		atc_disable_irq(atchan);
>> +		atc_disable_chan_irq(atdma, chan->chan_id);
>>  		tasklet_disable(&atchan->tasklet);
>>  
>>  		tasklet_kill(&atchan->tasklet);
>> diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
>> index aa4c9ae..5aa82b4 100644
>> --- a/drivers/dma/at_hdmac_regs.h
>> +++ b/drivers/dma/at_hdmac_regs.h
>> @@ -326,28 +326,27 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
>>  }
>>  
>>  
>> -static void atc_setup_irq(struct at_dma_chan *atchan, int on)
>> +static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on)
>>  {
>> -	struct at_dma	*atdma = to_at_dma(atchan->chan_common.device);
>> -	u32		ebci;
>> +	u32 ebci;
>>  
>>  	/* enable interrupts on buffer transfer completion & error */
>> -	ebci =    AT_DMA_BTC(atchan->chan_common.chan_id)
>> -		| AT_DMA_ERR(atchan->chan_common.chan_id);
>> +	ebci =    AT_DMA_BTC(chan_id)
>> +		| AT_DMA_ERR(chan_id);
>>  	if (on)
>>  		dma_writel(atdma, EBCIER, ebci);
>>  	else
>>  		dma_writel(atdma, EBCIDR, ebci);
>>  }
>>  
>> -static inline void atc_enable_irq(struct at_dma_chan *atchan)
>> +static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id)
>>  {
>> -	atc_setup_irq(atchan, 1);
>> +	atc_setup_irq(atdma, chan_id, 1);
>>  }
>>  
>> -static inline void atc_disable_irq(struct at_dma_chan *atchan)
>> +static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id)
>>  {
>> -	atc_setup_irq(atchan, 0);
>> +	atc_setup_irq(atdma, chan_id, 0);
>>  }
>>  
>>  
> 
> 


-- 
Nicolas Ferre

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

* Re: [PATCH] at_hdmac: bugfix for enabling channel irq
  2012-01-17 15:28 ` Nicolas Ferre
  2012-01-30  9:01   ` Nicolas Ferre
@ 2012-01-31  3:43   ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2012-01-31  3:43 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: Nikolaus Voss, Dan Williams, linux-kernel, linux-arm-kernel

On Tue, 2012-01-17 at 16:28 +0100, Nicolas Ferre wrote:
> On 01/17/2012 10:28 AM, Nikolaus Voss :
> > commit 463894705e4089d0ff69e7d877312d496ac70e5b deleted redundant
> > chan_id and chancnt initialization in dma drivers as this is done
> > in dma_async_device_register().
> > 
> > However, atc_enable_irq() relied on chan_id set before registering
> > the device, what left only channel 0 functional for this driver.
> > 
> > This patch introduces atc_enable/disable_chan_irq() as a variant
> > of atc_enable/disable_irq() with the channel as explicit argument.
> > 
> > Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: stable <stable@vger.kernel.org>
> 
> Vinod, can you please queue it in a "fixes" branch for 3.3. The stable
> tag is needed to address errors in 3.2 kernel series.
Thanks Applied now, and sorry for the delay

Tomorrow I will send pull request to Linus.
> 
> Nikolaus, thanks for your fix.
> 
> Best regards,
> 
> > ---
> >  drivers/dma/at_hdmac.c      |    4 ++--
> >  drivers/dma/at_hdmac_regs.h |   17 ++++++++---------
> >  2 files changed, 10 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> > index fcfa0a8..a60adbf 100644
> > --- a/drivers/dma/at_hdmac.c
> > +++ b/drivers/dma/at_hdmac.c
> > @@ -1286,7 +1286,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
> >  
> >  		tasklet_init(&atchan->tasklet, atc_tasklet,
> >  				(unsigned long)atchan);
> > -		atc_enable_irq(atchan);
> > +		atc_enable_chan_irq(atdma, i);
> >  	}
> >  
> >  	/* set base routines */
> > @@ -1353,7 +1353,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
> >  		struct at_dma_chan	*atchan = to_at_dma_chan(chan);
> >  
> >  		/* Disable interrupts */
> > -		atc_disable_irq(atchan);
> > +		atc_disable_chan_irq(atdma, chan->chan_id);
> >  		tasklet_disable(&atchan->tasklet);
> >  
> >  		tasklet_kill(&atchan->tasklet);
> > diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
> > index aa4c9ae..5aa82b4 100644
> > --- a/drivers/dma/at_hdmac_regs.h
> > +++ b/drivers/dma/at_hdmac_regs.h
> > @@ -326,28 +326,27 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
> >  }
> >  
> >  
> > -static void atc_setup_irq(struct at_dma_chan *atchan, int on)
> > +static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on)
> >  {
> > -	struct at_dma	*atdma = to_at_dma(atchan->chan_common.device);
> > -	u32		ebci;
> > +	u32 ebci;
> >  
> >  	/* enable interrupts on buffer transfer completion & error */
> > -	ebci =    AT_DMA_BTC(atchan->chan_common.chan_id)
> > -		| AT_DMA_ERR(atchan->chan_common.chan_id);
> > +	ebci =    AT_DMA_BTC(chan_id)
> > +		| AT_DMA_ERR(chan_id);
> >  	if (on)
> >  		dma_writel(atdma, EBCIER, ebci);
> >  	else
> >  		dma_writel(atdma, EBCIDR, ebci);
> >  }
> >  
> > -static inline void atc_enable_irq(struct at_dma_chan *atchan)
> > +static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id)
> >  {
> > -	atc_setup_irq(atchan, 1);
> > +	atc_setup_irq(atdma, chan_id, 1);
> >  }
> >  
> > -static inline void atc_disable_irq(struct at_dma_chan *atchan)
> > +static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id)
> >  {
> > -	atc_setup_irq(atchan, 0);
> > +	atc_setup_irq(atdma, chan_id, 0);
> >  }
> >  
> >  
> 
> 


-- 
~Vinod


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

end of thread, other threads:[~2012-01-31  3:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-17  9:28 [PATCH] at_hdmac: bugfix for enabling channel irq Nikolaus Voss
2012-01-17 15:28 ` Nicolas Ferre
2012-01-30  9:01   ` Nicolas Ferre
2012-01-31  3:43   ` Vinod Koul

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).