mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>
Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com,
	lukasz.luba@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal/core: Fix double device initialization
Date: Mon, 25 May 2026 17:43:31 +0200	[thread overview]
Message-ID: <0808cbfb-b66e-4f68-b651-03b884891936@oss.qualcomm.com> (raw)
In-Reply-To: <CAJZ5v0jjn0CtQPztw8+drroOvDy8fWFCVAi22s1Um5gkDYX8rA@mail.gmail.com>

On 5/25/26 17:29, Rafael J. Wysocki wrote:
> On Mon, May 25, 2026 at 5:16 PM Daniel Lezcano
> <daniel.lezcano@kernel.org> wrote:
>>
>> In the previous change splitting the cooling device register function,
>> the device initialization was mistakenly added in the move.
>>
>> This change is wrong because the device is registered with the
>> function device_register() which does device_initialize() and then
>> device_add(). That results in a double initialization and a message in
>> logs:
>>
>> [    1.531290] kobject: kobject (0000000053ba73b2): tried to init an initialized object, something is seriously wrong.
>> [    1.531293] CPU: 9 UID: 0 PID: 420 Comm: kworker/u50:3 Not tainted 7.1.0-rc1+ #48 PREEMPT(lazy)
>> [    1.531294] Hardware name: LENOVO 21N10007UK/21N10007UK, BIOS N42ET38W (1.12 ) 05/29/2024
>> [    1.531295] Workqueue: events_unbound deferred_probe_work_func
>> [    1.531298] Call trace:
>> [    1.531298]  show_stack+0x24/0x50 (C)
>> [    1.531301]  dump_stack_lvl+0x80/0xc0
>> [    1.531303]  kobject_init+0xc0/0xd8
>> [    1.531305]  device_initialize+0x3c/0x140
>> [    1.531308]  device_register+0x20/0x48
>> [    1.531310]  thermal_cooling_device_add+0xe0/0x208
>> [    1.531311]  thermal_of_cooling_device_register+0x54/0xa0
>> [    1.531313]  __cpufreq_cooling_register+0x1e0/0x368
>> [    1.531315]  of_cpufreq_cooling_register+0x64/0xe0
>> [    1.531316]  cpufreq_online+0xa6c/0xef0
>> [    1.531317]  cpufreq_add_dev+0x108/0x180
>> [    1.531318]  subsys_interface_register+0x138/0x168
>> [    1.531320]  cpufreq_register_driver+0x1b8/0x390
>>
>> Fix by just removing the added line.
>>
>> Fixes: 13f4e660a126 ("thermal/core: Split __thermal_cooling_device_register() into two functions")
> 
> In this commit, the device_register() has been replaced with
> device_add(), so the problem above should not trigger.
> 
> Which kernel have you tested?

Ah, right, I did the test on a branch having the patch "Split 
__thermal_cooling_device_register()" but without your changes where 
device_register() is replaced with device_add().

Everything ok then :)

  parent reply	other threads:[~2026-05-25 15:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 15:16 Daniel Lezcano
2026-05-25 15:29 ` Rafael J. Wysocki
2026-05-25 15:33   ` Rafael J. Wysocki
2026-05-25 15:43   ` Daniel Lezcano [this message]
2026-05-31  9:42 ` kernel test robot

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=0808cbfb-b66e-4f68-b651-03b884891936@oss.qualcomm.com \
    --to=daniel.lezcano@oss.qualcomm.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael@kernel.org \
    --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 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®