All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Zhang Rui <rui.zhang@intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org (open list:ACPI FAN DRIVER)
Subject: [PATCH] ACPI: fan: fix warning with CONFIG_DEBUG_LOCK_ALLOC
Date: Fri,  4 Dec 2020 12:25:45 -0600	[thread overview]
Message-ID: <20201204182545.8322-1-pierre-louis.bossart@linux.intel.com> (raw)

On a TigerLake device with CONFIG_DEBUG_LOCK_ALLOC the following
warning is thrown:

[   13.784413] BUG: key ffff88810ea5a080 has not been registered!
[   13.784722] DEBUG_LOCKS_WARN_ON(1)
[   13.784737] WARNING: CPU: 2 PID: 1 at kernel/locking/lockdep.c:4623
lockdep_init_map_waits+0x25e/0x310
[   13.787831] Call Trace:
[   13.787902]  __kernfs_create_file+0xa5/0x180
[   13.788016]  sysfs_add_file_mode_ns+0x120/0x270
[   13.788138]  sysfs_create_file_ns+0xcd/0x120
[   13.788256]  ? sysfs_add_file_mode_ns+0x270/0x270
[   13.788381]  ? fan_get_max_state+0x70/0x70
[   13.788491]  ? sort_r+0x1a5/0x200
[   13.788579]  acpi_fan_probe+0x63b/0x7a0

Dynamically-allocated attributes need to be initialized to make
lockdep happy, see include/linux/sysfs.h

Fixes: d19e470b6605c ('ACPI: fan: Expose fan performance state information')
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 drivers/acpi/fan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 66c3983f0ccc..9cab806298ff 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -357,6 +357,7 @@ static int acpi_fan_get_fps(struct acpi_device *device)
 		fps->dev_attr.store = NULL;
 		fps->dev_attr.attr.name = fps->name;
 		fps->dev_attr.attr.mode = 0444;
+		sysfs_attr_init(&fps->dev_attr.attr);
 		status = sysfs_create_file(&device->dev.kobj, &fps->dev_attr.attr);
 		if (status) {
 			int j;
-- 
2.25.1


             reply	other threads:[~2020-12-04 18:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 18:25 Pierre-Louis Bossart [this message]
2020-12-07 13:14 ` [PATCH] ACPI: fan: fix warning with CONFIG_DEBUG_LOCK_ALLOC 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=20201204182545.8322-1-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.