Skip to content

Commit 8b35a3b

Browse files
committed
Merge tag 'pmdomain-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain updates from Ulf Hansson: "pmdomain core: - Don't clear suspended_count at genpd_prepare() - Update the rejected/usage counters at system suspend too pmdomain providers: - ti-sci: Fix duplicate PD referrals - mediatek: Add MT8188 buck isolation setting - renesas: Add R-Car M3-W power-off delay quirk - renesas: Split R-Car M3-W and M3-W+ sub-drivers cpuidle-psci: - Update MAINTAINERS to set a git for DT IDLE PM DOMAIN/ARM PSCI PM DOMAIN - Update init level to core_initcall() - Drop superfluous wrappers psci_dt_attach|detach_cpu()" * tag 'pmdomain-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: pmdomain: ti-sci: Fix duplicate PD referrals pmdomain: core: Don't clear suspended_count at genpd_prepare() pmdomain: core: Update the rejected/usage counters at system suspend too pmdomain: renesas: rcar-sysc: Add R-Car M3-W power-off delay quirk pmdomain: renesas: rcar-sysc: Remove rcar_sysc_nullify() helper pmdomain: renesas: rcar-sysc: Split R-Car M3-W and M3-W+ sub-drivers pmdomain: renesas: rcar-sysc: Absorb rcar_sysc_ch into rcar_sysc_pd MAINTAINERS: Add a git for the DT IDLE PM DOMAIN MAINTAINERS: Add a git for the ARM PSCI PM DOMAIN cpuidle: psci: Update init level to core_initcall() cpuidle: psci: Drop superfluous wrappers psci_dt_attach|detach_cpu() pmdomain: mediatek: Add MT8188 buck isolation setting pmdomain: mediatek: scpsys: drop driver owner assignment
2 parents 6fd600d + d88ea30 commit 8b35a3b

File tree

13 files changed

+127
-109
lines changed

13 files changed

+127
-109
lines changed

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5658,13 +5658,15 @@ M: Ulf Hansson <[email protected]>
56585658
56595659
L: [email protected] (moderated for non-subscribers)
56605660
S: Supported
5661+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git
56615662
F: drivers/cpuidle/cpuidle-psci-domain.c
56625663
F: drivers/cpuidle/cpuidle-psci.h
56635664

56645665
CPUIDLE DRIVER - DT IDLE PM DOMAIN
56655666
M: Ulf Hansson <[email protected]>
56665667
56675668
S: Supported
5669+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm.git
56685670
F: drivers/cpuidle/dt_idle_genpd.c
56695671
F: drivers/cpuidle/dt_idle_genpd.h
56705672

drivers/cpuidle/cpuidle-psci-domain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/string.h>
2121

2222
#include "cpuidle-psci.h"
23+
#include "dt_idle_genpd.h"
2324

