Received: by 10.223.176.46 with SMTP id f43csp542002wra; Thu, 18 Jan 2018 21:52:49 -0800 (PST) X-Google-Smtp-Source: ACJfBot8eFPPGqxY08oFo4p5b1wub/2X9FYxJJ1d16oCY2Bk5pYEuSDMcFWyPzJYwmNHW4QUtYQ+ X-Received: by 10.99.5.69 with SMTP id 66mr32094791pgf.80.1516341169130; Thu, 18 Jan 2018 21:52:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516341169; cv=none; d=google.com; s=arc-20160816; b=bNvoFJq0lDgRZMAU1iSKUcSllmPblVSiza6iMjp7dgCDSV30lw9RKXPxmbNJPSbX8d n2W1f4bjHLb9hky+rncqiQ5uyim6HrW6Xw7I44yTp5nvA4elG/0l3sXphDpGx7zpK413 G7giqQMGveDBBOuDPZjS7WQisK4RczeQGnwjsSuvQiOSxcCrXDWdZXElf0PZ+wG2WfSl jWpRrnIbCh2lxHIlgrmF9jWTOLGDqT5+2d+NGF8J5pi7EC7V/lrClbZ2tR+XXJzvceQS PqpnIABOTXSql3foDQJYA/UyGpXWwS4GvarelQMN3Xky/sRPFrqch/ZryhTLGbCSghxr QFXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=g1HiitnWt0kz1oIFa0Z4yIyiegEr20uoLGXUtSVF/UA=; b=Y5rjnwVc35Uf1QETL1CBvhXuSnkvFmXnhA7aV7SCdxslD3y91LsKoglBJPF3w+Wuu5 aFLEOAg4LHWRhOOuAIeajojt6VO+MS6L93CAhbVDMXyTbSAv+rf75iZ9IMBRbL3j6g6J v2KZmGTBvDG1dMeVtTo5N0DvjcM7aiGGvanrMPhsPQRU7Lokz8wURxn4SAAVu2FmGcQd qBSKJ9m1y7E/4xJTARGFLG8V2Yk9PlsfQ4mcihPc20rjQAb1ycn2Ac9Nl36dezOwzAWn 5m5sTIbltOF65n+USJtpDHh7hFpOS6izT7C3MxTG5yIOCxJhbq9LJALdNKggsDu+rheo 7i8w== 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 i90si8541068pfd.147.2018.01.18.21.52.34; Thu, 18 Jan 2018 21:52:49 -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; 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 S1753762AbeASFu4 (ORCPT + 99 others); Fri, 19 Jan 2018 00:50:56 -0500 Received: from mga07.intel.com ([134.134.136.100]:26674 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbeASFut (ORCPT ); Fri, 19 Jan 2018 00:50:49 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2018 21:50:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,380,1511856000"; d="scan'208";a="20632739" Received: from vkoul-udesk7.iind.intel.com (HELO localhost) ([10.223.84.143]) by orsmga003.jf.intel.com with ESMTP; 18 Jan 2018 21:50:44 -0800 Date: Fri, 19 Jan 2018 11:25:09 +0530 From: Vinod Koul To: srinivas.kandagatla@linaro.org Cc: Andy Gross , dmaengine@vger.kernel.org, Rob Herring , Mark Rutland , David Brown , Dan Williams , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, yanhe@quicinc.com, ramkri@qti.qualcomm.com, sdharia@quicinc.com Subject: Re: [PATCH 2/4] dmaengine: qcom: bam_dma: add num-channels binding for remotely controlled Message-ID: <20180119055509.GW18649@localhost> References: <20180116190236.14558-1-srinivas.kandagatla@linaro.org> <20180116190236.14558-3-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180116190236.14558-3-srinivas.kandagatla@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 16, 2018 at 07:02:34PM +0000, srinivas.kandagatla@linaro.org wrote: > From: Srinivas Kandagatla > > When Linux is master of BAM, it can directly read registers to know number > of supported channels, however when its remotely controlled reading these > registers would trigger a crash if the BAM is not yet intialized/powered up > on the remote side. > > This patch adds num-channels binding to specify number of supported > dma channels on remotely controlled BAM. > > Signed-off-by: Srinivas Kandagatla > --- > Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++ > drivers/dma/qcom/bam_dma.c | 13 +++++++++++-- > 2 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt > index 9cbf5d9df8fd..aa6822cbb230 100644 > --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt > +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt > @@ -15,6 +15,8 @@ Required properties: > the secure world. > - qcom,controlled-remotely : optional, indicates that the bam is controlled by > remote proccessor i.e. execution environment. > +- num-channels : optional, indicates supported number of DMA channels in a > + remotely controlled bam. > > Example: > > diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c > index 78e488e8f96d..523bd178047a 100644 > --- a/drivers/dma/qcom/bam_dma.c > +++ b/drivers/dma/qcom/bam_dma.c > @@ -1083,8 +1083,10 @@ static int bam_init(struct bam_device *bdev) > if (bdev->ee >= val) > return -EINVAL; > > - val = readl_relaxed(bam_addr(bdev, 0, BAM_NUM_PIPES)); > - bdev->num_channels = val & BAM_NUM_PIPES_MASK; > + if (!bdev->num_channels) { > + val = readl_relaxed(bam_addr(bdev, 0, BAM_NUM_PIPES)); > + bdev->num_channels = val & BAM_NUM_PIPES_MASK; > + } > > if (bdev->controlled_remotely) > return 0; > @@ -1179,6 +1181,13 @@ static int bam_dma_probe(struct platform_device *pdev) > bdev->controlled_remotely = of_property_read_bool(pdev->dev.of_node, > "qcom,controlled-remotely"); > > + if (bdev->controlled_remotely) { hmm so if we remove the remotely controlled instanced from DT and then Linux won't see them and not do anything. Do we need to do configuration of these instances too? > + ret = of_property_read_u32(pdev->dev.of_node, "num-channels", > + &bdev->num_channels); > + if (ret) > + dev_err(bdev->dev, "num-channels unspecified in dt\n"); > + } > + > bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk"); > if (IS_ERR(bdev->bamclk)) { > bdev->bamclk = NULL; > -- > 2.15.1 > -- ~Vinod