From patchwork Fri Apr 12 10:42:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13627615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9D11C00A94 for ; Fri, 12 Apr 2024 10:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=L53sL9UVaYrPWNdnC9GfzHRJw+gyBwFP2Gn9l2Q/Ps4=; b=c8ky5gBJ7UXndn vFSb+pzO5UICd8i93PVt/oFp3b/lcpfMgiX367m9HEpVWb2KK9+ftaDYluB0JBbAb7pRFw8PT6yFt VUIhfR7aj6m9mv5CgIvbRpTmMmVp7W/+/JPfM1Ij/ucrL/0tMHQQ4LlLTDF+WF2XyXC/q4ZnzIrKO R/NxqhsAiqkmnpUaRR9vTe0Tpok6rScfr4lUKm04NgvLSGeDVf8SDq1X3uhqZLuiPQgDIXsR5OLS6 DAH/JmVuL2Z7/csRZCHBfbYAx6o8jM+Quf0rI8AerLA9ycaC2PXLH8AEjN2WJQWrC06d2HzXyD/S2 55v2FuUHk50xnOWK0T9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvENE-0000000GlJ4-48Sa; Fri, 12 Apr 2024 10:43:12 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvEMV-0000000Gl2l-0vBG for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 10:42:41 +0000 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-516cdb21b34so960690e87.1 for ; Fri, 12 Apr 2024 03:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712918543; x=1713523343; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0yzFF7XLEaVBUn6zqt63Jmp6pMmz0w4BTjsr5ZlkzWs=; b=BsZm0H0QdhyONS9usRQsCC+0Rd2eHQbEGdxkZJdtND0ws7VVpBtRN1/i4nAK/zCATk 3r+Cyf1bL9GG4Yd2AYQZk8ZzePIN85aQQJoRX5VWtIv+cRYC5irLku5CfnxkYOf8oTho yqtaUxLVuZy5piDqzq7ArvG21SlfFAKCDz0DcGw1715Bk6U6RQze7aUoDyrdPoz47qAC pB54DFBHxROvpgNXY12mnQmom08DofGv3BsWm0No4sCA6DfeRr9XNeVQp1LojRRtfIfB yyN0sVHNppZnVeJ2vYuUGuC/Ja7p+DbBCDCoVcC/x28f5bcQ8D0xrkOOc5RCiHVKaUlA YGIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712918543; x=1713523343; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0yzFF7XLEaVBUn6zqt63Jmp6pMmz0w4BTjsr5ZlkzWs=; b=QxVFpBFXzEykX8XZSoFUQ1K/14q0c3kKORDa3VbmoHiVwf6w408NlNHT5g3FIWGVHP NO49c8YowTURKMAy8yya9xaMb6FjTccr7QgQSGUNoWUi25ic39V5WVVa8QY23jqovgYV Z9F6n74FtdI+WNIwsRsdG+GeUQcISpN6+taQO7/FkHJjOlYWVBjppa4KSYNrBqgLDLZQ qhc+LMPWwTKKpkn1U03JiU/33orwODPBO2/nPiCwdpAEKirGZCOQNoYQ6ZY1kAWE2DxN AqQOSy3A2lROvTYxnjpTMoDqwL+2CAONXG+sqdvBEwc/NmVhREG15IwJb0ndNkOcqyg8 241A== X-Forwarded-Encrypted: i=1; AJvYcCXFV/F0wlHxGP51Q/2iDF+VzHp6NCHVmVRht0uiyluBKHq4uTPc/+l7LIlaZgwswpnxmBINU8xLTh1fBE0qPiAQpqWmyjsvkQTP1ZFmxZKr5L7tXb4= X-Gm-Message-State: AOJu0YxMZYMpe6BNXJ8ZdDUJqmj+r2EBecRwvSs6CBz7ngeP+nYL4x+9 946L8VPLaK5PZPa7vqMT0wFWfxpz0JzbWGFGxESWXlKBcZYCclvL+CtbzEAPNOU= X-Google-Smtp-Source: AGHT+IFEu4dnjTinOwWdQUMez8s60WK/1nUwKuFkVdaWfd4AmIZ0Ku0mYf4Xc1K806sEPp0uonGS3g== X-Received: by 2002:a05:6512:609:b0:518:9964:a7a6 with SMTP id b9-20020a056512060900b005189964a7a6mr1218lfe.42.1712918543246; Fri, 12 Apr 2024 03:42:23 -0700 (PDT) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id v10-20020a05651203aa00b005135f60f486sm493689lfp.112.2024.04.12.03.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 03:42:22 -0700 (PDT) From: Ulf Hansson To: Ulf Hansson , linux-pm@vger.kernel.org Cc: "Rafael J . Wysocki" , Nikunj Kela , Prasad Sodagudi , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] pmdomain: core: Update the rejected/usage counters at system suspend too Date: Fri, 12 Apr 2024 12:42:07 +0200 Message-Id: <20240412104208.74361-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_034227_794800_41BEFF47 X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org During system suspend we may try to enter a low power-state for the genpd in question. Let's take this into account for the statistics too, by updating the rejected/usage counters for the corresponding state. Signed-off-by: Ulf Hansson --- drivers/pmdomain/core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index 4215ffd9b11c..903ea0c193e1 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -1178,8 +1178,12 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock, /* Choose the deepest state when suspending */ genpd->state_idx = genpd->state_count - 1; - if (_genpd_power_off(genpd, false)) + if (_genpd_power_off(genpd, false)) { + genpd->states[genpd->state_idx].rejected++; return; + } else { + genpd->states[genpd->state_idx].usage++; + } genpd->status = GENPD_STATE_OFF;