From patchwork Fri Feb 9 14:10:24 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: 198910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp890137dyd; Fri, 9 Feb 2024 06:29:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXYlUNx+kaYVZBAu/26I9PkKTELQ0mRtlqDxrKPdJdHL+pEFCenIbsHS+s0iJYO570Ay+6h95Rg+4ODlavkVUv+jXxafA== X-Google-Smtp-Source: AGHT+IFCp+yfOssD38MS/wApULArW3gfBZEYE9uFdwCmU9mdoTdrGoGf37EMHHNZpKCn/+cmtF7A X-Received: by 2002:a05:6a20:6f03:b0:19e:a1ae:7a95 with SMTP id gt3-20020a056a206f0300b0019ea1ae7a95mr2424536pzb.47.1707488958408; Fri, 09 Feb 2024 06:29:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707488958; cv=pass; d=google.com; s=arc-20160816; b=Uqa3KCP332ptKdnPA8rrrdKHq54/e0FbERfY3qQAFGApOEIPX0B8yVvVaUovJMlYc/ XoeQdjmfIOuF+TaBohPDJReoLg3Ix8KFcR6bYueAr793Q3f4CHBhN+st3AxoJPesrcbN VVdEWFrUJRNU0Tex9DfaoFpKks28vzbp6mcr/z5YmE3dO/rpRztHR1mzXBpr54EweYSB ISGtrVWugomZUaZOuL1k0BO6V/xrj1CbUVCJIgkJgCeVvuXlVq8gEVEsp50Dm899TE5Q GZVg39OGb6yabgWnh1IrbOEX8p9Et773XsiG5npQK+f9r4BlOHWKSXq/HmmQ/RlMmdr1 9TjA== 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=MOc1M3ygDN6ML6O+0sPr9x+vEhgMnbhq1ZlrGHXuXKo=; fh=KjbTJ52onQYTuZrCw+iaPZknS6ZazRsgslW1ps/xwzY=; b=PVYMbKaAmWo3fCowdoKbgv275qzNbtnJpSf686GZOEbSqWa5A+bTt119wCZdQYKhTf TwRPkmSxcFz0PN1sFyEc8xLZPRY8wSR/bSdUGW/wX+eYRbwcPzX7g5RWrbwI+TN+5vPL jDC572jpDDVzeO/uzP3jtFAs6Ytduzm2MRVHKsKouFaCEUx4YkbIQDOrvjjuv0j9NpnD OCvqoJJM8UljH5t/qspCC9ZxJ61xMNmGo8DEDG0/mMn/JA4UGki7GbE3ZgLNKiGJm1pP tZYHEDyV/m7+yo6CQ7Z8yAUdNHQqrB9JeywZObyaAZAIDt8IhatRS7uE+RXFVFeOL7AY yB0w==; 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-59435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59435-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVJWeiuGOg0bpI8rL9vY/dMIsnOzDGF6RFzssLtpsO+ZQV/t7VohFdOdrwRYycYF3YvRE4uoGI2bKo8Mxf8NhMEm70rpg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d6-20020aa78e46000000b006e045c176fcsi379497pfr.324.2024.02.09.06.29.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 06:29:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59435-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-59435-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59435-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 D00C7289727 for ; Fri, 9 Feb 2024 14:19:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B3F8979DA9; Fri, 9 Feb 2024 14:14:50 +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 01DFB6DD11; Fri, 9 Feb 2024 14:14:45 +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=1707488088; cv=none; b=Nr+OnwbpWbo5mp/TvEwpc9CJWxPiGI9a3EUG9da+7/Nj+YFBk2ns4TMvi3ds70JQa5HmNffGHpaZdUN/ZoFEacO5i0MFoI8GuhYgwXN+Cb2BfgEfENQgkqz8c87z1lkUgxeBYBSOcLkLAyAZGRHZbWELWof9gZzEvl9/H4RWD5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707488088; c=relaxed/simple; bh=Ssul7hc7kbACnmZvX9krmTTLWenMYtCPw+q2NatOvlc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GQYAa82UcJgGzU/XbafaYU/vipOegskFBKOcMwppSCU8z0wpdfkNA6Xa2aKnx3PLpZISb81JHYxqJRqKVULDjUZByptVr18IOf0GtJSKpBd1Pd7eFVJm5Rse+xdWwJ+UMJdkOCx1Cd56zvIXeocDvYNPa4ymF0JMR2L/FN/COAE= 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 951de1a746e31c75; Fri, 9 Feb 2024 15:14:43 +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 42D3C669C4D; Fri, 9 Feb 2024 15:14:43 +0100 (CET) From: "Rafael J. Wysocki" To: Linux PM , Miri Korenblit Cc: Lukasz Luba , LKML , Daniel Lezcano , Stanislaw Gruszka , Srinivas Pandruvada , Zhang Rui , netdev@vger.kernel.org, Ido Schimmel , Petr Machata , linux-wireless@vger.kernel.org, Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Manaf Meethalavalappu Pallikunhi Subject: [PATCH v1 6/9] iwlwifi: mvm: Set THERMAL_TRIP_WRITABLE_TEMP directly Date: Fri, 09 Feb 2024 15:10:24 +0100 Message-ID: <3757041.MHq7AAxBmi@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: gggruggvucftvghtrhhoucdtuddrgedvledrtdeigdeitdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeefudduuedtuefgleffudeigeeitdeufeelvdejgefftdethffhhfethfeljefgteenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepudeipdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhhirhhirghmrdhrrggthhgvlhdrkhhorhgvnhgslhhithesihhnthgvlhdrtghomhdprhgtphhtthhopehluhhkrghsiidrlhhusggrsegrrhhmrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghl sehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehsthgrnhhishhlrgifrdhgrhhushiikhgrsehlihhnuhigrdhinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=16 Fuz1=16 Fuz2=16 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790431941726655566 X-GMAIL-MSGID: 1790431941726655566 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 iwlwifi 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 --- This patch obviously depends on https://patchwork.kernel.org/project/linux-pm/patch/8346768.T7Z3S40VBb@kreacher/ which has been queued up for 6.9 already. --- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) Index: linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c =================================================================== --- linux-pm.orig/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ linux-pm/drivers/net/wireless/intel/iwlwifi/mvm/tt.c @@ -667,9 +667,6 @@ static struct thermal_zone_device_ops t .set_trip_temp = iwl_mvm_tzone_set_trip_temp, }; -/* make all trips writable */ -#define IWL_WRITABLE_TRIPS_MSK (BIT(IWL_MAX_DTS_TRIPS) - 1) - static void iwl_mvm_thermal_zone_register(struct iwl_mvm *mvm) { int i, ret; @@ -692,11 +689,12 @@ static void iwl_mvm_thermal_zone_registe for (i = 0 ; i < IWL_MAX_DTS_TRIPS; i++) { mvm->tz_device.trips[i].temperature = THERMAL_TEMP_INVALID; mvm->tz_device.trips[i].type = THERMAL_TRIP_PASSIVE; + mvm->tz_device.trips[i].type = THERMAL_TRIP_WRITABLE_TEMP; } mvm->tz_device.tzone = thermal_zone_device_register_with_trips(name, mvm->tz_device.trips, IWL_MAX_DTS_TRIPS, - IWL_WRITABLE_TRIPS_MSK, + 0, mvm, &tzone_ops, NULL, 0, 0); if (IS_ERR(mvm->tz_device.tzone)) {