Skip to content
Commit 9468ab84 authored by Orson Zhai's avatar Orson Zhai Committed by Jassi Brar
Browse files

mailbox: sprd: Introduce refcnt when clients requests/free channels



Unisoc mailbox has no way to be enabled/disabled for any single channel.
They can only be set to startup or shutdown as a whole device at same time.

Add a variable to count references to avoid mailbox FIFO being reset
unexpectedly when clients are requesting or freeing channels.

Also add a lock to dismiss possible conflicts from register r/w in
different startup or shutdown threads. And fix the crash problem when early
interrupts come from channel which has not been requested by client yet.

Fixes: ca27fc26 ("mailbox: sprd: Add Spreadtrum mailbox driver")
Signed-off-by: default avatarOrson Zhai <orson.zhai@unisoc.com>
Reviewed-by: default avatarBaolin Wang <baolin.wang7@gmail.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent a8f96891
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment