* [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes
@ 2019-07-07 23:03 Dmitry Osipenko
2019-07-07 23:03 ` [PATCH v1 1/2] ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume() Dmitry Osipenko
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2019-07-07 23:03 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Peter De Schrijver
Cc: linux-tegra, linux-kernel
Hello,
This small series addresses two suspend-resume bugs: one affects Tegra30+
due to a typo in the code, other fixes CPU hang on Tegra30 specifically.
Please review and apply, thanks!
Dmitry Osipenko (2):
ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
ARM: tegra: Use WFE for power-gating on Tegra30
arch/arm/mach-tegra/reset-handler.S | 6 +++---
arch/arm/mach-tegra/sleep-tegra30.S | 4 +++-
drivers/soc/tegra/flowctrl.c | 19 +++++++++++++++++--
3 files changed, 23 insertions(+), 6 deletions(-)
--
2.22.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 1/2] ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
2019-07-07 23:03 [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
@ 2019-07-07 23:03 ` Dmitry Osipenko
2019-07-07 23:03 ` [PATCH v1 2/2] ARM: tegra: Use WFE for power-gating on Tegra30 Dmitry Osipenko
2019-07-23 1:28 ` [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2019-07-07 23:03 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Peter De Schrijver
Cc: linux-tegra, linux-kernel
There is an unfortunate typo in the code that results in writing to
FLOW_CTLR_HALT instead of FLOW_CTLR_CSR.
Cc: <stable@vger.kernel.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
arch/arm/mach-tegra/reset-handler.S | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index df44828a34d3..53123ae4ac3b 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -44,16 +44,16 @@ ENTRY(tegra_resume)
cmp r6, #TEGRA20
beq 1f @ Yes
/* Clear the flow controller flags for this CPU. */
- cpu_to_csr_reg r1, r0
+ cpu_to_csr_reg r3, r0
mov32 r2, TEGRA_FLOW_CTRL_BASE
- ldr r1, [r2, r1]
+ ldr r1, [r2, r3]
/* Clear event & intr flag */
orr r1, r1, \
#FLOW_CTRL_CSR_INTR_FLAG | FLOW_CTRL_CSR_EVENT_FLAG
movw r0, #0x3FFD @ enable, cluster_switch, immed, bitmaps
@ & ext flags for CPU power mgnt
bic r1, r1, r0
- str r1, [r2]
+ str r1, [r2, r3]
1:
mov32 r9, 0xc09
--
2.22.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 2/2] ARM: tegra: Use WFE for power-gating on Tegra30
2019-07-07 23:03 [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
2019-07-07 23:03 ` [PATCH v1 1/2] ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume() Dmitry Osipenko
@ 2019-07-07 23:03 ` Dmitry Osipenko
2019-07-23 1:28 ` [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2019-07-07 23:03 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Peter De Schrijver
Cc: linux-tegra, linux-kernel
Turned out that WFI doesn't work reliably on Tegra30 as a trigger for
the power-gating, it causes CPU hang under some circumstances like having
memory controller running of PLLP. The TRM doc states that WFI should be
used for the Big-Little "Cluster Switch", while WFE for the power-gating.
Hence let's use the WFE for CPU0 power-gating, like it is done for the
power-gating of a secondary cores. This fixes CPU hang after entering LP2
with memory running off PLLP.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
arch/arm/mach-tegra/sleep-tegra30.S | 4 +++-
drivers/soc/tegra/flowctrl.c | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-tegra/sleep-tegra30.S b/arch/arm/mach-tegra/sleep-tegra30.S
index e95e46d65e8c..2e42f2bc0630 100644
--- a/arch/arm/mach-tegra/sleep-tegra30.S
+++ b/arch/arm/mach-tegra/sleep-tegra30.S
@@ -683,10 +683,12 @@ tegra30_enter_sleep:
dsb
ldr r0, [r6, r2] /* memory barrier */
+ cmp r10, #TEGRA30
halted:
isb
dsb
- wfi /* CPU should be power gated here */
+ wfine /* CPU should be power gated here */
+ wfeeq
/* !!!FIXME!!! Implement halt failure handler */
b halted
diff --git a/drivers/soc/tegra/flowctrl.c b/drivers/soc/tegra/flowctrl.c
index b6bdeef33db1..b62ff4c1b997 100644
--- a/drivers/soc/tegra/flowctrl.c
+++ b/drivers/soc/tegra/flowctrl.c
@@ -91,8 +91,23 @@ void flowctrl_cpu_suspend_enter(unsigned int cpuid)
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFE_BITMAP;
/* clear wfi bitmap */
reg &= ~TEGRA30_FLOW_CTRL_CSR_WFI_BITMAP;
- /* pwr gating on wfi */
- reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid;
+
+ if (tegra_get_chip_id() == TEGRA30) {
+ /*
+ * The wfi doesn't work well on Tegra30 because
+ * CPU hangs under some odd circumstances after
+ * power-gating (like memory running off PLLP),
+ * hence use wfe that is working perfectly well.
+ * Note that Tegra30 TRM doc clearly stands that
+ * wfi should be used for "Cluster Switching",
+ * while wfe for the power-gating just like it is
+ * done on Tegra20.
+ */
+ reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid;
+ } else {
+ /* pwr gating on wfi */
+ reg |= TEGRA30_FLOW_CTRL_CSR_WFI_CPU0 << cpuid;
+ }
break;
}
reg |= FLOW_CTRL_CSR_INTR_FLAG; /* clear intr flag */
--
2.22.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes
2019-07-07 23:03 [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
2019-07-07 23:03 ` [PATCH v1 1/2] ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume() Dmitry Osipenko
2019-07-07 23:03 ` [PATCH v1 2/2] ARM: tegra: Use WFE for power-gating on Tegra30 Dmitry Osipenko
@ 2019-07-23 1:28 ` Dmitry Osipenko
2019-07-25 9:40 ` Peter De Schrijver
2 siblings, 1 reply; 6+ messages in thread
From: Dmitry Osipenko @ 2019-07-23 1:28 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Peter De Schrijver
Cc: linux-tegra, linux-kernel
08.07.2019 2:03, Dmitry Osipenko пишет:
> Hello,
>
> This small series addresses two suspend-resume bugs: one affects Tegra30+
> due to a typo in the code, other fixes CPU hang on Tegra30 specifically.
>
> Please review and apply, thanks!
>
> Dmitry Osipenko (2):
> ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
> ARM: tegra: Use WFE for power-gating on Tegra30
>
> arch/arm/mach-tegra/reset-handler.S | 6 +++---
> arch/arm/mach-tegra/sleep-tegra30.S | 4 +++-
> drivers/soc/tegra/flowctrl.c | 19 +++++++++++++++++--
> 3 files changed, 23 insertions(+), 6 deletions(-)
>
Hello Peter,
We were talking about these fixes on the IRC not so long time ago, does
it look good to you? Care to give an ACK?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes
2019-07-23 1:28 ` [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
@ 2019-07-25 9:40 ` Peter De Schrijver
2019-07-25 13:43 ` Dmitry Osipenko
0 siblings, 1 reply; 6+ messages in thread
From: Peter De Schrijver @ 2019-07-25 9:40 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: Thierry Reding, Jonathan Hunter, linux-tegra, linux-kernel
On Tue, Jul 23, 2019 at 04:28:35AM +0300, Dmitry Osipenko wrote:
> 08.07.2019 2:03, Dmitry Osipenko пишет:
> > Hello,
> >
> > This small series addresses two suspend-resume bugs: one affects Tegra30+
> > due to a typo in the code, other fixes CPU hang on Tegra30 specifically.
> >
> > Please review and apply, thanks!
> >
> > Dmitry Osipenko (2):
> > ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
> > ARM: tegra: Use WFE for power-gating on Tegra30
> >
> > arch/arm/mach-tegra/reset-handler.S | 6 +++---
> > arch/arm/mach-tegra/sleep-tegra30.S | 4 +++-
> > drivers/soc/tegra/flowctrl.c | 19 +++++++++++++++++--
> > 3 files changed, 23 insertions(+), 6 deletions(-)
> >
>
> Hello Peter,
>
> We were talking about these fixes on the IRC not so long time ago, does
> it look good to you? Care to give an ACK?
Acked-By Peter De Schrijver <pdeschrijver@nvidia.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes
2019-07-25 9:40 ` Peter De Schrijver
@ 2019-07-25 13:43 ` Dmitry Osipenko
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Osipenko @ 2019-07-25 13:43 UTC (permalink / raw)
To: Peter De Schrijver
Cc: Thierry Reding, Jonathan Hunter, linux-tegra, linux-kernel
25.07.2019 12:40, Peter De Schrijver пишет:
> On Tue, Jul 23, 2019 at 04:28:35AM +0300, Dmitry Osipenko wrote:
>> 08.07.2019 2:03, Dmitry Osipenko пишет:
>>> Hello,
>>>
>>> This small series addresses two suspend-resume bugs: one affects Tegra30+
>>> due to a typo in the code, other fixes CPU hang on Tegra30 specifically.
>>>
>>> Please review and apply, thanks!
>>>
>>> Dmitry Osipenko (2):
>>> ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume()
>>> ARM: tegra: Use WFE for power-gating on Tegra30
>>>
>>> arch/arm/mach-tegra/reset-handler.S | 6 +++---
>>> arch/arm/mach-tegra/sleep-tegra30.S | 4 +++-
>>> drivers/soc/tegra/flowctrl.c | 19 +++++++++++++++++--
>>> 3 files changed, 23 insertions(+), 6 deletions(-)
>>>
>>
>> Hello Peter,
>>
>> We were talking about these fixes on the IRC not so long time ago, does
>> it look good to you? Care to give an ACK?
>
> Acked-By Peter De Schrijver <pdeschrijver@nvidia.com>
>
Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-07-25 13:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-07 23:03 [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
2019-07-07 23:03 ` [PATCH v1 1/2] ARM: tegra: Fix FLOW_CTLR_HALT register clobbering by tegra_resume() Dmitry Osipenko
2019-07-07 23:03 ` [PATCH v1 2/2] ARM: tegra: Use WFE for power-gating on Tegra30 Dmitry Osipenko
2019-07-23 1:28 ` [PATCH v1 0/2] Tegra30+ CPU suspend-resume bug-fixes Dmitry Osipenko
2019-07-25 9:40 ` Peter De Schrijver
2019-07-25 13:43 ` Dmitry Osipenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).