All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH v1 3/4] thermal: core: Introduce thermal_cooling_device_update()
Date: Mon, 27 Mar 2023 23:57:48 +0300	[thread overview]
Message-ID: <ZCIDTLFt27Ei7+V6@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <10247847.nUPlyArG6x@kreacher>

Hi,

this leads to the stacktrace below triggered by
lockdep_assert_held(&cdev->lock) in cooling_device_stats_setup(), and

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 566df4522b885..132175b14814f 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -918,7 +918,9 @@ __thermal_cooling_device_register(struct device_node *np,
 	if (ret)
 		goto out_cdev_type;
 
+	mutex_lock(&cdev->lock);
 	thermal_cooling_device_setup_sysfs(cdev);
+	mutex_unlock(&cdev->lock);
 
 	ret = dev_set_name(&cdev->device, "cooling_device%d", cdev->id);
 	if (ret)

fixed it up for me, but not sure if it's the correct fix.

--Imre

[    4.662358] ------------[ cut here ]------------
[    4.662361] WARNING: CPU: 3 PID: 1 at drivers/thermal/thermal_sysfs.c:879 cooling_device_stats_setup+0xb4/0xc0
[    4.662370] Modules linked in:
[    4.662375] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G          I        6.3.0-rc4-imre+ #771
[    4.662379] Hardware name: Intel Corporation Shark Bay Client platform/Flathead Creek Crb, BIOS HSWLPTU1.86C.0109.R03.1301282055 01/28/2013
[    4.662382] RIP: 0010:cooling_device_stats_setup+0xb4/0xc0
[    4.662387] Code: 89 1d 58 52 36 01 5b 41 5c 41 5d 5d c3 cc cc cc cc 48 8d bf 18 05 00 00 be ff ff ff ff e8 f4 d2 3e 00 85 c0 0f 85 6f ff ff ff <0f> 0b e9 68 ff ff ff 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90
[    4.662390] RSP: 0000:ffff9f48c0057b30 EFLAGS: 00010246
[    4.662395] RAX: 0000000000000000 RBX: ffff8fc381ca9800 RCX: 0000000000000000
[    4.662398] RDX: 0000000000000000 RSI: ffffffff94ad1d28 RDI: ffffffff94b58cc6
[    4.662401] RBP: ffff9f48c0057b48 R08: 0000000000000004 R09: 0000000000000000
[    4.662404] R10: ffff8fc381c77cd0 R11: 0000000000000000 R12: 0000000000000002
[    4.662406] R13: ffff8fc381ca9800 R14: ffff8fc381b0a000 R15: 0000000000000000
[    4.662409] FS:  0000000000000000(0000) GS:ffff8fc6b5580000(0000) knlGS:0000000000000000
[    4.662412] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    4.662415] CR2: 0000000000000000 CR3: 0000000283856001 CR4: 00000000001706e0
[    4.662418] Call Trace:
[    4.662421]  <TASK>
[    4.662427]  thermal_cooling_device_setup_sysfs+0x12/0x30
[    4.662433]  __thermal_cooling_device_register+0x195/0x410
[    4.662442]  thermal_cooling_device_register+0x19/0x20
[    4.662446]  acpi_fan_probe+0xd7/0x5a0
[    4.662458]  ? acpi_match_device_ids+0x12/0x20
[    4.662464]  ? acpi_dev_pm_attach+0x41/0x110
[    4.662473]  platform_probe+0x48/0xc0
[    4.662481]  really_probe+0x1be/0x420
[    4.662487]  __driver_probe_device+0x8c/0x190
[    4.662493]  driver_probe_device+0x24/0x90
[    4.662498]  __driver_attach+0xf7/0x200
[    4.662503]  ? __pfx___driver_attach+0x10/0x10
[    4.662507]  bus_for_each_dev+0x80/0xd0
[    4.662516]  driver_attach+0x1e/0x30
[    4.662522]  bus_add_driver+0x11f/0x230
[    4.662530]  driver_register+0x5e/0x120
[    4.662534]  ? __pfx_acpi_fan_driver_init+0x10/0x10
[    4.662540]  __platform_driver_register+0x1e/0x30
[    4.662545]  acpi_fan_driver_init+0x17/0x20
[    4.662549]  do_one_initcall+0x61/0x280
[    4.662559]  ? debug_smp_processor_id+0x17/0x20
[    4.662568]  kernel_init_freeable+0x411/0x640
[    4.662582]  ? __pfx_kernel_init+0x10/0x10
[    4.662589]  kernel_init+0x1b/0x1f0
[    4.662594]  ? __pfx_kernel_init+0x10/0x10
[    4.662599]  ret_from_fork+0x2c/0x50
[    4.662615]  </TASK>
[    4.662618] irq event stamp: 506869
[    4.662620] hardirqs last  enabled at (506875): [<ffffffff9338e2d8>] __up_console_sem+0x68/0x80
[    4.662625] hardirqs last disabled at (506880): [<ffffffff9338e2bd>] __up_console_sem+0x4d/0x80
[    4.662628] softirqs last  enabled at (504698): [<ffffffff932de49f>] __irq_exit_rcu+0xbf/0x140
[    4.662633] softirqs last disabled at (504689): [<ffffffff932de49f>] __irq_exit_rcu+0xbf/0x140
[    4.662636] ---[ end trace 0000000000000000 ]---
[    4.662779] ------------[ cut here ]------------

  parent reply	other threads:[~2023-03-27 20:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 19:18 [PATCH v1 0/4] thermal: core/ACPI: Fix processor cooling device regression Rafael J. Wysocki
2023-03-03 19:19 ` [PATCH v1 1/4] ACPI: processor: Reorder acpi_processor_driver_init() Rafael J. Wysocki
2023-03-07 16:51   ` Zhang, Rui
2023-03-10 18:31     ` Rafael J. Wysocki
2023-03-12 16:08   ` Zhang, Rui
2023-03-13 13:48     ` Rafael J. Wysocki
2023-03-13 14:54       ` Zhang, Rui
2023-03-13 14:58         ` Rafael J. Wysocki
2023-03-03 19:21 ` [PATCH v1 2/4] thermal: core: Introduce thermal_cooling_device_present() Rafael J. Wysocki
2023-03-03 19:23 ` [PATCH v1 3/4] thermal: core: Introduce thermal_cooling_device_update() Rafael J. Wysocki
2023-03-07 16:40   ` Zhang, Rui
2023-03-10 18:25     ` Rafael J. Wysocki
2023-03-27 20:57   ` Imre Deak [this message]
2023-03-28 15:35     ` Rafael J. Wysocki
2023-03-03 19:23 ` [PATCH v1 4/4] ACPI: processor: thermal: Update CPU cooling devices on cpufreq policy changes Rafael J. Wysocki
2023-03-07 16:43   ` Zhang, Rui
2023-03-10 18:29     ` Rafael J. Wysocki
2023-03-12 14:44       ` Zhang, Rui
2023-03-13 13:50         ` 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=ZCIDTLFt27Ei7+V6@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rui.zhang@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.