Commit b05d2792 authored by Ravi Patel's avatar Ravi Patel Committed by Manish Pandey
Browse files

xilinx: versal: Do not pass ACPU0 always in set_wakeup_source()



Existing code passes ACPU0 to LibPM as node_id in set_wakeup_source()
call because last suspending core will be ACPU0 in most of the case.

Now it may be possible that user may disable the ACPU0 using hot-plug
and after that it suspends Linux. So in that case ACPU0 will not be
last suspending core.

To overcome above scenario, pass the current running processor ID
while calling set_wakeup_source().
Signed-off-by: default avatarRavi Patel <ravi.patel@xilinx.com>
Signed-off-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Change-Id: If15354c2150b5bb1305b5f93ca4e8c7a81d59f0a
parent 7fc19b8e
/* /*
* Copyright (c) 2019, Xilinx, Inc. All rights reserved. * Copyright (c) 2019-2020, Xilinx, Inc. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -113,8 +113,9 @@ static enum pm_device_node_idx irq_to_pm_node_idx(unsigned int irq) ...@@ -113,8 +113,9 @@ static enum pm_device_node_idx irq_to_pm_node_idx(unsigned int irq)
/** /**
* pm_client_set_wakeup_sources - Set all devices with enabled interrupts as * pm_client_set_wakeup_sources - Set all devices with enabled interrupts as
* wake sources in the LibPM. * wake sources in the LibPM.
* @node_id: Node id of processor
*/ */
static void pm_client_set_wakeup_sources(void) static void pm_client_set_wakeup_sources(uint32_t node_id)
{ {
uint32_t reg_num; uint32_t reg_num;
uint32_t device_id; uint32_t device_id;
...@@ -147,7 +148,7 @@ static void pm_client_set_wakeup_sources(void) ...@@ -147,7 +148,7 @@ static void pm_client_set_wakeup_sources(void)
(!pm_wakeup_nodes_set[node_idx])) { (!pm_wakeup_nodes_set[node_idx])) {
/* Get device ID from node index */ /* Get device ID from node index */
device_id = PERIPH_DEVID(node_idx); device_id = PERIPH_DEVID(node_idx);
ret = pm_set_wakeup_source(XPM_DEVID_ACPU_0, ret = pm_set_wakeup_source(node_id,
device_id, 1); device_id, 1);
pm_wakeup_nodes_set[node_idx] = !ret; pm_wakeup_nodes_set[node_idx] = !ret;
} }
...@@ -167,7 +168,7 @@ void pm_client_suspend(const struct pm_proc *proc, unsigned int state) ...@@ -167,7 +168,7 @@ void pm_client_suspend(const struct pm_proc *proc, unsigned int state)
bakery_lock_get(&pm_client_secure_lock); bakery_lock_get(&pm_client_secure_lock);
if (state == PM_STATE_SUSPEND_TO_RAM) if (state == PM_STATE_SUSPEND_TO_RAM)
pm_client_set_wakeup_sources(); pm_client_set_wakeup_sources(proc->node_id);
/* Set powerdown request */ /* Set powerdown request */
mmio_write_32(FPD_APU_PWRCTL, mmio_read_32(FPD_APU_PWRCTL) | mmio_write_32(FPD_APU_PWRCTL, mmio_read_32(FPD_APU_PWRCTL) |
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment