* [PATCH 0/2] Fix up rk3288 smp cpu hotplug
@ 2014-10-10 22:25 Kever Yang
2014-10-10 22:25 ` [PATCH 1/2] ARM: rockchip: fix " Kever Yang
2014-10-10 22:25 ` [PATCH 2/2] ARM: dts: rockchip: add reset for CPU nodes Kever Yang
0 siblings, 2 replies; 4+ messages in thread
From: Kever Yang @ 2014-10-10 22:25 UTC (permalink / raw)
To: heiko
Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao,
linux-rockchip, Kever Yang, Ian Campbell, devicetree,
linux-kernel, Kumar Gala, Russell King, Rob Herring, Pawel Moll,
Mark Rutland, linux-arm-kernel
For the CA12/CA17 MPCore multiprocessor, the active processors might be
stalled when the individual processor is powered down.
For rk3288, we can avoid this prolbem by softreset the processor before
power it down.
Kever Yang (2):
ARM: rockchip: fix up rk3288 smp cpu hotplug
ARM: dts: rockchip: add reset for CPU nodes
arch/arm/boot/dts/rk3288.dtsi | 4 ++++
arch/arm/mach-rockchip/platsmp.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ARM: rockchip: fix up rk3288 smp cpu hotplug
2014-10-10 22:25 [PATCH 0/2] Fix up rk3288 smp cpu hotplug Kever Yang
@ 2014-10-10 22:25 ` Kever Yang
2014-10-11 18:12 ` Heiko Stübner
2014-10-10 22:25 ` [PATCH 2/2] ARM: dts: rockchip: add reset for CPU nodes Kever Yang
1 sibling, 1 reply; 4+ messages in thread
From: Kever Yang @ 2014-10-10 22:25 UTC (permalink / raw)
To: heiko
Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao,
linux-rockchip, Kever Yang, Russell King, linux-arm-kernel,
linux-kernel
This patch fix up the problem we met in rk3288 smp cpu hotplug.
It is a known issue for the CA12/CA17 MPCore multiprocessor that the active
processors might be stalled when the individual processor is powered down,
we can avoid this prolbem by softreset the processor before power it down.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
arch/arm/mach-rockchip/platsmp.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index d1f858e..5c08262 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -22,6 +22,8 @@
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
+#include <linux/reset.h>
+#include <linux/cpu.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h>
#include <asm/smp_scu.h>
@@ -53,11 +55,47 @@ static int pmu_power_domain_is_on(int pd)
return !(val & BIT(pd));
}
+struct reset_control *rockchip_get_core_reset(int cpu)
+{
+ struct device *dev = get_cpu_device(cpu);
+ struct device_node *np;
+
+ /* The cpu device is only available after the initial core bringup */
+ if (dev)
+ np = dev->of_node;
+ else
+ np = of_get_cpu_node(cpu, 0);
+
+ return of_reset_control_get(np, NULL);
+}
+
static int pmu_set_power_domain(int pd, bool on)
{
u32 val = (on) ? 0 : BIT(pd);
int ret;
+ /*
+ * We need to soft reset the cpu when we turn off the cpu power domain,
+ * or else the active processors might be stalled when the individual
+ * processor is powered down.
+ */
+ if (read_cpuid_part_number() != ARM_CPU_PART_CORTEX_A9) {
+ struct reset_control *rstc = rockchip_get_core_reset(pd);
+
+ if (IS_ERR(rstc)) {
+ pr_err("%s: could not get reset control for core %d\n",
+ __func__, pd);
+ return PTR_ERR(rstc);
+ }
+
+ if (on)
+ reset_control_deassert(rstc);
+ else
+ reset_control_assert(rstc);
+
+ reset_control_put(rstc);
+ }
+
ret = regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), val);
if (ret < 0) {
pr_err("%s: could not update power domain\n", __func__);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ARM: dts: rockchip: add reset for CPU nodes
2014-10-10 22:25 [PATCH 0/2] Fix up rk3288 smp cpu hotplug Kever Yang
2014-10-10 22:25 ` [PATCH 1/2] ARM: rockchip: fix " Kever Yang
@ 2014-10-10 22:25 ` Kever Yang
1 sibling, 0 replies; 4+ messages in thread
From: Kever Yang @ 2014-10-10 22:25 UTC (permalink / raw)
To: heiko
Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao,
linux-rockchip, Kever Yang, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Russell King, linux-arm-kernel,
devicetree, linux-kernel
This patch add reset for CPU nodes to use the reset controller.
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---
arch/arm/boot/dts/rk3288.dtsi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 5e9c56d..291014d 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -53,21 +53,25 @@
device_type = "cpu";
compatible = "arm,cortex-a12";
reg = <0x500>;
+ resets = <&cru SRST_CORE0>;
};
cpu@501 {
device_type = "cpu";
compatible = "arm,cortex-a12";
reg = <0x501>;
+ resets = <&cru SRST_CORE1>;
};
cpu@502 {
device_type = "cpu";
compatible = "arm,cortex-a12";
reg = <0x502>;
+ resets = <&cru SRST_CORE2>;
};
cpu@503 {
device_type = "cpu";
compatible = "arm,cortex-a12";
reg = <0x503>;
+ resets = <&cru SRST_CORE3>;
};
};
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ARM: rockchip: fix up rk3288 smp cpu hotplug
2014-10-10 22:25 ` [PATCH 1/2] ARM: rockchip: fix " Kever Yang
@ 2014-10-11 18:12 ` Heiko Stübner
0 siblings, 0 replies; 4+ messages in thread
From: Heiko Stübner @ 2014-10-11 18:12 UTC (permalink / raw)
To: Kever Yang
Cc: dianders, sonnyrao, addy.ke, cf, xjq, hj, huangtao,
linux-rockchip, Russell King, linux-arm-kernel, linux-kernel
Am Freitag, 10. Oktober 2014, 15:25:14 schrieb Kever Yang:
> This patch fix up the problem we met in rk3288 smp cpu hotplug.
> It is a known issue for the CA12/CA17 MPCore multiprocessor that the active
> processors might be stalled when the individual processor is powered down,
> we can avoid this prolbem by softreset the processor before power it down.
>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
without my Signed-off please
Also this should probably be folded into the core rk3288-smp patch (patch
5/6).
I was able to verify the fault very easily and also that this patch fixed it,
so the original smp patch should not introduce code known to produce breakage.
After this, also simply include the patch adding the resets in the dts to the
general series as patch 7 or so.
Heiko
> ---
>
> arch/arm/mach-rockchip/platsmp.c | 38
> ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+)
>
> diff --git a/arch/arm/mach-rockchip/platsmp.c
> b/arch/arm/mach-rockchip/platsmp.c index d1f858e..5c08262 100644
> --- a/arch/arm/mach-rockchip/platsmp.c
> +++ b/arch/arm/mach-rockchip/platsmp.c
> @@ -22,6 +22,8 @@
> #include <linux/regmap.h>
> #include <linux/mfd/syscon.h>
>
> +#include <linux/reset.h>
> +#include <linux/cpu.h>
> #include <asm/cacheflush.h>
> #include <asm/cp15.h>
> #include <asm/smp_scu.h>
> @@ -53,11 +55,47 @@ static int pmu_power_domain_is_on(int pd)
> return !(val & BIT(pd));
> }
>
> +struct reset_control *rockchip_get_core_reset(int cpu)
> +{
> + struct device *dev = get_cpu_device(cpu);
> + struct device_node *np;
> +
> + /* The cpu device is only available after the initial core bringup */
> + if (dev)
> + np = dev->of_node;
> + else
> + np = of_get_cpu_node(cpu, 0);
> +
> + return of_reset_control_get(np, NULL);
> +}
> +
> static int pmu_set_power_domain(int pd, bool on)
> {
> u32 val = (on) ? 0 : BIT(pd);
> int ret;
>
> + /*
> + * We need to soft reset the cpu when we turn off the cpu power domain,
> + * or else the active processors might be stalled when the individual
> + * processor is powered down.
> + */
> + if (read_cpuid_part_number() != ARM_CPU_PART_CORTEX_A9) {
> + struct reset_control *rstc = rockchip_get_core_reset(pd);
> +
> + if (IS_ERR(rstc)) {
> + pr_err("%s: could not get reset control for core %d\n",
> + __func__, pd);
> + return PTR_ERR(rstc);
> + }
> +
> + if (on)
> + reset_control_deassert(rstc);
> + else
> + reset_control_assert(rstc);
> +
> + reset_control_put(rstc);
> + }
> +
> ret = regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), val);
> if (ret < 0) {
> pr_err("%s: could not update power domain\n", __func__);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-11 18:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-10 22:25 [PATCH 0/2] Fix up rk3288 smp cpu hotplug Kever Yang
2014-10-10 22:25 ` [PATCH 1/2] ARM: rockchip: fix " Kever Yang
2014-10-11 18:12 ` Heiko Stübner
2014-10-10 22:25 ` [PATCH 2/2] ARM: dts: rockchip: add reset for CPU nodes Kever Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox