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
111111 {
112112 debug_spin_lock_before(lock);
113113 arch_spin_lock(&lock->raw_lock);
114+ mmiowb_spin_lock();
114115 debug_spin_lock_after(lock);
115116 }
116117
@@ -118,8 +119,10 @@ int do_raw_spin_trylock(raw_spinlock_t *lock) · 1 unmodified line
118119 {
119120 int ret = arch_spin_trylock(&lock->raw_lock);
120121
121− if (ret)
122+ if (ret) {
123+ mmiowb_spin_lock();
122124 debug_spin_lock_after(lock);
125+ }
123126 #ifndef CONFIG_SMP
124127 /*
125128 * Must not happen on UP:
@@ -131,6 +134,7 @@ int do_raw_spin_trylock(raw_spinlock_t *lock) · 5 unmodified lines
131134
132135 void do_raw_spin_unlock(raw_spinlock_t *lock)
133136 {
137+ mmiowb_spin_unlock();
134138 debug_spin_unlock(lock);
135139 arch_spin_unlock(&lock->raw_lock);
136140 }

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