]> git.ipfire.org Git - thirdparty/linux.git/commit - drivers/hwspinlock/hwspinlock_core.c
hwspinlock: Introduce one new mode for hwspinlock
authorBaolin Wang <baolin.wang@linaro.org>
Sun, 8 Apr 2018 03:06:57 +0000 (11:06 +0800)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 17 Apr 2018 21:49:21 +0000 (14:49 -0700)
commit1e6c06a7e88c251d8a30271ad5206fbd967a4576
tree42921ec0798d2d306cec575c10f7b9317cac9b56
parent66742b19e5e0d01297d355cc445d4920b648821b
hwspinlock: Introduce one new mode for hwspinlock

In some scenarios, user need do some time-consuming or sleepable
operations under the hardware spinlock protection for synchronization
between the multiple subsystems.

For example, there is one PMIC efuse on Spreadtrum platform, which
need to be accessed under one hardware lock. But during the hardware
lock protection, the efuse operation is time-consuming to almost 5 ms,
so we can not disable the interrupts or preemption so long in this case.

Thus we can introduce one new mode to indicate that we just acquire the
hardware lock and do not disable interrupts or preemption, meanwhile we
should force user to protect the hardware lock with mutex or spinlock to
avoid dead-lock.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/hwspinlock/hwspinlock_core.c
include/linux/hwspinlock.h