From patchwork Thu Nov 6 10:22:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 40272 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 66CF224237 for ; Thu, 6 Nov 2014 10:25:20 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf1553792lam.8 for ; Thu, 06 Nov 2014 02:25:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=aKretb9dPa6o9qtqwuZg0zgIvriL2/oYclg+nKl7oos=; b=eYWrJvWHOlLx4gTjZv+GqWgJt2i7cBi0m4i2pBJ8XG3AyVAsVOuhnTbRG3tmHdT591 wN+UZ1MPzt3YARX/jU6qgn683SeRzHNEfdvBpIMOgCqvLhzl3I28vI3QMk9Xe/IsIuRX MU9MLmwhMyB8p29yv70pZWElBvyCRgr0r+kHGoskfWrB5um4qJQ3Li7LbqjpwAHwbQ1N fmu+mjGcUsXZ0+RAeOtKj3kXTktGE/HZO/c7T1ebgQkQmOUdwCPNEHMOlegF5ZCon81E 6u4ImRPnWNzP2mrcEwLL75Qg8mJ1sYnoexsfw6WAt1SAmz3hRvqZj8xiSxc1UljZ6tQf tpew== X-Gm-Message-State: ALoCoQlGh0isojD0XCP8Eh6vLdHZFtQy5fCH+pvhTisQeZsxlhiTxz2FZJGkiOUjbTqmdZ1PKDd+ X-Received: by 10.112.119.194 with SMTP id kw2mr32673lbb.16.1415269518975; Thu, 06 Nov 2014 02:25:18 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.99 with SMTP id bf3ls74067lab.24.gmail; Thu, 06 Nov 2014 02:25:18 -0800 (PST) X-Received: by 10.112.42.198 with SMTP id q6mr4005154lbl.69.1415269518770; Thu, 06 Nov 2014 02:25:18 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id ky4si10995785lbc.28.2014.11.06.02.25.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 02:25:18 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id s18so2363742lam.0 for ; Thu, 06 Nov 2014 02:25:18 -0800 (PST) X-Received: by 10.112.202.104 with SMTP id kh8mr4209058lbc.46.1415269518645; Thu, 06 Nov 2014 02:25:18 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp22689lbc; Thu, 6 Nov 2014 02:25:17 -0800 (PST) X-Received: by 10.66.65.203 with SMTP id z11mr763918pas.152.1415269516543; Thu, 06 Nov 2014 02:25:16 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id fh17si5459439pac.143.2014.11.06.02.25.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 02:25:16 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XmKDu-0007DE-8L; Thu, 06 Nov 2014 10:23:26 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XmKDr-0007Bz-N9 for linux-arm-kernel@lists.infradead.org; Thu, 06 Nov 2014 10:23:24 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id sA6AMsXS014457; Thu, 6 Nov 2014 04:22:54 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA6AMswp027641; Thu, 6 Nov 2014 04:22:54 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Thu, 6 Nov 2014 04:22:54 -0600 Received: from [172.24.190.171] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id sA6AMptO007832; Thu, 6 Nov 2014 04:22:51 -0600 Message-ID: <545B4BFA.5000203@ti.com> Date: Thu, 6 Nov 2014 15:52:50 +0530 From: Sekhar Nori User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Arnd Bergmann , =?windows-1252?Q?Uwe_Kleine-K=F6nig?= Subject: Re: Unconditional registering EMDA platform devices References: <20141024142904.GC3142@lunn.ch> <2124815.5oBngWtcFV@wuerfel> <20141025184854.GA10780@kleine-koenig.org> <2034542.1PWfBB7aBW@wuerfel> In-Reply-To: <2034542.1PWfBB7aBW@wuerfel> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141106_022323_845897_6E2766B3 X-CRM114-Status: GOOD ( 20.89 ) X-Spam-Score: -5.6 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.94.94.40 listed in wl.mailspike.net] -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Vinod Koul , Andrew Lunn , linux-arm-kernel@lists.infradead.org, matt.porter@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nsekhar@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 + Peter, Vinod On Sunday 26 October 2014 12:27 AM, Arnd Bergmann wrote: > On Saturday 25 October 2014 20:48:54 Uwe Kleine-König wrote: >> On Fri, Oct 24, 2014 at 06:14:01PM +0200, Arnd Bergmann wrote: >>> On Friday 24 October 2014 16:29:04 Andrew Lunn wrote: >>>> giving warnings: >>>> >>>> [ 0.114771] edma-dma-engine edma-dma-engine.0: Can't allocate PaRAM dummy slot >>>> [ 0.114794] edma-dma-engine: probe of edma-dma-engine.0 failed with error -5 >>>> >>>> These seem to be coming from drivers/dma/emda.c >>>> >>>> That driver has a subsys_initcall(edma_init); >>>> >>>> and the edma_init function is unconditionally registering a driver and >>>> a platform device. For a multiarch kernel, this is not a good idea. >>>> >>>> Please could you make this conditionally. Maybe look into the DT and >>>> see if the DMA is needed on the platform? >>> >>> I just looked at that code an I'm completely confused about how that >>> even works today. I do see that the driver is used on ATAGS based >>> davinci machines, which means we can't just look into the DT. >>> >>> The main problem seems to stem from arch/arm/common/edma.c being >>> half the driver that provides interfaces to both drivers/dma/edma.c >>> and to sound/soc/davinci/davinci-pcm.c, while drivers/dma/edma.c >>> is not really a driver by itself. My preferred solution to this would >>> be to move arch/arm/common/edma.c into drivers/dma/edma.c and still >>> have it export its private API, but I assume that the dmaengine >>> maintainers have already NAKed that approach. >> Isn't the preferred solution that sound/soc/davinci/davinci-pcm.c only >> uses dmaengine stuff and the private API goes away? > > Absolutely, yes. I believe all other drivers have been converted > already, and it's on somebody's TODO list. Yes, Peter was looking at removing the usage of private DMA API from davinci-pcm. https://lkml.org/lkml/2014/8/11/85 It is still on his TODO. > >>> 8<------- >>> Subject: dma: edma: move device registration to platform code >>> >>> The horrible split between the low-level part of the edma support >>> and the dmaengine front-end driver causes problems on multiplatform >>> kernels. This is an attempt to improve the situation slightly >>> by only registering the dmaengine devices that are actually >>> present. >>> >>> Signed-off-by: Arnd Bergmann I tested this patch on DA850 using MMC/SD as EDMA client and it worked fine. I think it will serve well as intermediate solution while Peter works on folding in arch/arm/common/edma.c into drivers/dma/edma.c I had to add the following patch on top to get DMA_BIT_MASK defined in edma.c ---8<--- In the same patch you can probably get rid of EDMA_CTLRS definition too as you noted below. If you decide to post it formally for Vinod to pick, you can add: Acked-by: Sekhar Nori >>> [...] >>> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c >>> index 123f578d6dd3..4cfaaa5a49be 100644 >>> --- a/drivers/dma/edma.c >>> +++ b/drivers/dma/edma.c >> There is a comment in drivers/dma/edma.c reading: >> >> /* >> * This will go away when the private EDMA API is folded >> * into this driver and the platform device(s) are >> * instantiated in the arch code. We can only get away >> * with this simplification because DA8XX may not be built >> * in the same kernel image with other DaVinci parts. This >> * avoids having to sprinkle dmaengine driver platform devices >> * and data throughout all the existing board files. >> */ >> >> Just looking into arch/arm/mach-davinci/Kconfig it seems wrong that >> DA8XX may not be enabled with other DaVinci parts. So probably there is >> really more broken here ... This was true when the comment was written. We have since moved to AUTO_ZRELADDR and a single config builds all DaVinci boards now. Thanks, Sekhar diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index f6cffee3c6ee..66725eb143ce 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c @@ -31,6 +31,7 @@ #include #include #include +#include #include ---8<---