msm: msm_xo: Fix scheduling while atomic bug
clk_get_sys() can't be called in atomic context, but the msm_xo
code is calling clk_get_sys within a spin_lock_irqsave(). This
leads to scheduling while atomic bugs. Fixing this to call
clk_get_sys() in a non-atomic location is not as simple as moving
the clk_get_sys() call to somewhere else such as msm_xo_init() or
msm_xo_get() since those are called before the clock driver is
initialized.
Luckily we have moved the XO voting in the clock driver to the
RPM clock driver so we can move the msm_xo interface to a
sleepable API using mutex_lock()/mutex_unlock() and also use the
sleepable variant of msm_rpmrs_set(). This should remove the
scheduling while atomic bug and also make the XO buffer API less
invasive by spinning on the RPM to respond to RPM requests.
Change-Id: I510cb125bde84b80b562add36494b716955ed773
Signed-off-by:
Stephen Boyd <sboyd@codeaurora.org>
Loading
Please sign in to comment