Skip to contentSkip to conversation

rwsem-spinlock linkage error

PATCH Applied Mikael Pettersson 2 participants 2 messages Apr 26, 2005 – Apr 27, 2005 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rwsem-spinlock linkage error

The

Andrew Morton:
o rwsem: Make rwsems use interrupt disabling spinlocks

change in 2.4.31-pre1 has a typo: one occurrence of spin_unlock() was changed to spin_unlock_restore() instead of spin_unlock_irqrestore() as was obviously the intention. Since spin_unlock_restore() doesn't exist, this results in linkage errors on x86_64 and other archs using CONFIG_RWSEM_GENERIC_SPINLOCK.

Trival fix below.

lib/rwsem-spinlock.c renamed from lib/rwsem-spinlock.c.~1~ +1 -1
@@ -269,7 +269,7 @@ void fastcall __up_read(struct rw_semaph
 	if (--sem->activity==0 && !list_empty(&sem->wait_list))
 		sem = __rwsem_wake_one_writer(sem);
 
-	spin_unlock_restore(&sem->wait_lock, flags);
+	spin_unlock_irqrestore(&sem->wait_lock, flags);
 
 	rwsemtrace(sem,"Leaving __up_read");
 }
#1 lore raw

Applied, thanks Mikael.

Quoted 26 lines · Mikael Pettersson

The

Andrew Morton:
o rwsem: Make rwsems use interrupt disabling spinlocks

change in 2.4.31-pre1 has a typo: one occurrence of spin_unlock() was changed to spin_unlock_restore() instead of spin_unlock_irqrestore() as was obviously the intention. Since spin_unlock_restore() doesn't exist, this results in linkage errors on x86_64 and other archs using CONFIG_RWSEM_GENERIC_SPINLOCK.

Trival fix below.

lib/rwsem-spinlock.c renamed from lib/rwsem-spinlock.c.~1~ +1 -1
@@ -269,7 +269,7 @@ void fastcall __up_read(struct rw_semaph
 	if (--sem->activity==0 && !list_empty(&sem->wait_list))
 		sem = __rwsem_wake_one_writer(sem);
 
-	spin_unlock_restore(&sem->wait_lock, flags);
+	spin_unlock_irqrestore(&sem->wait_lock, flags);
 
 	rwsemtrace(sem,"Leaving __up_read");
 }