[OpenWrt-Devel] [PATCH] kernel: modules: fix kmod-regmap

Christian Lamparter chunkeey at gmail.com
Fri Aug 3 12:00:00 EDT 2018


On Thursday, August 2, 2018 11:43:50 AM CEST Jonas Gorski wrote:
> On 1 August 2018 at 22:44, Christian Lamparter <chunkeey at gmail.com> wrote:
>> On Wednesday, August 1, 2018 3:21:00 PM CEST Jonas Gorski wrote:
>>> On 30/07/18 22:33, Christian Lamparter wrote:
>>>>
>>>> This patch fixes the a compile issue that was triggered by
>>>> apm821xx/sata when kmod-regmap was selected.
>>>>
>>>> The CONFIG_REGMAP is declared in drivers/base/regmap/Kconfig
>>>> as type "bool" and not "tristate". Hence the symbol should
>>>> never be set to module, as this confuses the #if CONFIG_REGMAP
>>>> guards in include/linux/regmap.h:
>>> This is actually the wrong fix and papers over an issue in one of our
>>> local patches.
>>> [...]
>>>
>>> We intentionally allow regmap to be built as a module, see
>>>
>>> https://github.com/openwrt/openwrt/blob/master/target/linux/generic/hack-4.14/259-regmap_dynamic.patch
>>>
>>> So there are likely some additional EXPORT_SYMBOL_GPL()s required instead.
>> Thanks for FYI, I missed this patch completely.
>>
>> I found that the issue lies in the upstream regulator core code.
>> It is using these regmap's functions. And the CONFIG_REGULATOR symbol that pulls
>> in the core's code is sadly a bool menuconfig option... so CONFIG_REGMAP pretty
>> much becomes a requirement/select for the REGULATOR.
>
> This is one of the more trickier variants, it optionally supports
> regmap thanks to the stubs provided if regmap is disabled - which
> breaks if you compile regmap as a module. I expect this to happen
> more in the future.


More information about the openwrt-devel mailing list