History

mmiowb: Hook up mmiowb helpers to spinlocks and generic I/O accessors

Removing explicit calls to mmiowb() from driver code means that we must now call into the generic mmiowb_spin_{lock,unlock}() functions from the core spinlock code. In order to elide barriers following critical sections without any I/O writes, we also hook into the asm-generic I/O routines.

Will Deacon committed 7 years ago

Commit 60ca1e51 parent fdcd06a3 files · +17 −3Browse files

Showing the changes to kernel/locking (1 of 3 files). Show all

Unified · Split

kernel/locking/spinlock_debug.c+5−1
@@ -111,6 +111,7 @@ void do_raw_spin_lock(raw_spinlock_t *lock) · 110 unmodified lines
111{111{
112 debug_spin_lock_before(lock);112 debug_spin_lock_before(lock);
113 arch_spin_lock(&lock->raw_lock);113 arch_spin_lock(&lock->raw_lock);
114 mmiowb_spin_lock();
114 debug_spin_lock_after(lock);115 debug_spin_lock_after(lock);
115}116}
116 117
@@ -118,8 +119,10 @@ int do_raw_spin_trylock(raw_spinlock_t *lock) · 1 unmodified line
118{119{
119 int ret = arch_spin_trylock(&lock->raw_lock);120 int ret = arch_spin_trylock(&lock->raw_lock);
120 121
121 if (ret)122 if (ret) {
123 mmiowb_spin_lock();
122 debug_spin_lock_after(lock);124 debug_spin_lock_after(lock);
125 }
123#ifndef CONFIG_SMP126#ifndef CONFIG_SMP
124 /*127 /*
125 * Must not happen on UP:128 * Must not happen on UP:
@@ -131,6 +134,7 @@ int do_raw_spin_trylock(raw_spinlock_t *lock) · 5 unmodified lines
131 134
132void do_raw_spin_unlock(raw_spinlock_t *lock)135void do_raw_spin_unlock(raw_spinlock_t *lock)
133{136{
137 mmiowb_spin_unlock();
134 debug_spin_unlock(lock);138 debug_spin_unlock(lock);
135 arch_spin_unlock(&lock->raw_lock);139 arch_spin_unlock(&lock->raw_lock);
136}140}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t