]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
phy: samsung: phy-exynos-pcie: sanitize init/power_on callbacks
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 28 Jun 2022 22:04:08 +0000 (00:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:45:46 +0000 (11:45 +0200)
commit51854ee9535cdbe1d38d6d9e0d642ccdbf88a28d
tree9c69d658da485acdc6a5bc530dbf3c80e5c58840
parent55faab828d23b5602e8408a0c3873c5185d6751a
phy: samsung: phy-exynos-pcie: sanitize init/power_on callbacks

[ Upstream commit f2812227bb07e2eaee74253f11cea1576945df31 ]

The exynos-pcie driver called phy_power_on() before phy_init() for some
historical reasons. However the generic PHY framework assumes that the
proper sequence is to call phy_init() first, then phy_power_on(). The
operations done by both functions should be considered as one action and as
such they are called by the exynos-pcie driver (without doing anything
between them). The initialization is just a sequence of register writes,
which cannot be altered without breaking the hardware operation.

To match the generic PHY framework requirement, simply move all register
writes to the phy_init()/phy_exit() and drop power_on()/power_off()
callbacks. This way the driver will also work with the old (incorrect)
PHY initialization call sequence.

Link: https://lore.kernel.org/r/20220628220409.26545-1-m.szyprowski@samsung.com
Reported-by: Bjorn Helgaas <helgaas@kernel.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-By: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/samsung/phy-exynos-pcie.c