From patchwork Thu Jan 3 08:38:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 1926691 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 75055DF25A for ; Thu, 3 Jan 2013 08:40:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TqgJI-00037w-QX; Thu, 03 Jan 2013 08:37:56 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TqgJF-00037B-4q for linux-arm-kernel@lists.infradead.org; Thu, 03 Jan 2013 08:37:54 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r038bfgI014262; Thu, 3 Jan 2013 02:37:41 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r038beg2030115; Thu, 3 Jan 2013 02:37:41 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Thu, 3 Jan 2013 02:37:41 -0600 Received: from [172.24.75.130] (h75-130.vpn.ti.com [172.24.75.130]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r038banb010004; Thu, 3 Jan 2013 02:37:37 -0600 Message-ID: <50E5438A.1050902@ti.com> Date: Thu, 3 Jan 2013 14:08:34 +0530 From: Santosh Shilimkar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: R Sricharan Subject: Re: [PATCH 1/1] arm :omap :DMA: fix a bug on reserving the omap SDMA channels References: <1356813800-4705-1-git-send-email-ahemaily@gmail.com> <50E5330B.2060007@ti.com> In-Reply-To: <50E5330B.2060007@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130103_033753_574116_80475B93 X-CRM114-Status: GOOD ( 14.74 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux@arm.linux.org.uk, tony@atomide.com, linux-kernel@vger.kernel.org, ahemaily@gmail.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Thursday 03 January 2013 12:58 PM, R Sricharan wrote: > Hi, > > On Sunday 30 December 2012 02:13 AM, ahemaily@gmail.com wrote: >> From: ahemaily >> >> 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 >> --- >> 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 > You are right. I missed it in last review. Below should be enough. dma_lch_count = d->lch_count; diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 37a488a..555ff7b 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -2019,7 +2019,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) errata = p->errata; if ((d->dev_caps & RESERVE_CHANNEL) && omap_dma_reserve_channels - && (omap_dma_reserve_channels <= dma_lch_count)) + && (omap_dma_reserve_channels <= d->lch_coun)) d->lch_count = omap_dma_reserve_channels;