[Bug 204807] Hardware monitoring sensor nct6798d doesn't work unless acpi_enforce_resources=lax is enabled

bugzilla-daemon
2021-03-21T19:15:35Z

Hans de Goede (jwrdegoede@fedoraproject.org) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |jwrdegoede@fedoraproject.or
| |g

--- Comment #47 from Hans de Goede (jwrdegoede@fedoraproject.org) ---
So if someone is willing to spend time on making this work, then here is how I
believe this could be made to work (for the case which Matthew Garrett
analysed):

1. Modify the nct6775 driver, adding a set of nct6775_register_ops to the
nct6775_sio_data struct and have any function which sits "below" the probe()
function only use these ops to do register accesses. Combined with having
sensors_nct6775_init() set these register-ops to the currently used superio
register access functions (so that nothing changes for existing users of the
driver).

2. Move the nct6775_sio_data struct declaration to a shared header somewhere
under include/linux

3. Have a new WMI driver which defines register-ops compatible with the ones
expected by the nct6775_sio_data struct, using the RHWM and WHWM methods which
Matthew found (note these should be called through their WMI wrappers) and have
this driver instantiate a platform device, with its platdata set to this new
nct6775_sio_data struct, allowing the nct6775 driver to access the registers
this way, using the mutual-exclusion mechanism build into the RHWM and WHWM
methods.

As the drivers/platform/x86 maintainer I would be more then happy to merge a
clean driver for step 3. To me this seems quite doable (to someone with some
kernel-dev experience + enough time).

Note I believe that this will not be a whole lot of work (but its not trivial
either).