Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp469599imp; Wed, 20 Feb 2019 03:30:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IbLDahoY5aZ0HsnidmPKkCFIVZJQnd/700vW35IKnXIkE3zOZy+vif7F0fzosjbhfyVAgnc X-Received: by 2002:a62:e216:: with SMTP id a22mr34235549pfi.20.1550662216674; Wed, 20 Feb 2019 03:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550662216; cv=none; d=google.com; s=arc-20160816; b=nGW8yy3nnxjzXnar+AId5PLwao4KB4IBkTdWujIVqgornNjKvxU6COb64oBdjdNEY+ 2pAkl93Dcuo6PpXBMVBs7hIkzO+u4CWwVim7CmQTDCCu3306MLvyvydK6Am7l9h5OO8j EhvYQ+4kBfW52kphu7KzyFZ0aGiXtd/1IbuSEkTskpFb0kFPC8cXBqBVSm+fySz1X4kJ RqtccSLHSOvHGoqPzrlrXMAMFurSzVf1JBtf8AOGDFP/sB3lgND9H8xpe56XSHi9KPKN iWDhV38LwWQCsDNVqeSVkAc145EYCuL+fdK+Rt1TXeebTLsrDzdT4qvRr4Fn+sCFgyUM cdAw== 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:dkim-signature; bh=0ekYov34e3h7u4UagIP+Zwo8KjjfYo+mnO834hleTZ4=; b=okj2U/SMpQ3Ldg4hxI2VpqKoUB4dEdvmhWD0kno69RTFKpJRI1fBMFnaErpHnf9Abx SpvaCszpdd3VnWnDJrCfFpghD03nuxceWq9Of/jPzfUDp6wYEfwRytVECl1H/PuRP8+w viu0rVR6Cd93ttBKqh/c5Wv00SwNbgYo2bcZiiZtiAQojYMGESXkdvM42Uh09kK09kRY rWjkj4SA2m4CeJ8SbLnkomtr9qxtTxtR1jYFKmTR5Ec9BcSn1RL+VpUS0JUqEeOPA2lv sIFqOjLcOSkodgDrTFV9hk4/R7g57HNgPyCdbwE5Uc+wUpZo4M1mKXCU1XnvFPF6wwu8 yeAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HYTfXEaP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si18245937pgc.186.2019.02.20.03.30.01; Wed, 20 Feb 2019 03:30:16 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=HYTfXEaP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726888AbfBTL3i (ORCPT + 99 others); Wed, 20 Feb 2019 06:29:38 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42454 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfBTL3h (ORCPT ); Wed, 20 Feb 2019 06:29:37 -0500 Received: by mail-lj1-f195.google.com with SMTP id d14so9303240ljl.9 for ; Wed, 20 Feb 2019 03:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0ekYov34e3h7u4UagIP+Zwo8KjjfYo+mnO834hleTZ4=; b=HYTfXEaPkaICjJnZ4jr8pRdKYfpJNSFMHI8bCK02hqnq5Ibjj4ZZGTU7D4fXTqJzXS U5kXaWRwI28r8buinjdqah6lA6jNn2yJU74clGfzkZnViqBKQ45qcvctt20YxUx6cxIm s3T5Wc+fci5nTIZdZ4vurnByMBEDoihIfwGDsTf8r7NjcVvr52M3yagkQugubIdiq6Ky yfa6ownOi8PUg1lQSUfBfEEsEf8yaa/eheO/9JrIMY000UiwP7WOTzP2SE7sU4/z8Wfy giO+nbJr2fM+sctHb7T4UvqhlodCx51nMMkzx/2fE7RwS300qN2ehJGh2Cxs1+ZK3YGS AWug== 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=0ekYov34e3h7u4UagIP+Zwo8KjjfYo+mnO834hleTZ4=; b=sw2sgc5CDLo/QZ/mx5weKdWCTxfkp2r0cvWjK+YiBh+mD13FZr75WmXA21bVR+HpO7 PWnOIVn3DSjp/kh56+9/iqpFKlokaZPwpA23SgmHQYehrRLP3BJKNn2nq74hkhlAni1e i6WE1dw4Ga4+K/L7HIfbt/HDd/oU9Uc3azKTpuwzdV6kW2JXyr3JbjrScfD9Gv8zCBRM L0IeBZKdmISbFzzCL7C9shUq30LlzJiVjSDJKu0r5qNZoE8Wze123t8pt6BZxpnCwPPY rW6UkyfoRCxjJWHaQJmLQoxaEd5zaNlPjz438hBDc2w4hfTBC7lYtGen3ykZJ5ILHO7d eCwA== X-Gm-Message-State: AHQUAubdzhZsfD5zV4QiEeiLKlcXNG7YX0VjD2+OrnO6XpAtw4l0JqG1 xs0bJN/rJ6+70AHrhiBR1jPmTp+c0P7LUBqIMhky6g== X-Received: by 2002:a2e:81c7:: with SMTP id s7mr20131487ljg.146.1550662174696; Wed, 20 Feb 2019 03:29:34 -0800 (PST) MIME-Version: 1.0 References: <20190219122027.GA21884@vkoul-mobl> In-Reply-To: From: Baolin Wang Date: Wed, 20 Feb 2019 19:29:23 +0800 Message-ID: Subject: Re: [PATCH 1/3] dt-bindings: dmaengine: Add one new cell to present hardware slave id To: Arnd Bergmann Cc: Vinod Koul , Geert Uytterhoeven , Rob Herring , Mark Rutland , Olof Johansson , Orson Zhai , Lyra Zhang , Dan Williams , DTML , arm-soc , Linux ARM , Linux Kernel Mailing List , dmaengine@vger.kernel.org, eric.long@unisoc.com, Mark Brown 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 Wed, 20 Feb 2019 at 17:08, Arnd Bergmann wrote: > > On Wed, Feb 20, 2019 at 4:13 AM Baolin Wang wrote: > > On Tue, 19 Feb 2019 at 20:20, Vinod Koul wrote: > > > On 19-02-19, 17:49, Baolin Wang wrote: > > > > On Tue, 19 Feb 2019 at 17:30, Geert Uytterhoeven wrote: > > > > > On Tue, Feb 19, 2019 at 4:15 AM Baolin Wang wrote: > > > > > > On Mon, 18 Feb 2019 at 20:23, Arnd Bergmann wrote: > > > > > > > On Mon, Feb 18, 2019 at 11:52 AM Baolin Wang wrote: > > > > > > > > On Mon, 18 Feb 2019 at 18:31, Arnd Bergmann wrote: > > > > > > > I did understand the need for a slave-id, I was instead wondering about > > > > > > > the channel-id number. On many SoCs, all channels are equal, and you > > > > > > > just have to pick one of those with the right capabilities for a particular > > > > > > > slave. > > > > > > > > > > > > Yes, all channels are equal. We just set a unique slave id for the > > > > > > channel for a particular slave. For example, the SPI slave can use > > > > > > channel 10 for tx transfer by setting slave id 11, or it also can use > > > > > > channel 9 for tx transfer by setting same slave id 11. > > > > > > > > > > So the channel selection is software policy, not hardware description, and > > > > > thus doesn't belong in DT? > > > > > > > > > > Can't the DMA engine driver allocate channels dynamically, removing the > > > > > need to specify this in DT? > > > > > > > > In theory we can do as you suggested. But we still want to > > > > manage/assign the DMA channel resources manually for one SoC, we can > > > > make sure some important DMA slaves (such as audio) can request a DMA > > > > channel at runtime firstly, another benefit is that it is easy to > > > > debug since we can easily know which channel is assigned for this > > > > slave. > > > > > > Are you suggesting that you have more users than channels available? > > > > Until now we have not met this issue, but we can not make sure if this > > can happen in future. Moreover DMA channel resources are belonging to > > the DMA engine's hardware resources, I think it should be described in > > DT like many other drivers did. > > As far as I can tell, most platforms do not describe the assignment > of resources in DT for dma engines, the numbers in there are meant to > describe whatever is fixed, and most platforms should do it that way. > > The naming is sometimes a bit confusing, as a dma request line > assignment can be called a slave-id or a channel-id depending whose > documentation you read. The drivers/dma/virt-dma.c implementation > is used in some cases to represent request numbers as virtual > channels, so a dmaengine driver can allow one dma_request_chan() > per slave, and then assign the hardware channels dynamically > while doing a transfer, rather than having a fixed channel assignment > when we first ask for a channel. Okay, sounds reasonable to me, and I think no issues will happen if we assign channels dynamically after some slave usages' investigation. I will remove channel id from DT in next version. Thanks for all your help. -- Baolin Wang Best Regards