Re: [PATCH] soc: fsl: qe: properly scan GPIO nodes at startup

"Christophe Leroy (CS GROUP)" <[email protected]> Thu, 30 Jul 2026 14:14:13 +0200
Newsgroups org.ozlabs.lists.linuxppc-dev,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

Le 30/07/2026 à 14:05, Krzysztof Kozlowski a écrit :
> On 30/07/2026 14:01, Christophe Leroy (CS GROUP) wrote:
>>
>>
>> Le 30/07/2026 à 13:14, Krzysztof Kozlowski a écrit :
>>> On 29/07/2026 16:10, Christophe Leroy (CS GROUP) wrote:
>>>> Before commit 156460811def ("soc: fsl: qe: Change GPIO driver to a
>>>> proper platform driver") qe_add_gpiochips() was walking the device
>>>> tree to find all nodes with compatible "fsl,mpc8323-qe-pario-bank".
>>>>
>>>> After that commit the discovery is handled by the platform core,
>>>> therefore it is necessary to call of_platform_default_populate() on
>>>> the par_io node.
>>>>
>>>> Fixes: 156460811def ("soc: fsl: qe: Change GPIO driver to a proper platform driver")
>>>> Signed-off-by: Christophe Leroy (CS GROUP) <[email protected]>
>>>> ---
>>>>    drivers/soc/fsl/qe/qe_io.c | 15 +++++++++++++++
>>>>    1 file changed, 15 insertions(+)
>>>>
>>>> diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c
>>>> index a5e2d0e5ab51..02ca556c8db0 100644
>>>> --- a/drivers/soc/fsl/qe/qe_io.c
>>>> +++ b/drivers/soc/fsl/qe/qe_io.c
>>>> @@ -15,6 +15,7 @@
>>>>    #include <linux/errno.h>
>>>>    #include <linux/module.h>
>>>>    #include <linux/ioport.h>
>>>> +#include <linux/of_platform.h>
>>>>    
>>>>    #include <asm/io.h>
>>>>    #include <soc/fsl/qe/qe.h>
>>>> @@ -184,3 +185,17 @@ int par_io_of_config(struct device_node *np)
>>>>    	return 0;
>>>>    }
>>>>    EXPORT_SYMBOL(par_io_of_config);
>>>> +
>>>> +static int __init par_io_populate(void)
>>>> +{
>>>> +	struct device_node *np = of_find_node_by_name(NULL, "par_io");
>>>
>>> No, node name must not be ABI. Especially wrong node name.
>>
>> What's wrong with the node name ?
> 
> 1. It causes W=2 warnings (which we might move to W=1 at some point)
> 2. It is not generic and DT spec asks for generic node names, although
> maybe this part of code follows more of ePAPR than DT. But ePAPR v1.1
> also was asking for generic node names.
> 
>>
>> Regardless, I messed it up, I wanted to use type but copy/pasted
>> of_find_node_by_name(NULL, "par_io") from quirk_mpc8360e_qe_enet10() in
>> arch/powerpc/platforms/83xx/km83xx.c instead.
>>
>> Is it OK to use of_find_node_by_type(NULL, "par_io") instead ?
> 
> Well, depends. Is it a documented ABI?

In Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt:

Required properties:
- device_type : should be "par_io".
- reg : offset to the register set and its length.
- num-ports : number of Parallel I/O ports

Example:
par_io@1400 {
	reg = <1400 100>;
	#address-cells = <1>;
	#size-cells = <0>;
	device_type = "par_io";
	num-ports = <7>;
	ucc_pin@1 {
		......
	};

Is it OK ?

Thanks,
Christophe