Message ID | 4565526.LvFx2qVVIh@kreacher |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-43482-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp821013dyb; Mon, 29 Jan 2024 12:41:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHf8ca13XqG0nsFG4nGWmZJ75SXf3s2okMScAdtNg2rcANV2H+hteqcnt1+CwB+uvo9SB/b X-Received: by 2002:a17:906:490c:b0:a30:f4a2:5688 with SMTP id b12-20020a170906490c00b00a30f4a25688mr5423584ejq.1.1706560909263; Mon, 29 Jan 2024 12:41:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706560909; cv=pass; d=google.com; s=arc-20160816; b=LVBPmERYo1MvFIQiATY2xWVTvIJFT2EBIR5bAIRp+dSUaD0PBV1oQBKIGbRhUwpt5K M1ZLFzg24CyJSO58ebcQaJLK530cq9adtgDULywK0dqeN2+BNbNeLMImOZtN3kKKsOYu 8paL3sr1nnBXXslJYKwE3vC2VU2z8nHM/rXtGA3kFcJoKm5WfyPwdqTaNFmFddBlsqBk ImxciL+nXqxmq0DVBB0btpCxReq4frdXWAp8L6nPaN/BjXS2vHTNETbeUeTYRhTpzV+K DeDVF9K0ASfvuWV+5FRfcn273N7wF1KfAIeEd04xzrsyHfuZuBC0/kxRekuTdIGrS7Ob CYng== ARC-Message-Signature: i=2; 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:message-id:date:subject:cc:to :from; bh=9sxjXg838bRXbRaSLrqzZkazlJ45vAJkIsDW6+B+UQw=; fh=nzxeE/TYNAMKFnNVzFRGzlLgExbBQK7SWWNZjNc8t74=; b=CTn4yQZ+GvvkwrqobDZSXHq4czbfknygT8hjAn2RJ3eFlF9kxNTpy0A44L+2a/w9q/ 7guv0z9H6S+q9OdptdkhdXvhFa1f+jeBKLyORC1i6wvgy/3SevdnMRXoomQBSs+hYptw cslk5Ex2iBLsjrLmAPoifBKYuIb8ssqcNuFqtftAqyF46kkaC3jmXd9EcTmgCSpXXNSw YEOJyJJO1rk3NExxpRYSt7WqHZk9JCzokxC+h1er5d9fAQyfB0G6KPZsfbf1cXWA8bZd CUHCcw+Dh8FSDfHk5Ug99Gn/uZ5fPIpUGz7lE/iCNlKD7ThKmJOHlqSohu9gs3joA1h7 iOOA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-43482-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43482-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lc18-20020a170906dff200b00a34a63c18aesi3708271ejc.174.2024.01.29.12.41.49 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 12:41:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43482-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-43482-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43482-ouuuleilei=gmail.com@vger.kernel.org" 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 B79261F24357 for <ouuuleilei@gmail.com>; Mon, 29 Jan 2024 20:41:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F26A157E97; Mon, 29 Jan 2024 20:41:02 +0000 (UTC) Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4226C604C5; Mon, 29 Jan 2024 20:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706560860; cv=none; b=AVJI+tHPw9Sp8cx/Q/4E2I1+xBymubPZuz5NPHi336DWA+8Ax5n2323Eo7rx+5YaGHBjWnyt6MYL5LM9V5kYr/TECnRIcRcizYQNfoVSPgLBTaE3MDT5rQt/kFeHWlS4eOozp5WVrgjwcubN/tkQhafbI5rUjcv3GvWYkXp7Ar0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706560860; c=relaxed/simple; bh=bgKBzEUJGevs+03viKCGW7Vn/kvA4V7Wl7NnMIBDmXI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=rZ7f4oP6CNmY4H3oYB451QU4C6Qpj8deUXrr+Ej97rKOY953a7aFoHLBZYPOqGfjwnfBo4CItRi04QdyK0fAWQ0Rjnw0jR7jool9ghDvaDVwcmTZw4mPc8RqxBbklaYqybyRfIvuHLAa5DUTb1Ctiz5/p+sr8cuUiG+rvpcAfls= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id da105db8dd8b6701; Mon, 29 Jan 2024 21:40:54 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 4F993669776; Mon, 29 Jan 2024 21:40:54 +0100 (CET) From: "Rafael J. Wysocki" <rjw@rjwysocki.net> To: Linux PM <linux-pm@vger.kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org> Cc: LKML <linux-kernel@vger.kernel.org>, Lukasz Luba <lukasz.luba@arm.com>, Zhang Rui <rui.zhang@intel.com>, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>, Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com> Subject: [PATCH v1] thermal: sysfs: Make trip hysteresis writable along with trip temperature Date: Mon, 29 Jan 2024 21:40:54 +0100 Message-ID: <4565526.LvFx2qVVIh@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtgedguddvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeegfffhudejlefhtdegffekteduhfethffhieettefhkeevgfdvgfefieekiefgheenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepjedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghnihgvlhdrlhgviigtrghnoheslhhinhgrrhhordhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhukhgrshiirdhluhgsrges rghrmhdrtghomhdprhgtphhtthhopehruhhirdiihhgrnhhgsehinhhtvghlrdgtohhmpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=7 Fuz1=7 Fuz2=7 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789458811513586910 X-GMAIL-MSGID: 1789458811513586910 |
Series |
[v1] thermal: sysfs: Make trip hysteresis writable along with trip temperature
|
|
Commit Message
Rafael J. Wysocki
Jan. 29, 2024, 8:40 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Trip point temperature can be modified via sysfs if CONFIG_THERMAL_WRITABLE_TRIPS is enabled and the thermal zone creator requested that the given trip be writable in the writable trips mask passed to the registration function. However, trip point hysteresis is treated differently - it is only writable if the thermal zone has a .set_trip_hyst() operation defined and neither CONFIG_THERMAL_WRITABLE_TRIPS, nor the writable trips mask supplied by the zone creator has any bearing on this. That is inconsistent and confusing, and it generally does not meet user expectations. For this reason, modify create_trip_attrs() to handle trip point hysteresis in the same way as trip point temperature, so they both are writable at the same time regardless of what trip point operations are defined for the thermal zone. Link: https://lore.kernel.org/linux-pm/20240106191502.29126-1-quic_manafm@quicinc.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> --- Notes: * I don't think that CONFIG_THERMAL_WRITABLE_TRIPS is very useful. The only thing controlled by it is whether or not the writable trip mask used during registration will have any effect and this is quite confusing. Some drivers select it for this reason which seems a bit odd to me. Maybe it can be dropped after the patch below? * IMO the writable trips mask itself is quite cumbersome and it would be better to mark individual trips as writable in the trips table passed during registration. This would be less prone to mistakes and it would allow the code to check whether or not the given trip should be writable (root can change sysfs file modes after all). If I'm not mistaken, this change should not be very hard to make, although it may take some time to switch over all of the relevant drivers from using the mask. --- drivers/thermal/thermal_sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 29/01/2024 21:40, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > Trip point temperature can be modified via sysfs if > CONFIG_THERMAL_WRITABLE_TRIPS is enabled and the thermal > zone creator requested that the given trip be writable > in the writable trips mask passed to the registration > function. > > However, trip point hysteresis is treated differently - it is only > writable if the thermal zone has a .set_trip_hyst() operation defined > and neither CONFIG_THERMAL_WRITABLE_TRIPS, nor the writable trips mask > supplied by the zone creator has any bearing on this. That is > inconsistent and confusing, and it generally does not meet user > expectations. > > For this reason, modify create_trip_attrs() to handle trip point > hysteresis in the same way as trip point temperature, so they both > are writable at the same time regardless of what trip point operations > are defined for the thermal zone. > > Link: https://lore.kernel.org/linux-pm/20240106191502.29126-1-quic_manafm@quicinc.com > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > --- > > Notes: > > * I don't think that CONFIG_THERMAL_WRITABLE_TRIPS is very useful. > The only thing controlled by it is whether or not the writable trip > mask used during registration will have any effect and this is quite > confusing. Some drivers select it for this reason which seems a bit > odd to me. > > Maybe it can be dropped after the patch below? Actually it is used from an userspace daemon to get threshold crossing temperature which is then changed on the fly. Instead of using multiple trip points, they use one where they change the temperature after it crossed the threshold. Usually the userspace tracks slow sensor temperature in order to set a specific set of limitations given a scenario. We are talking here about Android and thermal engines which are platform specific. For example, lower the battery charging speed if there is a game profile. From my POV, the thermal framework has been hacked via CONFIG_THERMAL_WRITABLE_TRIPS from userspace to get these threshold notification and to be honest I find that not sane. This should fall in a thermal debug section defaulting to 'no'. So in some ways in agree with you. We should drop it or make it more debug oriented in order to prevent it to go in production. But before doing that, we should provide a mechanism to userspace to specify an 'userspace' trip point. However, it is more complex than what it looks because the userspace should be able to specify a group of temperature (and hysteresis) in order to be notified when the boundaries are crossed and those can be dynamic. I will provide a proposal in a separate thread in order to not pollute the discussion of this one. > * IMO the writable trips mask itself is quite cumbersome and it would be > better to mark individual trips as writable in the trips table passed > during registration. This would be less prone to mistakes and it > would allow the code to check whether or not the given trip should > be writable (root can change sysfs file modes after all). If I'm not > mistaken, this change should not be very hard to make, although it may > take some time to switch over all of the relevant drivers from using > the mask. +1 +1 +1 I don't think they are so many drivers using this mask. All the drivers tied with a OF initialization are not impacted as the change will be in one site. > --- > drivers/thermal/thermal_sysfs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > Index: linux-pm/drivers/thermal/thermal_sysfs.c > =================================================================== > --- linux-pm.orig/drivers/thermal/thermal_sysfs.c > +++ linux-pm/drivers/thermal/thermal_sysfs.c > @@ -474,7 +474,8 @@ static int create_trip_attrs(struct ther > tz->trip_hyst_attrs[indx].name; > tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO; > tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show; > - if (tz->ops->set_trip_hyst) { > + if (IS_ENABLED(v) && ^^^ s/v/CONFIG_THERMAL_WRITABLE_TRIPS/ ? > + mask & (1 << indx)) { > tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR; > tz->trip_hyst_attrs[indx].attr.store = > trip_point_hyst_store; > > >
On Wed, Jan 31, 2024 at 7:18 PM Daniel Lezcano <daniel.lezcano@linaro.org> wrote: > > On 29/01/2024 21:40, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > Trip point temperature can be modified via sysfs if > > CONFIG_THERMAL_WRITABLE_TRIPS is enabled and the thermal > > zone creator requested that the given trip be writable > > in the writable trips mask passed to the registration > > function. > > > > However, trip point hysteresis is treated differently - it is only > > writable if the thermal zone has a .set_trip_hyst() operation defined > > and neither CONFIG_THERMAL_WRITABLE_TRIPS, nor the writable trips mask > > supplied by the zone creator has any bearing on this. That is > > inconsistent and confusing, and it generally does not meet user > > expectations. > > > > For this reason, modify create_trip_attrs() to handle trip point > > hysteresis in the same way as trip point temperature, so they both > > are writable at the same time regardless of what trip point operations > > are defined for the thermal zone. > > > > Link: https://lore.kernel.org/linux-pm/20240106191502.29126-1-quic_manafm@quicinc.com > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > --- > > > > Notes: > > > > * I don't think that CONFIG_THERMAL_WRITABLE_TRIPS is very useful. > > The only thing controlled by it is whether or not the writable trip > > mask used during registration will have any effect and this is quite > > confusing. Some drivers select it for this reason which seems a bit > > odd to me. > > > > Maybe it can be dropped after the patch below? > > Actually it is used from an userspace daemon to get threshold crossing > temperature which is then changed on the fly. I mean to drop CONFIG_THERMAL_WRITABLE_TRIPS and make the writable trip masks used during zone registration always work. Sorry for the confusion. > Instead of using multiple trip points, they use one where they change > the temperature after it crossed the threshold. > > Usually the userspace tracks slow sensor temperature in order to set a > specific set of limitations given a scenario. We are talking here about > Android and thermal engines which are platform specific. For example, > lower the battery charging speed if there is a game profile. > > From my POV, the thermal framework has been hacked via > CONFIG_THERMAL_WRITABLE_TRIPS from userspace to get these threshold > notification and to be honest I find that not sane. This should fall in > a thermal debug section defaulting to 'no'. > > So in some ways in agree with you. We should drop it or make it more > debug oriented in order to prevent it to go in production. > > But before doing that, we should provide a mechanism to userspace to > specify an 'userspace' trip point. However, it is more complex than what > it looks because the userspace should be able to specify a group of > temperature (and hysteresis) in order to be notified when the boundaries > are crossed and those can be dynamic. > > I will provide a proposal in a separate thread in order to not pollute > the discussion of this one. > > > * IMO the writable trips mask itself is quite cumbersome and it would be > > better to mark individual trips as writable in the trips table passed > > during registration. This would be less prone to mistakes and it > > would allow the code to check whether or not the given trip should > > be writable (root can change sysfs file modes after all). If I'm not > > mistaken, this change should not be very hard to make, although it may > > take some time to switch over all of the relevant drivers from using > > the mask. > > +1 +1 +1 > > I don't think they are so many drivers using this mask. All the drivers > tied with a OF initialization are not impacted as the change will be in > one site. There are a few. I think around 50% of the thermal_zone_device_register_with_trips() callers pass non-empty writable trip points masks. > > --- > > drivers/thermal/thermal_sysfs.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > Index: linux-pm/drivers/thermal/thermal_sysfs.c > > =================================================================== > > --- linux-pm.orig/drivers/thermal/thermal_sysfs.c > > +++ linux-pm/drivers/thermal/thermal_sysfs.c > > @@ -474,7 +474,8 @@ static int create_trip_attrs(struct ther > > tz->trip_hyst_attrs[indx].name; > > tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO; > > tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show; > > - if (tz->ops->set_trip_hyst) { > > + if (IS_ENABLED(v) && > > ^^^ > > s/v/CONFIG_THERMAL_WRITABLE_TRIPS/ ? Yes, and I'm not sure what happened here, because my local copy of the patch is correct. I'll send a v2 shortly. > > + mask & (1 << indx)) { > > tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR; > > tz->trip_hyst_attrs[indx].attr.store = > > trip_point_hyst_store; > > > > > > > > --
On Wednesday, January 31, 2024 7:41:52 PM CET Rafael J. Wysocki wrote: > On Wed, Jan 31, 2024 at 7:18 PM Daniel Lezcano > <daniel.lezcano@linaro.org> wrote: > > > > On 29/01/2024 21:40, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > > > Trip point temperature can be modified via sysfs if > > > CONFIG_THERMAL_WRITABLE_TRIPS is enabled and the thermal > > > zone creator requested that the given trip be writable > > > in the writable trips mask passed to the registration > > > function. > > > > > > However, trip point hysteresis is treated differently - it is only > > > writable if the thermal zone has a .set_trip_hyst() operation defined > > > and neither CONFIG_THERMAL_WRITABLE_TRIPS, nor the writable trips mask > > > supplied by the zone creator has any bearing on this. That is > > > inconsistent and confusing, and it generally does not meet user > > > expectations. > > > > > > For this reason, modify create_trip_attrs() to handle trip point > > > hysteresis in the same way as trip point temperature, so they both > > > are writable at the same time regardless of what trip point operations > > > are defined for the thermal zone. > > > > > > Link: https://lore.kernel.org/linux-pm/20240106191502.29126-1-quic_manafm@quicinc.com > > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > --- > > > > > > Notes: > > > > > > * I don't think that CONFIG_THERMAL_WRITABLE_TRIPS is very useful. > > > The only thing controlled by it is whether or not the writable trip > > > mask used during registration will have any effect and this is quite > > > confusing. Some drivers select it for this reason which seems a bit > > > odd to me. > > > > > > Maybe it can be dropped after the patch below? > > > > Actually it is used from an userspace daemon to get threshold crossing > > temperature which is then changed on the fly. > > I mean to drop CONFIG_THERMAL_WRITABLE_TRIPS and make the writable > trip masks used during zone registration always work. Sorry for the > confusion. So for the record, this (and note that the symbol is clearly not used as intended, because drivers select it and one platform sets it in defconfig): --- arch/arm/configs/imx_v6_v7_defconfig | 1 - drivers/thermal/Kconfig | 11 ----------- drivers/thermal/intel/Kconfig | 2 -- drivers/thermal/thermal_sysfs.c | 8 +++----- 4 files changed, 3 insertions(+), 19 deletions(-) Index: linux-pm/drivers/thermal/Kconfig =================================================================== --- linux-pm.orig/drivers/thermal/Kconfig +++ linux-pm/drivers/thermal/Kconfig @@ -83,17 +83,6 @@ config THERMAL_OF Say 'Y' here if you need to build thermal infrastructure based on device tree. -config THERMAL_WRITABLE_TRIPS - bool "Enable writable trip points" - help - This option allows the system integrator to choose whether - trip temperatures can be changed from userspace. The - writable trips need to be specified when setting up the - thermal zone but the choice here takes precedence. - - Say 'Y' here if you would like to allow userspace tools to - change trip temperatures. - choice prompt "Default Thermal governor" default THERMAL_DEFAULT_GOV_STEP_WISE Index: linux-pm/drivers/thermal/thermal_sysfs.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_sysfs.c +++ linux-pm/drivers/thermal/thermal_sysfs.c @@ -458,8 +458,7 @@ static int create_trip_attrs(struct ther tz->trip_temp_attrs[indx].name; tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO; tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show; - if (IS_ENABLED(CONFIG_THERMAL_WRITABLE_TRIPS) && - mask & (1 << indx)) { + if (mask & (1 << indx)) { tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR; tz->trip_temp_attrs[indx].attr.store = trip_point_temp_store; @@ -474,8 +473,7 @@ static int create_trip_attrs(struct ther tz->trip_hyst_attrs[indx].name; tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO; tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show; - if (IS_ENABLED(CONFIG_THERMAL_WRITABLE_TRIPS) && - mask & (1 << indx)) { + if (mask & (1 << indx)) { tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR; tz->trip_hyst_attrs[indx].attr.store = trip_point_hyst_store; Index: linux-pm/drivers/thermal/intel/Kconfig =================================================================== --- linux-pm.orig/drivers/thermal/intel/Kconfig +++ linux-pm/drivers/thermal/intel/Kconfig @@ -23,7 +23,6 @@ config X86_PKG_TEMP_THERMAL tristate "X86 package temperature thermal driver" depends on X86_THERMAL_VECTOR select THERMAL_GOV_USER_SPACE - select THERMAL_WRITABLE_TRIPS select INTEL_TCC default m help @@ -47,7 +46,6 @@ config INTEL_SOC_DTS_THERMAL tristate "Intel SoCs DTS thermal driver" depends on X86 && PCI && ACPI select INTEL_SOC_DTS_IOSF_CORE - select THERMAL_WRITABLE_TRIPS help Enable this to register Intel SoCs (e.g. Bay Trail) platform digital temperature sensor (DTS). These SoCs have two additional DTSs in Index: linux-pm/arch/arm/configs/imx_v6_v7_defconfig =================================================================== --- linux-pm.orig/arch/arm/configs/imx_v6_v7_defconfig +++ linux-pm/arch/arm/configs/imx_v6_v7_defconfig @@ -228,7 +228,6 @@ CONFIG_SENSORS_IIO_HWMON=y CONFIG_SENSORS_PWM_FAN=y CONFIG_SENSORS_SY7636A=y CONFIG_THERMAL_STATISTICS=y -CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_CPU_THERMAL=y CONFIG_IMX_THERMAL=y CONFIG_WATCHDOG=y
Index: linux-pm/drivers/thermal/thermal_sysfs.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_sysfs.c +++ linux-pm/drivers/thermal/thermal_sysfs.c @@ -474,7 +474,8 @@ static int create_trip_attrs(struct ther tz->trip_hyst_attrs[indx].name; tz->trip_hyst_attrs[indx].attr.attr.mode = S_IRUGO; tz->trip_hyst_attrs[indx].attr.show = trip_point_hyst_show; - if (tz->ops->set_trip_hyst) { + if (IS_ENABLED(v) && + mask & (1 << indx)) { tz->trip_hyst_attrs[indx].attr.attr.mode |= S_IWUSR; tz->trip_hyst_attrs[indx].attr.store = trip_point_hyst_store;