Use atomic_add_int rather than a simple ++ to ensure no cache races if
the power interrupt and init code waiting for the interrupt are running on different CPUs. I haven't seen this make any real difference, but I've also had some reports of odd behavior I can't otherwise explain. It is an infrequent operation, and certainly wouldn't hurt.
This commit is contained in:
parent
7b603a4ac7
commit
3e7d0bebac
@ -730,7 +730,7 @@ cbb_pci_filt(void *arg)
|
||||
if (sockevent & CBB_SOCKET_EVENT_POWER) {
|
||||
cbb_clrb(sc, CBB_SOCKET_MASK, CBB_SOCKET_EVENT_POWER);
|
||||
cbb_set(sc, CBB_SOCKET_EVENT, CBB_SOCKET_EVENT_POWER);
|
||||
sc->powerintr++;
|
||||
atomic_add_int(&sc->powerintr, 1);
|
||||
wakeup((void *)&sc->powerintr);
|
||||
}
|
||||
retval = FILTER_HANDLED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user