From patchwork Mon Feb 12 18:26:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 200004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp113604dyb; Mon, 12 Feb 2024 11:06:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVsmkJRLMAjDaxfqsTV+SNo25lpOK7/nDLy3VL8jgRHn142bZN6fBMfHLfKBdalR68uoyf1n6kpTdPlQzWQHLteHuw+WA== X-Google-Smtp-Source: AGHT+IFm0asjJhCGWfCCPDQey7rUHFyVFIS+2L+BbYCFdqn7KdkLwUaVcHIsQqEHPHrCiIMjxZ55 X-Received: by 2002:a17:90b:155:b0:297:3c67:7763 with SMTP id em21-20020a17090b015500b002973c677763mr1915964pjb.7.1707764810310; Mon, 12 Feb 2024 11:06:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707764810; cv=pass; d=google.com; s=arc-20160816; b=YnMvxpx8k4gqfVfnx7xK8elK8Y7SgCSQmsxY3Xp054/jLDLZb/SIUx6QbfJcr29Gha JuWqxdHu2c9NERXtLqbeuVFk0HjUYEfm+05l1UL9SgThp9Fcldr/iV1Ehh/Yla6A53QL I1N1mWIwMgjeeOMqPfEPmqRR0rXYk+cpbDMgWeIaI37QZe+l21AIXHt9pTwNuyFLPIo1 6Ia+40+aY076zW3aK8WNRy5TVAidd92KXUe6isdtCLiy//h5f3erJFnmY3ZMxCG/WI02 VmzxvTmBChLD2tFtRfWL+iuOm12rhxzJi+0R7XsoPMPMmcp1vnlZ7CRh7aWCqf2lsvOf i25g== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ZIIQSbWCUh3cm7UFrLeilfOk83hsde6d1/LgaLxD5WI=; fh=xKCOAJ6PtubQ7jY1b9GtcFOvecoRYi8hth0+0/aHbKM=; b=rcNsS3LyxKAF2Et0VU0Izsf6xVKk4N5F+hrkZxFrEtFcQ3NedLQGxr+lb1oAKVb/43 9I9zRb6+bAT533hPaCp5xas6UOyPTnk6Itxq7ZvNCw0nl+8fXMNeTdfsTDc2/wI91WbT YCjxTSNe1fZia9AiTz9OXy+Jd29zPLu+CGKf2DMfJ0tlDR5b3hfh/eiaK/D17fcX3PME 7k9pQaFknQgZ+Ny6oFxPcpdNxh+GDdqui0rYvCDcGGEvwbpyR/Z2vmlJnGqjX3Ycl37u Vv3DAz/eBIGy8KoPqVs9M5V0FWckvCx+l4AmsDRHjFZe3H5rlwvhascq40ha6xBX3rkp GKOw==; dara=google.com 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-62214-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62214-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWMKSLgb8+8qSGWuDukkgvLFRf9zv45tH0tJk3NkrpvTolJfFq5BVg0McyOOjjlaCwXVLkNtoOgGKfMCPXbParJUMSMXA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id gv2-20020a17090b11c200b002972f04d56esi666005pjb.147.2024.02.12.11.06.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 11:06:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62214-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-62214-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62214-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4F2EFB280AB for ; Mon, 12 Feb 2024 18:46:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98CEB4F60D; Mon, 12 Feb 2024 18:42:40 +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 B8AA7481DA; Mon, 12 Feb 2024 18:42:35 +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=1707763358; cv=none; b=CRwUpA9+m+6qg/iB2zfH+v5fVElA/qSIAITaezlS5Wl9uSt8+peaWfdcXWEaltiw+VNHLS699zBHEidUaiBHVfb+hlyboc5xxX0chYravo8uD133Lc1VPJh3Buw4GT3wsRu8oDndWAXdMqgpRNQFpJ0egdo+YNVN4RlRC6zCZHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707763358; c=relaxed/simple; bh=ruCrcRG0ZxbpdLcx0rWNmfXeUOipHCx6oaOxdYBpTi8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FmNQfk/VYn2CjH4yL32389ZPx0exw9W8G+4kVDgrjOw4guBREOtN/jIM3j4Q2lvDOYt7Sr078yoEzXcD/y+C7UQBvdMGTLdRungEvrnj6iX8O27P0qdVrwsZYTOz+lv2eqSGoQq/KvbuoqvzFi4ekZ73HcMdqP5II+MJUSxtKV8= 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 f4cc19245f191df7; Mon, 12 Feb 2024 19:42:33 +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 3CC00669CF2; Mon, 12 Feb 2024 19:42:33 +0100 (CET) From: "Rafael J. Wysocki" To: Linux PM Cc: Lukasz Luba , LKML , Daniel Lezcano , Stanislaw Gruszka , Srinivas Pandruvada , Zhang Rui , netdev@vger.kernel.org, Ido Schimmel , Petr Machata , Miri Korenblit , linux-wireless@vger.kernel.org, Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Manaf Meethalavalappu Pallikunhi Subject: [PATCH v2 1/9] thermal: Get rid of CONFIG_THERMAL_WRITABLE_TRIPS Date: Mon, 12 Feb 2024 19:26:25 +0100 Message-ID: <4545870.LvFx2qVVIh@kreacher> In-Reply-To: <6017196.lOV4Wx5bFT@kreacher> References: <6017196.lOV4Wx5bFT@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrudefgdduudegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdffueeitdfgvddtudegueejtdffteetgeefkeffvdeftddttdeuhfegfedvjefhnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepudeipdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhukhgrshiirdhluhgsrgesrghrmhdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegurghnihgvlhdrlhgviigtrghnoheslhhinhgrrhhordhorhhgpdhrtghpthhtohepshht rghnihhslhgrfidrghhruhhsiihkrgeslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=16 Fuz1=16 Fuz2=16 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790721193686921240 X-GMAIL-MSGID: 1790721193686921240 From: Rafael J. Wysocki The only difference made by CONFIG_THERMAL_WRITABLE_TRIPS is whether or not the writable trips mask passed during thermal zone registration will take any effect, but whoever passes a non-zero writable trips mask to thermal_zone_device_register_with_trips() can be forgiven thinking that it will always work. Moreover, some thermal drivers expect user space to set trip temperature values, so they select CONFIG_THERMAL_WRITABLE_TRIPS, possibly overriding a manual choice to unset it and going against the design purportedly allowing system integrators to decide on the writability of trip points for the given kernel build. It is also set in one platform's defconfig. Forthermore, CONFIG_THERMAL_WRITABLE_TRIPS only affects trip temperature, because trip hysteresis is writable as long as the thermal zone provides a callback to update it, regardless of the CONFIG_THERMAL_WRITABLE_TRIPS value. The above means that the symbol in question is used inconsistently and its purpose is at least moot, so remove it and always take the writable trip mask passed to thermal_zone_device_register_with_trips() into account. Signed-off-by: Rafael J. Wysocki Reviewed-by: Daniel Lezcano --- v1 -> v2: No changes --- arch/arm/configs/imx_v6_v7_defconfig | 1 - drivers/thermal/Kconfig | 11 ----------- drivers/thermal/intel/Kconfig | 2 -- drivers/thermal/thermal_sysfs.c | 3 +-- 4 files changed, 1 insertion(+), 16 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; 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