From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E93C43387 for ; Mon, 7 Jan 2019 06:26:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C508F206C0 for ; Mon, 7 Jan 2019 06:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546842381; bh=Popv6Sq1yL76yihLROiJyRmTq2fr/Xn+ufoh8ah3sGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=cImxQGXQ4b6epA35/XZJIUg1YReZ9XE6GQ+Dt8tKtetjwi2l0KFYJHGufeejTBxjy 70ejHZTPGzcV3linZNXylUPKy2nFtBP1OXGZcH1ajQ1lGKnP0mqYZiMQhLWJb/LBRK 9PLocmfNAsO4D8mRApO5EcfeeXY9XZCeRoUMBTiQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbfAGG0H (ORCPT ); Mon, 7 Jan 2019 01:26:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:51830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbfAGG0G (ORCPT ); Mon, 7 Jan 2019 01:26:06 -0500 Received: from localhost (unknown [171.76.109.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D669A206C0; Mon, 7 Jan 2019 06:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546842364; bh=Popv6Sq1yL76yihLROiJyRmTq2fr/Xn+ufoh8ah3sGw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OP/z/aFN2FaqTZOFInNl8ENXWJtIBYI2pv8ziUD/zVXytHw2gC4nKQw93COk7EDKU 43+FU0/aC0rJvCfQWV66uiJMyCPPxYYQvj3KbhCUt9x+/4T2oKPzOcJJUEjfum5oPv ABTKvJlPS5zH3lWiDr9W0lizX1GWlNAkZ/P4k0Fk= Date: Mon, 7 Jan 2019 11:54:27 +0530 From: Vinod Koul To: Manivannan Sadhasivam Cc: John Stultz , lkml , Rob Herring , Mark Rutland , Tanglei Han , Zhuangluan Su , Ryan Grachek , dmaengine@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Subject: Re: [PATCH 2/8 v2] Documentation: bindings: k3dma: Add binding for dma-avail-chan Message-ID: <20190107062427.GY13372@vkoul-mobl.Dlink> References: <1546635388-13795-1-git-send-email-john.stultz@linaro.org> <1546635388-13795-3-git-send-email-john.stultz@linaro.org> <20190105040030.GF2477@Mani-XPS-13-9360> <20190105045320.GA3761@Mani-XPS-13-9360> <20190105134610.GX13372@vkoul-mobl.Dlink> <20190105140826.GA28029@Mani-XPS-13-9360> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190105140826.GA28029@Mani-XPS-13-9360> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05-01-19, 19:38, Manivannan Sadhasivam wrote: > Hi Vinod, > > On Sat, Jan 05, 2019 at 07:16:10PM +0530, Vinod Koul wrote: > > On 05-01-19, 10:23, Manivannan Sadhasivam wrote: > > > On Fri, Jan 04, 2019 at 08:39:34PM -0800, John Stultz wrote: > > > > On Fri, Jan 4, 2019 at 8:00 PM Manivannan Sadhasivam > > > > wrote: > > > > > > > > > > Hi John, > > > > > > > > > > On Fri, Jan 04, 2019 at 12:56:22PM -0800, John Stultz wrote: > > > > > > Some dma channels can be reserved for secure mode or other > > > > > > hardware on the SoC, so provide a binding for a bitmask > > > > > > listing the available channels for the kernel to use. > > > > > > > > > > > > Cc: Vinod Koul > > > > > > Cc: Rob Herring > > > > > > Cc: Mark Rutland > > > > > > Cc: Tanglei Han > > > > > > Cc: Zhuangluan Su > > > > > > Cc: Ryan Grachek > > > > > > Cc: Manivannan Sadhasivam > > > > > > Cc: dmaengine@vger.kernel.org > > > > > > Cc: devicetree@vger.kernel.org > > > > > > Signed-off-by: John Stultz > > > > > > --- > > > > > > Documentation/devicetree/bindings/dma/k3dma.txt | 3 +++ > > > > > > 1 file changed, 3 insertions(+) > > > > > > > > > > > > diff --git a/Documentation/devicetree/bindings/dma/k3dma.txt b/Documentation/devicetree/bindings/dma/k3dma.txt > > > > > > index 10a2f15..1c466c1 100644 > > > > > > --- a/Documentation/devicetree/bindings/dma/k3dma.txt > > > > > > +++ b/Documentation/devicetree/bindings/dma/k3dma.txt > > > > > > @@ -14,6 +14,9 @@ Required properties: > > > > > > have specific request line > > > > > > - clocks: clock required > > > > > > > > > > > > +Optional properties: > > > > > > +- dma-avail-chan: Bitmask of available physical channels > > > > > > + > > > > > > > > > > This property looks too generic. Since this is specific to HiSi SoCs, > > > > > this could be "hisi-dma-avail-chan"? > > > > > > > > I'm fine to change it, but I'm not sure I fully understand the > > > > rational. Can you help me understand? > > > > Are device node-binding names supposed to have global scope? I assumed > > > > the node property names are basically scoped to the entry? > > > > > > IIUC properties documented in subsystem binding (dma.txt in this case) > > > will have global scope. Those which are not documented in this binding > > > are specific to vendor IPs and should be prefixed with the vendor > > > prefix (hisi in this case). > > > > > > > Further, having some dma channels be reserved doesn't seem to be too > > > > unique a concept, so I'm not sure what we gain long term by prefixing > > > > it? > > > > > > > > > > Right, but this brings up the point of having this functionality in > > > generic DMA engine so that the DMA controller drivers need not handle. > > > So either we should move this available channel check to DMA Engine > > > and document the property in dma.txt so that other IPs can also use it > > > or keep the functionality in K3 driver and use HiSi prefix for the > > > property. > > > > > > But I'd like to hear Vinod/Rob's opinion on this! > > > > So there are two parts, first is if this new property of using 'some' > > channels of controller is generic enough, the answer is unfortunately > > yes, so we should move this to dma.txt as a generic property > > > > But I don't agree the dmaengine core should handle it, we may add > > helpers, but controllers registers N channels and they would do so, core > > should not do filtering > > > > Okay. But won't it create ambiguity? What if a new driver developer > assmes that he can use this property to filter the channels for his own > DMA controller? Since we are _explicitly_ stating that these channels > should be filtered, why the dmaengine core can't handle it? > > If the property is generic, then it makes sense to keep the > functionality also generic. Core doesnt have a view of channels to be filtered, it looks at N channels getting registered and works on those. Till now folks do not create channels for 'filtered' ones and register the ones kernel can use.. -- ~Vinod