Skip to content

Commit 785ee98

Browse files
committed
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk fixes from Stephen Boyd: "A collection of clk driver fixes and one core clk API fix: - Fix stm32 clk data to avoid a crash early on - Fix a randconfig build error in HiSilicon clk driver - Avoid an oops at boot on Qualcomm MSM8936 SoCs due to an improper consolidation of structs - Fix imbalanced disabling of the unused MMC clock on Tegra210 Jetson Nano - Plug a memory leak in devm_clk_bulk_get_all() unwind path" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: fix leak on devm_clk_bulk_get_all() unwind clk: tegra: Implement disable_unused() of tegra_clk_sdmmc_mux_ops clk: qcom: smd-rpm: Fix MSM8936 RPM_SMD_PCNOC_A_CLK clk: hisilicon: hi3559a: select RESET_HISI clk: stm32f4: fix post divisor setup for I2S/SAI PLLs
2 parents c500bee + f828b0b commit 785ee98

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

drivers/clk/clk-devres.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,20 @@ int __must_check devm_clk_bulk_get_optional(struct device *dev, int num_clks,
9292
}
9393
EXPORT_SYMBOL_GPL(devm_clk_bulk_get_optional);
9494

95+
static void devm_clk_bulk_release_all(struct device *dev, void *res)
96+
{
97+
struct clk_bulk_devres *devres = res;
98+
99+
clk_bulk_put_all(devres->num_clks, devres->clks);
100+
}
101+
95102
int __must_check devm_clk_bulk_get_all(struct device *dev,
96103
struct clk_bulk_data **clks)
97104
{
98105
struct clk_bulk_devres *devres;
99106
int ret;
100107

101-
devres = devres_alloc(devm_clk_bulk_release,
108+
devres = devres_alloc(devm_clk_bulk_release_all,
102109
sizeof(*devres), GFP_KERNEL);
103110
if (!devres)
104111
return -ENOMEM;

drivers/clk/clk-stm32f4.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ struct stm32f4_pll {
526526

527527
struct stm32f4_pll_post_div_data {
528528
int idx;
529-
u8 pll_num;
529+
int pll_idx;
530530
const char *name;
531531
const char *parent;
532532
u8 flag;
@@ -557,13 +557,13 @@ static const struct clk_div_table post_divr_table[] = {
557557

558558
#define MAX_POST_DIV 3
559559
static const struct stm32f4_pll_post_div_data post_div_data[MAX_POST_DIV] = {
560-
{ CLK_I2SQ_PDIV, PLL_I2S, "plli2s-q-div", "plli2s-q",
560+
{ CLK_I2SQ_PDIV, PLL_VCO_I2S, "plli2s-q-div", "plli2s-q",
561561
CLK_SET_RATE_PARENT, STM32F4_RCC_DCKCFGR, 0, 5, 0, NULL},
562562

563-
{ CLK_SAIQ_PDIV, PLL_SAI, "pllsai-q-div", "pllsai-q",
563+
{ CLK_SAIQ_PDIV, PLL_VCO_SAI, "pllsai-q-div", "pllsai-q",
564564
CLK_SET_RATE_PARENT, STM32F4_RCC_DCKCFGR, 8, 5, 0, NULL },
565565

566-
{ NO_IDX, PLL_SAI, "pllsai-r-div", "pllsai-r", CLK_SET_RATE_PARENT,
566+
{ NO_IDX, PLL_VCO_SAI, "pllsai-r-div", "pllsai-r", CLK_SET_RATE_PARENT,
567567
STM32F4_RCC_DCKCFGR, 16, 2, 0, post_divr_table },
568568
};
569569

@@ -1774,7 +1774,7 @@ static void __init stm32f4_rcc_init(struct device_node *np)
17741774
post_div->width,
17751775
post_div->flag_div,
17761776
post_div->div_table,
1777-
clks[post_div->pll_num],
1777+
clks[post_div->pll_idx],
17781778
&stm32f4_clk_lock);
17791779

17801780
if (post_div->idx != NO_IDX)

drivers/clk/hisilicon/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ config COMMON_CLK_HI3519
1818
config COMMON_CLK_HI3559A
1919
bool "Hi3559A Clock Driver"
2020
depends on ARCH_HISI || COMPILE_TEST
21+
select RESET_HISI
2122
default ARCH_HISI
2223
help
2324
Build the clock driver for hi3559a.

drivers/clk/qcom/clk-smd-rpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ DEFINE_CLK_SMD_RPM(msm8936, sysmmnoc_clk, sysmmnoc_a_clk, QCOM_SMD_RPM_BUS_CLK,
467467

468468
static struct clk_smd_rpm *msm8936_clks[] = {
469469
[RPM_SMD_PCNOC_CLK] = &msm8916_pcnoc_clk,
470-
[RPM_SMD_PCNOC_A_CLK] = &msm8916_pcnoc_clk,
470+
[RPM_SMD_PCNOC_A_CLK] = &msm8916_pcnoc_a_clk,
471471
[RPM_SMD_SNOC_CLK] = &msm8916_snoc_clk,
472472
[RPM_SMD_SNOC_A_CLK] = &msm8916_snoc_a_clk,
473473
[RPM_SMD_BIMC_CLK] = &msm8916_bimc_clk,

drivers/clk/tegra/clk-sdmmc-mux.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@ static void clk_sdmmc_mux_disable(struct clk_hw *hw)
194194
gate_ops->disable(gate_hw);
195195
}
196196

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+
197206
static void clk_sdmmc_mux_restore_context(struct clk_hw *hw)
198207
{
199208
struct clk_hw *parent = clk_hw_get_parent(hw);
@@ -218,6 +227,7 @@ static const struct clk_ops tegra_clk_sdmmc_mux_ops = {
218227
.is_enabled = clk_sdmmc_mux_is_enabled,
219228
.enable = clk_sdmmc_mux_enable,
220229
.disable = clk_sdmmc_mux_disable,
230+
.disable_unused = clk_sdmmc_mux_disable_unused,
221231
.restore_context = clk_sdmmc_mux_restore_context,
222232
};
223233

0 commit comments

Comments
 (0)