Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp954163rdb; Fri, 9 Feb 2024 06:17:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVRHiTHyv5IYdDH84KXCO3OlWmwgGZ8TN6zKpOxB9L1hhODW89cX2AaOwjKnUtSVNxw4Rx7uTbjbDW2PWTvMCzMwb3v9ImjWRugrYSNLA== X-Google-Smtp-Source: AGHT+IGC3B1PoPKtdwK3NiUO+CbEoVZnYGmS8rVe0jspdE/s2smBT75NTEqaiw5m0gL/Lw4aG90u X-Received: by 2002:a17:906:dfd8:b0:a3c:de7:f54e with SMTP id jt24-20020a170906dfd800b00a3c0de7f54emr260359ejc.14.1707488272775; Fri, 09 Feb 2024 06:17:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707488272; cv=pass; d=google.com; s=arc-20160816; b=mb9MEhxrH9t6bbuC3N/4NRyuwJtLV/L4ICcrloyA0vxM2Z2yHSTpXOwbOuAtpAvEiW 3uI8a9+XEwVQYgJoOozUkjV6uHdEjtkQabB/vkVqbT1hxQ/5VU0pE0BNteX6ogbzldNa 0SLa9qXaRhmHdHjoMLJdBfHwFH06yRPHVLqs1TQR/dkilwiy2X/LRMa4qrlQuUYQ9/oS 9ToepDK+PCyCRTNWRDMhn622tVpU20y73ainFo1ra8/u/OSDj2iHkqpeiv0Lqlun7RFN xFEfGWj4SfhCL4Z6qqQs/apPOm97xrrJSPNVmxGdr8F7Fg2ZRviaIkGiodyi7MNvG3Sk 4uXw== 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=HKOoCykZvqxNdGPlRg9+vUM85ZyYhEi3d2wBL9rPltk=; b=x9fdZRLXejNzbmsvAOGOPBWTU+ZxP42kFp80BmcpHJ5LLLGlttp+WiyJqRUw9bfDBj OJ7GLcZfk/zjyGom4lVkLWjFdTaVSYrsN9bFBsaLdjk96Tk1WEHCr15WmeCc2/lmt6jp Ynd3x0I9/awRuUea3Ox5W3WwH8IkzglI4+FV93WfrWY62temkl9xPjLRlPdY1skdoNAP j0Q+eFiWRsRJCCrfesDc5Voj/Ryp2gDMSCLeuzsvHRIfKB9TT+zRjR9lo9L6OVPPbBBH Fk0d+7LjhatAztFSTUoFZ3FV5vEfJM031Zv7GqsgU03FCUIe3CfrBtFgXbnZ24ooIAjA E6Xw==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59433-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCV3r4TTENeHRizXQQci/Y3ZMUkljbfj5+/R2RQRL9HkOKRMIfe8YQ9eMQYUPKDOC+jcnGvoKxnq7QZop/6LFCZEiWzKrChQKa9OKaxDgg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gn27-20020a1709070d1b00b00a3c017e2b00si362066ejc.628.2024.02.09.06.17.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:17:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59433-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; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-59433-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59433-linux.lists.archive=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 8773D1F218D3 for ; Fri, 9 Feb 2024 14:17:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B52CB74E30; Fri, 9 Feb 2024 14:14:47 +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 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: gggruggvucftvghtrhhoucdtuddrgedvledrtdeigdeitdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehlihhnuhigqdhpmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehluhhkrghsiidrlhhusggrsegrrhhmrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehsthgr nhhishhlrgifrdhgrhhushiikhgrsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=16 Fuz1=16 Fuz2=16 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);