soc: imx: gpcv2: Assert reset before ungating clock
authorMarek Vasut <marex@denx.de>
Fri, 12 Aug 2022 17:08:02 +0000 (19:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 09:30:03 +0000 (11:30 +0200)
commita53b30716c607e8a8e036d765e41cd8a88d8205f
treeb4715a943cca22d54d4378291608c530ae219d7a
parent83a7e5d2f14e63dc095aea90c2db5e7b8cfa56f3
soc: imx: gpcv2: Assert reset before ungating clock

[ Upstream commit df88005bd81b80c944d185554e264a4b0f993c37 ]

In case the power domain clock are ungated before the reset is asserted,
the system might freeze completely. This is likely due to a device is an
undefined state being attached to bus, which sporadically leads to a bus
hang. Assert the reset before the clock are enabled to assure the device
is in defined state before being attached to bus.

Fixes: fe58c887fb8ca ("soc: imx: gpcv2: add support for optional resets")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/imx/gpcv2.c