Message ID | 20241031070232.1793078-9-masterr3c0rd@epochal.quest (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | sunxi: A100/A133 second stage support | expand |
On Thu, 31 Oct 2024 04:02:21 -0300 Cody Eksal <masterr3c0rd@epochal.quest> wrote: > During testing, it was noted that MMC would fail to initialize, with > "mmc: fatal err update clk timeout" being printed in the log. It was > found that CLK_SET_RATE_NO_REPARENT was set on the MMC controllers, and > that removing this allows MMC to initialize. Therefore, remove > CLK_SET_RATE_NO_REPARENT from mmc0/1/2. Well, while this change indeed prevented that error message you mentioned, but the SD card still doesn't work for me: it probes and I can mount a filesystem on it, but then it hangs, for instance when running an "ls" on it. It could be my setup (lacking DT or device issue or missing kernel config), though, and the eMMC works for me this way, but it would be good to have that sorted. Also it would be good to know why CLK_SET_RATE_NO_REPARENT was put there in the first place: I don't see it in any other MMC clocks in sunxi-ng, so it wasn't just copied&pasted. So was there a problem that this flag was supposed to fix? Is that something that only applied to older kernels (back when the MMC patches were first posted), and which has now been fixed/changed elsewhere? I feel a bit uneasy of just removing this just because it works(TM), especially if it doesn't really (SD card for me, for instance). Cheers, Andre > Signed-off-by: Cody Eksal <masterr3c0rd@epochal.quest> > --- > drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a100.c b/drivers/clk/sunxi-ng/ccu-sun50i-a100.c > index bbaa82978716..a59e420b195d 100644 > --- a/drivers/clk/sunxi-ng/ccu-sun50i-a100.c > +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a100.c > @@ -436,7 +436,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0", mmc_parents, 0x830, > 24, 2, /* mux */ > BIT(31), /* gate */ > 2, /* post-div */ > - CLK_SET_RATE_NO_REPARENT); > + 0); > > static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834, > 0, 4, /* M */ > @@ -444,7 +444,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834, > 24, 2, /* mux */ > BIT(31), /* gate */ > 2, /* post-div */ > - CLK_SET_RATE_NO_REPARENT); > + 0); > > static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838, > 0, 4, /* M */ > @@ -452,7 +452,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838, > 24, 2, /* mux */ > BIT(31), /* gate */ > 2, /* post-div */ > - CLK_SET_RATE_NO_REPARENT); > + 0); > > static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb3", 0x84c, BIT(0), 0); > static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb3", 0x84c, BIT(1), 0);
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a100.c b/drivers/clk/sunxi-ng/ccu-sun50i-a100.c index bbaa82978716..a59e420b195d 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-a100.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a100.c @@ -436,7 +436,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0", mmc_parents, 0x830, 24, 2, /* mux */ BIT(31), /* gate */ 2, /* post-div */ - CLK_SET_RATE_NO_REPARENT); + 0); static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834, 0, 4, /* M */ @@ -444,7 +444,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834, 24, 2, /* mux */ BIT(31), /* gate */ 2, /* post-div */ - CLK_SET_RATE_NO_REPARENT); + 0); static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838, 0, 4, /* M */ @@ -452,7 +452,7 @@ static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838, 24, 2, /* mux */ BIT(31), /* gate */ 2, /* post-div */ - CLK_SET_RATE_NO_REPARENT); + 0); static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb3", 0x84c, BIT(0), 0); static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb3", 0x84c, BIT(1), 0);
During testing, it was noted that MMC would fail to initialize, with "mmc: fatal err update clk timeout" being printed in the log. It was found that CLK_SET_RATE_NO_REPARENT was set on the MMC controllers, and that removing this allows MMC to initialize. Therefore, remove CLK_SET_RATE_NO_REPARENT from mmc0/1/2. Signed-off-by: Cody Eksal <masterr3c0rd@epochal.quest> --- drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)