From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Alexey Klimov <alexey.klimov@linaro.org>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Sean Wang <sean.wang@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Paul Cercueil <paul@crapouillou.net>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH v2 08/12] pinctrl: qcom: use generic pin function helpers
Date: Fri, 11 Jul 2025 14:19:26 +0200 [thread overview]
Message-ID: <b9f6f827-78bf-4fee-8be2-74a9c94d9722@oss.qualcomm.com> (raw)
In-Reply-To: <CAMRc=Mc7KSSTF=Jsu-_1C6eWrTXNKB=_Q9fnZor8K_4nnQ5m4g@mail.gmail.com>
On 7/10/25 3:38 PM, Bartosz Golaszewski wrote:
> On Thu, Jul 10, 2025 at 2:25 PM Konrad Dybcio
> <konrad.dybcio@oss.qualcomm.com> wrote:
>>
>> On 7/9/25 4:39 PM, Bartosz Golaszewski wrote:
>>> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>>
>>> Use the existing infrastructure for storing and looking up pin functions
>>> in pinctrl core. Remove hand-crafted callbacks.
>>>
>>> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>>> ---
>>
>> [...]
>>
>>> int msm_pinctrl_probe(struct platform_device *pdev,
>>> const struct msm_pinctrl_soc_data *soc_data)
>>> {
>>> + const struct pinfunction *func;
>>> struct msm_pinctrl *pctrl;
>>> struct resource *res;
>>> int ret;
>>> @@ -1606,6 +1581,14 @@ int msm_pinctrl_probe(struct platform_device *pdev,
>>> return PTR_ERR(pctrl->pctrl);
>>> }
>>>
>>> + for (i = 0; i < soc_data->nfunctions; i++) {
>>> + func = &soc_data->functions[i];
>>> +
>>> + ret = pinmux_generic_add_pinfunction(pctrl->pctrl, func, NULL);
>>> + if (ret < 0)
>>> + return ret;
>>> + }
>>
>> It's good in principle, but we're now going to house two copies of
>> the function data in memory... Can we trust __initconst nowadays?
>>
>
> Well, if I annotate the functions struct with __initconst, then it
> does indeed end up in the .init.rodata section if that's your
> question. Then the kernel seems to be freeing this in
> ./kernel/module/main.c so I sure hope we can trust it.
>
> Do I understand correctly that you're implicitly asking to also
> annotate all affected _functions structures across all tlmm drivers?
>
> Alternatively: we can provide another interface:
> pinmux_generic_add_const_pinfunction() which - instead of a deep-copy
> - would simply store addresses of existing pinfunction structures in
> the underlying radix tree.
This option seems like less of a churn
Konrad
next prev parent reply other threads:[~2025-07-11 12:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 14:38 [PATCH v2 00/12] pinctrl: introduce the concept of a GPIO pin function category Bartosz Golaszewski
2025-07-09 14:38 ` [PATCH v2 01/12] pinctrl: pinmux: open-code PINCTRL_FUNCTION_DESC() Bartosz Golaszewski
2025-07-10 20:37 ` Bjorn Andersson
2025-07-09 14:38 ` [PATCH v2 02/12] pinctrl: provide pinmux_generic_add_pinfunction() Bartosz Golaszewski
2025-07-09 14:38 ` [PATCH v2 03/12] pinctrl: equilibrium: use pinmux_generic_add_pinfunction() Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 04/12] pinctrl: airoha: " Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 05/12] pinctrl: mediatek: moore: " Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 06/12] pinctrl: keembay: " Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 07/12] pinctrl: ingenic: " Bartosz Golaszewski
2025-07-09 21:25 ` Paul Cercueil
2025-07-09 14:39 ` [PATCH v2 08/12] pinctrl: qcom: use generic pin function helpers Bartosz Golaszewski
2025-07-10 12:25 ` Konrad Dybcio
2025-07-10 13:38 ` Bartosz Golaszewski
2025-07-11 12:19 ` Konrad Dybcio [this message]
2025-07-11 18:37 ` Linus Walleij
2025-07-13 8:43 ` Bartosz Golaszewski
2025-07-09 14:39 ` [PATCH v2 09/12] pinctrl: allow to mark pin functions as requestable GPIOs Bartosz Golaszewski
2025-07-14 11:29 ` Heiko Stübner
2025-07-09 14:39 ` [PATCH v2 10/12] pinctrl: qcom: add infrastructure for marking pin functions as GPIOs Bartosz Golaszewski
2025-07-09 18:04 ` Konrad Dybcio
2025-07-09 14:39 ` [PATCH v2 11/12] pinctrl: qcom: mark the `gpio` and `egpio` pins function as non-strict functions Bartosz Golaszewski
2025-07-09 18:03 ` Konrad Dybcio
2025-07-09 14:39 ` [PATCH v2 12/12] pinctrl: qcom: make the pinmuxing strict Bartosz Golaszewski
2025-07-10 12:26 ` Konrad Dybcio
2025-07-19 16:02 ` [PATCH v2 00/12] pinctrl: introduce the concept of a GPIO pin function category Linus Walleij
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=b9f6f827-78bf-4fee-8be2-74a9c94d9722@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=alexey.klimov@linaro.org \
--cc=andersson@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=konradybcio@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mips@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=paul@crapouillou.net \
--cc=sean.wang@kernel.org \
/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