mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: [PATCH v1 1/2] thermal: testing: zone: Use debugfs_create_file()
Date: Wed, 17 Jun 2026 18:09:29 +0200	[thread overview]
Message-ID: <6304554.lOV4Wx5bFT@rafael.j.wysocki> (raw)
In-Reply-To: <12941879.O9o76ZdvQC@rafael.j.wysocki>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Use debugfs_create_file() for creating debugfs files related to thermal
zone templates so that their file operations are properly synchronized
with thermal zone template removal.

Fixes: f6a034f2df42 ("thermal: Introduce a debugfs-based testing facility")
Link: https://sashiko.dev/#/patchset/20260605185212.2491144-1-sam.moelius%40trailofbits.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/thermal/testing/zone.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

--- a/drivers/thermal/testing/zone.c
+++ b/drivers/thermal/testing/zone.c
@@ -171,11 +171,11 @@ static void tt_add_tz_work_fn(struct wor
 		return;
 	}
 
-	debugfs_create_file_unsafe("temp", 0600, tt_zone->d_tt_zone, tt_zone,
-				   &tt_zone_tz_temp_attr);
+	debugfs_create_file("temp", 0600, tt_zone->d_tt_zone, tt_zone,
+			    &tt_zone_tz_temp_attr);
 
-	debugfs_create_file_unsafe("init_temp", 0600, tt_zone->d_tt_zone,
-				   &tt_zone->temp, &tt_int_attr);
+	debugfs_create_file("init_temp", 0600, tt_zone->d_tt_zone,
+			    &tt_zone->temp, &tt_int_attr);
 
 	guard(mutex)(&tt_thermal_zones_lock);
 
@@ -315,12 +315,12 @@ static void tt_zone_add_trip_work_fn(str
 	kfree(tt_work);
 
 	snprintf(d_name, TT_MAX_FILE_NAME_LENGTH, "trip_%d_temp", tt_trip->id);
-	debugfs_create_file_unsafe(d_name, 0600, tt_zone->d_tt_zone,
-				   &tt_trip->trip.temperature, &tt_int_attr);
+	debugfs_create_file(d_name, 0600, tt_zone->d_tt_zone,
+			    &tt_trip->trip.temperature, &tt_int_attr);
 
 	snprintf(d_name, TT_MAX_FILE_NAME_LENGTH, "trip_%d_hyst", tt_trip->id);
-	debugfs_create_file_unsafe(d_name, 0600, tt_zone->d_tt_zone,
-				   &tt_trip->trip.hysteresis, &tt_unsigned_int_attr);
+	debugfs_create_file(d_name, 0600, tt_zone->d_tt_zone,
+			    &tt_trip->trip.hysteresis, &tt_unsigned_int_attr);
 
 	tt_put_tt_zone(tt_zone);
 }




  reply	other threads:[~2026-06-17 16:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 16:08 [PATCH v1 0/2] thermal: testing: Fix two issues related to cleanup Rafael J. Wysocki
2026-06-17 16:09 ` Rafael J. Wysocki [this message]
2026-06-17 16:10 ` [PATCH v1 2/2] thermal: testing: Flush work items during cleanup Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6304554.lOV4Wx5bFT@rafael.j.wysocki \
    --to=rafael@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®