fix(xilinx): avoid unexpected variable update

The commit 50ab13577f ("fix(xilinx): typecast expression to match
data type") introduced a change where the isenabler1 variable is
modified within the loop iterating over GICD_ISENABLER registers.
Instead of computing the offset from the base address for each
register, the offset is accumulated incorrectly, leading to an
incorrect register read.

As a result, some GIC enablers, including the RTC device were missed,
so pm_set_wakeup_source was not called for them and the
suspend-resume use case was failed because of that.

Fix the logic to ensure the correct offset calculation for each
iteration, preserving the intended behavior.

Fixes: 50ab13577f fix(xilinx): typecast expression to match data type
Change-Id: Iec5bafcbde21078545a37259b2cf0353585ef1fa
Signed-off-by: Madhav Bhatt <madhav.bhatt@amd.com>
Signed-off-by: Ronak Jain <ronak.jain@amd.com>
This commit is contained in:
Madhav Bhatt 2025-03-03 22:50:01 -08:00 committed by Ronak Jain
parent d153bcf427
commit b3d25dca86

View file

@ -56,8 +56,7 @@ void pm_client_set_wakeup_sources(uint32_t node_id)
for (reg_num = 0U; reg_num < NUM_GICD_ISENABLER; reg_num++) { for (reg_num = 0U; reg_num < NUM_GICD_ISENABLER; reg_num++) {
uint32_t base_irq = reg_num << ISENABLER_SHIFT; uint32_t base_irq = reg_num << ISENABLER_SHIFT;
isenabler1 += (reg_num << 2); uint32_t reg = mmio_read_32((uint64_t)(isenabler1 + (reg_num << 2)));
uint32_t reg = mmio_read_32((uint64_t)isenabler1);
if (reg == 0U) { if (reg == 0U) {
continue; continue;