Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp863384imu; Wed, 9 Jan 2019 07:38:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN5dprAZziDe9jSRjDnLDyb5n3kk3gm7QK8NxrgANdkgRXxH9NhcOEYHuk3QaEYVNaeKZp0k X-Received: by 2002:a63:a84a:: with SMTP id i10mr5908131pgp.263.1547048286656; Wed, 09 Jan 2019 07:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547048286; cv=none; d=google.com; s=arc-20160816; b=wd6WaHOYJeJZkChezWgXs5gJfwUuXc30YEmLINUGPv4x78PXhhcqQGC1mXGughzyK8 01JBQ2dfv1Iv5nccsLnmMEOTJrKMc1kdQpVTFAS4/ugLi1HLdzMDy48rJglZzGAX19vp onQ0ZrBx/DQMjrP4YZkAKAY/oixA58DaCRX1Dj/eT8Z8vPm0Q90yFJz4NzPK47+bhPm2 XemioeluYe5u8/NE/MWqMy0Pfn77PndBrbGgqCcpdxupJcA1IHbx1aQVT5fCwQ+7GM4J 4N6dQwplbZ8oDN9b7Rt/twOglO5Hx9Y2CWDdip58/wFn1TKlTWiRee4AN0mJWnr27arQ +qdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature; bh=/8mD1/D1KuQ/7klTNtxpJdvwiwvyLd/dDXd0ckra3Ek=; b=mty9mK78TQtyyv0D8Lt+21NJf5rJII7e014h1g+wW32PNRFI/NVX3S7uWvpqoyEyZm UDS1lbatOd8wlWUpiZboOcQfx9DyhDbHrjUXI8TxOJCmOAtOSFQNyKAqQMCTYRvof+yy ZihnhXoDL+A73wFidoqoRZZynAYJtY+ZRooAx4Zdoimp28lsK+8qpfUmrv9gqiu5SMUz O1HapFnkMipTQ3CNigKUInNgqKT0hQdaDwH4xKDuqQz/7SG495KOfkefQ8YCLHL55YdF /4d8lqNyvtgO+gW+yLBhJ6x0T8QMb4eU7WiOVMmuHnibt2LoIs4QaNVBEdCrThkxPd30 QpIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=covnt8Se; dkim=pass header.i=@codeaurora.org header.s=default header.b=jzctDUVh; 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 h88si12867294pfa.49.2019.01.09.07.37.49; Wed, 09 Jan 2019 07:38:06 -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=@codeaurora.org header.s=default header.b=covnt8Se; dkim=pass header.i=@codeaurora.org header.s=default header.b=jzctDUVh; 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 S1731653AbfAIOk2 (ORCPT + 99 others); Wed, 9 Jan 2019 09:40:28 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:35876 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730605AbfAIOk2 (ORCPT ); Wed, 9 Jan 2019 09:40:28 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BF526601DA; Wed, 9 Jan 2019 14:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547044826; bh=5GkCLWdKym0RO7Cz8WlQatBMDx4xO274jfu9GrfL7jI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=covnt8Sedd1B2FpGCmIFh+In/zujtKvZo5KLypA18BX1DsIGDE6MWOcQcSexD6Yn1 NaPksVqE7Kvl+f0db+tOkO7Ur+shc63UeMA/Rm20m1Ncijbf53DlqzEtC/gt4rfGE1 K50j7jzAmpxk+J8lJ1ut72KiiuuVBmBIyBSl/Va4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id A31B9601DA; Wed, 9 Jan 2019 14:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1547044825; bh=5GkCLWdKym0RO7Cz8WlQatBMDx4xO274jfu9GrfL7jI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jzctDUVhom9A7HNb8vA2w6HNz27zTL7kMaHkMak0y4Xfm1nkD/EwMg6UXYEOTuEYN ME8yhuLOj9clMn2OPbYmeNwk0V64DcROko2r4V278xQR0gONUa5aWh6ifhMdnqjnY6 7qO8aPul/LP2LuL1M5B8wXkFwfZPQwJrvWEtGTVs= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 09 Jan 2019 20:10:25 +0530 From: Sibi Sankar To: Bjorn Andersson Cc: Andy Gross , David Brown , Rob Herring , Mark Rutland , 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, linux-kernel-owner@vger.kernel.org Subject: Re: [PATCH v2 5/7] remoteproc: q6v5-mss: Active powerdomain for SDM845 In-Reply-To: <20190106080915.4493-6-bjorn.andersson@linaro.org> References: <20190106080915.4493-1-bjorn.andersson@linaro.org> <20190106080915.4493-6-bjorn.andersson@linaro.org> Message-ID: X-Sender: sibis@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-06 13:39, Bjorn Andersson wrote: > 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 > Reviewed-by: Sibi Sankar Tested-by: Sibi Sankar > 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", -- -- Sibi Sankar -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.