Re: [PATCH v2] i2c: Allow ACPI_I2C_OPREGION if I2C is built as a module
From: Hans de Goede
Date: Wed Jan 24 2018 - 10:23:59 EST
Hi,
On 24-01-18 16:12, Sinan Kaya wrote:
On 1/24/2018 9:59 AM, Hans de Goede wrote:
TL;DR: I have to NAK this, I'm sorry but with the current state of ACPI we
must simply have some stuff builtin to help with probe-ordering issues. Now
if the ACPI code where ever to honor the _DEP method everywhere instead of
only for battery devices this might change, but even then things will still
be tricky.
Well, the alternative is even worse.
No it is not, if I2C gets builtin things work fine, you proposal does not
fix anything, it merely gives the illusion of being builtin
Redhat and most other distros configure I2C as a module.
Fedora has stopped building I2C as a module a long time ago already and where
Fedora goes RHEL typically follows.
With this setup,
I2C OpRegion support does not get compiled. It doesn't even work let alone to have
race conditions.
So at least it is consistent then, which makes for a lot easier debugging.
I2C OpRegion feature is practically dead for most general users unless you recompile
your own kernel.
Then talk to various distro kernel maintainers and ask them to
set CONFIG_I2C=y.
There must be a middle ground somewhere.
One thing which comes to mind is to simply not allow building i2c as a module
when ACPI is selected, something like this should work I think:
config I2C
tristate "I2C support"
select RT_MUTEXES
select IRQ_DOMAIN
+ # force building I2C in on ACPI systems, for opregion availability
+ depends on y || !ACPI
I had some conversation with Rafael about _DEP support. He is not a big fan :)
Ok.
Regards,
Hans