mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC] pinctrl: ingenic: impossible MACH_* guards can drop OF match data
@ 2026-06-25  6:09 Pengpeng Hou
  2026-06-25  6:28 ` H. Nikolaus Schaller
  0 siblings, 1 reply; 4+ messages in thread
From: Pengpeng Hou @ 2026-06-25  6:09 UTC (permalink / raw)
  To: Paul Cercueil, Linus Walleij
  Cc: linux-mips, linux-gpio, linux-kernel, Pengpeng Hou

Hi,

while auditing conditional data-provider paths, I noticed that
drivers/pinctrl/pinctrl-ingenic.c still derives some SoC descriptor exposure
from IS_ENABLED(CONFIG_MACH_*) style conditions whose corresponding Kconfig
symbols do not appear to exist in the current Ingenic Kconfig universe.

This looks like a data-symbol legality issue rather than a simple cleanup:
the OF match table .data entries carry SoC-specific pinctrl descriptors.  If
the guard can never be true, a compatible string can lose the intended
descriptor provider even though the descriptor is still present in source.

I am not sending a patch yet because the correct policy is not obvious.  The
possible directions include:

1. remove impossible MACH_* gates from the OF match data;
2. restore current Kconfig symbols for the intended SoC families;
3. split unsupported legacy SoCs from supported descriptor exposure; or
4. keep the gates and document that these descriptors are intentionally not
   exposed.

Could you confirm which direction matches the current Ingenic pinctrl support
policy?

This is static source/Kconfig analysis only.  I have not tested the affected
hardware.

Thanks,
Pengpeng


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] pinctrl: ingenic: impossible MACH_* guards can drop OF match data
  2026-06-25  6:09 [RFC] pinctrl: ingenic: impossible MACH_* guards can drop OF match data Pengpeng Hou
@ 2026-06-25  6:28 ` H. Nikolaus Schaller
  2026-12-03  4:01   ` Pengpeng Hou
  0 siblings, 1 reply; 4+ messages in thread
From: H. Nikolaus Schaller @ 2026-06-25  6:28 UTC (permalink / raw)
  To: Pengpeng Hou
  Cc: Paul Cercueil, Linus Walleij, linux-mips, linux-gpio,
	linux-kernel, Discussions about the Letux Kernel

Hi,

Since I am just these days working to extend the ingenic-pinctrl driver for x2600
support, I can comment from a distribution kernel perspective.

> Am 25.06.2026 um 08:09 schrieb Pengpeng Hou <pengpeng@iscas.ac.cn>:
> 
> Hi,
> 
> while auditing conditional data-provider paths, I noticed that
> drivers/pinctrl/pinctrl-ingenic.c still derives some SoC descriptor exposure
> from IS_ENABLED(CONFIG_MACH_*) style conditions whose corresponding Kconfig
> symbols do not appear to exist in the current Ingenic Kconfig universe.
> 
> This looks like a data-symbol legality issue rather than a simple cleanup:
> the OF match table .data entries carry SoC-specific pinctrl descriptors.  If

The idea is that you can choose through CONFIG_MACH_* which records are
included in the match table at all to be able to shrink the driver to a bare
minimum for embedded use (e.g. X1600 with just 32 MB RAM).

Or have a full driver for a distribution kernel which supports all options by a
full driver (module).

Currently we have in the LetuxOS kernel:

grep -e "CONFIG_MACH_JZ" -e "CONFIG_MACH_X" .config
CONFIG_MACH_JZ4725B=y
CONFIG_MACH_JZ4730=y
CONFIG_MACH_JZ4740=y
CONFIG_MACH_JZ4770=y
CONFIG_MACH_JZ4780=y
CONFIG_MACH_X1000=y
CONFIG_MACH_X1600=y
CONFIG_MACH_X1830=y
CONFIG_MACH_X2000=y
CONFIG_MACH_X2600=y

> the guard can never be true, a compatible string can lose the intended
> descriptor provider even though the descriptor is still present in source.
> 
> I am not sending a patch yet because the correct policy is not obvious.  The
> possible directions include:
> 
> 1. remove impossible MACH_* gates from the OF match data;
> 2. restore current Kconfig symbols for the intended SoC families;
> 3. split unsupported legacy SoCs from supported descriptor exposure; or
> 4. keep the gates and document that these descriptors are intentionally not
>   exposed.

5. keep it as is and wait until we can upstream some missing SoC families.

(BTW: can you list what you think is unsupported legacy or impossible please?)

> 
> Could you confirm which direction matches the current Ingenic pinctrl support
> policy?
> 
> This is static source/Kconfig analysis only.  I have not tested the affected
> hardware.
> 
> Thanks,
> Pengpeng

Hope this helps the maintainers to decide.

BR,
Nikolaus


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] pinctrl: ingenic: impossible MACH_* guards can drop OF match data
  2026-06-25  6:28 ` H. Nikolaus Schaller
