Commit 21b3ddd
efi: Don't use spinlocks for efi vars
All efivars operations are protected by a spinlock which prevents
interruptions and preemption. This is too restricted, we just need a
lock preventing concurrency.
The idea is to use a semaphore of count 1 and to have two ways of
locking, depending on the context:
- In interrupt context, we call down_trylock(), if it fails we return
an error
- In normal context, we call down_interruptible()
We don't use a mutex here because the mutex_trylock() function must not
be called from interrupt context, whereas the down_trylock() can.
Signed-off-by: Sylvain Chouleur <sylvain.chouleur@intel.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Sylvain Chouleur <sylvain.chouleur@gmail.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>1 parent 217b27d commit 21b3ddd
6 files changed
+139
-76
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
147 | | - | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
151 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
152 | 159 | | |
153 | | - | |
| 160 | + | |
| 161 | + | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
| |||
172 | 180 | | |
173 | 181 | | |
174 | 182 | | |
| 183 | + | |
175 | 184 | | |
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
181 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
182 | 194 | | |
183 | 195 | | |
184 | 196 | | |
| |||
190 | 202 | | |
191 | 203 | | |
192 | 204 | | |
193 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
194 | 208 | | |
195 | 209 | | |
196 | 210 | | |
| |||
232 | 246 | | |
233 | 247 | | |
234 | 248 | | |
235 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
236 | 253 | | |
237 | 254 | | |
238 | 255 | | |
| |||
347 | 364 | | |
348 | 365 | | |
349 | 366 | | |
350 | | - | |
| 367 | + | |
| 368 | + | |
351 | 369 | | |
352 | 370 | | |
353 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
| 514 | + | |
514 | 515 | | |
515 | 516 | | |
516 | 517 | | |
| |||
575 | 576 | | |
576 | 577 | | |
577 | 578 | | |
578 | | - | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
579 | 583 | | |
580 | 584 | | |
581 | 585 | | |
| |||
690 | 694 | | |
691 | 695 | | |
692 | 696 | | |
693 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
694 | 701 | | |
695 | 702 | | |
696 | 703 | | |
697 | 704 | | |
698 | 705 | | |
699 | 706 | | |
700 | 707 | | |
701 | | - | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
702 | 716 | | |
703 | 717 | | |
704 | 718 | | |
| |||
0 commit comments