Re: DT overlay applied via pinctrl description

From: Linus Walleij
Date: Mon Mar 01 2021 - 04:20:00 EST


On Tue, Feb 16, 2021 at 4:35 PM Michal Simek <michal.simek@xxxxxxxxxx> wrote:

> I have a question about expectations when pinctrl setting is applied. In
> DTS all nodes are described in the order available in DT.
>
> uart-default {
> mux {
> ...
> };
>
> conf {
> ...
> };
> };
>
> I don't know if this standard description or not. I definitely see other
> pinctrl drivers which are using different structure.
>
> Anyway when overlay is applied the order has changed to
> uart-default {
> conf {
> ...
> };
>
> mux {
> ...
> };
> };
>
> which is causing issue because pin is configured first via conf node
> before it is requested via mux. This is something what firmware is
> checking and error out.

As Frank says the DT ordering has no semantic meaning, it is essentially
a functional language, describes object relations not sequences.

The Linux kernel applies the mux and conf in that order because of how
the code is implemented (this order also makes a lot of sense for the
hardware). I would recommend to trace the execution of an overlay
being applied and try to find the reason conf goes before mux and fix
the bug there. I think it is a bug in how pinctrl handles DT overlays.

Yours,
Linus Walleij