@ 2026-12-03  4:01   ` Pengpeng Hou
  2026-12-03  6:56     ` H. Nikolaus Schaller
  0 siblings, 1 reply; 4+ messages in thread
From: Pengpeng Hou @ 2026-12-03  4:01 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Pengpeng Hou, Paul Cercueil, Linus Walleij, linux-mips,
	linux-gpio, linux-kernel, Discussions about the Letux Kernel

Hi Nikolaus,

Comparing the OF match data in pinctrl-ingenic.c with the MACH entries
in arch/mips/ingenic/Kconfig, the names I can't find in that Kconfig
are JZ4730, JZ4750, JZ4755, JZ4760, JZ4775, X1500, X1600, X2000 and
X2100 (all with the MACH_ prefix).

That is a list of missing upstream configuration entries, not a list
of unsupported chips. In particular your Letux configuration is a
counterexample to calling JZ4730, X1600 or X2000 impossible. Removing
the guards would also take away the size choice you described. I'm
not proposing that change.

Thanks,
Pengpeng


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] pinctrl: ingenic: impossible MACH_* guards can drop OF match data
  2026-12-03  4:01   ` Pengpeng Hou
@ 2026-12-03  6:56     ` H. Nikolaus Schaller
  0 siblings, 0 replies; 4+ messages in thread
From: H. Nikolaus Schaller @ 2026-12-03  6:56 UTC (permalink / raw)
  To: Pengpeng Hou
  Cc: Paul Cercueil, Linus Walleij, linux-mips, linux-gpio,
	linux-kernel, Discussions about the Letux Kernel

Hi Pengpeng,

> Am 03.12.2026 um 05:01 schrieb Pengpeng Hou <pengpeng@iscas.ac.cn>:
> 
> Hi Nikolaus,
> 
> Comparing the OF match data in pinctrl-ingenic.c with the MACH entries
> in arch/mips/ingenic/Kconfig, the names I can't find in that Kconfig
> are JZ4730, JZ4750, JZ4755, JZ4760, JZ4775, X1500, X1600, X2000 and
> X2100 (all with the MACH_ prefix).
> 
> That is a list of missing upstream configuration entries, not a list
> of unsupported chips. In particular your Letux configuration is a
> counterexample to calling JZ4730, X1600 or X2000 impossible.

As a distribution kernel it is adding the missing entries to upstream Kconfig.

> Removing
> the guards would also take away the size choice you described. I'm
> not proposing that change.

Yes, not all configs that the driver assumes are selectable in upstream kernels.

Some of the missing configs (x1600, x2000, x2600, jz4730) are (will be) fixed by:

https://lore.kernel.org/all/887d9b55de3804fa798781ca03b99402040cf833.camel@crapouillou.net/
https://lore.kernel.org/all/a8706b933ed64eee14bcceaccda292a7e2ddf0a2.camel@crapouillou.net/

Several entries in pinctrl were added years ago by multiple authors and likely some
patch to arch/mips/ingenic/Kconfig was forgotten back then.

I'd suggest to wait until the new pinctrl series is merged and then you can add
the missing MACH_ definitions to Kconfig.

As a side-note: I think the entries for 

.compatible = "ingenic,x1000e-pinctrl",
.compatible = "ingenic,x2000e-pinctrl",

could be removed since the "e" suffix denotes a different RAM size but not to add
different pinmux controller and they share the same chip_info anyways.

BR and thanks,
Nikolaus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-03  6:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-25  6:09 [RFC] pinctrl: ingenic: impossible MACH_* guards can drop OF match data Pengpeng Hou
2026-06-25  6:28 ` H. Nikolaus Schaller
2026-12-03  4:01   ` Pengpeng Hou
2026-12-03  6:56     ` H. Nikolaus Schaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®