Skip to content
  • fwu's avatar
    ARM: 7544/1: Add BUG_ON when hlt counter is wrongly used · 871df85a
    fwu authored
    1. On ARM platform, "nohlt" can be used to prevent core from idle
       process, returning immediately.
    2. There are two interfaces, exported for other modules, named
       "disable_hlt" and "enable_hlt" are used to enable/disable the
       cpuidle mechanism by increasing/decreasing "hlt_counter".
       Disable_hlt and enable_hlt are paired operation,
       when you first call disable_hlt and then enable_hlt, the
       semantics are right.
    3. There is no obvious constraint to prevent user(driver/module)
       code to prevent the case that enable_hlt is ahead of disable_hlt,
       which is a fatal operation on kernel state change from user,
       and there is no any WARNING or notification if the case happens
       in current kernel code.
       This patch aims to report BUG when the case happens, just like
       what the kernel do when enable_irq is ahead of disable_irq.
    
    Link: https://patchwork.kernel.org/patch/1527881/
    
    
    
    Signed-off-by: default avatarfwu <fwu@marvell.com>
    Signed-off-by: default avatarYiLu Mao <ylmao@marvell.com>
    Signed-off-by: default avatarNing Jiang <ning.jiang@marvell.com>
    Acked-by: Nicolas Pitre
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    871df85a