2425
struct psci_pd_provider {
2526
struct list_head link;
@@ -200,4 +201,4 @@ static int __init psci_idle_init_domains(void)
200201
{
201202
return platform_driver_register(&psci_cpuidle_domain_driver);
202203
}
203-
subsys_initcall(psci_idle_init_domains);
204+
core_initcall(psci_idle_init_domains);

drivers/cpuidle/cpuidle-psci.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include "cpuidle-psci.h"
3030
#include "dt_idle_states.h"
31+
#include "dt_idle_genpd.h"
3132

3233
struct psci_cpuidle_data {
3334
u32 *psci_states;
@@ -224,7 +225,7 @@ static int psci_dt_cpu_init_topology(struct cpuidle_driver *drv,
224225
if (IS_ENABLED(CONFIG_PREEMPT_RT))
225226
return 0;
226227

227-
data->dev = psci_dt_attach_cpu(cpu);
228+
data->dev = dt_idle_attach_cpu(cpu, "psci");
228229
if (IS_ERR_OR_NULL(data->dev))
229230
return PTR_ERR_OR_ZERO(data->dev);
230231

@@ -311,7 +312,7 @@ static void psci_cpu_deinit_idle(int cpu)
311312
{
312313
struct psci_cpuidle_data *data = per_cpu_ptr(&psci_cpuidle_data, cpu);
313314

314-
psci_dt_detach_cpu(data->dev);
315+
dt_idle_detach_cpu(data->dev);
315316
psci_cpuidle_use_cpuhp = false;
316317
}
317318

drivers/cpuidle/cpuidle-psci.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,9 @@
33
#ifndef __CPUIDLE_PSCI_H
44
#define __CPUIDLE_PSCI_H
55

6-
struct device;
76
struct device_node;
87

98
void psci_set_domain_state(u32 state);
109
int psci_dt_parse_state_node(struct device_node *np, u32 *state);
1110

12-
#ifdef CONFIG_ARM_PSCI_CPUIDLE_DOMAIN
13-
14-
#include "dt_idle_genpd.h"
15-
16-
static inline struct device *psci_dt_attach_cpu(int cpu)
17-
{
18-
return dt_idle_attach_cpu(cpu, "psci");
19-
}
20-
21-
static inline void psci_dt_detach_cpu(struct device *dev)
22-
{
23-
dt_idle_detach_cpu(dev);
24-
}
25-
26-
#else
27-
static inline struct device *psci_dt_attach_cpu(int cpu) { return NULL; }
28-
static inline void psci_dt_detach_cpu(struct device *dev) { }
29-
#endif
30-
3111
#endif /* __CPUIDLE_PSCI_H */

drivers/pmdomain/core.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,12 @@ static void genpd_sync_power_off(struct generic_pm_domain *genpd, bool use_lock,
11781178

11791179
/* Choose the deepest state when suspending */
11801180
genpd->state_idx = genpd->state_count - 1;
1181-
if (_genpd_power_off(genpd, false))
1181+
if (_genpd_power_off(genpd, false)) {
1182+
genpd->states[genpd->state_idx].rejected++;
11821183
return;
1184+
} else {
1185+
genpd->states[genpd->state_idx].usage++;
1186+
}
11831187

11841188
genpd->status = GENPD_STATE_OFF;
11851189

@@ -1251,10 +1255,7 @@ static int genpd_prepare(struct device *dev)
12511255
return -EINVAL;
12521256

12531257
genpd_lock(genpd);
1254-
1255-
if (genpd->prepared_count++ == 0)
1256-
genpd->suspended_count = 0;
1257-
1258+
genpd->prepared_count++;
12581259
genpd_unlock(genpd);
12591260

12601261
ret = pm_generic_prepare(dev);

drivers/pmdomain/mediatek/mt8188-pm-domains.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = {
175175
.ctl_offs = 0x35C,
176176
.pwr_sta_offs = 0x16C,
177177
.pwr_sta2nd_offs = 0x170,
178+
.ext_buck_iso_offs = 0x3EC,
179+
.ext_buck_iso_mask = BIT(10),
178180
.bp_cfg = {
179181
BUS_PROT_WR(INFRA,
180182
MT8188_TOP_AXI_PROT_EN_2_ADSP_AO_STEP1,
@@ -187,7 +189,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = {
187189
MT8188_TOP_AXI_PROT_EN_2_CLR,
188190
MT8188_TOP_AXI_PROT_EN_2_STA),
189191
},
190-
.caps = MTK_SCPD_ALWAYS_ON,
192+
.caps = MTK_SCPD_ALWAYS_ON | MTK_SCPD_EXT_BUCK_ISO,
191193
},
192194
[MT8188_POWER_DOMAIN_ADSP_INFRA] = {
193195
.name = "adsp_infra",
@@ -524,6 +526,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = {
524526
.ctl_offs = 0x3A4,
525527
.pwr_sta_offs = 0x16C,
526528
.pwr_sta2nd_offs = 0x170,
529+
.ext_buck_iso_offs = 0x3EC,
530+
.ext_buck_iso_mask = BIT(12),
527531
.bp_cfg = {
528532
BUS_PROT_WR(INFRA,
529533
MT8188_TOP_AXI_PROT_EN_MM_IMG_VCORE_STEP1,
@@ -541,7 +545,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = {
541545
MT8188_TOP_AXI_PROT_EN_MM_2_CLR,
542546
MT8188_TOP_AXI_PROT_EN_MM_2_STA),
543547
},
544-
.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
548+
.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY |
549+
MTK_SCPD_EXT_BUCK_ISO,
545550
},
546551
[MT8188_POWER_DOMAIN_IMG_MAIN] = {
547552
.name = "img_main",
@@ -591,6 +596,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = {
591596
.ctl_offs = 0x3A0,
592597
.pwr_sta_offs = 0x16C,
593598
.pwr_sta2nd_offs = 0x170,
599+
.ext_buck_iso_offs = 0x3EC,
600+
.ext_buck_iso_mask = BIT(11),
594601
.bp_cfg = {
595602
BUS_PROT_WR(INFRA,
596603
MT8188_TOP_AXI_PROT_EN_MM_CAM_VCORE_STEP1,
@@ -618,7 +625,8 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8188[] = {
618625
MT8188_TOP_AXI_PROT_EN_MM_2_CLR,
619626
MT8188_TOP_AXI_PROT_EN_MM_2_STA),
620627
},
621-
.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
628+
.caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY |
629+
MTK_SCPD_EXT_BUCK_ISO,
622630
},
623631
[MT8188_POWER_DOMAIN_CAM_MAIN] = {
624632
.name = "cam_main",

drivers/pmdomain/mediatek/mtk-scpsys.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,6 @@ static struct platform_driver scpsys_drv = {
11381138
.driver = {
11391139
.name = "mtk-scpsys",
11401140
.suppress_bind_attrs = true,
1141-
.owner = THIS_MODULE,
11421141
.of_match_table = of_scpsys_match_tbl,
11431142
},
11441143
};

drivers/pmdomain/renesas/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ obj-$(CONFIG_SYSC_R8A7791) += r8a7791-sysc.o
1414
obj-$(CONFIG_SYSC_R8A7792) += r8a7792-sysc.o
1515
obj-$(CONFIG_SYSC_R8A7794) += r8a7794-sysc.o
1616
obj-$(CONFIG_SYSC_R8A7795) += r8a7795-sysc.o
17-
obj-$(CONFIG_SYSC_R8A77960) += r8a7796-sysc.o
18-
obj-$(CONFIG_SYSC_R8A77961) += r8a7796-sysc.o
17+
obj-$(CONFIG_SYSC_R8A77960) += r8a77960-sysc.o
18+
obj-$(CONFIG_SYSC_R8A77961) += r8a77961-sysc.o
1919
obj-$(CONFIG_SYSC_R8A77965) += r8a77965-sysc.o
2020
obj-$(CONFIG_SYSC_R8A77970) += r8a77970-sysc.o
2121
obj-$(CONFIG_SYSC_R8A77980) += r8a77980-sysc.o
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Renesas R-Car M3-W System Controller
4+
*
5+
* Copyright (C) 2016 Glider bvba
6+
* Copyright (C) 2018-2019 Renesas Electronics Corporation
7+
*/
8+
9+
#include <linux/bits.h>
10+
#include <linux/kernel.h>
11+
12+
#include <dt-bindings/power/r8a7796-sysc.h>
13+
14+
#include "rcar-sysc.h"
15+
16+
static const struct rcar_sysc_area r8a77960_areas[] __initconst = {
17+
{ "always-on", 0, 0, R8A7796_PD_ALWAYS_ON, -1, PD_ALWAYS_ON },
18+
{ "ca57-scu", 0x1c0, 0, R8A7796_PD_CA57_SCU, R8A7796_PD_ALWAYS_ON,
19+
PD_SCU },
20+
{ "ca57-cpu0", 0x80, 0, R8A7796_PD_CA57_CPU0, R8A7796_PD_CA57_SCU,
21+
PD_CPU_NOCR },
22+
{ "ca57-cpu1", 0x80, 1, R8A7796_PD_CA57_CPU1, R8A7796_PD_CA57_SCU,
23+
PD_CPU_NOCR },
24+
{ "ca53-scu", 0x140, 0, R8A7796_PD_CA53_SCU, R8A7796_PD_ALWAYS_ON,
25+
PD_SCU },
26+
{ "ca53-cpu0", 0x200, 0, R8A7796_PD_CA53_CPU0, R8A7796_PD_CA53_SCU,
27+
PD_CPU_NOCR },
28+
{ "ca53-cpu1", 0x200, 1, R8A7796_PD_CA53_CPU1, R8A7796_PD_CA53_SCU,
29+
PD_CPU_NOCR },
30+
{ "ca53-cpu2", 0x200, 2, R8A7796_PD_CA53_CPU2, R8A7796_PD_CA53_SCU,
31+
PD_CPU_NOCR },
32+
{ "ca53-cpu3", 0x200, 3, R8A7796_PD_CA53_CPU3, R8A7796_PD_CA53_SCU,
33+
PD_CPU_NOCR },
34+
{ "cr7", 0x240, 0, R8A7796_PD_CR7, R8A7796_PD_ALWAYS_ON },
35+
{ "a3vc", 0x380, 0, R8A7796_PD_A3VC, R8A7796_PD_ALWAYS_ON,
36+
PD_OFF_DELAY },
37+
{ "a2vc0", 0x3c0, 0, R8A7796_PD_A2VC0, R8A7796_PD_A3VC },
38+
{ "a2vc1", 0x3c0, 1, R8A7796_PD_A2VC1, R8A7796_PD_A3VC },
39+
{ "3dg-a", 0x100, 0, R8A7796_PD_3DG_A, R8A7796_PD_ALWAYS_ON },
40+
{ "3dg-b", 0x100, 1, R8A7796_PD_3DG_B, R8A7796_PD_3DG_A },
41+
{ "a3ir", 0x180, 0, R8A7796_PD_A3IR, R8A7796_PD_ALWAYS_ON,
42+
PD_OFF_DELAY },
43+
};
44+
45+
46+
const struct rcar_sysc_info r8a77960_sysc_info __initconst = {
47+
.areas = r8a77960_areas,
48+
.num_areas = ARRAY_SIZE(r8a77960_areas),
49+
};
Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/*
3-
* Renesas R-Car M3-W/W+ System Controller
3+
* Renesas R-Car M3-W+ System Controller
44
*
55
* Copyright (C) 2016 Glider bvba
66
* Copyright (C) 2018-2019 Renesas Electronics Corporation
@@ -13,7 +13,7 @@
1313

1414
#include "rcar-sysc.h"
1515

16-
static struct rcar_sysc_area r8a7796_areas[] __initdata = {
16+
static const struct rcar_sysc_area r8a77961_areas[] __initconst = {
1717
{ "always-on", 0, 0, R8A7796_PD_ALWAYS_ON, -1, PD_ALWAYS_ON },
1818
{ "ca57-scu", 0x1c0, 0, R8A7796_PD_CA57_SCU, R8A7796_PD_ALWAYS_ON,
1919
PD_SCU },
@@ -33,35 +33,15 @@ static struct rcar_sysc_area r8a7796_areas[] __initdata = {
3333
PD_CPU_NOCR },
3434
{ "cr7", 0x240, 0, R8A7796_PD_CR7, R8A7796_PD_ALWAYS_ON },
3535
{ "a3vc", 0x380, 0, R8A7796_PD_A3VC, R8A7796_PD_ALWAYS_ON },
36-
{ "a2vc0", 0x3c0, 0, R8A7796_PD_A2VC0, R8A7796_PD_A3VC },
3736
{ "a2vc1", 0x3c0, 1, R8A7796_PD_A2VC1, R8A7796_PD_A3VC },
3837
{ "3dg-a", 0x100, 0, R8A7796_PD_3DG_A, R8A7796_PD_ALWAYS_ON },
3938
{ "3dg-b", 0x100, 1, R8A7796_PD_3DG_B, R8A7796_PD_3DG_A },
4039
{ "a3ir", 0x180, 0, R8A7796_PD_A3IR, R8A7796_PD_ALWAYS_ON },
4140
};
4241

43-
44-
#ifdef CONFIG_SYSC_R8A77960
45-
const struct rcar_sysc_info r8a77960_sysc_info __initconst = {
46-
.areas = r8a7796_areas,
47-
.num_areas = ARRAY_SIZE(r8a7796_areas),
48-
};
49-
#endif /* CONFIG_SYSC_R8A77960 */
50-
51-
#ifdef CONFIG_SYSC_R8A77961
52-
static int __init r8a77961_sysc_init(void)
53-
{
54-
rcar_sysc_nullify(r8a7796_areas, ARRAY_SIZE(r8a7796_areas),
55-
R8A7796_PD_A2VC0);
56-
57-
return 0;
58-
}
59-
6042
const struct rcar_sysc_info r8a77961_sysc_info __initconst = {
61-
.init = r8a77961_sysc_init,
62-
.areas = r8a7796_areas,
63-
.num_areas = ARRAY_SIZE(r8a7796_areas),
43+
.areas = r8a77961_areas,
44+
.num_areas = ARRAY_SIZE(r8a77961_areas),
6445
.extmask_offs = 0x2f8,
6546
.extmask_val = BIT(0),
6647
};
67-
#endif /* CONFIG_SYSC_R8A77961 */

0 commit comments

Comments
 (0)