Skip to contentSkip to conversation

ARM: tegra30: make the wait time of CPU power up to proportional to HZ

PATCH New Joseph Lo 2 participants 3 messages Jan 7, 2013 – Jan 8, 2013

Subsystems (3)
lore
Share & tools
lore

Joseph Lo

author
#0 lore raw

PATCH 1/1 ARM: tegra30: make the wait time of CPU power up to proportional to HZ

It would rather to use the API of time_to_jiffies than a constant number of jiffies for the wait time of CPU power up.

Based on the work by:
Sang-Hun Lee <[email protected]>

---
 arch/arm/mach-tegra/platsmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-tegra/platsmp.c +2 -2
index 60daf9f..6867030 100644
@@ -90,7 +90,7 @@ static int tegra30_power_up_cpu(unsigned int cpu)
 	 * next time around.
 	 */
 	if (cpumask_test_cpu(cpu, &tegra_cpu_init_mask)) {
-		timeout = jiffies + 5*HZ;
+		timeout = jiffies + msecs_to_jiffies(50);
 		do {
 			if (!tegra_powergate_is_powered(pwrgateid))
 				goto remove_clamps;
@@ -110,7 +110,7 @@ static int tegra30_power_up_cpu(unsigned int cpu)
 			return ret;
 
 		/* Wait for the power to come up. */
-		timeout = jiffies + 10*HZ;
+		timeout = jiffies + msecs_to_jiffies(100);
 		while (tegra_powergate_is_powered(pwrgateid)) {
 			if (time_after(jiffies, timeout))
 				return -ETIMEDOUT;
Signature · 1 line
1.8.0.3
#1 lore raw

PATCH 1/1 ARM: tegra30: make the wait time of CPU power up to proportional to HZ

Quoted 5 lines · Joseph Lo

It would rather to use the API of time_to_jiffies than a constant number of jiffies for the wait time of CPU power up.

Based on the work by:
Sang-Hun Lee <[email protected]>

Applied to Tegra's for-3.9/soc branch.

arch/arm/mach-tegra/platsmp.c static int tegra30_power_up_cpu(unsigned int cpu) · line 93

Quoted 4 lines
arch/arm/mach-tegra/platsmp.c +1 -1
 
-		timeout = jiffies + 5*HZ;
+		timeout = jiffies + msecs_to_jiffies(50);

I did just want to confirm though; I think that changes the timeout from 5 seconds to 50mS and similarly for the other change. I assume that was intended? The code certainly seemed to work just fine with this change when I tested it.

author
#2 lore raw

PATCH 1/1 ARM: tegra30: make the wait time of CPU power up to proportional to HZ

Quoted 11 lines · Stephen Warren
Quoted 5 lines · Joseph Lo

It would rather to use the API of time_to_jiffies than a constant number of jiffies for the wait time of CPU power up.

Based on the work by:
Sang-Hun Lee <[email protected]>

Applied to Tegra's for-3.9/soc branch.

Quoted 1 line
arch/arm/mach-tegra/platsmp.c +0 -0
Quoted 7 lines

arch/arm/mach-tegra/platsmp.c static int tegra30_power_up_cpu(unsigned int cpu) · line 93

Quoted 2 lines
arch/arm/mach-tegra/platsmp.c +1 -1
-		timeout = jiffies + 5*HZ;
+		timeout = jiffies + msecs_to_jiffies(50);

I did just want to confirm though; I think that changes the timeout from 5 seconds to 50mS and similarly for the other change. I assume that was intended? The code certainly seemed to work just fine with this change when I tested it.

Yes, I also tested this patch with CPU hotplug stress test. The result was good.

Thanks for confirming.

Joseph