[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180511033530.7931-2-yinbo.zhu@nxp.com>
Date: Fri, 11 May 2018 11:35:23 +0800
From: Yinbo Zhu <yinbo.zhu@....com>
To: <yinbo.zhu@....com>, Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
"Catalin Marinas )" <catalin.marinas@....com>,
"Will Deacon )" <will.deacon@....com>,
"Lorenzo Pieralisi )" <lorenzo.pieralisi@....com>,
Li Yang <leoyang.li@....com>
CC: <xiaobo.xie@....com>, <ran.wang_1@....com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Shawn Guo <shawnguo@...nel.org>,
Madalin Bucur <madalin.bucur@....com>,
Hou Zhiqiang <Zhiqiang.Hou@....com>,
Changming Huang <jerry.huang@....com>,
Minghuan Lian <Minghuan.Lian@....com>,
Zhao Qiang <qiang.zhao@....com>,
Fabio Estevam <fabio.estevam@....com>,
"jiaheng . fan" <jiaheng.fan@....com>, Po Liu <po.liu@....com>,
Nipun Gupta <nipun.gupta@....com>,
Horia Geantă <horia.geanta@....com>,
Priyanka Jain <priyanka.jain@....com>,
Sumit Garg <sumit.garg@....com>,
costi <constantin.tudor@...escale.com>,
Bogdan Purcareata <bogdan.purcareata@....com>,
Meng Yi <meng.yi@....com>,
Wang Dongsheng <dongsheng.wang@....com>,
"open list:CLOCKSOURCE, CLOCKEVENT DRIVERS"
<linux-kernel@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
"open list:FREESCALE SOC DRIVERS" <linuxppc-dev@...ts.ozlabs.org>,
Tang Yuantian <Yuantian.Tang@....com>,
<ying.zhang22455@....com>
Subject: [PATCH 2/9] armv8: pm: Fix issue of rcpm driver wrongly program other IP control bits
From: Ran Wang <ran.wang_1@....com>
When rcpm driver get target register data from DTS property 'fsl,
rcpm-wakeup' (second value), it directly write that data to register
RCPM_IPPDEXPCRx rather than 'OR' the value read from it before. This
operation will over-write those non-related IP control bit which
might have been programmed, should be prevented.
Signed-off-by: Ran Wang <ran.wang_1@....com>
Signed-off-by: Yinbo Zhu <yinbo.zhu@....com>
---
drivers/soc/fsl/rcpm.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
index ff0477b..39eabfb 100644
--- a/drivers/soc/fsl/rcpm.c
+++ b/drivers/soc/fsl/rcpm.c
@@ -75,6 +75,7 @@ static void rcpm_wakeup_fixup(struct device *dev, void *data)
static int rcpm_suspend_prepare(void)
{
int i;
+ u32 val;
WARN_ON(!rcpm);
@@ -84,9 +85,12 @@ static int rcpm_suspend_prepare(void)
dpm_for_each_dev(NULL, rcpm_wakeup_fixup);
for (i = 0; i < rcpm->ipp_num; i++) {
- rcpm_reg_write(rcpm->ippdexpcr_offset + 4 * i,
- rcpm->ippdexpcr[i]);
- pr_debug("ippdexpcr%d = 0x%x\n", i, rcpm->ippdexpcr[i]);
+ if (rcpm->ippdexpcr[i]) {
+ val = rcpm_reg_read(rcpm->ippdexpcr_offset + 4 * i);
+ rcpm_reg_write(rcpm->ippdexpcr_offset + 4 * i,
+ val | rcpm->ippdexpcr[i]);
+ pr_debug("ippdexpcr%d = 0x%x\n", i, rcpm->ippdexpcr[i]);
+ }
}
return 0;
--
1.7.1
Powered by blists - more mailing lists