Skip to content

Commit 063c0e7

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 set of clk driver fixes that resolve issues for various SoCs. Most of these are incorrect clk data, like bad parent descriptions. When the clk tree is improperly described things don't work, like USB and UFS controllers, because clk frequencies are wonky. Here are the extra details: - Fix the parent of UFS reference clks on Qualcomm SC8280XP so that UFS works properly - Fix the clk ID for USB on AT91 RM9200 so the USB driver continues to probe - Stop using of_device_get_match_data() on the wrong device for a Samsung Exynos driver so it gets the proper clk data - Fix ExynosAutov9 binding - Fix the parent of the div4 clk on Exynos7885 - Stop calling runtime PM APIs from the Qualcomm GDSC driver directly as it leads to a lockdep splat and is just plain wrong because it violates runtime PM semantics by calling runtime PM APIs when the device has been runtime PM disabled" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: qcom: gcc-sc8280xp: add cxo as parent for three ufs ref clks ARM: at91: rm9200: fix usb device clock id clk: samsung: Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()" dt-bindings: clock: exynosautov9: fix reference to CMU_FSYS1 clk: qcom: gdsc: Remove direct runtime PM calls clk: samsung: exynos7885: Correct "div4" clock parents
2 parents ef4d3ea + f6abcc2 commit 063c0e7

File tree

8 files changed

+21
-64
lines changed

8 files changed

+21
-64
lines changed

Documentation/devicetree/bindings/clock/samsung,exynosautov9-clock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ allOf:
148148
items:
149149
- const: oscclk
150150
- const: dout_clkcmu_fsys1_bus
151-
- const: dout_clkcmu_fsys1_mmc_card
151+
- const: gout_clkcmu_fsys1_mmc_card
152152
- const: dout_clkcmu_fsys1_usbdrd
153153

154154
- if:

arch/arm/boot/dts/at91rm9200.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@
666666
compatible = "atmel,at91rm9200-udc";
667667
reg = <0xfffb0000 0x4000>;
668668
interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>;
669-
clocks = <&pmc PMC_TYPE_PERIPHERAL 11>, <&pmc PMC_TYPE_SYSTEM 2>;
669+
clocks = <&pmc PMC_TYPE_PERIPHERAL 11>, <&pmc PMC_TYPE_SYSTEM 1>;
670670
clock-names = "pclk", "hclk";
671671
status = "disabled";
672672
};

drivers/clk/at91/at91rm9200.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static const struct clk_pll_characteristics rm9200_pll_characteristics = {
4040
};
4141

