Skip to content

Commit c715f13

Browse files
committed
Merge tag 'pmdomain-v7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain fixes from Ulf Hansson: - bcm: increase ASB control timeout for bcm2835 - mediatek: fix power domain count * tag 'pmdomain-v7.0-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: pmdomain: bcm: bcm2835-power: Increase ASB control timeout pmdomain: mediatek: Fix power domain count
2 parents d072527 + b826d2c commit c715f13

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

drivers/pmdomain/bcm/bcm2835-power.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/clk.h>
1010
#include <linux/delay.h>
1111
#include <linux/io.h>
12+
#include <linux/iopoll.h>
1213
#include <linux/mfd/bcm2835-pm.h>
1314
#include <linux/module.h>
1415
#include <linux/platform_device.h>
@@ -153,7 +154,6 @@ struct bcm2835_power {
153154
static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable)
154155
{
155156
void __iomem *base = power->asb;
156-
u64 start;
157157
u32 val;
158158

159159
switch (reg) {
@@ -166,8 +166,6 @@ static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable
166166
break;
167167
}
168168

169-
start = ktime_get_ns();
170-
171169
/* Enable the module's async AXI bridges. */
172170
if (enable) {
173171
val = readl(base + reg) & ~ASB_REQ_STOP;
@@ -176,11 +174,9 @@ static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable
176174
}
177175
writel(PM_PASSWORD | val, base + reg);
178176

179-
while (!!(readl(base + reg) & ASB_ACK) == enable) {
180-
cpu_relax();
181-
if (ktime_get_ns() - start >= 1000)
182-
return -ETIMEDOUT;
183-
}
177+
if (readl_poll_timeout_atomic(base + reg, val,
178+
!!(val & ASB_ACK) != enable, 0, 5))
179+
return -ETIMEDOUT;
184180

185181
return 0;
186182
}

drivers/pmdomain/mediatek/mtk-pm-domains.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ static int scpsys_probe(struct platform_device *pdev)
12031203
scpsys->soc_data = soc;
12041204

12051205
scpsys->pd_data.domains = scpsys->domains;
1206-
scpsys->pd_data.num_domains = soc->num_domains;
1206+
scpsys->pd_data.num_domains = num_domains;
12071207

12081208
parent = dev->parent;
12091209
if (!parent) {

0 commit comments

Comments
 (0)