From: Kevin Hilman <khilman@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] pinctrl/meson: enable building as modules
Date: Tue, 20 Oct 2020 14:13:10 -0700 [thread overview]
Message-ID: <7heelsk3dl.fsf@baylibre.com> (raw)
In-Reply-To: <CAFBinCAXVFjm-aDJ3KFvqcn2Hht2tGOy_O99wggo530xv6McpQ@mail.gmail.com>
Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
> Hi Kevin,
>
> On Tue, Oct 20, 2020 at 1:09 AM Kevin Hilman <khilman@baylibre.com> wrote:
> [...]
>> The default is still built-in, this only adds the option of building
>> as module.
>
> (as of today) the majority of the SoC specific pin controller drivers
> use bool instead of tristate
> my understanding is that tristate can be "dangerous" because if you
> compile a driver as module then your kernel may not boot (I haven't
> tried, but in that case the reset controller driver probably has to be
> added to the initramfs).
> is there something that we need to do about this?
Yes. We need to test it.
> my thoughts: these
> options default to "y" so it shouldn't be a problem unless someone
> tinkers with their kernel configuration
Correct. I want to keep a working default upstream defconfig, but the
goal of this is to enable the tinkering. :)
I've been testing this, and meson pinctrl driver works fine as a module
(so far only tested in G12A and SM1). Obviously, it depends on the
bootloader to have some sane default, and in general depending on the
bootloader for this is not a great idea.
In fact, I currently have a kernel booting on meson-sm1-khadas-vim3l
that has everything (including clocks, pinctrl, GPIO IRQs and PM
domains) built as modules. The clock stuff requires a bit more work,
but there's a handful of patches to enable the rest of the drivers as
modules from Neil and myself over the last few days.
Kevin
> [...]
>> diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
>> index 20683cd072bb..b467ab49539a 100644
>> --- a/drivers/pinctrl/meson/pinctrl-meson.c
>> +++ b/drivers/pinctrl/meson/pinctrl-meson.c
>> @@ -152,6 +152,7 @@ int meson_pmx_get_funcs_count(struct pinctrl_dev *pcdev)
>>
>> return pc->data->num_funcs;
>> }
>> +EXPORT_SYMBOL_GPL(meson_pmx_get_funcs_count);
>>
>> const char *meson_pmx_get_func_name(struct pinctrl_dev *pcdev,
>> unsigned selector)
>> @@ -160,6 +161,7 @@ const char *meson_pmx_get_func_name(struct pinctrl_dev *pcdev,
>>
>> return pc->data->funcs[selector].name;
>> }
>> +EXPORT_SYMBOL_GPL(meson_pmx_get_func_name);
>>
>> int meson_pmx_get_groups(struct pinctrl_dev *pcdev, unsigned selector,
>> const char * const **groups,
>> @@ -172,6 +174,7 @@ int meson_pmx_get_groups(struct pinctrl_dev *pcdev, unsigned selector,
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(meson_pmx_get_groups);
>>
>> static int meson_pinconf_set_gpio_bit(struct meson_pinctrl *pc,
>> unsigned int pin,
>> @@ -723,6 +726,7 @@ int meson8_aobus_parse_dt_extra(struct meson_pinctrl *pc)
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(meson8_aobus_parse_dt_extra);
>>
>> int meson_a1_parse_dt_extra(struct meson_pinctrl *pc)
>> {
>> @@ -732,6 +736,7 @@ int meson_a1_parse_dt_extra(struct meson_pinctrl *pc)
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_GPL(meson_a1_parse_dt_extra);
>>
>> int meson_pinctrl_probe(struct platform_device *pdev)
>> {
>> @@ -766,3 +771,7 @@ int meson_pinctrl_probe(struct platform_device *pdev)
>>
>> return meson_gpiolib_register(pc);
>> }
>> +EXPORT_SYMBOL_GPL(meson_pinctrl_probe);
>> +
>> +MODULE_LICENSE("GPL v2");
>> +
> please remove this blank line at EOF because there is already one in
> the existing file (with this one there's now two of them)
>
>
> Best regards,
> Martin
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
prev parent reply other threads:[~2020-10-20 21:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 23:09 [PATCH] pinctrl/meson: enable building as modules Kevin Hilman
2020-10-20 19:56 ` Martin Blumenstingl
2020-10-20 21:13 ` Kevin Hilman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7heelsk3dl.fsf@baylibre.com \
--to=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=martin.blumenstingl@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).