mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladyslav Tymoshchuk <tvlad744@gmail.com>
To: Jeff Johnson <jjohnson@kernel.org>
Cc: Baochen Qiang <baochen.qiang@oss.qualcomm.com>,
	linux-wireless@vger.kernel.org, ath12k@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] wifi: ath12k: unregister the thermal devices of a radio only once
Date: Thu, 12 Nov 2026 13:00:07 +0200	[thread overview]
Message-ID: <20261112110008.1229-4-tvlad744@gmail.com> (raw)
In-Reply-To: <20261112110008.1229-1-tvlad744@gmail.com>

ath12k_core_reconfigure_on_crash() calls ath12k_thermal_unregister(),
and the devices are registered again only when the start that follows
reaches ath12k_core_pdev_create(). If it does not, because the firmware
crashes again or the start fails earlier, the next restart unregisters
the devices a second time:

  Unable to handle kernel NULL pointer dereference at virtual address 0000000000000050
  Workqueue: ath12k_wq ath12k_core_restart [ath12k]
  pc : hwmon_device_unregister+0x24/0x90
  lr : ath12k_thermal_unregister+0x7c/0xf4 [ath12k]
  Call trace:
   hwmon_device_unregister+0x24/0x90 (P)
   ath12k_thermal_unregister+0x7c/0xf4 [ath12k]
   ath12k_core_restart+0x3c/0x210 [ath12k]

Skip the radios that have nothing registered.

Fixes: 151322bccdbd ("wifi: ath12k: add basic hwmon temperature reporting")
Signed-off-by: Vladyslav Tymoshchuk <tvlad744@gmail.com>
---
 drivers/net/wireless/ath/ath12k/thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/thermal.c b/drivers/net/wireless/ath/ath12k/thermal.c
index 97fc49c40ac1..7707ae4eb683 100644
--- a/drivers/net/wireless/ath/ath12k/thermal.c
+++ b/drivers/net/wireless/ath/ath12k/thermal.c
@@ -257,7 +257,7 @@ static void ath12k_thermal_cleanup_radio(struct ath12k_base *ab, int i)
 	struct ath12k *ar;
 
 	ar = ab->pdevs[i].ar;
-	if (!ar)
+	if (!ar || !ar->thermal.cdev)
 		return;
 
 	hwmon_device_unregister(ar->thermal.hwmon_dev);
-- 
2.43.0


  parent reply	other threads:[~2026-11-12 11:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 11:00 [PATCH 0/4] wifi: ath12k: recover from a firmware crash during resume Vladyslav Tymoshchuk
2026-11-12 11:00 ` [PATCH 1/4] wifi: ath12k: disable and enable the CE interrupts only once Vladyslav Tymoshchuk
2026-11-12 11:00 ` [PATCH 2/4] wifi: ath12k: do not wait in resume for a reset that cannot finish there Vladyslav Tymoshchuk
2026-11-12 11:00 ` Vladyslav Tymoshchuk [this message]
2026-11-12 11:00 ` [PATCH 4/4] wifi: ath12k: skip the links without a radio when a scan fails Vladyslav Tymoshchuk

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=20261112110008.1229-4-tvlad744@gmail.com \
    --to=tvlad744@gmail.com \
    --cc=ath12k@lists.infradead.org \
    --cc=baochen.qiang@oss.qualcomm.com \
    --cc=jjohnson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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®