public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma: pl330: Support per channel irq allocation
@ 2013-09-30  6:50 Michal Simek
  2013-10-13 15:31 ` Vinod Koul
  2013-10-13 16:07 ` Vinod Koul
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2013-09-30  6:50 UTC (permalink / raw)
  To: linux-kernel, monstr, vinod.koul; +Cc: Dan Williams

[-- Attachment #1: Type: text/plain, Size: 1427 bytes --]

Some pl330 have per channel irq and it is necessary
to allocate all of them. Loop over irq assigned for this
device to support these pl330 IPs.

For example this IP is available on Xilinx Zynq platform.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
Hi Vinod,

this is the patch I told you about it. I have tested it
just on Zynq(8 dma channels) but it shouldn't break
any other pl330 clones.
One more change has to be done to support all 8 dma channels
which is to extend AMBA_NR_IRQS which is still 2.
But I will send separate patch for it directly to Russell.

Thanks,
Michal

---
 drivers/dma/pl330.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 58623dc..96de393 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2922,11 +2922,18 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)

 	amba_set_drvdata(adev, pdmac);

-	irq = adev->irq[0];
-	ret = devm_request_irq(&adev->dev, irq, pl330_irq_handler, 0,
-			dev_name(&adev->dev), pi);
-	if (ret)
-		return ret;
+	for (i = 0; i <= AMBA_NR_IRQS; i++) {
+		irq = adev->irq[i];
+		if (irq) {
+			ret = devm_request_irq(&adev->dev, irq,
+					       pl330_irq_handler, 0,
+					       dev_name(&adev->dev), pi);
+			if (ret)
+				return ret;
+		} else {
+			break;
+		}
+	}

 	pi->pcfg.periph_id = adev->periphid;
 	ret = pl330_add(pi);
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] dma: pl330: Support per channel irq allocation
  2013-09-30  6:50 [PATCH] dma: pl330: Support per channel irq allocation Michal Simek
@ 2013-10-13 15:31 ` Vinod Koul
  2013-10-13 16:32   ` Lars-Peter Clausen
  2013-10-13 16:07 ` Vinod Koul
  1 sibling, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2013-10-13 15:31 UTC (permalink / raw)
  To: Michal Simek; +Cc: linux-kernel, monstr, Dan Williams, Lars-Peter Clausen

[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]

On Mon, Sep 30, 2013 at 08:50:48AM +0200, Michal Simek wrote:
> Some pl330 have per channel irq and it is necessary
> to allocate all of them. Loop over irq assigned for this
> device to support these pl330 IPs.
> 
> For example this IP is available on Xilinx Zynq platform.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> Hi Vinod,
> 
> this is the patch I told you about it. I have tested it
> just on Zynq(8 dma channels) but it shouldn't break
> any other pl330 clones.
> One more change has to be done to support all 8 dma channels
> which is to extend AMBA_NR_IRQS which is still 2.
> But I will send separate patch for it directly to Russell.

Thanks, this patch looks fine, Lars can you try testing this if you have this HW
please?

~Vinod
> 
> Thanks,
> Michal
> 
> ---
>  drivers/dma/pl330.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 58623dc..96de393 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2922,11 +2922,18 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
> 
>  	amba_set_drvdata(adev, pdmac);
> 
> -	irq = adev->irq[0];
> -	ret = devm_request_irq(&adev->dev, irq, pl330_irq_handler, 0,
> -			dev_name(&adev->dev), pi);
> -	if (ret)
> -		return ret;
> +	for (i = 0; i <= AMBA_NR_IRQS; i++) {
> +		irq = adev->irq[i];
> +		if (irq) {
> +			ret = devm_request_irq(&adev->dev, irq,
> +					       pl330_irq_handler, 0,
> +					       dev_name(&adev->dev), pi);
> +			if (ret)
> +				return ret;
> +		} else {
> +			break;
> +		}
> +	}
> 
>  	pi->pcfg.periph_id = adev->periphid;
>  	ret = pl330_add(pi);
> --
> 1.8.2.3
> 



-- 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] dma: pl330: Support per channel irq allocation
  2013-09-30  6:50 [PATCH] dma: pl330: Support per channel irq allocation Michal Simek
  2013-10-13 15:31 ` Vinod Koul
@ 2013-10-13 16:07 ` Vinod Koul
  1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2013-10-13 16:07 UTC (permalink / raw)
  To: Michal Simek; +Cc: linux-kernel, monstr, Dan Williams

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

On Mon, Sep 30, 2013 at 08:50:48AM +0200, Michal Simek wrote:
> Some pl330 have per channel irq and it is necessary
> to allocate all of them. Loop over irq assigned for this
> device to support these pl330 IPs.
> 
> For example this IP is available on Xilinx Zynq platform.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Applied, thanks

~Vinod

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] dma: pl330: Support per channel irq allocation
  2013-10-13 15:31 ` Vinod Koul
@ 2013-10-13 16:32   ` Lars-Peter Clausen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2013-10-13 16:32 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Michal Simek, linux-kernel, monstr, Dan Williams

On 10/13/2013 05:31 PM, Vinod Koul wrote:
> On Mon, Sep 30, 2013 at 08:50:48AM +0200, Michal Simek wrote:
>> Some pl330 have per channel irq and it is necessary
>> to allocate all of them. Loop over irq assigned for this
>> device to support these pl330 IPs.
>>
>> For example this IP is available on Xilinx Zynq platform.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>> Hi Vinod,
>>
>> this is the patch I told you about it. I have tested it
>> just on Zynq(8 dma channels) but it shouldn't break
>> any other pl330 clones.
>> One more change has to be done to support all 8 dma channels
>> which is to extend AMBA_NR_IRQS which is still 2.
>> But I will send separate patch for it directly to Russell.
>
> Thanks, this patch looks fine, Lars can you try testing this if you have this HW
> please?
>
> ~Vinod

Michal and I are using the same hardware, I have his patch in my tree and it is 
working fine.

Tested-by: Lars-Peter Clausen <lars@metafoo.de>

>>
>> Thanks,
>> Michal
>>
>> ---
>>   drivers/dma/pl330.c | 17 ++++++++++++-----
>>   1 file changed, 12 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
>> index 58623dc..96de393 100644
>> --- a/drivers/dma/pl330.c
>> +++ b/drivers/dma/pl330.c
>> @@ -2922,11 +2922,18 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
>>
>>   	amba_set_drvdata(adev, pdmac);
>>
>> -	irq = adev->irq[0];
>> -	ret = devm_request_irq(&adev->dev, irq, pl330_irq_handler, 0,
>> -			dev_name(&adev->dev), pi);
>> -	if (ret)
>> -		return ret;
>> +	for (i = 0; i <= AMBA_NR_IRQS; i++) {
>> +		irq = adev->irq[i];
>> +		if (irq) {
>> +			ret = devm_request_irq(&adev->dev, irq,
>> +					       pl330_irq_handler, 0,
>> +					       dev_name(&adev->dev), pi);
>> +			if (ret)
>> +				return ret;
>> +		} else {
>> +			break;
>> +		}
>> +	}
>>
>>   	pi->pcfg.periph_id = adev->periphid;
>>   	ret = pl330_add(pi);
>> --
>> 1.8.2.3
>>
>
>
>


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

end of thread, other threads:[~2013-10-13 16:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-30  6:50 [PATCH] dma: pl330: Support per channel irq allocation Michal Simek
2013-10-13 15:31 ` Vinod Koul
2013-10-13 16:32   ` Lars-Peter Clausen
2013-10-13 16:07 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox