mbox series

[v2,0/2] Fix hang due to CPU BW request as BPMP suspended

Message ID 20231009100557.18224-1-sumitg@nvidia.com
Headers show
Series Fix hang due to CPU BW request as BPMP suspended | expand

Message

Sumit Gupta Oct. 9, 2023, 10:05 a.m. UTC
This patch set fixes hang during system resume which started coming
after adding Memory Interconnect and OPP support to the Tegra194 CPUFREQ
in below change:
 f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth").

Tegra194 CPUFREQ driver uses 'CPUFREQ_NEED_INITIAL_FREQ_CHECK' flag
which causes a CPU frequency set request from the 'cpuhp_cpufreq_online'
hotplug notifier during resume. The CPU frequency set call also triggers
a DRAM bandwidth set request but the BPMP driver hasn't resumed yet
which results in hang during resume.

Fix this by resetting the BPMP IPC channels inside tegra_bpmp_transfer*()
API if the bandwidth request came from CPU clusters and the BPMP driver
is still suspended.

---
v[1] -> v2:
- add suspend hook instead of reset hook based approach.
- add suspended instead of needs_reset flag in 'struct tegra_bpmp'.
- add flags field to 'struct tegra_bpmp_message'.
- set TEGRA_BPMP_MESSAGE_RESET flag from MC driver for CPU BW request.
- use suspended and flags to reset BPMP IPC early on resume.

Sumit Gupta (1):
  firmware: tegra: add suspend hook and reset BPMP IPC early on resume

Thierry Reding (1):
  memory: tegra: set BPMP msg flags to reset IPC channels

 drivers/firmware/tegra/bpmp.c   | 30 ++++++++++++++++++++++++++++++
 drivers/memory/tegra/tegra234.c |  4 ++++
 include/soc/tegra/bpmp.h        |  6 ++++++
 3 files changed, 40 insertions(+)

[1] https://lore.kernel.org/linux-tegra/20230830115829.23977-1-sumitg@nvidia.com/

Comments

Thierry Reding Oct. 13, 2023, 12:25 p.m. UTC | #1
From: Thierry Reding <treding@nvidia.com>


On Mon, 09 Oct 2023 15:35:55 +0530, Sumit Gupta wrote:
> This patch set fixes hang during system resume which started coming
> after adding Memory Interconnect and OPP support to the Tegra194 CPUFREQ
> in below change:
>  f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth").
> 
> Tegra194 CPUFREQ driver uses 'CPUFREQ_NEED_INITIAL_FREQ_CHECK' flag
> which causes a CPU frequency set request from the 'cpuhp_cpufreq_online'
> hotplug notifier during resume. The CPU frequency set call also triggers
> a DRAM bandwidth set request but the BPMP driver hasn't resumed yet
> which results in hang during resume.
> 
> [...]

Applied, thanks!

[2/2] memory: tegra: set BPMP msg flags to reset IPC channels
      (no commit info)

Best regards,
Thierry Reding Oct. 13, 2023, 12:36 p.m. UTC | #2
On Fri, Oct 13, 2023 at 02:25:12PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> 
> On Mon, 09 Oct 2023 15:35:55 +0530, Sumit Gupta wrote:
> > This patch set fixes hang during system resume which started coming
> > after adding Memory Interconnect and OPP support to the Tegra194 CPUFREQ
> > in below change:
> >  f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth").
> > 
> > Tegra194 CPUFREQ driver uses 'CPUFREQ_NEED_INITIAL_FREQ_CHECK' flag
> > which causes a CPU frequency set request from the 'cpuhp_cpufreq_online'
> > hotplug notifier during resume. The CPU frequency set call also triggers
> > a DRAM bandwidth set request but the BPMP driver hasn't resumed yet
> > which results in hang during resume.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [2/2] memory: tegra: set BPMP msg flags to reset IPC channels
>       (no commit info)

For the record, I've actually applied both patches, but applying them to
different branches (i.e. resulting in two subsets for the same series)
seems to have confused b4.

Thierry