Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 247fccb4 authored by Mahesh Sivasubramanian's avatar Mahesh Sivasubramanian Committed by Neeraj Upadhyay
Browse files

drivers: qcom: system_pm: Save/restore GICD registers at system sleep



Some of the GICD registers could be read in and stored as zeros if an
intterupt is triggered around the same time as the system sleep. The
pending state of the interrupt would be latched but the configuration
registers for the interrupt is reset. To ensure that the interrupt
triggers, restore the interrupts configuration around System sleep
notification.

Change-Id: Ib04720241e8fa4382383bd08897c4e19aaaded8c
Signed-off-by: default avatarMahesh Sivasubramanian <msivasub@codeaurora.org>
parent b179a8e1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -22,6 +22,13 @@
#define PDC_TIME_VALID_SHIFT	31
#define PDC_TIME_UPPER_MASK	0xFFFFFF

#ifdef CONFIG_ARM_GIC_V3
#include <linux/irqchip/arm-gic-v3.h>
#else
static inline void gic_v3_dist_restore(void) {}
static inline void gic_v3_dist_save(void) {}
#endif

static struct rpmh_client *rpmh_client;

static int setup_wakeup(uint32_t lo, uint32_t hi)
@@ -61,6 +68,7 @@ static bool system_sleep_allowed(void)
 */
static int system_sleep_enter(struct cpumask *mask)
{
	gic_v3_dist_save();
	return rpmh_flush(rpmh_client);
}

@@ -70,6 +78,7 @@ static int system_sleep_enter(struct cpumask *mask)
static void system_sleep_exit(void)
{
	msm_rpmh_master_stats_update();
	gic_v3_dist_restore();
}

static struct system_pm_ops pm_ops = {