CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2020/07/15 05:33:12

Modified files:
        sys/dev/fdt    : sxitemp.c 

Log message:
Run the sxitemp(4) at IPL_SOFTCLOCK instead of IPL_VM.  Prevents "panic:
mtx ...: locking against myself" on Orange Pi Zero.

Analysis by patrick@:

"The thermal sensor framework uses its own taskq with IPL_SOFTCLOCK.
sxitemp(4) calls thermal_sensor_update() from interrupt context, and
sxitemp(4) is using IPL_VM (memory allocation?!) for its interrupt.

IPL_VM is obviously higher than IPL_SOFTCLOCK, so it ends up being able
to interrupt the taskq.  Even though we're in msleep_nsec, I think we
have *not yet* given up the mutex, that we are holding while looking for
more work, only releasing it while sleeping.

Thus, the interrupt runs task_add(), which tries to grab the taskq's
mutex, even though the taskq already holds it!"

ok patrick@ kettenis@

Reply via email to