4242
static const struct sck at91rm9200_systemck[] = {
43-
{ .n = "udpck", .p = "usbck", .id = 2 },
43+
{ .n = "udpck", .p = "usbck", .id = 1 },
4444
{ .n = "uhpck", .p = "usbck", .id = 4 },
4545
{ .n = "pck0", .p = "prog0", .id = 8 },
4646
{ .n = "pck1", .p = "prog1", .id = 9 },

drivers/clk/qcom/gcc-sc8280xp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5364,6 +5364,8 @@ static struct clk_branch gcc_ufs_1_card_clkref_clk = {
53645364
.enable_mask = BIT(0),
53655365
.hw.init = &(const struct clk_init_data) {
53665366
.name = "gcc_ufs_1_card_clkref_clk",
5367+
.parent_data = &gcc_parent_data_tcxo,
5368+
.num_parents = 1,
53675369
.ops = &clk_branch2_ops,
53685370
},
53695371
},
@@ -5432,6 +5434,8 @@ static struct clk_branch gcc_ufs_card_clkref_clk = {
54325434
.enable_mask = BIT(0),
54335435
.hw.init = &(const struct clk_init_data) {
54345436
.name = "gcc_ufs_card_clkref_clk",
5437+
.parent_data = &gcc_parent_data_tcxo,
5438+
.num_parents = 1,
54355439
.ops = &clk_branch2_ops,
54365440
},
54375441
},
@@ -5848,6 +5852,8 @@ static struct clk_branch gcc_ufs_ref_clkref_clk = {
58485852
.enable_mask = BIT(0),
58495853
.hw.init = &(const struct clk_init_data) {
58505854
.name = "gcc_ufs_ref_clkref_clk",
5855+
.parent_data = &gcc_parent_data_tcxo,
5856+
.num_parents = 1,
58515857
.ops = &clk_branch2_ops,
58525858
},
58535859
},

drivers/clk/qcom/gdsc.c

Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <linux/kernel.h>
1212
#include <linux/ktime.h>
1313
#include <linux/pm_domain.h>
14-
#include <linux/pm_runtime.h>
1514
#include <linux/regmap.h>
1615
#include <linux/regulator/consumer.h>
1716
#include <linux/reset-controller.h>
@@ -56,22 +55,6 @@ enum gdsc_status {
5655
GDSC_ON
5756
};
5857

59-
static int gdsc_pm_runtime_get(struct gdsc *sc)
60-
{
61-
if (!sc->dev)
62-
return 0;
63-
64-
return pm_runtime_resume_and_get(sc->dev);
65-
}
66-
67-
static int gdsc_pm_runtime_put(struct gdsc *sc)
68-
{
69-
if (!sc->dev)
70-
return 0;
71-
72-
return pm_runtime_put_sync(sc->dev);
73-
}
74-
7558
/* Returns 1 if GDSC status is status, 0 if not, and < 0 on error */
7659
static int gdsc_check_status(struct gdsc *sc, enum gdsc_status status)
7760
{
@@ -271,8 +254,9 @@ static void gdsc_retain_ff_on(struct gdsc *sc)
271254
regmap_update_bits(sc->regmap, sc->gdscr, mask, mask);
272255
}
273256

274-
static int _gdsc_enable(struct gdsc *sc)
257+
static int gdsc_enable(struct generic_pm_domain *domain)
275258
{
259+
struct gdsc *sc = domain_to_gdsc(domain);
276260
int ret;
277261

278262
if (sc->pwrsts == PWRSTS_ON)
@@ -328,22 +312,11 @@ static int _gdsc_enable(struct gdsc *sc)
328312
return 0;
329313
}
330314

331-
static int gdsc_enable(struct generic_pm_domain *domain)
315+
static int gdsc_disable(struct generic_pm_domain *domain)
332316
{
333317
struct gdsc *sc = domain_to_gdsc(domain);
334318
int ret;
335319

336-
ret = gdsc_pm_runtime_get(sc);
337-
if (ret)
338-
return ret;
339-
340-
return _gdsc_enable(sc);
341-
}
342-
343-
static int _gdsc_disable(struct gdsc *sc)
344-
{
345-
int ret;
346-
347320
if (sc->pwrsts == PWRSTS_ON)
348321
return gdsc_assert_reset(sc);
349322

@@ -388,18 +361,6 @@ static int _gdsc_disable(struct gdsc *sc)
388361
return 0;
389362
}
390363

391-
static int gdsc_disable(struct generic_pm_domain *domain)
392-
{
393-
struct gdsc *sc = domain_to_gdsc(domain);
394-
int ret;
395-
396-
ret = _gdsc_disable(sc);
397-
398-
gdsc_pm_runtime_put(sc);
399-
400-
return ret;
401-
}
402-
403364
static int gdsc_init(struct gdsc *sc)
404365
{
405366
u32 mask, val;
@@ -447,26 +408,21 @@ static int gdsc_init(struct gdsc *sc)
447408
return ret;
448409
}
449410

450-
/* ...and the power-domain */
451-
ret = gdsc_pm_runtime_get(sc);
452-
if (ret)
453-
goto err_disable_supply;
454-
455411
/*
456412
* Votable GDSCs can be ON due to Vote from other masters.
457413
* If a Votable GDSC is ON, make sure we have a Vote.
458414
*/
459415
if (sc->flags & VOTABLE) {
460416
ret = gdsc_update_collapse_bit(sc, false);
461417
if (ret)
462-
goto err_put_rpm;
418+
goto err_disable_supply;
463419
}
464420

465421
/* Turn on HW trigger mode if supported */
466422
if (sc->flags & HW_CTRL) {
467423
ret = gdsc_hwctrl(sc, true);
468424
if (ret < 0)
469-
goto err_put_rpm;
425+
goto err_disable_supply;
470426
}
471427

472428
/*
@@ -496,13 +452,10 @@ static int gdsc_init(struct gdsc *sc)
496452

497453
ret = pm_genpd_init(&sc->pd, NULL, !on);
498454
if (ret)
499-
goto err_put_rpm;
455+
goto err_disable_supply;
500456

501457
return 0;
502458

503-
err_put_rpm:
504-
if (on)
505-
gdsc_pm_runtime_put(sc);
506459
err_disable_supply:
507460
if (on && sc->rsupply)
508461
regulator_disable(sc->rsupply);
@@ -541,8 +494,6 @@ int gdsc_register(struct gdsc_desc *desc,
541494
for (i = 0; i < num; i++) {
542495
if (!scs[i])
543496
continue;
544-
if (pm_runtime_enabled(dev))
545-
scs[i]->dev = dev;
546497
scs[i]->regmap = regmap;
547498
scs[i]->rcdev = rcdev;
548499
ret = gdsc_init(scs[i]);

drivers/clk/qcom/gdsc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ struct reset_controller_dev;
3030
* @resets: ids of resets associated with this gdsc
3131
* @reset_count: number of @resets
3232
* @rcdev: reset controller
33-
* @dev: the device holding the GDSC, used for pm_runtime calls
3433
*/
3534
struct gdsc {
3635
struct generic_pm_domain pd;
@@ -74,7 +73,6 @@ struct gdsc {
7473

7574
const char *supply;
7675
struct regulator *rsupply;
77-
struct device *dev;
7876
};
7977

8078
struct gdsc_desc {

drivers/clk/samsung/clk-exynos-clkout.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,19 @@ MODULE_DEVICE_TABLE(of, exynos_clkout_ids);
8181
static int exynos_clkout_match_parent_dev(struct device *dev, u32 *mux_mask)
8282
{
8383
const struct exynos_clkout_variant *variant;
84+
const struct of_device_id *match;
8485

8586
if (!dev->parent) {
8687
dev_err(dev, "not instantiated from MFD\n");
8788
return -EINVAL;
8889
}
8990

90-
variant = of_device_get_match_data(dev->parent);
91-
if (!variant) {
91+
match = of_match_device(exynos_clkout_ids, dev->parent);
92+
if (!match) {
9293
dev_err(dev, "cannot match parent device\n");
9394
return -EINVAL;
9495
}
96+
variant = match->data;
9597

9698
*mux_mask = variant->mux_mask;
9799

drivers/clk/samsung/clk-exynos7885.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ static const struct samsung_div_clock top_div_clks[] __initconst = {
231231
CLK_CON_DIV_PLL_SHARED0_DIV2, 0, 1),
232232
DIV(CLK_DOUT_SHARED0_DIV3, "dout_shared0_div3", "fout_shared0_pll",
233233
CLK_CON_DIV_PLL_SHARED0_DIV3, 0, 2),
234-
DIV(CLK_DOUT_SHARED0_DIV4, "dout_shared0_div4", "fout_shared0_pll",
234+
DIV(CLK_DOUT_SHARED0_DIV4, "dout_shared0_div4", "dout_shared0_div2",
235235
CLK_CON_DIV_PLL_SHARED0_DIV4, 0, 1),
236236
DIV(CLK_DOUT_SHARED0_DIV5, "dout_shared0_div5", "fout_shared0_pll",
237237
CLK_CON_DIV_PLL_SHARED0_DIV5, 0, 3),
238238
DIV(CLK_DOUT_SHARED1_DIV2, "dout_shared1_div2", "fout_shared1_pll",
239239
CLK_CON_DIV_PLL_SHARED1_DIV2, 0, 1),
240240
DIV(CLK_DOUT_SHARED1_DIV3, "dout_shared1_div3", "fout_shared1_pll",
241241
CLK_CON_DIV_PLL_SHARED1_DIV3, 0, 2),
242-
DIV(CLK_DOUT_SHARED1_DIV4, "dout_shared1_div4", "fout_shared1_pll",
242+
DIV(CLK_DOUT_SHARED1_DIV4, "dout_shared1_div4", "dout_shared1_div2",
243243
CLK_CON_DIV_PLL_SHARED1_DIV4, 0, 1),
244244

245245
/* CORE */

0 commit comments

Comments
 (0)