From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Rob Herring <robh@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: property: stop creating callback for each pinctrl-N property
Date: Mon, 22 Dec 2025 11:18:33 +0100 [thread overview]
Message-ID: <87wm2estty.fsf@prevas.dk> (raw)
In-Reply-To: <CAL_JsqJimYgXBurnEQR=Bjtx4NhfeCA+rBoK_2jvz_x7NTE3VA@mail.gmail.com> (Rob Herring's message of "Fri, 19 Dec 2025 08:18:22 -0600")
On Fri, Dec 19 2025, Rob Herring <robh@kernel.org> wrote:
> On Fri, Dec 19, 2025 at 6:18 AM Rasmus Villemoes
> <linux@rasmusvillemoes.dk> wrote:
>>
>> While not a lot in the grand scheme of things, this eliminates 8*2
>> pointless function calls for almost every property present in the
>> device tree (the exception are the few properties that were already
>> matched). It also seems to reduce .text by about 1.5K - why gcc
>> decides to inline parse_prop_cells() in every instantiation I don't know.
>
> Presumably it is still doing that with all the other cases? Perhaps we
> should add a noinline attr.
Yes, it does, parse_prop_cells() does not exist at all in the generated
code (I've just tested with arm64 defconfig and arm
imx_v6_v7_defconfig).
Adding noinline to just parse_prop_cells (on top of current patch) does
$ size drivers/of/property.o.{old,new}
text data bss dec hex filename
18098 278 0 18376 47c8 drivers/of/property.o.old
14962 278 0 15240 3b88 drivers/of/property.o.new
There are only two uses of DEFINE_SUFFIX_PROP, so giving
parse_suffix_prop_cells() the same treatment doesn't result in that much
(merely 300 bytes), but should probably be done as well for consistency.
I'll send a proper patch.
>> Supporting double-digit suffixes would still require tweaking, but it
>> does match pinctrl-9.
>
> Looks to me like double-digit suffixes would work. Even pinctrl-0foo
> would work (which is fine IMO).
Ah, yes, if matching ^pinctrl-[0-9] is sufficient and not
^pinctrl-[0-9]+$ (or something even worse to
avoid-leading-0-unless-exactly-0), it does work, and I agree that that's
unlikely to ever be a problem.
Rasmus
prev parent reply other threads:[~2025-12-22 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 12:18 [PATCH] of: property: stop creating callback for each pinctrl-N property Rasmus Villemoes
2025-12-19 14:18 ` Rob Herring
2025-12-22 10:18 ` Rasmus Villemoes [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=87wm2estty.fsf@prevas.dk \
--to=linux@rasmusvillemoes.dk \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.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).