Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5917992rwd; Wed, 24 May 2023 08:25:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ556f+dzlFl2d+MCR3nbu9IpLTcfv9w4L3zg2H13RMPQKXOZKFYlU1Imh9Zva6uL0nWsEMC X-Received: by 2002:a17:902:cec2:b0:1af:cdd9:e970 with SMTP id d2-20020a170902cec200b001afcdd9e970mr6317540plg.12.1684941919090; Wed, 24 May 2023 08:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684941919; cv=none; d=google.com; s=arc-20160816; b=gg3yUXTnNmh66nlvcfxQ10szIxgZFze6OEcEatJSVO+l4DS6DE0C8l2xMhqjdW9INo 2c6ibBb9NPZDD6U15mWfmh23pH2p1ItyWS9gfASxjmnEcVIU0X5xDMVnFYTz4NeV26L1 8tuu3Esc6xRptOC7iwf1c/7YykK94OpFWNIVOgy97GBkxcereq9/Fg8AqfVnbNz+I0vQ 7TBuKR2mjuc9adTtszpDhTu0U+1Ft0O2DNuRTUUDNhi/duMDQVyW8nI5sqX54MCAA+vS JJMf2UCSkHh6+4uoVem5AjXeUSaU/N/67XtVMnOaQJmHhU0Ckix+R3sN3NVDvEra0uBo o1Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=xiKyKwgeZz3mIyuap0baM0hJw4N+AnbwpEW09g73gv4=; b=et2W6JFvShox2IwAM6iB1dCHAsPEUQdGPSvi6ZizkXewRZ9Ezds117rqzqQ1zuvAiJ +XB9/NAYmW/OsXAD3+WfGick4brhed7hfXVE3yR3p9aDGQ7+zUy17H3/kexvavrrPV9a oXIFGcs2YF6teNdTJlaWmCNX1zlq2PIEDFtQTIe+lFC29rwwZ/j6/KVH8l4fbFXn/wQz z6UXPs9IJc4kQg7Mpd6+4In+TVQon+wICY676Wh3d1pCbSuHAwAB1J3hPhPI9HAulo6z X1Q05LWr9HtB9OSTGY4qy+NTbVz/KOb3WAONfGuvnP4cEXrnfBXbnHZA+s/8oICEQzdl m0cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a170902ecd100b0019f3064da41si3617724plh.383.2023.05.24.08.25.05; Wed, 24 May 2023 08:25:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235778AbjEXPLY convert rfc822-to-8bit (ORCPT + 99 others); Wed, 24 May 2023 11:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231633AbjEXPLW (ORCPT ); Wed, 24 May 2023 11:11:22 -0400 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71951E9; Wed, 24 May 2023 08:11:20 -0700 (PDT) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-96f72e6925cso24433166b.1; Wed, 24 May 2023 08:11:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684941079; x=1687533079; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7nss0ucgr/ESmy+PjCm3qpugQV6w2aHePkSgyOIXHvM=; b=KgMx/g88W0NvPJ8qpLn3QiZhmXVyC+ZUqAr4C0z4GRvwVGKAFmtaT9XH0dR3gP/UCi /GNSq1qDV3dtRltoMdWU3HjoUdPCO6fi97cnLFzqwTgmr5tL+gg54y+/ebbkBTHIq+EL iASfWQ5z5h0h93BLzjwIJgMaQoDWb9MYHdWkBrAZBMw6JiIhuymUzMcxZYl+XkwuwEPq 4X6o7XRIY6DePMWiUeytNbOPCIC5o1kMlWV5ME527tgEdbMAXjNpofgFOVzLz9w8DCQ1 Il91kHf8xFnopVfk5lMachMglS+d+21gO7vk7iCVzLswl9tcTS1sauZJmbY6KDrOe3A+ uxWQ== X-Gm-Message-State: AC+VfDzAu7INL2m6rsmeLNyRRWd9oevzUXmcuQ/ijTAJT15Z7xXZvWwz u9bZsk/dFsaAXFRSLIF/3ZV3S+LoMA4h8TUQW6g= X-Received: by 2002:a17:906:72ce:b0:96f:56ab:c69b with SMTP id m14-20020a17090672ce00b0096f56abc69bmr2531918ejl.3.1684941078712; Wed, 24 May 2023 08:11:18 -0700 (PDT) MIME-Version: 1.0 References: <20230309140724.2152712-1-cristian.marussi@arm.com> <20230309140724.2152712-4-cristian.marussi@arm.com> In-Reply-To: <20230309140724.2152712-4-cristian.marussi@arm.com> From: "Rafael J. Wysocki" Date: Wed, 24 May 2023 17:11:07 +0200 Message-ID: Subject: Re: [PATCH v2 3/3] powercap: arm_scmi: Add support for disabling powercaps on a zone To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, tarek.el-sherbiny@arm.com, nicola.mazzucato@arm.com, souvik.chakravarty@arm.com, wleavitt@marvell.com, wbartczak@marvell.com, "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 9, 2023 at 3:07 PM Cristian Marussi wrote: > > Add support to disable/enable powercapping on a zone. > > Cc: "Rafael J. Wysocki" > Signed-off-by: Cristian Marussi Acked-by: Rafael J. Wysocki > --- > drivers/powercap/arm_scmi_powercap.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c > index 05d0e516176a..5231f6d52ae3 100644 > --- a/drivers/powercap/arm_scmi_powercap.c > +++ b/drivers/powercap/arm_scmi_powercap.c > @@ -70,10 +70,26 @@ static int scmi_powercap_get_power_uw(struct powercap_zone *pz, > return 0; > } > > +static int scmi_powercap_zone_enable_set(struct powercap_zone *pz, bool mode) > +{ > + struct scmi_powercap_zone *spz = to_scmi_powercap_zone(pz); > + > + return powercap_ops->cap_enable_set(spz->ph, spz->info->id, mode); > +} > + > +static int scmi_powercap_zone_enable_get(struct powercap_zone *pz, bool *mode) > +{ > + struct scmi_powercap_zone *spz = to_scmi_powercap_zone(pz); > + > + return powercap_ops->cap_enable_get(spz->ph, spz->info->id, mode); > +} > + > static const struct powercap_zone_ops zone_ops = { > .get_max_power_range_uw = scmi_powercap_get_max_power_range_uw, > .get_power_uw = scmi_powercap_get_power_uw, > .release = scmi_powercap_zone_release, > + .set_enable = scmi_powercap_zone_enable_set, > + .get_enable = scmi_powercap_zone_enable_get, > }; > > static void scmi_powercap_normalize_cap(const struct scmi_powercap_zone *spz, > -- > 2.34.1 >