Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: tegra: Implement disable_unused() of tegra_clk_sdmmc_mux_ops

Implement disable_unused() callback of tegra_clk_sdmmc_mux_ops to fix
imbalanced disabling of the unused MMC clock on Tegra210 Jetson Nano.

Fixes: c592c8a28f58 ("clk: tegra: Fix refcounting of gate clocks")
Reported-by: Jon Hunter <jonathanh@nvidia.com> # T210 Nano
Tested-by: Jon Hunter <jonathanh@nvidia.com> # T210 Nano
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210717112742.7196-1-digetx@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Dmitry Osipenko and committed by
Stephen Boyd
2bcc025a 4ee107c5

+10
+10
drivers/clk/tegra/clk-sdmmc-mux.c
··· 194 194 gate_ops->disable(gate_hw); 195 195 } 196 196 197 + static void clk_sdmmc_mux_disable_unused(struct clk_hw *hw) 198 + { 199 + struct tegra_sdmmc_mux *sdmmc_mux = to_clk_sdmmc_mux(hw); 200 + const struct clk_ops *gate_ops = sdmmc_mux->gate_ops; 201 + struct clk_hw *gate_hw = &sdmmc_mux->gate.hw; 202 + 203 + gate_ops->disable_unused(gate_hw); 204 + } 205 + 197 206 static void clk_sdmmc_mux_restore_context(struct clk_hw *hw) 198 207 { 199 208 struct clk_hw *parent = clk_hw_get_parent(hw); ··· 227 218 .is_enabled = clk_sdmmc_mux_is_enabled, 228 219 .enable = clk_sdmmc_mux_enable, 229 220 .disable = clk_sdmmc_mux_disable, 221 + .disable_unused = clk_sdmmc_mux_disable_unused, 230 222 .restore_context = clk_sdmmc_mux_restore_context, 231 223 }; 232 224