lkml.org 
[lkml]   [2019]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 05/15] riscv: improve the default power off implementation
    Date
    Only call the SBI code if we are not running in M mode, and if we didn't
    do the SBI call, or it didn't succeed call wfi in a loop to at least
    save some power.

    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Atish Patra <atish.patra@wdc.com>
    ---
    arch/riscv/kernel/reset.c | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c
    index d0fe623bfb8f..2f5ca379747e 100644
    --- a/arch/riscv/kernel/reset.c
    +++ b/arch/riscv/kernel/reset.c
    @@ -8,8 +8,11 @@

    static void default_power_off(void)
    {
    +#ifndef CONFIG_M_MODE
    sbi_shutdown();
    - while (1);
    +#endif
    + while (1)
    + wait_for_interrupt();
    }

    void (*pm_power_off)(void) = default_power_off;
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-08-13 17:51    [W:8.539 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site