From patchwork Wed Feb 14 14:44:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 128356 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp687309ljc; Wed, 14 Feb 2018 06:48:54 -0800 (PST) X-Google-Smtp-Source: AH8x224hbQsH0ZDtoNbBSCta0E2ByIgCNBA4Bzwhe+I9lxBG4hN0pIeQw6AT5pwsml3sIvSh56Aw X-Received: by 10.98.143.1 with SMTP id n1mr4984152pfd.126.1518619733873; Wed, 14 Feb 2018 06:48:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518619733; cv=none; d=google.com; s=arc-20160816; b=E3SvMCBuGArgeDCNLOIb170Tv79vQgYMGcnCjdf0FHGKBPxgyR2OioESNJZvg1G8T0 oB3QqY9dVLlY/q3bYFTSearmv03entXgGFVbIhqqgMrt8FURAxMjDfjMww3vDGa+kjwV rYHB6iui1jXHLqX8g1TKxD5FgE56b8nMrpk1LSSSaxFOnV2EBKPBUBJqKAUUzOpL/2RN pKgFFLPFeZAYp7sFi4ak4d+El17xECKBI2Av8W+bWMhMFFKR9pWlpYuYRRp8QNI09s5+ N+eQzcTFMRf2LjbXzVsy8XaxVAcuuGeluQUrV9uyb/d+sbTlfzG2bOxaFlGguec7CLPK i04g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7y3LwNkgwSq043PbjQPLdWq/K3DSD2bGusoerwoGTVk=; b=c7t4wL+QSPNYXu48c16VefMNMs7Q16tnBTWr574RHBDik+K3UUyC1v55n8HqYyzYEB v+tVyZcsH0i8RqxFiESFWGg8fEgqK5TyORLrRjRZTKhqeK7q6asjwVhiyQtj6pEhZQS1 moh4/WOc/OtzLeh1sLBavlNGDBVCB9motqAurX8g4EQ6SYqJnAAWpDb+7jOlMKAI9qOd HF11KRRjoFoBodCyIvx7Ia0Am+q3GBJVfeCX7+RGo7GPlaB/2QUZHi1zZY83LE7AUIQx lbNroMQ2AtXtbC/uVKpu7QtQm8adRfRGDB7rYzHv1DUeX0m41S7o3Igpf74ifCPRpD0G H07g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cZHB3X0M; 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 bi5-v6si2195478plb.604.2018.02.14.06.48.53; Wed, 14 Feb 2018 06:48:53 -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=cZHB3X0M; 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 S1030744AbeBNOss (ORCPT + 28 others); Wed, 14 Feb 2018 09:48:48 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:52805 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031068AbeBNOrL (ORCPT ); Wed, 14 Feb 2018 09:47:11 -0500 Received: by mail-wm0-f66.google.com with SMTP id j199so11012025wmj.2 for ; Wed, 14 Feb 2018 06:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7y3LwNkgwSq043PbjQPLdWq/K3DSD2bGusoerwoGTVk=; b=cZHB3X0M5CcAETVP8B77ZwytvyECZp+WDX09K4MRaNBgtSCsw6KhsNZey07yUZEzW0 tlY2k5O8L0Iqikud2m2SqludOWZBTWfKsbwiaEpjA/wM9vrzyS+jOq0ixkoptNB4fTfs /xx/mxa7eSjB7mPqOuUFj5HGfE+aF7z0hH6p0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7y3LwNkgwSq043PbjQPLdWq/K3DSD2bGusoerwoGTVk=; b=k1rAF6hrLtb+joYMCUSxAuqaba/eVKzt5bagSqZ2+C5wY/dRMtUnJuHplSzeunWAYj UWXcCWdtNu3ScCpiomrb8SSC2IXbsbzi0DekVekgoezBLAN7vM2hcmNpV4q0hsqCUJRi XzDMAaWymN8vEEicUqaRtczfIPQdaOoctP4HVFEf/mWdwGDoTdAb2ra30/EWTGdz9YX2 ALAAX8wascXv9j1Q5w4Kp/Dmuy3tQ5R6RD9HisEH5/duP/uimK0t+YpEDoFZp8pCgDz3 oxjDNb+2x0nkmDH6zfXMXB/Gl6wKg2BiS2yiRusdFnUlAjmCfRUlGrf4vaiLKhXMvg2F ptew== X-Gm-Message-State: APf1xPAEdo2FBsB2NEBw3QAwgj3t61WDgpg41VxLb8HAOjmwCtjrNXR1 cIRJmKfqTo0mhJ/jlnA7v8ADig== X-Received: by 10.28.120.15 with SMTP id t15mr4417191wmc.34.1518619629997; Wed, 14 Feb 2018 06:47:09 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u20sm7675965wrg.13.2018.02.14.06.47.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Feb 2018 06:47:09 -0800 (PST) From: srinivas.kandagatla@linaro.org To: vinod.koul@intel.com, andy.gross@linaro.org, dmaengine@vger.kernel.org Cc: robh+dt@kernel.org, mark.rutland@arm.com, david.brown@linaro.org, dan.j.williams@intel.com, 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, Srinivas Kandagatla Subject: [PATCH v2 2/5] dt-bindings: dmaengine: bam_dma: add remote controlled bindings Date: Wed, 14 Feb 2018 14:44:56 +0000 Message-Id: <20180214144459.29813-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> References: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla This patch adds 2 new properties for remote controlled bam dt bindings. 1. num-channels to indicate number of dma channels. 2. qcom,num-ees to indicate number of Execution Environments. Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/dma/qcom_bam_dma.txt | 4 ++++ 1 file changed, 4 insertions(+) -- 2.15.1 diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt index 9cbf5d9df8fd..cf5b9e44432c 100644 --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt @@ -15,6 +15,10 @@ 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. +- qcom,num-ees : optional, indicates supported number of Execution Environments + in a remotely controlled bam. Example: From patchwork Wed Feb 14 14:44:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 128354 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp686128ljc; Wed, 14 Feb 2018 06:47:32 -0800 (PST) X-Google-Smtp-Source: AH8x2260zcBlghYPlohHz6AWDFs0I1hEC7JtlDNUzVSGC6RP53U3H5bilEjtLlzaZPufTCnoAprS X-Received: by 2002:a17:902:8a89:: with SMTP id p9-v6mr4642744plo.397.1518619652657; Wed, 14 Feb 2018 06:47:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518619652; cv=none; d=google.com; s=arc-20160816; b=LzYKXKy6x+hT8ZIGwZhQBW+AqUziMTTjmkPlmfu9foia1E55s1V5lqw4NncLyBQfNY f37rtBp9SA04VcqVxKbv0BBErZ834hO0uQHagM9Ri4TyXUz4bumtTVoqOn+qUD88EhoS P5hLnl3nsLd6EcpvYPcoL1RqUiS7UD1d65mKYChNT1ZbMa31vs26CylxBfVFO0HPrVJ2 gcyvcVA4tPfjt1roW5PDc+4BkuqNkhnb/Z19rOoUhmUNXc60NvyV2dZy/VV0zoRLIPcP fcEGlHpHuVZE89/27DeZBWzpTUHTqLEogTOZAunD+O0N9q1+z/fzZSE8bnxUHIWeRQka xMWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=6GsUZzD4b92p30xF7vactajfdGzwze35pVfcUrpKsGs=; b=SG4uQP4YwbKg0y5eytEONO9MF1S8WYta43N5/bTQDzDJKowgqdjiuniDmJM72jXHiK G6PoEU3JavdRy2H2W06J+gUwtZhTkXOfxcE/onZEoKdwuuPPUaUDhxPqy3RdTpF0oQ6x ogEap5pGbGdecBFhvzoIyVIkQpuQazPpg6FQoiVOra4Z4IK2OP1FxdED2kosgb+S2VXy hkFNCLw1I0euHmbFd2V65XL68T/XrANcQBeZYmchWs0YwayMVo0Txp6l2OKyfgbC0fs2 hDgoFqwuegtsgZwnssq5smr32B5M2j/bJPX3nkgcY2G+4/z7YFtZM0pbFSaYp7UrsdRs NoCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fOhHpND3; 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 s13si1268543pfk.177.2018.02.14.06.47.32; Wed, 14 Feb 2018 06:47:32 -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=fOhHpND3; 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 S1030965AbeBNOr0 (ORCPT + 28 others); Wed, 14 Feb 2018 09:47:26 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34357 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031079AbeBNOrN (ORCPT ); Wed, 14 Feb 2018 09:47:13 -0500 Received: by mail-wm0-f66.google.com with SMTP id j21so18106506wmh.1 for ; Wed, 14 Feb 2018 06:47:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6GsUZzD4b92p30xF7vactajfdGzwze35pVfcUrpKsGs=; b=fOhHpND3b1uLSZgz/Dc1oyTYLRqK0uczG621YriwbhOYiwXhX2BZ+Xrz1a68pdNqCM 420XQVyBrTz76xQkzZPf7Q7xDxlyTwhhdpzg+LEL6TnYjUPsKCAeOji8yZIrEAbjHtmu xGgf4YXi8p9vUcK9JquS8hooy9QwrSqWmbP2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6GsUZzD4b92p30xF7vactajfdGzwze35pVfcUrpKsGs=; b=suCou02dXQik3U8gZd1zz0xkIluqDI+UksNN2dHYSC142qd8/s8EHSJ1HxKeOVPIng zkmwbM2Wx4JHyXlAmTNPUXElTiA+bmtnFce8VbBmanOnmSYE2CHrDijvgNw2oaKK9PG+ r1LK32MMvKxEETcTNPGmXw7mK5W/EPjhIlvywe3rerafrzZYiABlXTnDmZ/1ZFEPmJ85 REUvLKRgj61j8xmt+hlktGchzvla2HJnt95H47kjX+0JgZfYOinXdUqWi6OaTI8zdMoF 71Kj5xp+fNGn0XK/AN+oDof52ar/1YXGVgI76YuDOlc14G0ROZ7cIOYvoyEj4SDAdxQI 5UMA== X-Gm-Message-State: APf1xPCOB3fjMTImko6mGwhEhBwAWsiEMlj//95+Tu9B5ftnvtwba2O5 r3oOB9f4ZmkzdbxnqAsfSZf9ww== X-Received: by 10.28.148.214 with SMTP id w205mr4367780wmd.67.1518619632667; Wed, 14 Feb 2018 06:47:12 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u20sm7675965wrg.13.2018.02.14.06.47.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Feb 2018 06:47:12 -0800 (PST) From: srinivas.kandagatla@linaro.org To: vinod.koul@intel.com, andy.gross@linaro.org, dmaengine@vger.kernel.org Cc: robh+dt@kernel.org, mark.rutland@arm.com, david.brown@linaro.org, dan.j.williams@intel.com, 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, Srinivas Kandagatla Subject: [PATCH v2 4/5] dmaengine: qcom: bam_dma: do not write to global regs in remote mode Date: Wed, 14 Feb 2018 14:44:58 +0000 Message-Id: <20180214144459.29813-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> References: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla BAM_DESC_CNT_TRSHLD register is global register, which can only be written when BAM is in master mode, So check the mode of operation before writing it. Without this check SOC's xPU would catch such access and crash the system. First noticed on DB820c while testing SLIMBus BAM. Signed-off-by: Srinivas Kandagatla --- drivers/dma/qcom/bam_dma.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) -- 2.15.1 diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 146b5d03256f..88ec515ad125 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -935,12 +935,15 @@ static void bam_apply_new_config(struct bam_chan *bchan, struct bam_device *bdev = bchan->bdev; u32 maxburst; - if (dir == DMA_DEV_TO_MEM) - maxburst = bchan->slave.src_maxburst; - else - maxburst = bchan->slave.dst_maxburst; + if (!bdev->controlled_remotely) { + if (dir == DMA_DEV_TO_MEM) + maxburst = bchan->slave.src_maxburst; + else + maxburst = bchan->slave.dst_maxburst; - writel_relaxed(maxburst, bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); + writel_relaxed(maxburst, + bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); + } bchan->reconfigure = 0; } From patchwork Wed Feb 14 14:44:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 128353 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp686058ljc; Wed, 14 Feb 2018 06:47:29 -0800 (PST) X-Google-Smtp-Source: AH8x227c5fZMPbPAnqU/nXXpKjkcCVT8MhOyTP80KomA3FYxZjpM4nQuLUxLcX3RO+79bn71VegQ X-Received: by 10.99.120.143 with SMTP id t137mr4162923pgc.79.1518619648947; Wed, 14 Feb 2018 06:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518619648; cv=none; d=google.com; s=arc-20160816; b=W23rwjdyr0F8mGP7DO200TuK3rItvMZWC6tJZSugIgLp4c0rz92ZxkB1l5DQ6s5J9J MwruOWLWPzfjgLAFNIi0Z361OPx3+QV43cVcfKC1f9xNcyMUvZtmPmc6C3w1NA8QDpc+ XRN1/Ipb0QiNYqi4gJqHO8jOWvtm0o2nGP+FcOIeDEHBD1jIo2ktxSs3WKr/Y5GYnt/I bIISBLU49G/LGKiY2VPYBvT4m6yYkZ+leKgbTRAHghxaam3toprLNFuaM+loNwDnZ+kp tguufzUmYApaJxQJAHu2tc5CvuKCg0MjIDBSK8R+eRiM7jAKyBGTd29L0EuL6ZwxaUgk ygQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iGIUlLTXe5YlQRL1SFpRs80ajzgNP1ylmrEJTMEn+q8=; b=TAC2FU1jCCzeChbeezHDbTIQZ8q6zuiOCf6IY3ge6UJshVhhHp6+Ey9M1zzM+7wnvp UCHLBzS7zs2TgxXwQsKEZPXXdnzpNAYuVn6FJyZnjmLR2GdtW5WSyBM3MXDOynwqegje x2IZqraQ0EMl0uSx6TEWj0sHySc51O1++XbDKsZjFVWh/eIH9UF1Fy6xOKUmPkBnzmm0 exPBUFQHueIIeCvXtnWzRLdkh7bQLKtL9nG7cd7GA4fgLVxWDxSFVtBNy+SATEfy/pBI UU34XyYSnEs/VmZYnTI0mi8XEToTjTHkF+xxmBwXG6AYoIbUA8SkjFx0rCTMPuYn0P1V HM9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W8zxasGF; 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 p29-v6si724680pli.731.2018.02.14.06.47.28; Wed, 14 Feb 2018 06:47:28 -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=W8zxasGF; 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 S1030951AbeBNOrZ (ORCPT + 28 others); Wed, 14 Feb 2018 09:47:25 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33610 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031097AbeBNOrP (ORCPT ); Wed, 14 Feb 2018 09:47:15 -0500 Received: by mail-wm0-f67.google.com with SMTP id x4so18079717wmc.0 for ; Wed, 14 Feb 2018 06:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iGIUlLTXe5YlQRL1SFpRs80ajzgNP1ylmrEJTMEn+q8=; b=W8zxasGFq80qDJfWl7C9UZayVpD/JsPayp2epgWgmtK8K3d5WiaYGfh6dCJFQp3rCo LKtmgXkdzA1QcNbJDiF21Ny8v5Ci2VoDtUGzDy+azKmfei3nV5TqCpYdcgxlMMjYOTFv 5KEi9+nT6ITCy4KELv09u1ZHzVBhCISSs8H64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iGIUlLTXe5YlQRL1SFpRs80ajzgNP1ylmrEJTMEn+q8=; b=Ym87qq7PJCPPl8WavS+5XoMLAXUVhCiEJbiXViz0dBHACSWeALVJbE0ve5zpKWE5gm LIuNW2op6qhUIJIZNMS7Wc+xa9nz27YKO60XYoBl5+JApBXU+XxETDvufzAWGqdtzN9R E8k0W0iYuioNgO3O1g5gm3mShykyiPqWrfU4SxCE/7vIGHawALIntBVnYxBVCqvalN8J ycgdkZxjXmcHshSas7RPn3+PmPF19xea1iDsvrDtndlsa6jjMlHQgj2a/7Bq1dIpHLh+ W5+RPzgsajVzXJJ0RDdFxBPJtyJIp4+Nb20zeBYp/FHXdv+257Kk0wlwgh/LdMfRzYkc xWzg== X-Gm-Message-State: APf1xPCUY0uJCrrqXRsHEYut8Hkwn+4ORNfWUSFQXgvLe/fFLiOteD+w xlxE9Fjc5EMyIe9yeKSKwQOCyQ== X-Received: by 10.28.166.20 with SMTP id p20mr4284342wme.85.1518619633935; Wed, 14 Feb 2018 06:47:13 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u20sm7675965wrg.13.2018.02.14.06.47.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Feb 2018 06:47:13 -0800 (PST) From: srinivas.kandagatla@linaro.org To: vinod.koul@intel.com, andy.gross@linaro.org, dmaengine@vger.kernel.org Cc: robh+dt@kernel.org, mark.rutland@arm.com, david.brown@linaro.org, dan.j.williams@intel.com, 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, Srinivas Kandagatla Subject: [PATCH v2 5/5] dmaengine: qcom: bam_dma: disable runtime pm on remote controlled Date: Wed, 14 Feb 2018 14:44:59 +0000 Message-Id: <20180214144459.29813-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> References: <20180214144459.29813-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla Remotely controlled BAM instance should not do any power management from CPU side, as cpu can not reliably say if the BAM is busy or not. Disable it for such instances. Signed-off-by: Srinivas Kandagatla --- drivers/dma/qcom/bam_dma.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) -- 2.15.1 diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 88ec515ad125..6e4fe398f0c8 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -1330,6 +1330,11 @@ static int bam_dma_probe(struct platform_device *pdev) if (ret) goto err_unregister_dma; + if (bdev->controlled_remotely) { + pm_runtime_disable(&pdev->dev); + return 0; + } + pm_runtime_irq_safe(&pdev->dev); pm_runtime_set_autosuspend_delay(&pdev->dev, BAM_DMA_AUTOSUSPEND_DELAY); pm_runtime_use_autosuspend(&pdev->dev); @@ -1413,7 +1418,8 @@ static int __maybe_unused bam_dma_suspend(struct device *dev) { struct bam_device *bdev = dev_get_drvdata(dev); - pm_runtime_force_suspend(dev); + if (!bdev->controlled_remotely) + pm_runtime_force_suspend(dev); clk_unprepare(bdev->bamclk); @@ -1429,7 +1435,8 @@ static int __maybe_unused bam_dma_resume(struct device *dev) if (ret) return ret; - pm_runtime_force_resume(dev); + if (!bdev->controlled_remotely) + pm_runtime_force_resume(dev); return 0; }