• Srinivas Pandruvada's avatar
    Thermal: x86_pkg_temp: change spin lock · 7bed1b3c
    Srinivas Pandruvada authored
    x86_pkg_temp receives thermal notifications via a callback from a
    therm_throt driver, where thermal interrupts are processed.
    This callback is pkg_temp_thermal_platform_thermal_notify. Here to
    avoid multiple interrupts from cores in a package, we disable the
    source and also set a variable to avoid scheduling delayed work function.
    This variable is protected via spin_lock_irqsave. On one buggy platform,
    we still receiving interrupts even if the source is disabled. This
    can cause deadlock/lockdep warning, when interrupt is generated while under
    spinlock in work function.
    Change spin_lock to spin_lock_irqsave and spin_unlock to
    spin_unlock_irqrestore as the data it is trying to protect can also
    be modified in a notification call called from interrupt handler.
    Signed-off-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
    7bed1b3c
x86_pkg_temp_thermal.c 16.4 KB