Skip to content

Commit b2df838

Browse files
committed
clk: mediatek: mt7987-infracfg: drop initconst
The initconst statement causes memory to be freed after init resulting in non-working devices. Signed-off-by: Frank Wunderlich <frank-w@public-files.de> --- clk: mediatek: clk-gate: fix crash since 6.18-rc1 [ 5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock [ 5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare [ 5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388 [ 5.300166] Mem abort info: [ 5.302948] ESR = 0x0000000096000007 [ 5.306684] EC = 0x25: DABT (current EL), IL = 32 bits [ 5.311983] SET = 0, FnV = 0 [ 5.315025] EA = 0, S1PTW = 0 [ 5.318154] FSC = 0x07: level 3 translation fault [ 5.323020] Data abort info: [ 5.325888] ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000 [ 5.331359] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 5.336397] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000 [ 5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000 [ 5.360895] Internal error: Oops: 0000000096000007 [#1] SMP [ 5.366543] Modules linked in: [ 5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE [ 5.378882] Hardware name: Bananapi BPI-R4-LITE (DT) [ 5.383834] Workqueue: pm pm_runtime_work [ 5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 5.394792] pc : mtk_cg_disable+0x18/0x38 [ 5.398795] lr : clk_core_disable+0x7c/0x150 [ 5.403057] sp : ffffffc081bb3bc0 [ 5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000 [ 5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0 [ 5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738 [ 5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff [ 5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532 [ 5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0 [ 5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8 [ 5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8 [ 5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001 [ 5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400 [ 5.477605] Call trace: [ 5.480041] mtk_cg_disable+0x18/0x38 (P) [ 5.484043] clk_core_disable+0x7c/0x150 [ 5.487956] clk_disable+0x30/0x4c [ 5.491350] clk_bulk_disable+0x3c/0x58 [ 5.495177] msdc_gate_clock+0x48/0x15c [ 5.499005] msdc_runtime_suspend+0x2a0/0x2e4 [ 5.503352] pm_generic_runtime_suspend+0x2c/0x44 [ 5.508047] __rpm_callback+0x40/0x228 [ 5.511788] rpm_callback+0x38/0x80 [ 5.515268] rpm_suspend+0xd8/0x630 [ 5.518748] pm_runtime_work+0x114/0x118 [ 5.522662] process_one_work+0x164/0x3ac [ 5.526665] worker_thread+0x284/0x46c [ 5.530404] kthread+0x114/0x1c8 [ 5.533623] ret_from_fork+0x10/0x20 [ 5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24) [ 5.543272] ---[ end trace 0000000000000000 ]--- [ 5.277262] mtk-msdc 11230000.mmc: msdc_runtime_suspend:3308 before gate_clock [ 5.284492] mtk-msdc 11230000.mmc: msdc_gate_clock:925 before bulk_disable_unprepare [ 5.292255] Unable to handle kernel paging request at virtual address ffffffc0813d2388 [ 5.300166] Mem abort info: [ 5.302948] ESR = 0x0000000096000007 [ 5.306684] EC = 0x25: DABT (current EL), IL = 32 bits [ 5.311983] SET = 0, FnV = 0 [ 5.315025] EA = 0, S1PTW = 0 [ 5.318154] FSC = 0x07: level 3 translation fault [ 5.323020] Data abort info: [ 5.325888] ISV = 0, ISS = 0x00000007, ISS2 = 0x00000000 [ 5.331359] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 5.336397] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 5.341695] swapper pgtable: 4k pages, 39-bit VAs, pgdp=00000000452fd000 [ 5.348382] [ffffffc0813d2388] pgd=1000000045ae1003, p4d=1000000045ae1003, pud=1000000045ae1003, pmd=1000000045ae4003, pte=0000000000000000 [ 5.360895] Internal error: Oops: 0000000096000007 [#1] SMP [ 5.366543] Modules linked in: [ 5.369590] CPU: 0 UID: 0 PID: 11 Comm: kworker/0:1 Not tainted 6.18.0-rc1-bpi-r4-mt7987-clk #34 NONE [ 5.378882] Hardware name: Bananapi BPI-R4-LITE (DT) [ 5.383834] Workqueue: pm pm_runtime_work [ 5.387843] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 5.394792] pc : mtk_cg_disable+0x18/0x38 [ 5.398795] lr : clk_core_disable+0x7c/0x150 [ 5.403057] sp : ffffffc081bb3bc0 [ 5.406360] x29: ffffffc081bb3bc0 x28: ffffff8000113540 x27: 0000000000000000 [ 5.413485] x26: ffffff8000113580 x25: 00000000000f4240 x24: ffffff80001a1ac0 [ 5.420610] x23: 0000000000000008 x22: 0000000000000004 x21: ffffff8001112738 [ 5.427734] x20: ffffff8000ff8800 x19: ffffff8000ff8800 x18: 00000000ffffffff [ 5.434858] x17: 755f656c62617369 x16: 645f6b6c75622065 x15: 726f666562203532 [ 5.441983] x14: 00000000ffffffea x13: ffffffc081bb3918 x12: ffffffc081869cf0 [ 5.449107] x11: 0000000000000001 x10: 0000000000000001 x9 : 0000000000017fe8 [ 5.456232] x8 : c0000000ffffefff x7 : ffffffc081811c70 x6 : 0000000000057fa8 [ 5.463356] x5 : ffffffc081869c98 x4 : ffffffc081ace6a8 x3 : 0000000000000001 [ 5.470480] x2 : 0000000000000001 x1 : ffffffc0813d2370 x0 : ffffff8001036400 [ 5.477605] Call trace: [ 5.480041] mtk_cg_disable+0x18/0x38 (P) [ 5.484043] clk_core_disable+0x7c/0x150 [ 5.487956] clk_disable+0x30/0x4c [ 5.491350] clk_bulk_disable+0x3c/0x58 [ 5.495177] msdc_gate_clock+0x48/0x15c [ 5.499005] msdc_runtime_suspend+0x2a0/0x2e4 [ 5.503352] pm_generic_runtime_suspend+0x2c/0x44 [ 5.508047] __rpm_callback+0x40/0x228 [ 5.511788] rpm_callback+0x38/0x80 [ 5.515268] rpm_suspend+0xd8/0x630 [ 5.518748] pm_runtime_work+0x114/0x118 [ 5.522662] process_one_work+0x164/0x3ac [ 5.526665] worker_thread+0x284/0x46c [ 5.530404] kthread+0x114/0x1c8 [ 5.533623] ret_from_fork+0x10/0x20 [ 5.537193] Code: d2800023 910003fd f9401401 f9400c00 (f9400c24) [ 5.543272] ---[ end trace 0000000000000000 ]--- Fixes: ("clk: mediatek: clk-gate: Refactor mtk_clk_register_gate to use mtk_gate struct") Fixes: ("clk: mediatek: add clock driver for mt7987 from sdk")
1 parent b9fe9a7 commit b2df838

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/mediatek/clk-mt7987-infracfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static const struct mtk_gate_regs infra3_cg_regs = {
133133
.regs = _regs, .shift = _shift, .flags = CLK_IS_CRITICAL, \
134134
.ops = &mtk_clk_gate_ops_setclr, \
135135
}
136-
static const struct mtk_gate infra_clks[] __initconst = {
136+
static const struct mtk_gate infra_clks[] = {
137137
/* INFRA1 */
138138
GATE_INFRA1(CLK_INFRA_66M_GPT_BCK, "infra_hf_66m_gpt_bck",
139139
"sysaxi_sel", 0),

0 commit comments

Comments
 (0)