Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2402203imu; Sun, 6 Jan 2019 00:25:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/XJqWWsvDEiDYtOe/ffkmWaQIkKGrQtBIAL7boedJPZKvdKJ5z0vZt3clkyq4zFHO4Kew+x X-Received: by 2002:a62:59c9:: with SMTP id k70mr58547980pfj.243.1546763104576; Sun, 06 Jan 2019 00:25:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763104; cv=none; d=google.com; s=arc-20160816; b=IrtNFTAG2QpARryi/KtWHSfyq7pxtn3WHCaTYXvcVHUk9SDFVG+ovdqfERkMwCWnEL 4E7KRsumFUncfEr7PV2jprKqZdI/9UnGI203Rx+bhQZGD92YYfF2SWYXEbCstFh4YNKr nYdXLmz26qjc06Sx6GBFiBBLKOVJ3gUW8CrEqJW4XTtOVU57oL1gXk0WG3fwdc9706BH CzXGRPhON/dtzXLxVN0gFdP1MjHyXhSf2uE27/J/Lvp060aalWrj1xg+e593fYRvKb9p 4AwjXeG6/Ha4F0avAYjGRgaJ9dzrL+2zwAXpBbmqG/DP0mjC5GrMbhgLDbojetvcbR1X Bcaw== 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; bh=Eykwn78UBt1QHUenCjEDKqDsuRhugMZbWizZ48+FyMg=; b=JR+dzKIDW4ZOKDWAjwqM6EwhMSFQstGI9W5GLreY83eSnE7JgtmccnsLEIIphZqi56 MkNjiHa8X4JgdGWa3X3kJlplAWGkBFrfatMhmJnbE8ywl9BK0eulCaosmE6G85gr0d9v W/I/Jyz1Eoe07uxUsGoNVFdoIAM1B25WxyvIF07Ol5owd2jHUGBNRO5nYDj42g6RIUFf JqLvtZwna31c24+lo5dqJJsF1poKYjHzE66gUegThPJP8AcnCexirgsTkuqISKuxmbks QEklnuDpSeA8xLOS7r5ln2BQhp8/csOazA0yVdNTNmScaAH2ixjrGwTYhYD4OIYe6Ar+ 7vdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=auAGKjun; 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 i63si12751839pge.515.2019.01.06.00.24.46; Sun, 06 Jan 2019 00:25:04 -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=auAGKjun; 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 S1726559AbfAFIKo (ORCPT + 99 others); Sun, 6 Jan 2019 03:10:44 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:42131 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbfAFIKY (ORCPT ); Sun, 6 Jan 2019 03:10:24 -0500 Received: by mail-pl1-f194.google.com with SMTP id y1so19381707plp.9 for ; Sun, 06 Jan 2019 00:10:23 -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=Eykwn78UBt1QHUenCjEDKqDsuRhugMZbWizZ48+FyMg=; b=auAGKjun5gdTF6rkH5KplLjZ4gxXOfdr+8dFHbA+ENRXJgU/jDZQ0vFciuMaJoAijs Z2aW4MHZyFjkpt4NDM5cux8Ckjn3vME/0dLTZaAcgKComYyuxOLN9V4tByI1eN3KZX6f up+vc2EPqBzRrEBhZzh/i9fUYvJp0QESbc2Tw= 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=Eykwn78UBt1QHUenCjEDKqDsuRhugMZbWizZ48+FyMg=; b=sZisdbA8BOhvdHBadsgci8+DjX+F80xvm9S/nLmhUNEQSr0O3fZ1zvW4fusEtV7cVq BtmcaqwFb31OtSvvBz83rsvAPXiyfBRnqKMKUeKjUSJT2CgLmmt2eHLBKSZjzsDXn+Vh K6f2Vkm1OTFLkgV5hdXQM/mjuxvgpldB/SNO66HTBMLG/50qNjY94QaQjgCOdFtzNkIO xsuC9bL30dEkEz4SHJM6tzR2c6Lqpp2n9+Ba+pTJW7k29PpeDcY7qxg6ycmui8NHEsU3 Ib/fnjRSEDZESn/9L736zlhcCWHZ8cufUG5zTbnAnO/ddwHV5zKUE5d8H3oWRlhnd/7l dKyg== X-Gm-Message-State: AJcUukdMLfyuyHDj8oUo07oCX8vMmkW6FLNERfGCoI4BIuXeGy7dmO0e x2XBK+7ZJoyJiIlqZqyftWOElA== X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr55746557plp.247.1546762222820; Sun, 06 Jan 2019 00:10:22 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id v190sm90763364pfv.26.2019.01.06.00.10.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Jan 2019 00:10:22 -0800 (PST) From: Bjorn Andersson To: Andy Gross , David Brown , Rob Herring , Mark Rutland Cc: Russell King , Ulf Hansson , Arun Kumar Neelakantam , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/7] remoteproc: q6v5-mss: Active powerdomain for SDM845 Date: Sun, 6 Jan 2019 00:09:13 -0800 Message-Id: <20190106080915.4493-6-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190106080915.4493-1-bjorn.andersson@linaro.org> References: <20190106080915.4493-1-bjorn.andersson@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SDM845 MSS needs the load_state powerdomain voted for during the duration of the MSS being powered on, to let the AOSS know that it may not perform certain power save measures. So vote for this. Signed-off-by: Bjorn Andersson --- Changes since v1: - New patch drivers/remoteproc/qcom_q6v5_mss.c | 31 ++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 62cf16ddb7af..7f86d9c551c4 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -133,6 +133,7 @@ struct rproc_hexagon_res { char **proxy_clk_names; char **reset_clk_names; char **active_clk_names; + char **active_pd_names; char **proxy_pd_names; int version; bool need_mem_protection; @@ -159,10 +160,12 @@ struct q6v5 { struct clk *active_clks[8]; struct clk *reset_clks[4]; struct clk *proxy_clks[4]; + struct device *active_pds[1]; struct device *proxy_pds[3]; int active_clk_count; int reset_clk_count; int proxy_clk_count; + int active_pd_count; int proxy_pd_count; struct reg_info active_regs[1]; @@ -730,10 +733,16 @@ static int q6v5_mba_load(struct q6v5 *qproc) qcom_q6v5_prepare(&qproc->q6v5); + ret = q6v5_pds_enable(qproc, qproc->active_pds, qproc->active_pd_count); + if (ret < 0) { + dev_err(qproc->dev, "failed to enable active power domains\n"); + goto disable_irqs; + } + ret = q6v5_pds_enable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); if (ret < 0) { dev_err(qproc->dev, "failed to enable proxy power domains\n"); - goto disable_irqs; + goto disable_active_pds; } ret = q6v5_regulator_enable(qproc, qproc->proxy_regs, @@ -839,6 +848,8 @@ static int q6v5_mba_load(struct q6v5 *qproc) qproc->proxy_reg_count); disable_proxy_pds: q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); +disable_active_pds: + q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count); disable_irqs: qcom_q6v5_unprepare(&qproc->q6v5); @@ -878,6 +889,7 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc) qproc->active_clk_count); q6v5_regulator_disable(qproc, qproc->active_regs, qproc->active_reg_count); + q6v5_pds_disable(qproc, qproc->active_pds, qproc->active_pd_count); /* In case of failure or coredump scenario where reclaiming MBA memory * could not happen reclaim it here. @@ -1410,11 +1422,19 @@ static int q6v5_probe(struct platform_device *pdev) } qproc->active_reg_count = ret; + ret = q6v5_pds_attach(&pdev->dev, qproc->active_pds, + desc->active_pd_names); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to attach active power domains\n"); + goto free_rproc; + } + qproc->active_pd_count = ret; + ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds, desc->proxy_pd_names); if (ret < 0) { dev_err(&pdev->dev, "Failed to init power domains\n"); - goto free_rproc; + goto detach_active_pds; } qproc->proxy_pd_count = ret; @@ -1446,6 +1466,8 @@ static int q6v5_probe(struct platform_device *pdev) detach_proxy_pds: q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); +detach_active_pds: + q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count); free_rproc: rproc_free(rproc); @@ -1463,6 +1485,7 @@ static int q6v5_remove(struct platform_device *pdev) qcom_remove_smd_subdev(qproc->rproc, &qproc->smd_subdev); qcom_remove_ssr_subdev(qproc->rproc, &qproc->ssr_subdev); + q6v5_pds_detach(qproc, qproc->active_pds, qproc->active_pd_count); q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); rproc_free(qproc->rproc); @@ -1489,6 +1512,10 @@ static const struct rproc_hexagon_res sdm845_mss = { "mnoc_axi", NULL }, + .active_pd_names = (char*[]){ + "load_state", + NULL + }, .proxy_pd_names = (char*[]){ "cx", "mx", -- 2.18.0