Commit 7c64de1
committed
lkl: relax cpu during __ndelay()
__ndelay() spins until the timeout occurs. If interrupts come
concurrently from another host thread, an irq_status bit will be set,
but the handler will not be called during the spin. This behavior is
unreasonable. At least, it differs from that of real Linux running on a
bare-mental machine.
A driver may expect the device to raise an IRQ within a few
microseconds, so it tries to spin and wait for it. This does not work
without the commit.
Calling cpu_relax() explicitly can cause the handlers to fire. This is
also a valid use of cpu_relax() because the CPU is spinning.
Signed-off-by: Ruihan Li <lrh2000@pku.edu.cn>1 parent 9c51103 commit 7c64de1
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments