WSL2-Linux-Kernel/drivers/clk/sunxi-ng
Samuel Holland b5dd513daa clk: sunxi-ng: Unregister clocks/resets when unbinding
[ Upstream commit 9bec2b9c61 ]

Currently, unbinding a CCU driver unmaps the device's MMIO region, while
leaving its clocks/resets and their providers registered. This can cause
a page fault later when some clock operation tries to perform MMIO. Fix
this by separating the CCU initialization from the memory allocation,
and then using a devres callback to unregister the clocks and resets.

This also fixes a memory leak of the `struct ccu_reset`, and uses the
correct owner (the specific platform driver) for the clocks and resets.

Early OF clock providers are never unregistered, and limited error
handling is possible, so they are mostly unchanged. The error reporting
is made more consistent by moving the message inside of_sunxi_ccu_probe.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20210901050526.45673-2-samuel@sholland.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-25 09:48:23 +01:00
..
Kconfig clk: sunxi-ng: Add support for the Allwinner H616 CCU 2021-01-28 11:14:35 +01:00
Makefile clk: sunxi-ng: Add support for the Allwinner H616 CCU 2021-01-28 11:14:35 +01:00
ccu-sun4i-a10.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun4i-a10.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun5i.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun5i.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun6i-a31.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun6i-a31.h clk: sunxi: a31: Export the MIPI PLL 2020-01-04 09:45:09 +01:00
ccu-sun8i-a23-a33.h clk: sunxi: a23/a33: Export the MIPI PLL 2020-01-04 09:45:19 +01:00
ccu-sun8i-a23.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-a33.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-a83t.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-a83t.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun8i-de2.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-de2.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun8i-h3.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-h3.h clk: sunxi-ng: h3: Export MBUS clock 2019-11-05 11:34:41 +01:00
ccu-sun8i-r.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-r.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun8i-r40.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-r40.h clk: sunxi-ng: r40: Export MBUS clock 2020-01-03 10:37:14 +01:00
ccu-sun8i-v3s.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun8i-v3s.h clk: sunxi-ng: v3s: Fix incorrect number of hw_clks. 2019-12-09 08:49:31 +01:00
ccu-sun9i-a80-de.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun9i-a80-de.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun9i-a80-usb.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun9i-a80-usb.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun9i-a80.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun9i-a80.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ccu-sun50i-a64.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun50i-a64.h clk: sunxi-ng: a64: Export MBUS clock 2020-02-11 07:49:14 +01:00
ccu-sun50i-a100-r.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun50i-a100-r.h clk: sunxi-ng: add support for the Allwinner A100 CCU 2020-08-25 10:52:18 +02:00
ccu-sun50i-a100.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun50i-a100.h clk: sunxi-ng: add support for the Allwinner A100 CCU 2020-08-25 10:52:18 +02:00
ccu-sun50i-h6-r.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun50i-h6-r.h clk: sunxi-ng: h6-r: Add R_APB2_RSB clock and reset 2021-01-06 19:34:29 +08:00
ccu-sun50i-h6.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun50i-h6.h clk: sunxi-ng: Use the correct style for SPDX License Identifier 2019-05-01 13:01:26 -07:00
ccu-sun50i-h616.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-sun50i-h616.h clk: sunxi-ng: Add support for the Allwinner H616 CCU 2021-01-28 11:14:35 +01:00
ccu-suniv-f1c100s.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu-suniv-f1c100s.h clk: sunxi-ng: Use the correct style for SPDX License Identifier 2019-05-01 13:01:26 -07:00
ccu_common.c clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu_common.h clk: sunxi-ng: Unregister clocks/resets when unbinding 2021-11-25 09:48:23 +01:00
ccu_div.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_div.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_frac.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_frac.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_gate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_gate.h This round of clk driver and framework updates is heavy on the driver update 2019-07-17 10:07:48 -07:00
ccu_mmc_timing.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_mp.c clk: sunxi-ng: mp: fix parent rate change flag check 2021-02-11 19:02:24 -08:00
ccu_mp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_mult.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_mult.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ccu_mux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_mux.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ccu_nk.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_nk.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_nkm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_nkm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_nkmp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_nkmp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_nm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_nm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_phase.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_phase.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_reset.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_reset.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
ccu_sdm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ccu_sdm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00