soc: fixes for 7.3, part 3
Two more small fixes came in, both addressing corner cases in platform specific code: the microchip mpfs system controller probe and the CPU power management on 32-bit rockchips SoCs. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmorLtUACgkQmmx57+YA GNm00xAAsYhcrY71KndI6OCLG/j8/WXd544Ghu/18JTVAzBiSug4KRtBfPaMCzAK ZyPX/G5SqihSYOTZ8ETMUSFasde7AyHE7UphB5TMH5uesPjjKdToGMVWnhjVpY7y 3ECYSsbkWw0p8FHwh//utRxThwSaK0wnJrb2Q465Wf9URktBrQ5jGltfOow8+jji nLMZ5UpQ21tqQP0qkPkusIDqQKabfcFzjjzuj+2e0BCFZcxLChZXO+xxfTYjkMjt eOzVuN75QIbRK1QVc9aHo+xs7pFqR969tNK7889aSXLUi2UzyFy+32pPxeZQVyWB vTHsx5/RqhIvu9BwSHPNTOSYhjS6EmYR5PPOyB74uhMnhwCtjfHEiP28K9J5ROfC FVBIAJvb7w4aLoBcxQoI3wroCzv22RV4wiy+FPvUX8RT0kZ1D4aj0N0x1SDxoJ1I mak2Cf5m4vRfJ1PIQroxX3hn0M36ayp4Z7kKX8CAol8fc8fUanXRy+6VN34IByiC c54Hlt6xNaOBVm7xC1tuONgvRRmoTI8RvtRK9uvOAyiqx5hjNDuTuhXGwG/WApYL PTC7Yzmqb5Hj6FhuCsG0IO32DzHY6E2lBCsnpYjPDDo41oYDM+ALFJ4w67d6rfgf Ns9phfPVzgNJF2i/r1rU26auN+zg4IgzI+hMbkzxsVNLJ4giBoU= =4BDQ -----END PGP SIGNATURE----- Merge tag 'soc-fixes-7.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull SoC fixes from Arnd Bergmann: "Two more small fixes came in, both addressing corner cases in platform specific code: the microchip mpfs system controller probe and the CPU power management on 32-bit rockchips SoCs" * tag 'soc-fixes-7.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: ARM: rockchip: keep reset control around soc: microchip: mpfs-sys-controller: fix resource leak on probe error
This commit is contained in:
commit
fd41dc46db
2 changed files with 14 additions and 8 deletions
|
|
@ -34,6 +34,7 @@ static int ncores;
|
|||
|
||||
static struct regmap *pmu;
|
||||
static int has_pmu = true;
|
||||
static struct reset_control *cpu_rstc[4];
|
||||
|
||||
static int pmu_power_domain_is_on(int pd)
|
||||
{
|
||||
|
|
@ -64,9 +65,11 @@ static struct reset_control *rockchip_get_core_reset(int cpu)
|
|||
static int pmu_set_power_domain(int pd, bool on)
|
||||
{
|
||||
u32 val = (on) ? 0 : BIT(pd);
|
||||
struct reset_control *rstc = rockchip_get_core_reset(pd);
|
||||
struct reset_control *rstc;
|
||||
int ret;
|
||||
|
||||
rstc = pd < ARRAY_SIZE(cpu_rstc) ? cpu_rstc[pd] : ERR_PTR(-EINVAL);
|
||||
|
||||
if (IS_ERR(rstc) && read_cpuid_part() != ARM_CPU_PART_CORTEX_A9) {
|
||||
pr_err("%s: could not get reset control for core %d\n",
|
||||
__func__, pd);
|
||||
|
|
@ -100,11 +103,8 @@ static int pmu_set_power_domain(int pd, bool on)
|
|||
}
|
||||
}
|
||||
|
||||
if (!IS_ERR(rstc)) {
|
||||
if (on)
|
||||
reset_control_deassert(rstc);
|
||||
reset_control_put(rstc);
|
||||
}
|
||||
if (!IS_ERR(rstc) && on)
|
||||
reset_control_deassert(rstc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -312,6 +312,10 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
|
|||
ncores = ((l2ctlr >> 24) & 0x3) + 1;
|
||||
}
|
||||
|
||||
/* Collect cpu core reset control for each core */
|
||||
for (i = 0; i < ncores; i++)
|
||||
cpu_rstc[i] = rockchip_get_core_reset(i);
|
||||
|
||||
/* Make sure that all cores except the first are really off */
|
||||
for (i = 1; i < ncores; i++)
|
||||
pmu_set_power_domain(0 + i, false);
|
||||
|
|
|
|||
|
|
@ -158,8 +158,8 @@ no_flash:
|
|||
|
||||
of_data = (struct mpfs_syscon_config *) device_get_match_data(dev);
|
||||
if (!of_data) {
|
||||
dev_err(dev, "Error getting match data\n");
|
||||
return -EINVAL;
|
||||
ret = dev_err_probe(dev, -EINVAL, "Error getting match data\n");
|
||||
goto out_free_channel;
|
||||
}
|
||||
|
||||
for (i = 0; i < of_data->nb_subdevs; i++) {
|
||||
|
|
@ -173,6 +173,8 @@ no_flash:
|
|||
|
||||
return 0;
|
||||
|
||||
out_free_channel:
|
||||
mbox_free_channel(sys_controller->chan);
|
||||
out_free:
|
||||
kfree(sys_controller);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue