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

Maharaja Kennadyrajan maharaja.kennadyrajan at oss.qualcomm.com
Mon Feb 23 03:32:17 PST 2026


On 2/23/2026 3:35 PM, Nicolas Escande wrote:
> 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 ?


Thanks for the review. ar->thermal.lock is redundant here since the path is already serialized by wiphy_lock .

I’ll drop the extra mutex and its init in the next version.


>
>> +
>> +	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