• Nicholas Piggin's avatar
    powerpc/powernv: Always stop secondaries before reboot/shutdown · f2748bdf
    Nicholas Piggin authored
    Currently powernv reboot and shutdown requests just leave secondaries
    to do their own things. This is undesirable because they can trigger
    any number of watchdogs while waiting for reboot, but also we don't
    know what else they might be doing -- they might be causing trouble,
    trampling memory, etc.
    
    The opal scheduled flash update code already ran into watchdog problems
    due to flashing taking a long time, and it was fixed with 2196c6f1
    ("powerpc/powernv: Return secondary CPUs to firmware before FW update"),
    which returns secondaries to opal. It's been found that regular reboots
    can take over 10 seconds, which can result in the hard lockup watchdog
    firing,
    
      reboot: Restarting system
      [  360.038896709,5] OPAL: Reboot request...
      Watchdog CPU:0 Hard LOCKUP
      Watchdog CPU:44 detected Hard LOCKUP other CPUS:16
      Watchdog CPU:16 Hard LOCKUP
      watchdog: BUG: soft lockup - CPU#16 stuck for 3s! [swapper/16:0]
    
    This patch removes the special case for flash update, and calls
    smp_send_stop in all cases before calling reboot/shutdown.
    
    smp_send_stop could return CPUs to OPAL, the main reason not to is
    that the request could come from a NMI that interrupts OPAL code,
    so re-entry to OPAL can cause a number of problems. Putting
    secondaries into simple spin loops improves the chances of a
    successful reboot.
    Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
    Reviewed-by: default avatarVasant Hegde <hegdevasant@linux.vnet.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    f2748bdf
setup.c 10.7 KB