Skip to content

Commit 939c5ae

Browse files
author
Martin Schwidefsky
committed
s390/rwlock: add missing local_irq_restore calls
The out of line _raw_read_lock_wait_flags/_raw_write_lock_wait_flags functions for the arch_read_lock_flags/arch_write_lock_flags calls fail to re-enable the interrupts after another unsuccessful try to get the lock with compare-and-swap. The following wait would be done with interrupts disabled which is suboptimal. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent bae8f56 commit 939c5ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/s390/lib/spinlock.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ void _raw_read_lock_wait_flags(arch_rwlock_t *rw, unsigned long flags)
143143
local_irq_disable();
144144
if (_raw_compare_and_swap(&rw->lock, old, old + 1))
145145
return;
146+
local_irq_restore(flags);
146147
}
147148
}
148149
EXPORT_SYMBOL(_raw_read_lock_wait_flags);
@@ -199,6 +200,7 @@ void _raw_write_lock_wait_flags(arch_rwlock_t *rw, unsigned long flags)
199200
local_irq_disable();
200201
if (_raw_compare_and_swap(&rw->lock, 0, 0x80000000))
201202
return;
203+
local_irq_restore(flags);
202204
}
203205
}
204206
EXPORT_SYMBOL(_raw_write_lock_wait_flags);

0 commit comments

Comments
 (0)