From patchwork Sat Sep 14 00:57:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 2892841 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 789D3BFF05 for ; Sat, 14 Sep 2013 00:58:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F8CB20266 for ; Sat, 14 Sep 2013 00:58:33 +0000 (UTC) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A4E592026C for ; Sat, 14 Sep 2013 00:58:32 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r8E0vPAB023546; Fri, 13 Sep 2013 19:57:25 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r8E0vP1u009788; Fri, 13 Sep 2013 19:57:25 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Fri, 13 Sep 2013 19:57:25 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id r8E0vP3u010052; Fri, 13 Sep 2013 19:57:25 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 1EC2C80627; Fri, 13 Sep 2013 19:57:25 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflxv15.itg.ti.com (dflxv15.itg.ti.com [128.247.5.124]) by linux.omap.com (Postfix) with ESMTP id 6813880626 for ; Fri, 13 Sep 2013 19:57:23 -0500 (CDT) Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r8E0vN9d009739; Fri, 13 Sep 2013 19:57:23 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Fri, 13 Sep 2013 19:57:22 -0500 Received: from [172.24.57.43] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id r8E0vM1L017918; Fri, 13 Sep 2013 19:57:22 -0500 Message-ID: <5233B471.40603@ti.com> Date: Fri, 13 Sep 2013 19:57:21 -0500 From: Joel Fernandes User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Sekhar Nori Subject: Re: [PATCH v3] ARM: EDMA: Fix clearing of unused list for DT DMA resources References: <1378839171-14455-1-git-send-email-joelf@ti.com> <5231903F.7080301@ti.com> In-Reply-To: <5231903F.7080301@ti.com> CC: Linux DaVinci Kernel List , Russell King , Vinod Koul , Linux MMC List , Koen Kooi , Jyri Sarah , Linux Kernel Mailing List , Dan Williams , Linux OMAP List , Linux ARM Kernel List X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 09/12/2013 04:58 AM, Sekhar Nori wrote: > On Wednesday 11 September 2013 12:22 AM, Joel Fernandes wrote: >> HWMOD removal for MMC is breaking edma_start as the events are being manually >> triggered due to unused channel list not being clear. [..] > It is better to send one version with all comments fixed. Helps avoid > confusion. Ok, here is the final version with all comments fixed, please apply this one: --->8--- From: Joel Fernandes Subject: [PATCH v4] ARM: EDMA: Fix clearing of unused list for DT DMA resources HWMOD removal for MMC is breaking edma_start as the events are being manually triggered due to unused channel list not being clear. This patch fixes the issue, by reading the "dmas" property from the DT node if it exists and clearing the bits in the unused channel list. For this purpose we use the of_* helpers to parse the arguments in the dmas phandle list. Reviewed-by: Sekhar Nori Reported-by: Balaji T K Cc: Pantel Antoniou Signed-off-by: Joel Fernandes --- Changes since v1, in v2 and v3: - Reduced indentation of non-of case by returning from of-case - Using of_* helpers for parsing Note: This patch should go into the merge window as it is a critical bug fix. arch/arm/common/edma.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 39ad030..43c7b22 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c @@ -560,14 +560,33 @@ static int reserve_contiguous_slots(int ctlr, unsigned int id, static int prepare_unused_channel_list(struct device *dev, void *data) { struct platform_device *pdev = to_platform_device(dev); - int i, ctlr; + int i, count, ctlr; + struct of_phandle_args dma_spec; + if (dev->of_node) { + count = of_property_count_strings(dev->of_node, "dma-names"); + if (count < 0) + return 0; + for (i = 0; i < count; i++) { + if (of_parse_phandle_with_args(dev->of_node, "dmas", + "#dma-cells", i, + &dma_spec)) + continue; + + ctlr = EDMA_CTLR(dma_spec.args[0]); + clear_bit(EDMA_CHAN_SLOT(dma_spec.args[0]), + edma_cc[ctlr]->edma_unused); + } + return 0; + } + + /* For non-OF case */ for (i = 0; i < pdev->num_resources; i++) { if ((pdev->resource[i].flags & IORESOURCE_DMA) && (int)pdev->resource[i].start >= 0) { ctlr = EDMA_CTLR(pdev->resource[i].start); clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start), - edma_cc[ctlr]->edma_unused); + edma_cc[ctlr]->edma_unused); } }