mailbox: stm32_ipcc: add spinlock to fix channels concurrent access
authorArnaud Pouliquen <arnaud.pouliquen@st.com>
Wed, 22 May 2019 08:25:35 +0000 (10:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:34 +0000 (09:21 +0100)
commit95442682dd2dfc6398be43574cb073f4322d6889
treee2081d93d549cdb0567efdbae1f9f60cba039043
parentf9367f945d23ccb8f8d930bcd9a60a509457ba83
mailbox: stm32_ipcc: add spinlock to fix channels concurrent access

commit dba9a3dfe912dc47c9dbc9ba1f5f65adbf9aea0f upstream.

Add spinlock protection on IPCC register update to avoid race condition.
Without this fix, stm32_ipcc_set_bits and stm32_ipcc_clr_bits can be
called in parallel for different channels. This results in register
corruptions.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Reviewed-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mailbox/stm32-ipcc.c