Message ID | 3757041.MHq7AAxBmi@kreacher |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-59435-ouuuleilei=gmail.com@vger.kernel.org> 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 <ouuuleilei@gmail.com> (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 <ouuuleilei@gmail.com>; 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" <rjw@rjwysocki.net> To: Linux PM <linux-pm@vger.kernel.org>, Miri Korenblit <miriam.rachel.korenblit@intel.com> Cc: Lukasz Luba <lukasz.luba@arm.com>, LKML <linux-kernel@vger.kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>, Zhang Rui <rui.zhang@intel.com>, netdev@vger.kernel.org, Ido Schimmel <idosch@nvidia.com>, Petr Machata <petrm@nvidia.com>, linux-wireless@vger.kernel.org, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com> 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: <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: 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 |
Series |
thermal: Writable trip points handling rework
|
|
Commit Message
Rafael J. Wysocki
Feb. 9, 2024, 2:10 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> 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 <rafael.j.wysocki@intel.com> --- 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(-)
Comments
On Fri, Feb 09, 2024 at 03:10:24PM +0100, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > 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 <rafael.j.wysocki@intel.com> > --- > > 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.trips[i].flags = THERMAL_TRIP_WRITABLE_TEMP; Consider using diffrent prefix for constants to diffrenciate flags and types. Regards Stanislaw > } > 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)) { > > >
On Fri, Feb 9, 2024 at 3:50 PM Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com> wrote: > > On Fri, Feb 09, 2024 at 03:10:24PM +0100, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > 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 <rafael.j.wysocki@intel.com> > > --- > > > > 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.trips[i].flags = THERMAL_TRIP_WRITABLE_TEMP; > > Consider using diffrent prefix for constants to diffrenciate flags and types. Well, I can use THERMAL_TRIP_FLAG_RW_TEMP or similar, but is it really so confusing? I'm wondering what others think. > > } > > 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)) { > > > > > > >
On Fri, Feb 09, 2024 at 05:15:41PM +0100, Rafael J. Wysocki wrote: > On Fri, Feb 9, 2024 at 3:50 PM Stanislaw Gruszka > <stanislaw.gruszka@linux.intel.com> wrote: > > > > On Fri, Feb 09, 2024 at 03:10:24PM +0100, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > > > 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 <rafael.j.wysocki@intel.com> > > > --- > > > > > > 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.trips[i].flags = THERMAL_TRIP_WRITABLE_TEMP; > > > > Consider using diffrent prefix for constants to diffrenciate flags and types. > > Well, I can use THERMAL_TRIP_FLAG_RW_TEMP or similar, but is it really > so confusing? It's not, it was just suggestion, if you don't want to, don't do it. Regards Stanislaw > I'm wondering what others think. > > > > } > > > 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)) { > > > > > > > > > > > >
"Rafael J. Wysocki" <rjw@rjwysocki.net> writes: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > 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 <rafael.j.wysocki@intel.com> For wireless patches we use "wifi:" prefix in the title, if you can still change the patch please add that.
On Fri, 2024-02-09 at 17:15 +0100, Rafael J. Wysocki wrote: > > > 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.trips[i].flags = THERMAL_TRIP_WRITABLE_TEMP; > > > > Consider using diffrent prefix for constants to diffrenciate flags and types. > > Well, I can use THERMAL_TRIP_FLAG_RW_TEMP or similar, but is it really > so confusing? > > I'm wondering what others think. > I'd tend to agree with Stanislaw. I did (eventually) notice the double assignment to .type above, but had that not been visible in the context, or you'd have removed the first one by accident, I'd really not have thought about it twice. The bug also makes it look like you even confused yourself ;-) So having a clearer indication that it's a flag would make sense, I'd say. johannes
On Mon, Feb 12, 2024 at 8:30 AM Kalle Valo <kvalo@kernel.org> wrote: > > "Rafael J. Wysocki" <rjw@rjwysocki.net> writes: > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > > > 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 <rafael.j.wysocki@intel.com> > > For wireless patches we use "wifi:" prefix in the title, if you can > still change the patch please add that. Sure, no problem.
On Mon, Feb 12, 2024 at 11:31 AM Johannes Berg <johannes@sipsolutions.net> wrote: > > On Fri, 2024-02-09 at 17:15 +0100, Rafael J. Wysocki wrote: > > > > 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.trips[i].flags = THERMAL_TRIP_WRITABLE_TEMP; > > > > > > Consider using diffrent prefix for constants to diffrenciate flags and types. > > > > Well, I can use THERMAL_TRIP_FLAG_RW_TEMP or similar, but is it really > > so confusing? > > > > I'm wondering what others think. > > > > I'd tend to agree with Stanislaw. I did (eventually) notice the double > assignment to .type above, but had that not been visible in the context, > or you'd have removed the first one by accident, I'd really not have > thought about it twice. > > The bug also makes it look like you even confused yourself ;-) No, that's just a mistake. > So having a clearer indication that it's a flag would make sense, I'd say. Sure, thanks!
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)) {