Skip to contentSkip to conversation

Fix spinaphore down_spin()

IA64 Luck, Tony 1 participant 1 message Jun 29, 2010

lore
Share & tools
lore

Luck, Tony

author
#0 lore raw

Typo in down_spin() meant it only read the low 32 bits of the "serve" value, instead of the full 64 bits. This results in the system hanging when the values in ticket/serve get larger than 32-bits. A big enough system running the right test can hit this in just a couple of days.

Reported via IRC by Bjorn Helgaas

arch/ia64/mm/tlb.c +1 -1
index 5dfd916..7b3cdc6 100644
@@ -121,7 +121,7 @@ static inline void down_spin(struct spinaphore *ss)
 	ia64_invala();
 
 	for (;;) {
-		asm volatile ("ld4.c.nc %0=[%1]" : "=r"(serve) : "r"(&ss->serve) : "memory");
+		asm volatile ("ld8.c.nc %0=[%1]" : "=r"(serve) : "r"(&ss->serve) : "memory");
 		if (time_before(t, serve))
 			return;
 		cpu_relax();