Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbbDPWDw (ORCPT ); Thu, 16 Apr 2015 18:03:52 -0400 Received: from smtp.domeneshop.no ([194.63.252.55]:41748 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbbDPWDo (ORCPT ); Thu, 16 Apr 2015 18:03:44 -0400 Message-ID: <553031B2.1090103@tronnes.org> Date: Fri, 17 Apr 2015 00:03:30 +0200 From: =?UTF-8?B?Tm9yYWxmIFRyw7hubmVz?= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: linux-rpi-kernel@lists.infradead.org CC: Alexander Stein , Stefan Wahren , dmaengine@vger.kernel.org, vinod.koul@intel.com, dan.j.williams@intel.com, jonathan@raspberrypi.org, "linux-kernel@vger.kernel.org" , Stephen Warren Subject: Re: [PATCH] dmaengine: bcm2835: Add slave dma support References: <1429091778-26350-1-git-send-email-noralf@tronnes.org> <552EB54A.3060404@lategoodbye.de> <8408334.G8cbCZ65GO@kongar> In-Reply-To: <8408334.G8cbCZ65GO@kongar> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3180 Lines: 61 Den 16.04.2015 21:06, skrev Alexander Stein: > Hi Stefan, > > On Wednesday 15 April 2015, 21:00:26 wrote Stefan Wahren: >> Am 15.04.2015 um 11:56 schrieb Noralf Trønnes: >>> Add slave transfer capability to BCM2835 dmaengine driver. >>> This patch is pulled from the bcm2708-dmaengine driver in the >>> Raspberry Pi repo. The work was done by Gellert Weisz. >>> >>> Tested with the bcm2835-mmc driver from the same repo. >> why not with the upstream kernel? > I also looked at slave dma support, especially for use in mmc. It turns our that bcm2835-mmc is written more or less completly new. > Mainline linux uses sdhci "framework" which internally uses the SDMA and/or ADMA (both internal, to SD/MMC controller, DMA units) which can be supported by an SDHCI compatible controller. > AFAIK the SD/MMC controller in bcm2835 lacks both that is why the driver only uses PIO. I dunno if external DMA usage can so easily be integrated into the sdhci, I have my doubts. I asked Jonathan Bell (Raspberry Pi) about why a new driver was made instead of extending sdhci-bcm2835. On 10.04.2015 20:02, Jonathan Bell wrote: > Basically, it's impossible to integrate platform DMA channel support > within the SDHCI framework. The Arasan controller (and the Broadcom > MMCI controller) both use platform DMA channels to pump data to/from > the host FIFO. Our old "sdhci-bcm2708" driver basically hacked sdhci.c > to allow platform DMA support in a way that was guaranteed to cause > merge conflicts with every new kernel branch. The reasoning behind > creating an MMC-level driver was to minimise disruption of incorporating > platform DMA and to have additional control e.g. on sequencing of commands > that are known to have bugs/problems. There are drivers in the source > tree that are "SDHCI compliant" but have their own various idiosyncrasies > - e.g. : http://lxr.free-electrons.com/source/drivers/mmc/host/davinci_mmc.c > Implementing an MMC-level driver was the easiest way to incorporate all > our various bits of baggage (random necessary delays here, busy-wait there) > without disrupting the rest of the codebase. I agree that some functions > could just substitute the sdhci.c equivalents and deduplicate some of the code. Stephen Warren made this comment on a previous attempt to upstream the bcm2835-mmc driver: On Tue, 28 Oct 2014 19:55:20 -0600, Stephen Warren wrote: > On 10/28/2014 06:00 PM, Piotr Król wrote: > > This is driver for Arasan External Mass Media Controller provided in > > Raspberry Pi single board computer. > > We should not have multiple drivers for the same HW. The correct > approach would be to enhance the existing sdhci-bcm2835.c to support any > new features or bug-fixes embodied within this driver. Presumably that > way, you'd also end up with a lot of small feature patches, which would > make patch review easier. Consequently I haven't reviewed this patch much. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/