pwm: fix kernel crash using spinlock_t lock
authorJian Hu <jian.hu@amlogic.com>
Fri, 28 Jul 2017 06:41:05 +0000 (14:41 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 28 Jul 2017 10:36:15 +0000 (03:36 -0700)
commit72d840c8f7273272f8a992524b63a03a396d081f
tree5bbf1244500805f7792ce4fb2f1d1a07fc905114
parent6df60b00fe5241eb5dcfbd832f3d9caf88578544
pwm: fix kernel crash using spinlock_t lock

PD#148269: fix kernel panic when hibenating

1.Using mutex lock instead of spinlock_t lock.
2.Clk_prepare_enable might sleep could not use
  spinlock_t lock.
3.Add spinlock_t lock for clock_mux.
4.Panic message:
BUG: sleeping function called from invalid context at
kernel/locking/mutex.c:97
in_atomic(): 1, irqs_disabled(): 128, pid: 2501, name: sh
Preemption disabled at:[   69.935889@1] [<ffffff80097af728>]
meson_pwm_apply+0x48/0x398

Change-Id: Ib2f42c4d757d1bb4bd8e4df0f90f7924be2fa799
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
drivers/amlogic/pwm/pwm_meson.c
include/linux/amlogic/pwm_meson.h