Skip to content
Snippets Groups Projects
Forked from gfx-ci / linux
Source project has a limited visibility.
  • Sourabh Jain's avatar
    6efbd5dd
    kexec/crash: no crash update when kexec in progress · 6efbd5dd
    Sourabh Jain authored
    The following errors are observed when kexec is done with SMT=off on
    powerpc.
    
    [  358.458385] Removing IBM Power 842 compression device
    [  374.795734] kexec_core: Starting new kernel
    [  374.795748] kexec: Waking offline cpu 1.
    [  374.875695] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
    [  374.935833] kexec: Waking offline cpu 2.
    [  375.015664] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
    snip..
    [  375.515823] kexec: Waking offline cpu 6.
    [  375.635667] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
    [  375.695836] kexec: Waking offline cpu 7.
    
    To avoid kexec kernel boot failure on PowerPC, all the present CPUs that
    are offline are brought online during kexec.  For more information, refer
    to commit e8e5c215 ("powerpc/kexec: Fix orphaned offline CPUs across
    kexec").  Bringing the CPUs online triggers the crash hotplug handler,
    crash_handle_hotplug_event(), to update the kdump image.  Since the system
    is on the kexec kernel boot path and the kexec lock is held, the
    crash_handle_hotplug_event() function fails to acquire the same lock to
    update the kdump image, resulting in the error messages mentioned above.
    
    To fix this, return from crash_handle_hotplug_event() without printing the
    error message if kexec is in progress.
    
    The same applies to the crash_check_hotplug_support() function.  Return 0
    if kexec is in progress because kernel is not in a position to update the
    kdump image.
    
    Link: https://lkml.kernel.org/r/20240921103745.560430-1-sourabhjain@linux.ibm.com
    
    
    Signed-off-by: default avatarSourabh Jain <sourabhjain@linux.ibm.com>
    Acked-by: default avatarBaoquan he <bhe@redhat.com>
    Reported-by: default avatarSachin P Bappalige <sachinpb@linux.vnet.ibm.com>
    Cc: Hari Bathini <hbathini@linux.ibm.com>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    6efbd5dd
    History
    kexec/crash: no crash update when kexec in progress
    Sourabh Jain authored
    The following errors are observed when kexec is done with SMT=off on
    powerpc.
    
    [  358.458385] Removing IBM Power 842 compression device
    [  374.795734] kexec_core: Starting new kernel
    [  374.795748] kexec: Waking offline cpu 1.
    [  374.875695] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
    [  374.935833] kexec: Waking offline cpu 2.
    [  375.015664] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
    snip..
    [  375.515823] kexec: Waking offline cpu 6.
    [  375.635667] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate
    [  375.695836] kexec: Waking offline cpu 7.
    
    To avoid kexec kernel boot failure on PowerPC, all the present CPUs that
    are offline are brought online during kexec.  For more information, refer
    to commit e8e5c215 ("powerpc/kexec: Fix orphaned offline CPUs across
    kexec").  Bringing the CPUs online triggers the crash hotplug handler,
    crash_handle_hotplug_event(), to update the kdump image.  Since the system
    is on the kexec kernel boot path and the kexec lock is held, the
    crash_handle_hotplug_event() function fails to acquire the same lock to
    update the kdump image, resulting in the error messages mentioned above.
    
    To fix this, return from crash_handle_hotplug_event() without printing the
    error message if kexec is in progress.
    
    The same applies to the crash_check_hotplug_support() function.  Return 0
    if kexec is in progress because kernel is not in a position to update the
    kdump image.
    
    Link: https://lkml.kernel.org/r/20240921103745.560430-1-sourabhjain@linux.ibm.com
    
    
    Signed-off-by: default avatarSourabh Jain <sourabhjain@linux.ibm.com>
    Acked-by: default avatarBaoquan he <bhe@redhat.com>
    Reported-by: default avatarSachin P Bappalige <sachinpb@linux.vnet.ibm.com>
    Cc: Hari Bathini <hbathini@linux.ibm.com>
    Cc: Michael Ellerman <mpe@ellerman.id.au>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>