clk: mediatek: Migrate to common probe/remove helpers and fix memory leaks
Status from this message: Applied to v7.4-next/clk, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest35 patches 2 repliesApplied
- v132 patches 5 repliesSuperseded
Changes in v2 from the cover letter
- Add two new fixes "Fix index in composite clock unwind path" and "Fix memory leak in mtk_clk_register_gate()".
- Add new refactor "return 0 instead of r in __mtk_clk_simple_probe()"
- Fix missing .data = &apmixed_desc in the MT8167 and MT8195 apmixedsys drivers.
- Fix PLL registration and unregistration when CONFIG_COMMON_CLK_MEDIATEK_FHCTL is disabled.
- Fix child-device population logic.
- Clarify the rationale in the SoC conversion commit messages.
- Minor fixes to several commit messages.
- Rebased onto 24a19b953e2a ("Linux 7.3-rc7")
from 075b74841bd0 ("Linux 7.2-rc6")
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/35 | clk: mediatek: mt2712: Fix memory leak on module removaldrivers/ | +2 | 0 replies | |
| 2/35 | clk: mediatek: mt6795: Fix memory leak on module removaldrivers/ drivers/ drivers/ | +6 | 0 replies | |
| 3/35 | clk: mediatek: mt7622: Fix memory leak on module removaldrivers/ drivers/ | +4 | 0 replies | |
| 4/35 | clk: mediatek: mt8135: Fix memory leak on module removaldrivers/ | +2 | 0 replies | |
| 5/35 | clk: mediatek: mt8173: Fix memory leak on module removaldrivers/ drivers/ | +4 | 0 replies | |
| 6/35 | clk: mediatek: mt8192: Fix memory leak on module removaldrivers/ | +2 | 0 replies | |
| 7/35 | clk: mediatek: mt6735: Add missing MODULE_DEVICE_TABLE()drivers/ drivers/ | +2 | 0 replies | |
| 8/35 | clk: mediatek: mt7988-apmixed: Add missing MODULE_DEVICE_TABLE()drivers/ | +1 | 0 replies | |
| 9/35 | clk: mediatek: Fix index in composite clock unwind pathdrivers/ | +1 | 0 replies | |
| 10/35 | clk: mediatek: Fix memory leak in mtk_clk_register_gate()drivers/ | +3 | 0 replies | |
| 11/35 | clk: mediatek: return 0 instead of r in __mtk_clk_simple_probe()drivers/ | +1 | 0 replies | |
| 12/35 | clk: mediatek: Add cpumux support to common probe/remove helpersdrivers/ drivers/ | +19 | 0 replies | |
| 13/35 | clk: mediatek: Add PLL support to common probe/remove helpersdrivers/ drivers/ | +19 | 0 replies | |
| 14/35 | clk: mediatek: Add child-device population to probe/remove helpersdrivers/ drivers/ | +18 | 0 replies | |
| 15/35 | clk: mediatek: Add FHCTL support to common probe/remove helpersdrivers/ drivers/ | +44 | 0 replies | |
| 16/35 | clk: mediatek: mt2701: Switch to common probe/remove helpersdrivers/ drivers/ drivers/ | +65 | 0 replies | |
| 17/35 | clk: mediatek: mt2712-apmixedsys: Switch to common probe/remove helpersdrivers/ | +7 | 0 replies | |
| 18/35 | clk: mediatek: mt6735-apmixedsys: Switch to common probe/remove helpersdrivers/ | +7 | 0 replies | |
| 19/35 | clk: mediatek: mt6779: Switch to common probe/remove helpersdrivers/ | +22 | 0 replies | |
| 20/35 | clk: mediatek: mt6795: Switch to common probe/remove helpersdrivers/ drivers/ | +23 | 0 replies | |
| 21/35 | clk: mediatek: mt6797: Switch to common probe/remove helpersdrivers/ drivers/ | +24 | 0 replies | |
| 22/35 | clk: mediatek: mt7622: Switch to common probe/remove helpersdrivers/ drivers/ drivers/ | +23 | 0 replies | |
| 23/35 | clk: mediatek: mt7981-apmixed: Switch to common probe/remove helpersdrivers/ drivers/ | +10 | 0 replies | |
| 24/35 | clk: mediatek: mt7986-apmixed: Switch to common probe/remove helpersdrivers/ | +9 | 0 replies | |
| 25/35 | clk: mediatek: mt7988-apmixed: Switch to common probe/remove helpersdrivers/ | +9 | 0 replies | |
| 26/35 | clk: mediatek: mt8135-apmixedsys: Switch to common probe/remove helpersdrivers/ | +7 | 0 replies | |
| 27/35 | clk: mediatek: mt8167-apmixedsys: Switch to common probe/remove helpersdrivers/ | +16 | 0 replies | |
| 28/35 | clk: mediatek: mt8173-infracfg: Switch to common probe/remove helpersdrivers/ | +16 | 0 replies | |
| 29/35 | clk: mediatek: mt8183: Switch to common probe/remove helpersdrivers/ drivers/ | +13 | 0 replies | |
| 30/35 | clk: mediatek: mt8186-apmixedsys: Switch to common probe/remove helpersdrivers/ | +11 | 0 replies | |
| 31/35 | clk: mediatek: mt8188-apmixedsys: Switch to common probe/remove helpersdrivers/ | +10 | 0 replies | |
| 32/35 | clk: mediatek: mt8192: Switch to common probe/remove helpersdrivers/ drivers/ | +16 | 0 replies | |
| 33/35 | clk: mediatek: mt8195: Switch to common probe/remove helpersdrivers/ drivers/ drivers/ | +31 | 0 replies | |
| 34/35 | clk: mediatek: mt8196: Switch to common probe/remove helpersdrivers/ drivers/ drivers/ | +63 | 0 replies | |
| 35/35 | clk: mediatek: mt8516-apmixedsys: Switch to common probe/remove helpersdrivers/ | +8 | 0 replies |
Reviews trailers per patch
6 of 35 patches have a Reviewed-by or Acked-by.
| Patch | Brian Masney | Chen-Yu Tsai |
|---|---|---|
| 1/35 | R-b | |
| 2/35 | R-b | |
| 3/35 | R-b | |
| 4/35 | R-b | |
| 5/35 | ||
| 6/35 | R-b | |
| 7/35 | ||
| 8/35 | ||
| 9/35 | ||
| 10/35 | ||
| 11/35 | ||
| 12/35 | R-b | |
| 13/35 | ||
| 14/35 | ||
| 15/35 | ||
| 16/35 | ||
| 17/35 | ||
| 18/35 | ||
| 19/35 | ||
| 20/35 | ||
| 21/35 | ||
| 22/35 | ||
| 23/35 | ||
| 24/35 | ||
| 25/35 | ||
| 26/35 | ||
| 27/35 | ||
| 28/35 | ||
| 29/35 | ||
| 30/35 | ||
| 31/35 | ||
| 32/35 | ||
| 33/35 | ||
| 34/35 | ||
| 35/35 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/35] clk: mediatek: Migrate to common probe/remove helpers and fix memory leaks
This series migrates most MediaTek clock drivers to the common probe/remove helpers provided by the MTK clock framework.
Key changes:
- Fix memory leaks on module removal caused by missing platform_set_drvdata() calls (patches 1-6).
- Add missing MODULE_DEVICE_TABLE() (patches 7, 8).
- Add missing support for cpumux, PLL, FHCTL, and child-device population to the common helpers (patches 12-15).
- Convert all compatible clock drivers to use struct mtk_clk_desc and mtk_clk_simple_probe/remove (patches 16-35).
The memory leak and MODULE_DEVICE_TABLE() fixes are split from the migration patches to allow backporting to stable.
Drivers not converted:
- MT6765 apmixedsys: requires direct register init.
- MT6795 apmixedsys: uses mtk_clk_register_ref2usb_tx().
- MT7629 eth/sgmiisys: uses a hacked probe sequence (multi-instance sgmii gates).
- MT8173 apmixedsys: uses mtk_clk_register_ref2usb_tx() and custom divider registration.
- MT8188/MT8195 topckgen: call devm_clk_hw_register_mux() and register a notifier.
- MT8196 vlpckgen: requires direct register init.
- MT8365 apmixedsys: uses devm_clk_hw_register_gate().
Patches 1-6 are based on
"[PATCH v2 0/6] clk: mediatek: fix memory leak on module removal" (In addition fixed a compilation error in mt8173-infracfg)
https://lore.kernel.org/linux-mediatek/[email protected]/
Patch 5 fixes the same issue mentioned below
"[PATCH] clk: mediatek: clk-mt8173-apmixedsys: Invoke platform_set_drvdata on probe"
https://lore.kernel.org/linux-mediatek/[email protected]/
Patch 12 is based on
"[PATCH 1/3] clk: mediatek: clk-mtk: Add cpumux support to common probe/remove helpers"
https://lore.kernel.org/lkml/[email protected]/
Changes in v2:
- Add two new fixes "Fix index in composite clock unwind path" and "Fix memory leak in mtk_clk_register_gate()".
- Add new refactor "return 0 instead of r in __mtk_clk_simple_probe()"
- Fix missing .data = &apmixed_desc in the MT8167 and MT8195 apmixedsys drivers.
- Fix PLL registration and unregistration when CONFIG_COMMON_CLK_MEDIATEK_FHCTL is disabled.
- Fix child-device population logic.
- Clarify the rationale in the SoC conversion commit messages.
- Minor fixes to several commit messages.
- Rebased onto 24a19b953e2a ("Linux 7.3-rc7")
from 075b74841bd0 ("Linux 7.2-rc6")
Link to v1:
https://lore.kernel.org/linux-mediatek/[email protected]/T/
Akari Tsuyukusa (35):
clk: mediatek: mt2712: Fix memory leak on module removal
clk: mediatek: mt6795: Fix memory leak on module removal
clk: mediatek: mt7622: Fix memory leak on module removal
clk: mediatek: mt8135: Fix memory leak on module removal
clk: mediatek: mt8173: Fix memory leak on module removal
clk: mediatek: mt8192: Fix memory leak on module removal
clk: mediatek: mt6735: Add missing MODULE_DEVICE_TABLE()
clk: mediatek: mt7988-apmixed: Add missing MODULE_DEVICE_TABLE()
clk: mediatek: Fix index in composite clock unwind path
clk: mediatek: Fix memory leak in mtk_clk_register_gate()
clk: mediatek: return 0 instead of r in __mtk_clk_simple_probe()
clk: mediatek: Add cpumux support to common probe/remove helpers
clk: mediatek: Add PLL support to common probe/remove helpers
clk: mediatek: Add child-device population to probe/remove helpers
clk: mediatek: Add FHCTL support to common probe/remove helpers
clk: mediatek: mt2701: Switch to common probe/remove helpers
clk: mediatek: mt2712-apmixedsys: Switch to common probe/remove
helpers
clk: mediatek: mt6735-apmixedsys: Switch to common probe/remove
helpers
clk: mediatek: mt6779: Switch to common probe/remove helpers
clk: mediatek: mt6795: Switch to common probe/remove helpers
clk: mediatek: mt6797: Switch to common probe/remove helpers
clk: mediatek: mt7622: Switch to common probe/remove helpers
clk: mediatek: mt7981-apmixed: Switch to common probe/remove helpers
clk: mediatek: mt7986-apmixed: Switch to common probe/remove helpers
clk: mediatek: mt7988-apmixed: Switch to common probe/remove helpers
clk: mediatek: mt8135-apmixedsys: Switch to common probe/remove
helpers
clk: mediatek: mt8167-apmixedsys: Switch to common probe/remove
helpers
clk: mediatek: mt8173-infracfg: Switch to common probe/remove helpers
clk: mediatek: mt8183: Switch to common probe/remove helpers
clk: mediatek: mt8186-apmixedsys: Switch to common probe/remove
helpers
clk: mediatek: mt8188-apmixedsys: Switch to common probe/remove
helpers
clk: mediatek: mt8192: Switch to common probe/remove helpers
clk: mediatek: mt8195: Switch to common probe/remove helpers
clk: mediatek: mt8196: Switch to common probe/remove helpers
clk: mediatek: mt8516-apmixedsys: Switch to common probe/remove
helpers
drivers/clk/mediatek/Kconfig | 34 +-- drivers/clk/mediatek/clk-gate.c | 4 +- drivers/clk/mediatek/clk-mt2701-aud.c | 35 +-- drivers/clk/mediatek/clk-mt2701.c | 233 +++++-------------- drivers/clk/mediatek/clk-mt2712-apmixedsys.c | 48 +--- drivers/clk/mediatek/clk-mt6735-apmixedsys.c | 51 +--- drivers/clk/mediatek/clk-mt6735-imgsys.c | 1 + drivers/clk/mediatek/clk-mt6735-mfgcfg.c | 1 + drivers/clk/mediatek/clk-mt6779.c | 124 ++-------- drivers/clk/mediatek/clk-mt6795-apmixedsys.c | 2 + drivers/clk/mediatek/clk-mt6795-infracfg.c | 70 +----- drivers/clk/mediatek/clk-mt6795-pericfg.c | 71 +----- drivers/clk/mediatek/clk-mt6797.c | 140 ++--------- drivers/clk/mediatek/clk-mt7622-apmixedsys.c | 60 +---- drivers/clk/mediatek/clk-mt7622-aud.c | 35 +-- drivers/clk/mediatek/clk-mt7622-infracfg.c | 70 +----- drivers/clk/mediatek/clk-mt7981-apmixed.c | 37 +-- drivers/clk/mediatek/clk-mt7986-apmixed.c | 37 +-- drivers/clk/mediatek/clk-mt7988-apmixed.c | 40 +--- drivers/clk/mediatek/clk-mt8135-apmixedsys.c | 48 +--- drivers/clk/mediatek/clk-mt8167-apmixedsys.c | 58 ++--- drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 2 + drivers/clk/mediatek/clk-mt8173-infracfg.c | 98 ++------ drivers/clk/mediatek/clk-mt8183-apmixedsys.c | 51 +--- drivers/clk/mediatek/clk-mt8183-audio.c | 26 +-- drivers/clk/mediatek/clk-mt8186-apmixedsys.c | 59 +---- drivers/clk/mediatek/clk-mt8188-apmixedsys.c | 60 +---- drivers/clk/mediatek/clk-mt8192-apmixedsys.c | 67 ++---- drivers/clk/mediatek/clk-mt8192-aud.c | 26 +-- drivers/clk/mediatek/clk-mt8195-apmixedsys.c | 75 ++---- drivers/clk/mediatek/clk-mt8195-apusys_pll.c | 49 +--- drivers/clk/mediatek/clk-mt8196-apmixedsys.c | 67 +----- drivers/clk/mediatek/clk-mt8196-mcu.c | 96 +++----- drivers/clk/mediatek/clk-mt8196-mfg.c | 84 ++----- drivers/clk/mediatek/clk-mt8516-apmixedsys.c | 42 +--- drivers/clk/mediatek/clk-mtk.c | 90 ++++++- drivers/clk/mediatek/clk-mtk.h | 12 + 37 files changed, 496 insertions(+), 1607 deletions(-)
Signature · 1 line
2.56.0