<marex>
mwalle: if CONFIG_IS_ENABLED(PINCTRL_FULL) -> pinctrl_select_state_full() returns -ENODEV , it's a measure to save space in SPL
ikarso has quit [Quit: Connection closed for inactivity]
<marex>
mwalle: does pinctrl_select_state_full() return -ve somewhere from within itself ?
<marex>
is PINCTRL_FULL enabled ?
Leopold_ has joined #u-boot
Leopold has quit [Ping timeout: 255 seconds]
<mwalle>
marex: when PINCTRL_FULL is enabled then pinctrl_select_state_full returns enodev?
<mwalle>
you mean if it's not enabled?
goliath has quit [Quit: SIGSEGV]
mmu_man has quit [Ping timeout: 265 seconds]
<mwalle>
locally, i've guarded the simple call with !CONFIG_IS_ENABLED(PINCTRL_FULL) as I don't see the usecase that both are used. which was my initial question, why is there an if (!full()) simple()
<mwalle>
marex: and yes I have PINCTRL_FULL and no SPL
Leopold_ has quit [Write error: Broken pipe]
Leopold has joined #u-boot
mmu_man has joined #u-boot
<marex>
mwalle: see the macro protection at the beginning ... #if CONFIG_IS_ENABLED(PINCTRL_FULL)
<marex>
164 #else
<marex>
165 static int pinctrl_select_state_full(struct udevice *dev, const char *statename)
<marex>
166 {
<marex>
167 return -ENODEV;
<marex>
168 }
<marex>
so, in case ^ always returns -ENODEV for !PINCTRL_FULL
<marex>
320 if (pinctrl_select_state_full(dev, statename))
stipa has quit [Read error: Connection reset by peer]
stipa_ is now known as stipa
goliath has quit [Quit: SIGSEGV]
<mwalle>
marex: so, pinctrl_select_state() is called for every device (except the root and the pinctrl itself) regardless if there is a pinctrl property or not. and if there is none, the pinctrl_select_state_full() will fail with EINVAL
<mwalle>
marex: which means, that right now, the _simple() will be called for every device which doesn't have a pinctrl property
<mwalle>
marex: I think the real bug here is that the _full() never returns -ENOSYS
___nick___ has quit [Ping timeout: 256 seconds]
<marex>
mwalle: ENOSYS in case property not present ?
<mwalle>
marex: yes, right now, this is returened via the _simple()
goliath has joined #u-boot
<mwalle>
marex: what actually happens on my board is the following (before relocation). pinctrl_select_state() is called for each device (or just some? doesn't matter), the full will fail, because most devices don't have a pinctrl-names property. then _simple() is called, that does a device_probe of the pinctrl, which fails because the parent isn't probed yet (and i need the regmap of the parent).
<mwalle>
the device_probe() will allocate memory.. which is never freed because we are before relocation, and somewhere along the path, I'm running out of pre-reloc heap memory
Leopold has quit [Remote host closed the connection]
prabhakarlad has quit [Quit: Client closed]
Leopold has joined #u-boot
<marex>
mwalle: what would be the expected behavior ?
<mwalle>
marex: regarding the pinctrl or regarding my board ;)
<marex>
mwalle: regarding the early pinctrl config
<marex>
the pinctrl should likely be configured anyway, right ?
<mwalle>
marex: in what case? i need it for the uart, but i have a pinctrl node there
<mwalle>
marex: and it's working as long as there isn't the _simple() fallback which eats up my memory as i mentioned
<marex>
mwalle: so who does configure the pinctrl for the UART then ? the full ?
<mwalle>
marex: yes the ful
<mwalle>
*full
Leopold_ has joined #u-boot
Leopold has quit [Ping timeout: 255 seconds]
prabhakarlad has joined #u-boot
torez has quit [Quit: torez]
<marex>
mwalle: OK, I see, in that case yes, skip the simple and be done with it