From patchwork Fri Feb 9 14:12:55 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: 198902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp883104dyd; Fri, 9 Feb 2024 06:18:32 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWSb+qasPIIUWGSMvPjy1a4DIy2r7+WYZ5PmTUzRSHoeoRXUNXM437bT8dpkRuUUIEREriuph9ElZYd3Md9Ebj9v+hvpQ== X-Google-Smtp-Source: AGHT+IGd9RHqP12NBxFgscgqaCbCA2/nNxJ+u6JqcOLpbIReEij1ys5bAtFwRTjMFwRdLzc22KHI X-Received: by 2002:a05:6a20:d485:b0:19e:9d92:492e with SMTP id im5-20020a056a20d48500b0019e9d92492emr1765582pzb.44.1707488312357; Fri, 09 Feb 2024 06:18:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707488312; cv=pass; d=google.com; s=arc-20160816; b=MjVFXogww07hW2eSgA+wRrAROyMSyfc3Yqe9tWfwAtY+WXZnKR5dv48ZxMug0A5obo 7r608gQ8MQ5ArxzBEgMJU5olL45V3/nQJYTMOL5XLD4ZNAZoxKwE0dXZ4xfOjD5UKGFJ nxAWg3J0VbLbFkxDPaqroKhCnUyl9Y591iO893W6QxlExk7Ca0T17pTO8zOycake3UdM JfsLZb+kA09sqDs01idq0ukwxp4NRVgM3/29n12ddl81iUuhOTOvVsWW9dHuMePv3ITz zdt/eExYdB/PEwIZwGBOy+UUpbEUsxpEcMxiXJ0Dt1RHS1QY2uxwBrIXEtRpR9IZC3Rw RxtA== 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=lMn/KqWPRmaGp59A/yWVCDAX1D8RbK+KvFBIqIddImE=; fh=CL2Aey1s4JpC0PXVgY4Y7mjxzNDecUqTtbPRoAJeYsY=; b=SOuUz6E6IQ/kZfWZta8F2Ol92KKpVEzIBEmo0XT1IG90NICdKtXjY5WQQdV2cS/0z5 r6Vfea0aaJx8EbHB2lgJ3nZGgEO2OxK6eAqhYT2wgTWi3dzFHoT1E1MuTiLB4G7aRKl4 8YPXo7gzih5d1wW25zR8gywXHJSgS/4ZghVPNkDobGuXghqhqD/A5gQBsg9XZx6Myh5q y1nxypNiRmGQN4HsgLtO9tC1IGIjf+0QrJMaFngJcFKUOfNTuveDGtJ9vIS5y5b4QEKG PasfG1xNaeJxz4EsbEJW/TkeECErUEVg4RMSunjePdWcWX7Pg/uw8hO1Dpq8zuN/oyFq q3Zg==; 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-59433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59433-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXiw98KTVSWqiY1SXQF68Qruktf5Q9tzMaBHGC3ArrbgMgncPgF9cnacR7QqQbxVUHCSG/LzJ1g1IaAAKNy3AV3WUPEHA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l190-20020a6388c7000000b005d8b44e7961si1714695pgd.599.2024.02.09.06.18.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:18:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-59433-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59433-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 272B8280C1A for ; Fri, 9 Feb 2024 14:18:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F306E7691D; Fri, 9 Feb 2024 14:14:48 +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 3ED5365BBC; Fri, 9 Feb 2024 14:14:43 +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=1707488087; cv=none; b=Cyd/WK9gvNF0td89ycBUC0a7PovpVOniSSf7N6Wd4T2VFwT1c5y5gUBb/FRYljRBquDNqapwMv3cDz95oSe6YDEt3UTAaRPMT5XKzn/qnngfbpG+nCUEQNxhAP6bxAAACJoHvK5QQoRPHdhOO5+6wvO5bR4WFnKXoLEMfC0VlC4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488087; c=relaxed/simple; bh=0aV/S+3kFjqWSHlmNGQrAPqW+jmdMdKldoo/BBfTj9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pUr1OKzlf9SFOxxDeeKZT20OMop/9Ace2DAAhanOH9v65hFXPmIR68EflJ9px+w807OyHia/YS6VUdmG30hp4qzrDjSmCU7ZQrala4RzBrkxiMkJclX5xQiMvX/kV4HvpIfH/CQPrmqjL6Qx2i3oBhu8hHYtXCNH0Ut2jRfDGlo= 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 3bbb5adbc2281c63; Fri, 9 Feb 2024 15:14:42 +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 6DA10669C4D; Fri, 9 Feb 2024 15:14:41 +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 v1 8/9] thermal: of: Set THERMAL_TRIP_WRITABLE_TEMP directly Date: Fri, 09 Feb 2024 15:12:55 +0100 Message-ID: <2209601.Icojqenx9y@kreacher> In-Reply-To: <3232442.5fSG56mABF@kreacher> References: <3232442.5fSG56mABF@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: gggruggvucftvghtrhhoucdtuddrgedvledrtdeigdeitdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehluhhkrghsiidrlhhusggrsegrrhhmrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehsthgr nhhishhlrgifrdhgrhhushiikhgrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=16 Fuz1=16 Fuz2=16 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790431265093450272 X-GMAIL-MSGID: 1790431265093450272 From: Rafael J. Wysocki It is now possible to flag trip points with THERMAL_TRIP_WRITABLE_TEMP to allow their temperature to be set from user space via sysfs instead of using a nonzero writable trips mask during thermal zone registration, so make the OF thermal code do that. No intentional functional impact. Note that this change is requisite for dropping the mask argument from thermal_zone_device_register_with_trips() going forward. Signed-off-by: Rafael J. Wysocki --- drivers/thermal/thermal_of.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux-pm/drivers/thermal/thermal_of.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_of.c +++ linux-pm/drivers/thermal/thermal_of.c @@ -117,6 +117,8 @@ static int thermal_of_populate_trip(stru return ret; } + trip->flags = THERMAL_TRIP_WRITABLE_TEMP; + return 0; } @@ -477,7 +479,7 @@ static struct thermal_zone_device *therm struct device_node *np; const char *action; int delay, pdelay; - int ntrips, mask; + int ntrips; int ret; of_ops = kmemdup(ops, sizeof(*ops), GFP_KERNEL); @@ -510,15 +512,13 @@ static struct thermal_zone_device *therm of_ops->bind = thermal_of_bind; of_ops->unbind = thermal_of_unbind; - mask = GENMASK_ULL((ntrips) - 1, 0); - ret = of_property_read_string(np, "critical-action", &action); if (!ret) if (!of_ops->critical && !strcasecmp(action, "reboot")) of_ops->critical = thermal_zone_device_critical_reboot; tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips, - mask, data, of_ops, &tzp, + 0, data, of_ops, &tzp, pdelay, delay); if (IS_ERR(tz)) { ret = PTR_ERR(tz);