Re: [PATCH v3 RESEND 2/2] scsi: mpt3sas: add hwmon support

From: Damien Le Moal

Date: Thu Jun 11 2026 - 19:34:20 EST


On 6/12/26 01:39, Louis Sautier wrote:
> On Wed, 10 Jun 2026 08:22:22 +0800, Damien Le Moal wrote:
>>> +config SCSI_MPT3SAS_HWMON
>>> + bool "LSI MPT Fusion SAS hwmon support"
>>> + depends on SCSI_MPT3SAS && HWMON
>>> + depends on !(SCSI_MPT3SAS=y && HWMON=m)
>>> + help
>>> + Say Y here to expose the IOC and board temperature sensors of
>>> + LSI / Broadcom SAS HBAs (such as the 9300, 9400, and 9500 series)
>>> + through hwmon.
>>
>> Why do you need this ?
>
> I was following the logic used by NVME_HWMON to prevent issues with
> SCSI_MPT3SAS=y and HWMON=m.

Ah, yes, indeed. I did not thought of this case.

>
>>> + struct mpt3sas_hwmon *hwmon;
>>
>> This should be conditionally defined with "#ifdef CONFIG_HWMON". Then you can
>> simply drop the config entry you added.
>
> If I dropped SCSI_MPT3SAS_HWMON, I would use
> "#if IS_REACHABLE(CONFIG_HWMON)" to match what i915_hwmon.h and
> xe_hwmon.h do and properly handle the SCSI_MPT3SAS=y and HWMON=m case.
> What do you think?

That seems appropriate. If there is a clean way to avoid adding the new config
option, we should use that method.


--
Damien Le Moal
Western Digital Research