Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp219881pxk; Thu, 24 Sep 2020 04:07:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTDErdP89dsrINIb9nX5r2l4ar1jxiRgwWVjOa6i84KLhZBq/4U4eP7tGLsekMc5ocn6cz X-Received: by 2002:a17:906:d965:: with SMTP id rp5mr400702ejb.364.1600945669997; Thu, 24 Sep 2020 04:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600945669; cv=none; d=google.com; s=arc-20160816; b=GIqPuGqonBs4WN14LpBVa9YuMoXF1FASnaB9KBpX28b/5L4xJu6tV16AQU8cKqrbw4 HFbJKqTXurRlw06fg449Dgo/SKi+2gW/SuSmc85X36SiFEx40UGCrD3eoMdu9PhAW8JU mLj9mTq/17xHsYth6nc5x5V54WLdq2xJ7H7yTmyIRQLN+pNVSDj2zbqiseaIfIkQfHOr /s2/Zwvz0lyJAz0VKYMAEiha1jyQfY3qIdmAWVW/z/LgU6K4QrUTqPrB0JT3Cc4Za3WN weWDtDStElBm1ZIs3q+wRyJZEnMdszY8jYYaxn+kuEe3BKlSBR+7CFa/FYuw8jYF8pg9 9agw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rLopvQrJpLUDqmj8LU9atUffkZGt0vm6zsb0hp7AK58=; b=YU+6KH4UjjpJ0H8mGkMaiNp8YNH/RYK8FMR5AEBN4jeeKRxsF+6jijwdcgiGCotKQV NVsB2GOyhMOCpW217xIHWJpxGc0Z+WTvYDBzoZdytroPD5XR2ysI5HICqa0+zvr1WD7D LM4GHYbTOBUo3hxOpQ/q1SPR9ixNopgZcSA67LWBv+Xkc9uRG7G4WSHjvfMyXPyyTZq6 vAFf58V7tk7AWaWOoxZ/w8WqR+eXeernfKEZ+VLBpG7kbrPswt1bKq0SuXM0mLArWP+x f4gGc46S3/Y3tKD4ZhL7Ct9mcIeix46SQT1BJeOBKWNvaDcglOBk6LKS80KvjJxhX+Np nRkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wvcRRsSv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id mc3si1823957ejb.404.2020.09.24.04.07.26; Thu, 24 Sep 2020 04:07:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wvcRRsSv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727450AbgIXLGT (ORCPT + 99 others); Thu, 24 Sep 2020 07:06:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbgIXLGQ (ORCPT ); Thu, 24 Sep 2020 07:06:16 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C50C0613CE for ; Thu, 24 Sep 2020 04:06:16 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id k25so2407559ljk.0 for ; Thu, 24 Sep 2020 04:06:15 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=rLopvQrJpLUDqmj8LU9atUffkZGt0vm6zsb0hp7AK58=; b=wvcRRsSvhqV6/9Q6s7YiZ+xs12EtQc5ccJUikKs3Qu4pVZqzgGRQ4eRGNt3NyG4jZS vz2iWC8lkiFCM0Kb/P+XhVsxQTCJNTZ0tEVw5eGWvJZG6IvzU1BOfH9Twnj6HprWuz1n t8vqUn2XuKlu2hYk0V5YEpT9MuEznOXCNfdx5Yfg6zUrjFXKxJ3BZe3z0VKO2k2MsNrL cvD0ksN/Ldr8fnidbDytW6HYMCIjNlHUvCUlsJ0XoFVytbCe8/cE1PSCfxsM78isRuic 9+C9kBeTglf981ThomRSgdEk8kL18qVvyEQWMf6BwJ4h2AC+BiIvZg5mW4InypZY3d5Y tlog== 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:mime-version:content-transfer-encoding; bh=rLopvQrJpLUDqmj8LU9atUffkZGt0vm6zsb0hp7AK58=; b=rlvOvLwe1BQEywT9zaoBV3F6ueVY6BVFgkCXgGlxD6bI7vfcysvUDHFeIb6gJHZzRu XNUKBZ6v7LM5Ig7LfNgWqcTvDNbIFXTyRuI7x8NkNkkhZvhKJLE2j4QqFiqQOylK1Ja5 /N0KkCjTn6B7jdYkuZKacOEbQ7+GJnVYaVgqUEgpJSQQlIJZwOJfOBVq/PeqvGtUfjn3 NnjcKq2NpUXZtzZM9r9Kho6otJqNHaynph6UQkOxPK1OL8vmZBSGEVOiCqVlZUOC6p2Y 4j8MjJqXW9ErGLDgUNytsCGRAXRvrOAha8qlkVyfhxM63RXCUS/2ln5kjMF5jjJavS8q M9IQ== X-Gm-Message-State: AOAM531+sTcQoE14nefAGFyffWvvxUvuC5kf+RA9Gj8hDS8IRaUt0zEo X7jPdyrIH0OoG6lE8XnOiW69SQ== X-Received: by 2002:a05:651c:32e:: with SMTP id b14mr144247ljp.314.1600945574405; Thu, 24 Sep 2020 04:06:14 -0700 (PDT) Received: from localhost.localdomain (h-155-4-133-169.NA.cust.bahnhof.se. [155.4.133.169]) by smtp.gmail.com with ESMTPSA id w4sm1762393lfr.139.2020.09.24.04.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Sep 2020 04:06:13 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Kevin Hilman , linux-pm@vger.kernel.org Cc: Sudeep Holla , Lorenzo Pieralisi , Daniel Lezcano , Lina Iyer , Lukasz Luba , Vincent Guittot , Stephen Boyd , Bjorn Andersson , Ulf Hansson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] PM / Domains: Rename power state enums for genpd Date: Thu, 24 Sep 2020 13:04:47 +0200 Message-Id: <20200924110449.329523-2-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200924110449.329523-1-ulf.hansson@linaro.org> References: <20200924110449.329523-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To clarify the code a bit, let's rename GPD_STATE_ACTIVE into GENPD_STATE_ON and GPD_STATE_POWER_OFF to GENPD_STATE_OFF. Signed-off-by: Ulf Hansson --- Changes in v2: - None. --- drivers/base/power/domain.c | 33 ++++++++++++++++----------------- include/linux/pm_domain.h | 4 ++-- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 2cb5e04cf86c..23aa2feced77 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -123,7 +123,7 @@ static const struct genpd_lock_ops genpd_spin_ops = { #define genpd_lock_interruptible(p) p->lock_ops->lock_interruptible(p) #define genpd_unlock(p) p->lock_ops->unlock(p) -#define genpd_status_on(genpd) (genpd->status == GPD_STATE_ACTIVE) +#define genpd_status_on(genpd) (genpd->status == GENPD_STATE_ON) #define genpd_is_irq_safe(genpd) (genpd->flags & GENPD_FLAG_IRQ_SAFE) #define genpd_is_always_on(genpd) (genpd->flags & GENPD_FLAG_ALWAYS_ON) #define genpd_is_active_wakeup(genpd) (genpd->flags & GENPD_FLAG_ACTIVE_WAKEUP) @@ -222,7 +222,7 @@ static void genpd_update_accounting(struct generic_pm_domain *genpd) * out of off and so update the idle time and vice * versa. */ - if (genpd->status == GPD_STATE_ACTIVE) { + if (genpd->status == GENPD_STATE_ON) { int state_idx = genpd->state_idx; genpd->states[state_idx].idle_time = @@ -563,7 +563,7 @@ static int genpd_power_off(struct generic_pm_domain *genpd, bool one_dev_on, return ret; } - genpd->status = GPD_STATE_POWER_OFF; + genpd->status = GENPD_STATE_OFF; genpd_update_accounting(genpd); list_for_each_entry(link, &genpd->child_links, child_node) { @@ -616,7 +616,7 @@ static int genpd_power_on(struct generic_pm_domain *genpd, unsigned int depth) if (ret) goto err; - genpd->status = GPD_STATE_ACTIVE; + genpd->status = GENPD_STATE_ON; genpd_update_accounting(genpd); return 0; @@ -961,7 +961,7 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock, if (_genpd_power_off(genpd, false)) return; - genpd->status = GPD_STATE_POWER_OFF; + genpd->status = GENPD_STATE_OFF; list_for_each_entry(link, &genpd->child_links, child_node) { genpd_sd_counter_dec(link->parent); @@ -1007,8 +1007,7 @@ static void genpd_sync_power_on(struct generic_pm_domain *genpd, bool use_lock, } _genpd_power_on(genpd, false); - - genpd->status = GPD_STATE_ACTIVE; + genpd->status = GENPD_STATE_ON; } /** @@ -1287,7 +1286,7 @@ static int genpd_restore_noirq(struct device *dev) * so make it appear as powered off to genpd_sync_power_on(), * so that it tries to power it on in case it was really off. */ - genpd->status = GPD_STATE_POWER_OFF; + genpd->status = GENPD_STATE_OFF; genpd_sync_power_on(genpd, true, 0); genpd_unlock(genpd); @@ -1777,7 +1776,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd, genpd->gov = gov; INIT_WORK(&genpd->power_off_work, genpd_power_off_work_fn); atomic_set(&genpd->sd_count, 0); - genpd->status = is_off ? GPD_STATE_POWER_OFF : GPD_STATE_ACTIVE; + genpd->status = is_off ? GENPD_STATE_OFF : GENPD_STATE_ON; genpd->device_count = 0; genpd->max_off_time_ns = -1; genpd->max_off_time_changed = true; @@ -2802,8 +2801,8 @@ static int genpd_summary_one(struct seq_file *s, struct generic_pm_domain *genpd) { static const char * const status_lookup[] = { - [GPD_STATE_ACTIVE] = "on", - [GPD_STATE_POWER_OFF] = "off" + [GENPD_STATE_ON] = "on", + [GENPD_STATE_OFF] = "off" }; struct pm_domain_data *pm_data; const char *kobj_path; @@ -2881,8 +2880,8 @@ static int summary_show(struct seq_file *s, void *data) static int status_show(struct seq_file *s, void *data) { static const char * const status_lookup[] = { - [GPD_STATE_ACTIVE] = "on", - [GPD_STATE_POWER_OFF] = "off" + [GENPD_STATE_ON] = "on", + [GENPD_STATE_OFF] = "off" }; struct generic_pm_domain *genpd = s->private; @@ -2895,7 +2894,7 @@ static int status_show(struct seq_file *s, void *data) if (WARN_ON_ONCE(genpd->status >= ARRAY_SIZE(status_lookup))) goto exit; - if (genpd->status == GPD_STATE_POWER_OFF) + if (genpd->status == GENPD_STATE_OFF) seq_printf(s, "%s-%u\n", status_lookup[genpd->status], genpd->state_idx); else @@ -2938,7 +2937,7 @@ static int idle_states_show(struct seq_file *s, void *data) ktime_t delta = 0; s64 msecs; - if ((genpd->status == GPD_STATE_POWER_OFF) && + if ((genpd->status == GENPD_STATE_OFF) && (genpd->state_idx == i)) delta = ktime_sub(ktime_get(), genpd->accounting_time); @@ -2961,7 +2960,7 @@ static int active_time_show(struct seq_file *s, void *data) if (ret) return -ERESTARTSYS; - if (genpd->status == GPD_STATE_ACTIVE) + if (genpd->status == GENPD_STATE_ON) delta = ktime_sub(ktime_get(), genpd->accounting_time); seq_printf(s, "%lld ms\n", ktime_to_ms( @@ -2984,7 +2983,7 @@ static int total_idle_time_show(struct seq_file *s, void *data) for (i = 0; i < genpd->state_count; i++) { - if ((genpd->status == GPD_STATE_POWER_OFF) && + if ((genpd->status == GENPD_STATE_OFF) && (genpd->state_idx == i)) delta = ktime_sub(ktime_get(), genpd->accounting_time); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index ee11502a575b..66f3c5d64d81 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -64,8 +64,8 @@ #define GENPD_FLAG_RPM_ALWAYS_ON (1U << 5) enum gpd_status { - GPD_STATE_ACTIVE = 0, /* PM domain is active */ - GPD_STATE_POWER_OFF, /* PM domain is off */ + GENPD_STATE_ON = 0, /* PM domain is on */ + GENPD_STATE_OFF, /* PM domain is off */ }; struct dev_power_governor { -- 2.25.1