Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp39095rdh; Wed, 20 Dec 2023 15:19:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRNg8uggKOvlmfcuawBNSHLctVICdDwlFNdSC6wPeUAfNIhOnNrv+oyZoEowB0CScxfFWj X-Received: by 2002:a50:cb85:0:b0:54c:4837:93f1 with SMTP id k5-20020a50cb85000000b0054c483793f1mr11312074edi.56.1703114350547; Wed, 20 Dec 2023 15:19:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703114350; cv=none; d=google.com; s=arc-20160816; b=btLZCqUjgi79zfNt5N0fGlX/cCrqMsj8TeZnoSKWc5Bx/tDix4l/uW14YJg5LF1eah 0DAT7GNIx6w1V1irbv0J326LMy1BcjL9rkf4VHnvgZ768iflnVz/zMuqF/VvJQQXNw9M SjUTzJKquvpJ/rjRUu96f9+uFpK3d9HlRNXqsZnaxgPEybbJzrdGwwYxnV1Hd5EhFhHk slf+gvkROPrjYbaSsMwZkX1JCJobH51xPKTlYSJYneO4lMsAZnIHkWB8u97CNtbW93pR Nx+AKfgmZUs43y9PuRsMzfdhYZbodwWhhGWvFTtnhLF/gpbzdMxQ0py18qzioUHsPYlY Gyxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=/GywyLc1XSl0UuZvGhqeJSh8ebS7tHPCLETTLUgM0vs=; fh=BLXDRFxX5XTO46cEytehPgkEKhEpfPIIZAXbZsHkuJk=; b=k6PjDro2fpc33/60QSc7VRRXvF8JYH+I/rqMRbp14n8pU7ze08Al9fGXePuYonJwfS Xjh7TT/j66hGxot+aEDau555qkak3L2ZXGaRrIcwFVGYtb1csf7eNQUKNHikT1UA9uJW LJd/aCvqo7S/nEW+asCvTrCCkXDjjyrac1nKixTV6DQk7aRz7Kx8o4T+yAHuq3hqm4vl MU9UxkmOIuhx6zCyvYuSN8+dRVe8MntPycbl2BECDGEqkAKMtXzJcMZsPGPAZf6RzRl/ 73ipL+1ria+AC9I3TQfw+0QwR/7KvE/+oBP46nU04BRKUDP0YMtlHCSChK0CcIT/e30x 9DrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7630-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7630-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bt8-20020a0564020a4800b00553a59b52desi259110edb.325.2023.12.20.15.19.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:19:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7630-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7630-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7630-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 525BC1F24676 for ; Wed, 20 Dec 2023 23:19:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8AEA4C61C; Wed, 20 Dec 2023 23:17:07 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 148DE4CDF8; Wed, 20 Dec 2023 23:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8FA8F2F4; Wed, 20 Dec 2023 15:17:50 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.82.217]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 62D2E3F64C; Wed, 20 Dec 2023 15:17:04 -0800 (PST) From: Lukasz Luba To: linux-kernel@vger.kernel.org, rafael@kernel.org Cc: linux-pm@vger.kernel.org, daniel.lezcano@linaro.org, rui.zhang@intel.com, lukasz.luba@arm.com Subject: [PATCH v3 8/9] thermal/sysfs: Update governors when the 'weight' has changed Date: Wed, 20 Dec 2023 23:17:52 +0000 Message-Id: <20231220231753.1824364-9-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231220231753.1824364-1-lukasz.luba@arm.com> References: <20231220231753.1824364-1-lukasz.luba@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Support governors update when the thermal instance's weight has changed. This allows to adjust internal state for the governor. Signed-off-by: Lukasz Luba --- drivers/thermal/thermal_sysfs.c | 3 +++ include/linux/thermal.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 299c0fb16593..5abf6d136c24 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -940,6 +940,9 @@ ssize_t weight_store(struct device *dev, struct device_attribute *attr, /* Don't race with governors using the 'weight' value */ mutex_lock(&instance->tz->lock); instance->weight = weight; + + thermal_governor_update_tz(instance->tz, + THERMAL_INSTANCE_WEIGHT_CHANGED); mutex_unlock(&instance->tz->lock); return count; diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 1b76878cea46..a759570de364 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -53,6 +53,7 @@ enum thermal_notify_event { THERMAL_EVENT_KEEP_ALIVE, /* Request for user space handler to respond */ THERMAL_TZ_BIND_CDEV, /* Cooling dev is bind to the thermal zone */ THERMAL_TZ_UNBIND_CDEV, /* Cooling dev is unbind from the thermal zone */ + THERMAL_INSTANCE_WEIGHT_CHANGED, /* Thermal instance weight changed */ }; /** -- 2.25.1