projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6efb943
)
ALSA: core: Use READ_ONCE() / WRITE_ONCE() for power state change
author
Takashi Iwai
<tiwai@suse.de>
Sun, 23 May 2021 09:09:15 +0000
(11:09 +0200)
committer
Takashi Iwai
<tiwai@suse.de>
Tue, 25 May 2021 06:48:03 +0000
(08:48 +0200)
We need proper barriers to handle the power state change of the card
from different CPUs.
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link:
https://lore.kernel.org/r/20210523090920.15345-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/core.h
patch
|
blob
|
history
diff --git
a/include/sound/core.h
b/include/sound/core.h
index 1f9aef0adbc905c9c3d654162a8fc85507a79ab5..d69dfc6c49535f5107ce1320f83ff2be7ea8bddd 100644
(file)
--- a/
include/sound/core.h
+++ b/
include/sound/core.h
@@
-142,12
+142,12
@@
struct snd_card {
#ifdef CONFIG_PM
static inline unsigned int snd_power_get_state(struct snd_card *card)
{
- return
card->power_state
;
+ return
READ_ONCE(card->power_state)
;
}
static inline void snd_power_change_state(struct snd_card *card, unsigned int state)
{
-
card->power_state = state
;
+
WRITE_ONCE(card->power_state, state)
;
wake_up(&card->power_sleep);
}