diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-07-18 17:13:00 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-07-20 11:02:59 +0300 |
commit | dc438bac711d703e08cffa527db192c4b1630cd4 (patch) | |
tree | 7e5fccd7d6e4eb248bd384c80051ecaa0345cf6d /drivers/staging/greybus/audio_codec.h | |
parent | a3bee62e90d8fdfdbd325323106de00b3e3a729f (diff) | |
download | linux-dc438bac711d703e08cffa527db192c4b1630cd4.tar.xz |
staging: greybus: Avoid abusing controls_rwsem
The controls_rwsem of snd_card object is rather an internal lock, and
not really meant to be used by others for its data protection.
This patch addresses it by replacing the controls_rwsem usages with
the own (new) mutex.
Note that the up_write() and down_write() calls around
gbaudio_remove_component_controls() are simply dropped without
replacement. These temporary up/down were a workaround since
gbaudio_remove_component_controls() itself took the rwsem. Now it was
also gone, we can clean up the workaround, too.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Cc: Mark Greer <mgreer@animalcreek.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: greybus-dev@lists.linaro.org
Link: https://lore.kernel.org/r/20230718141304.1032-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/staging/greybus/audio_codec.h')
-rw-r--r-- | drivers/staging/greybus/audio_codec.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index ce15e800e607..f3f7a7ec6be4 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -71,6 +71,7 @@ struct gbaudio_codec_info { /* to maintain runtime stream params for each DAI */ struct list_head dai_list; struct mutex lock; + struct mutex register_mutex; }; struct gbaudio_widget { |