Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1185458imm; Fri, 17 Aug 2018 13:25:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwinoIecnPgm1FFPNpkfReTHDKLGqY0Y5mYFImdF1k8Acku7nJKaS3LP8UVZdxbScE6p54u X-Received: by 2002:a63:530b:: with SMTP id h11-v6mr34406846pgb.139.1534537536823; Fri, 17 Aug 2018 13:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534537536; cv=none; d=google.com; s=arc-20160816; b=PjkeyPUNMyS/sQ5/i3mauKuVhQmJHALN6oN2sOJ0KrQd2XQpabFUnrcu9U6cyLxppX XiSlMU9FddhFgQ/AuKjrwbbi7QeRM/eho4Dm1u4h1HNuCJtKWjmnSrghJWnDOHPKLrYI ZCPkcbmmMznwIPnaERWTT4ULeUTU7SNX9h/f7npDYCQABGaEf1RbtGFWrMvzbMDo+ncO EwMfi/lUQx4roC5IUppiX8wrqKHYDXqnxnMPM9fCegzPZkKaYvtLdcBd0/qbJxuiO2EP F+I/Qn/ro72FhzfiIqhQFmWQuzjwzg0aye5L9GK0aaJ7fWYoekXPFcJ6ONX10bghLKgh HgbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=GggbUWRL0hidBFZgFvgs58ekcHBf4Rf58pwXd/MN2ko=; b=pAmLx/Y1JCiiz84BEcZHjNUZu710M7M5tgSWVMJgdnqbZTT/fRfxFZZDWGdr06YBoQ xbLRsdAutOephISkmUk0uaB40+0pO3G4Ns9MScU2osynnWAux/pH8XEzxAbmaiKk0zqE kDLnVru6FcChq2DxcQarQCpUDhV7mIdEgmNWPdUPuDLZlKuZBs58JDatEWzvB7vfgk8R dyxn6QfwFhDZXEJNJ8RHKemsUZ9BRDigYoMnRTx0Uyq86OFpF5PdjVv9V0fo61iOZUUP TwBI8Oew682hUmjtOC67FJnFY6AB2Lw6tAlQJMcz4ZMN7C8TrhMQS+Ln1lwBJ2nhzelW u14Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144-v6si2643711pge.259.2018.08.17.13.25.21; Fri, 17 Aug 2018 13:25:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbeHQX2y (ORCPT + 99 others); Fri, 17 Aug 2018 19:28:54 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:37995 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbeHQX2y (ORCPT ); Fri, 17 Aug 2018 19:28:54 -0400 Received: by mail-qt0-f193.google.com with SMTP id x7-v6so848692qtk.5; Fri, 17 Aug 2018 13:24:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GggbUWRL0hidBFZgFvgs58ekcHBf4Rf58pwXd/MN2ko=; b=uK6s+BE8bTUNvvso+Ra6Ltdk5gXpytlrn+qfNB5OpT0dAqYzO5btuYln5a1Qoxcsh9 XIZKU9480AlS8LkcQ4sa2G8L9O7z19PXgX6QNeMxEu4/RHW6v32QUetjGqSwp2TmzNOx dMWivDO92a6kTzOgIIQa/sbJMNKWGwMyhyCeZwmNQBfcPqXglZ1etk3QMh9vb2JIY2iS JsKKGUYkDdAh35L1KSSWKe9svLl1QUQnPQ2PEwgJ/wfp+yfyQKva2f6JxoLj4rulPwHw oXnRD0w2ZINJSvVllLS6D5B1O7pGnnMyziJRtf1l4z12jadnd7fkUYtddIERGWw8gXr6 tQIw== X-Gm-Message-State: AOUpUlHdTe94CSHdId1BA0/km+T9YQnNLPuUlaVrMAlAeEK1B3m7fSaV 6fyIoLBWGy3vKXVUAc5jwIOaPYPVIeqaUYtGRz4= X-Received: by 2002:ac8:1645:: with SMTP id x5-v6mr3227993qtk.389.1534537445544; Fri, 17 Aug 2018 13:24:05 -0700 (PDT) MIME-Version: 1.0 References: <20180724120147.15096-1-hch@lst.de> <20180724202115.GA4685@lst.de> <18df6608-61c1-963d-bb1a-d46320232f40@landley.net> <418f3fa1-036f-d775-f1bc-e96778b4a4d8@landley.net> In-Reply-To: <418f3fa1-036f-d775-f1bc-e96778b4a4d8@landley.net> From: Arnd Bergmann Date: Fri, 17 Aug 2018 22:23:49 +0200 Message-ID: Subject: Re: dmaengine for sh7760 (was Re: use the generic dma-noncoherent code for sh V2) To: Rob Landley Cc: Christoph Hellwig , Yoshinori Sato , Rich Felker , Thomas Petazzoni , "open list:IOMMU DRIVERS" , Jacopo Mondi , Linux Kernel Mailing List , Linux-sh list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 17, 2018 at 7:04 PM Rob Landley wrote: > On 07/31/2018 07:56 AM, Arnd Bergmann wrote: > > On Fri, Jul 27, 2018 at 6:20 PM, Rob Landley wrote: > >> On 07/24/2018 03:21 PM, Christoph Hellwig wrote: > >>> On Tue, Jul 24, 2018 at 02:01:42PM +0200, Christoph Hellwig wrote: > >>>> Hi all, > > If you hack on it, please convert the dmaengine platform data to use > > a dma_slave_map array to pass the data into the dmaengine driver, > > The dmatest module didn't need it? I don't see why the ethernet driver would? > (Isn't the point of an allocator to allocate from a request?) I guess you have hit two of the special cases here: - dmatest uses the memory-to-memory DMA engine interface, not the slave API, so you don't have to configure a slave at all - smc91x (and its smc911x.c relative) are apparently special in that they use they use the DMA slave API but (AFAICT) require programming the dmaengine hardware into a memory-to-memory transfer with no DMA slave request signal and completely synchronous operation (the IRQ handler polls for the DMA descriptor to be complete), see also https://lkml.org/lkml/2018/4/3/464 for the discussion about the recent rework of that driver's implementation. > > mapping the settings from a (pdev-name, channel-id) tuple to a pointer > > that describes the channel configuration rather than having the > > mapping from an numerical slave_id to a struct sh_dmae_slave_config > > in the setup files. It should be a fairly mechanical conversion. > > I think all 8 channels are generic. Drivers should be able to grab them and > release them at will, why does it need a table? > > (I say this not having made the smc91x.c driver use this yet, its "conversion" > to device tree left it full of PXA #ifdefs and constants, and I've tried the Another point about smc91x is that it only uses DMA on the PXA platform, which is not part of the "multiplatform" ARM setup. It's likely that no other platform actually has a DMA engine that can talk to this device in the absence of a request signal, or that on more modern CPU cores, a readsl() is actually just as fast, but it avoids the setup cost of talking to the dma engine. Possibly both of the above. > last half-dozen kernel releases and qemu releases and have yet to find an arm > mainstone board under qemu that _doesn't_ time out trying to use DMA with this > card. But that's another post...) Is smc91x the only driver that you want to make use of the DMA engine? I suspect that every other one currently relies on passing a slave ID shdma_chan_filter into dma_request_slave_channel_compat() or dma_request_channel() , which are some of the interfaces we want to remove in the future, to make everything work the same across all platforms. shdma_chan_filter() is one of those that expect its pointer argument to be a number that is in turn associated with an sh_dmae_slave_config structure in the platform data of the dma engine. What the newer dma_request_chan() interface does is to pass a pointer to the slave device and a string as identifier for the same data, which then gets associated through the dma_slave_map. On smc91x, both the device and name argument are NULL, which triggers the special case in the pxa dmaengine driver. > > The other part I noticed is arch/sh/drivers/dma/*, which appears to > > be entirely unused, and should probably removed. > > I had to switch that off to get this to work, yes. I believe it predates > dmaengine and was obsoleted by it. Ok. Have you found any reason to keep it around though? Arnd