* [PATCH] of/address: Drop ISA parts when !CONFIG_ISA
@ 2026-06-26 17:19 Daniel Palmer
2026-06-26 17:35 ` sashiko-bot
2026-06-28 5:44 ` Daniel Palmer
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Palmer @ 2026-06-26 17:19 UTC (permalink / raw)
To: robh, saravanak; +Cc: devicetree, linux-kernel, Daniel Palmer
The PCI parts are already wrapped in #ifdef CONFIG_PCI
so it seems sensible to add #ifdef CONFIG_ISA around the ISA
parts.
This reduces the code/data size a bit on configs with !CONFIG_ISA.
Signed-off-by: Daniel Palmer <daniel@thingy.jp>
---
Sorry for the spam, somehow I botched sending a patch..
I thought about making this RFC as I'm a bit unsure if machines
that need this ISA stuff actually select CONFIG_ISA or not.
The only in-kernel devicetrees that seem to use this are 4 old powerpc
ones and I couldn't work out if those boards do end up with CONFIG_ISA.
But then again it seems odd for everyone to get this code for 4 old
boards.
drivers/of/address.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/of/address.c b/drivers/of/address.c
index cf4aab11e9b1..9b2f0d462fb5 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -277,6 +277,7 @@ int of_range_to_resource(struct device_node *np, int index, struct resource *res
}
EXPORT_SYMBOL(of_range_to_resource);
+#ifdef CONFIG_ISA
/*
* ISA bus specific translator
*/
@@ -316,6 +317,7 @@ static unsigned int of_bus_isa_get_flags(const __be32 *addr)
flags |= IORESOURCE_MEM;
return flags;
}
+#endif
static int of_bus_default_flags_match(struct device_node *np)
{
@@ -349,6 +351,7 @@ static const struct of_bus of_busses[] = {
.get_flags = of_bus_pci_get_flags,
},
#endif /* CONFIG_PCI */
+#ifdef CONFIG_ISA
/* ISA */
{
.name = "isa",
@@ -360,6 +363,7 @@ static const struct of_bus of_busses[] = {
.flag_cells = 1,
.get_flags = of_bus_isa_get_flags,
},
+#endif /* CONFIG_ISA */
/* Default with flags cell */
{
.name = "default-flags",
--
2.53.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] of/address: Drop ISA parts when !CONFIG_ISA
2026-06-26 17:19 [PATCH] of/address: Drop ISA parts when !CONFIG_ISA Daniel Palmer
@ 2026-06-26 17:35 ` sashiko-bot
2026-06-28 5:44 ` Daniel Palmer
1 sibling, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-06-26 17:35 UTC (permalink / raw)
To: Daniel Palmer; +Cc: conor+dt, robh, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Wrapping the 'isa' OF bus translator in `#ifdef CONFIG_ISA` breaks I/O address translation for LPC/ISA bridges on architectures that do not enable `CONFIG_ISA`.
--
commit 2b56de0432a2e0bc839872a80da8947f0a3d2b72
Author: Daniel Palmer <daniel@thingy.jp>
of/address: Drop ISA parts when !CONFIG_ISA
This commit wraps the ISA-specific address translation code in of/address.c
with #ifdef CONFIG_ISA. This is intended to reduce code and data size on
configurations that do not enable CONFIG_ISA.
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index cf4aab11e9b1f..9b2f0d462fb59 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
[ ... ]
> @@ -349,6 +351,7 @@ static const struct of_bus of_busses[] = {
> .get_flags = of_bus_pci_get_flags,
> },
> #endif /* CONFIG_PCI */
> +#ifdef CONFIG_ISA
> /* ISA */
> {
> .name = "isa",
> .addresses = "reg",
> .match = of_bus_isa_match,
> .count_cells = of_bus_isa_count_cells,
> .map = of_bus_isa_map,
> .translate = of_bus_default_flags_translate,
> .flag_cells = 1,
> .get_flags = of_bus_isa_get_flags,
> },
> +#endif /* CONFIG_ISA */
[Severity: High]
Will this break I/O address translation for LPC/ISA bridges on architectures
that do not enable CONFIG_ISA?
While the architecture itself might not have CONFIG_ISA enabled (such as
ARM64, PowerPC, or MIPS), they often still use LPC bridges in their device
trees for devices like RTC, UART, or IPMI nodes.
If this "isa" translator is completely disabled, the bus mapping will fall
back to the "default" translator. The default translator will incorrectly
parse these resources as IORESOURCE_MEM instead of IORESOURCE_IO.
Could this prevent drivers relying on I/O space access from probing or
mapping resources correctly on those platforms?
> /* Default with flags cell */
> {
> .name = "default-flags",
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260626171906.476688-1-daniel@thingy.jp?part=1
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] of/address: Drop ISA parts when !CONFIG_ISA
2026-06-26 17:19 [PATCH] of/address: Drop ISA parts when !CONFIG_ISA Daniel Palmer
2026-06-26 17:35 ` sashiko-bot
@ 2026-06-28 5:44 ` Daniel Palmer
2026-06-30 16:48 ` Rob Herring
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Palmer @ 2026-06-28 5:44 UTC (permalink / raw)
To: robh, saravanak; +Cc: devicetree, linux-kernel
Hi Daniel, (Replying to myself..)
On Sat, 27 Jun 2026 at 02:19, Daniel Palmer <daniel@thingy.jp> wrote:
>
> The PCI parts are already wrapped in #ifdef CONFIG_PCI
> so it seems sensible to add #ifdef CONFIG_ISA around the ISA
> parts.
>
> This reduces the code/data size a bit on configs with !CONFIG_ISA.
>
> Signed-off-by: Daniel Palmer <daniel@thingy.jp>
> ---
>
> Sorry for the spam, somehow I botched sending a patch..
>
> I thought about making this RFC as I'm a bit unsure if machines
> that need this ISA stuff actually select CONFIG_ISA or not.
So sashiko worked out what is going on here. A few machines have
things connected via an LPC bus that is derived from ISA and needs the
code to parse those nodes but those machines don't select CONFIG_ISA.
There seem to be ~15 devicetrees in total that actually need it (1 in
x86, 1 in arm64, a few in mips/loongson for loongson machines, and
then a few in ppc).
I made a series that adds CONFIG_OF_ISA to enable this code, selects
it in the places that needs it, and then does the original part of
disabling the code if not needed. I will wait a bit before sending.
The reason to do this is I am using devicetree to boot a machine with
4MB of RAM and a 7MHz CPU. Removing dead code/data like this helps.
Cheers!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] of/address: Drop ISA parts when !CONFIG_ISA
2026-06-28 5:44 ` Daniel Palmer
@ 2026-06-30 16:48 ` Rob Herring
2026-07-02 9:05 ` Daniel Palmer
0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2026-06-30 16:48 UTC (permalink / raw)
To: Daniel Palmer; +Cc: saravanak, devicetree, linux-kernel
On Sun, Jun 28, 2026 at 02:44:51PM +0900, Daniel Palmer wrote:
> Hi Daniel, (Replying to myself..)
>
> On Sat, 27 Jun 2026 at 02:19, Daniel Palmer <daniel@thingy.jp> wrote:
> >
> > The PCI parts are already wrapped in #ifdef CONFIG_PCI
> > so it seems sensible to add #ifdef CONFIG_ISA around the ISA
> > parts.
> >
> > This reduces the code/data size a bit on configs with !CONFIG_ISA.
> >
> > Signed-off-by: Daniel Palmer <daniel@thingy.jp>
> > ---
> >
> > Sorry for the spam, somehow I botched sending a patch..
> >
> > I thought about making this RFC as I'm a bit unsure if machines
> > that need this ISA stuff actually select CONFIG_ISA or not.
>
> So sashiko worked out what is going on here. A few machines have
> things connected via an LPC bus that is derived from ISA and needs the
> code to parse those nodes but those machines don't select CONFIG_ISA.
> There seem to be ~15 devicetrees in total that actually need it (1 in
> x86, 1 in arm64, a few in mips/loongson for loongson machines, and
> then a few in ppc).
>
> I made a series that adds CONFIG_OF_ISA to enable this code, selects
> it in the places that needs it, and then does the original part of
> disabling the code if not needed. I will wait a bit before sending.
> The reason to do this is I am using devicetree to boot a machine with
> 4MB of RAM and a 7MHz CPU. Removing dead code/data like this helps.
I tend to not want more CONFIG_OF_foo options, but okay I guess.
Alternatively, maybe CONFIG_ISA should just be enabled with these
drivers. Doesn't really look like there's actually much or any code for
CONFIG_ISA. The biggest issue might be the option doesn't exist on
arm64.
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] of/address: Drop ISA parts when !CONFIG_ISA
2026-06-30 16:48 ` Rob Herring
@ 2026-07-02 9:05 ` Daniel Palmer
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Palmer @ 2026-07-02 9:05 UTC (permalink / raw)
To: Rob Herring; +Cc: saravanak, devicetree, linux-kernel
Hi Rob,
On Wed, 1 Jul 2026 at 01:48, Rob Herring <robh@kernel.org> wrote:
> > I made a series that adds CONFIG_OF_ISA to enable this code, selects
> > it in the places that needs it, and then does the original part of
> > disabling the code if not needed. I will wait a bit before sending.
> > The reason to do this is I am using devicetree to boot a machine with
> > 4MB of RAM and a 7MHz CPU. Removing dead code/data like this helps.
>
> I tend to not want more CONFIG_OF_foo options, but okay I guess.
>
> Alternatively, maybe CONFIG_ISA should just be enabled with these
> drivers. Doesn't really look like there's actually much or any code for
> CONFIG_ISA. The biggest issue might be the option doesn't exist on
> arm64.
I guess I'll try sending a patch for arm64 to add CONFIG_ISA and
select it for the drivers that need the ISA bits in address.c
Thanks,
Daniel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-02 9:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 17:19 [PATCH] of/address: Drop ISA parts when !CONFIG_ISA Daniel Palmer
2026-06-26 17:35 ` sashiko-bot
2026-06-28 5:44 ` Daniel Palmer
2026-06-30 16:48 ` Rob Herring
2026-07-02 9:05 ` Daniel Palmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox