mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: xzhangjr@gmail.com
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (coretemp) Retry failed sensor creation
Date: Tue, 20 Oct 2026 11:35:45 -0700	[thread overview]
Message-ID: <42ee0ffb-c0f0-4426-a568-28be267e4a93@roeck-us.net> (raw)
In-Reply-To: <20261020-coretemp-retry-sensor-creation-v1-1-7dd4851a34dc@gmail.com>

On Tue, Oct 20, 2026 at 09:39:35PM +0400, Ximing Zhang via B4 Relay wrote:
> From: Ximing Zhang <xzhangjr@gmail.com>
> 
> coretemp_add_core() only logs create_core_data() failures, but
> coretemp_cpu_online() still records the CPU in pdata->cpumask. When an
> SMT sibling is processed later, the mask makes the driver skip sensor
> creation. The core interface then remains absent until all siblings are
> cycled or the module is reloaded.
> 
> Package sensor creation is similarly attempted only when the hwmon
> device is first registered. A failure leaves the package interface
> absent for the lifetime of that device.
> 
> Retry missing package and core sensors whenever an eligible CPU comes
> online. Determine whether a core sensor exists from its temperature data
> instead of the CPU mask, which continues to track CPUs available for MSR
> reads and hotplug retargeting.
> 
> A package retry might fail after per-core data exists. Keep the core_data
> array alive until the hwmon device is unregistered so failure cleanup
> cannot discard live per-core pointers. Publish nr_cores only after that
> array is allocated successfully, and rate-limit errors because a
> permanent failure can now be retried.
> 
> Tested on an Intel Core i7-10510U running 7.2.5-1-cachyos. With
> test-only fault injection, two package creation failures and one Core 0
> creation failure left the unpatched driver without both interfaces. The
> patched driver retried and exposed all five readable sensors. SMT sibling
> hotplug and 20 module unload/load cycles also retained the expected
> sensors.
> 
> Signed-off-by: Ximing Zhang <xzhangjr@gmail.com>
> ---
> coretemp currently treats a failed package or per-core sensor creation as
> permanent for the lifetime of the hwmon device. This change retries missing
> sensors as eligible CPUs come online while keeping the CPU mask available for
> MSR targeting and hotplug handling.
> 
> Tested on an Intel Core i7-10510U running 7.2.5-1-cachyos. Test-only fault
> injection reproduced missing package and Core 0 interfaces with the current

Is that a theoretic or a real problem ? "Test-only fault injection" very
much suggests that it is a theoretic problem. Have you observed it on
a real system (without artificial fault injection) ?

Thanks,
Guenter

  reply	other threads:[~2026-10-20 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 17:39 Ximing Zhang via B4 Relay
2026-10-20 18:35 ` Guenter Roeck [this message]
2026-10-21 12:28   ` Ximing Zhang
2026-10-21 14:01     ` Guenter Roeck

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=42ee0ffb-c0f0-4426-a568-28be267e4a93@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xzhangjr@gmail.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®