[1/1] arm :omap :DMA: fix a bug on reserving the omap SDMA channels
diff mbox

Message ID 1356813800-4705-1-git-send-email-ahemaily@gmail.com
State New, archived
Headers show

Commit Message

ahemaily@gmail.com Dec. 29, 2012, 8:43 p.m. UTC
From: ahemaily <ahemaily@gmail.com>

The variable  dma_lch_count  used for comparison  (omap_dma_reserve_channels <= dma_lch_count)
before it initialized to the value from omap_dma_dev_attr : d->lch_count.

I change the place of dma_lch_count initialization to be before the comparison.

Signed-off-by: Abdelrahman Hemaily <ahemaily@gmail.com>
---
 arch/arm/plat-omap/dma.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Santosh Shilimkar Dec. 30, 2012, 6:24 a.m. UTC | #1
$subject
s/arm:omap/ARM: OMAP:

On Sunday 30 December 2012 02:13 AM, ahemaily@gmail.com wrote:
> From: ahemaily <ahemaily@gmail.com>
>
> The variable  dma_lch_count  used for comparison  (omap_dma_reserve_channels <= dma_lch_count)
> before it initialized to the value from omap_dma_dev_attr : d->lch_count.
s/it/it is

> I change the place of dma_lch_count initialization to be before the comparison.
>
s/I change the place of dma_lch_count initialization to be before the 
comparison./ Initialize dma_lch_count before it is being used for 
comparison.

> Signed-off-by: Abdelrahman Hemaily <ahemaily@gmail.com>
> ---
Change looks good to my eyes o.w

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
R Sricharan Jan. 3, 2013, 7:28 a.m. UTC | #2
Hi,

On Sunday 30 December 2012 02:13 AM, ahemaily@gmail.com wrote:
> From: ahemaily <ahemaily@gmail.com>
>
> The variable  dma_lch_count  used for comparison  (omap_dma_reserve_channels <= dma_lch_count)
> before it initialized to the value from omap_dma_dev_attr : d->lch_count.
>
> I change the place of dma_lch_count initialization to be before the comparison.
>
> Signed-off-by: Abdelrahman Hemaily <ahemaily@gmail.com>
> ---
>   arch/arm/plat-omap/dma.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
> index c76ed8b..cb3e321 100644
> --- a/arch/arm/plat-omap/dma.c
> +++ b/arch/arm/plat-omap/dma.c
> @@ -2014,12 +2014,12 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
>
>   	d			= p->dma_attr;
>   	errata			= p->errata;
> -
> +	dma_lch_count           = d->lch_count;
> +
>   	if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels
>   			&& (omap_dma_reserve_channels <= dma_lch_count))
>   		d->lch_count	= omap_dma_reserve_channels;
>
> -	dma_lch_count		= d->lch_count;
    By removing this line, you are effectively not assigning
    d->lch_count after reserving. So the patch should only change
    dma_lch_count in the above "if statement" to d->lch_count

Regards,
  Sricharan


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

Patch
diff mbox

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index c76ed8b..cb3e321 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -2014,12 +2014,12 @@  static int __devinit omap_system_dma_probe(struct platform_device *pdev)
 
 	d			= p->dma_attr;
 	errata			= p->errata;
-
+	dma_lch_count           = d->lch_count;
+
 	if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels
 			&& (omap_dma_reserve_channels <= dma_lch_count))
 		d->lch_count	= omap_dma_reserve_channels;
 
-	dma_lch_count		= d->lch_count;
 	dma_chan_count		= dma_lch_count;
 	dma_chan		= d->chan;
 	enable_1510_mode	= d->dev_caps & ENABLE_1510_MODE;