• Baolin Wang's avatar
    hwspinlock: Introduce one new mode for hwspinlock · 1e6c06a7
    Baolin Wang authored
    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: default avatarBaolin Wang <baolin.wang@linaro.org>
    Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
    1e6c06a7
hwspinlock_core.c 20.8 KB