[PATCH ath-next v3] wifi: ath12k: add basic hwmon temperature reporting

Nicolas Escande nico.escande at gmail.com
Mon Feb 23 02:05:08 PST 2026


On Mon Feb 23, 2026 at 7:02 AM CET, Maharaja Kennadyrajan wrote:
[...]
> +static ssize_t ath12k_thermal_temp_show(struct device *dev,
> +					struct device_attribute *attr,
> +					char *buf)
> +{
> +	struct ath12k *ar = dev_get_drvdata(dev);
> +	unsigned long time_left;
> +	int ret, temperature;
> +
> +	guard(wiphy)(ath12k_ar_to_hw(ar)->wiphy);
> +	guard(mutex)(&ar->thermal.lock);

Hello,

Is this mutex really needed ? It is used in conjuction with the wiphy_lock but
it's never used elsewhere. So even though there can be multiple ar for a single
wiphy, there is no code path that that would lock this ar->thermal.lock without
locking first the wiphy. And the wiphy lock already protect for reconfiguration
and recovery right ?

> +
> +	if (ar->ah->state != ATH12K_HW_STATE_ON)
> +		return -ENETDOWN;
> +
> +	reinit_completion(&ar->thermal.wmi_sync);
> +	ret = ath12k_wmi_send_pdev_temperature_cmd(ar);
> +	if (ret) {
> +		ath12k_warn(ar->ab, "failed to read temperature %d\n", ret);
> +		return ret;
> +	}



More information about the ath12k mailing list