Re: [PATCH] pinctrl: imx: make sure that maps are fully initialized
From: Fabio Estevam
Date: Sat Nov 10 2018 - 12:49:09 EST
Hi Martin,
On Sat, Nov 10, 2018 at 3:39 PM Martin Kaiser <martin@xxxxxxxxx> wrote:
>
> The commit that added scu based pinctrl support introduced a regression
> for the mmio case. In the for-loop where the maps are initialized, we
> end up creating a partially initialized map in some cases. This causes a
> kernel panic when such a map is used at a later stage.
>
> When scu is not used and and a pin uses the default pad configuration,
> the current code sets the map's type and data.configs.group_or_pin but
> no configs or num_configs are set. The previous code without scu
> support did not create a new map at all in this case and did not
> increment the counter.
>
> Fix this by setting the map type and data.configs.group_or_pin only when
> a configuration was set before, either by scu or by mmio using a
> non-default pad config. Increment the counter only if a new map was
> created.
>
> Fixes: b96eea718bf6 ("pinctrl: fsl: add scu based pinctrl support")
> Cc: A.s. Dong <aisheng.dong@xxxxxxx>
> Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
Thanks for the fix:
Reviewed-by: Fabio Estevam <festevam@xxxxxxxxx>