Skip to content

Commit caeaf63

Browse files
committed
Merge: Description: Updates for powerpc crash kexec
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/414 JIRA: https://issues.redhat.com/browse/RHEL-76749 Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=66787277 Tested: Verified Brew build test kernel RPMs Signed-off-by: Mamatha Inamdar <minamdar@redhat.com> commit 6efbd5d Author: Sourabh Jain <sourabhjain@linux.ibm.com> Date: Sat Sep 21 16:07:45 2024 +0530 kexec/crash: no crash update when kexec in progress 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 e8e5c21 ("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: Sourabh Jain <sourabhjain@linux.ibm.com> Acked-by: Baoquan he <bhe@redhat.com> Reported-by: Sachin P Bappalige <sachinpb@linux.vnet.ibm.com> Cc: Hari Bathini <hbathini@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mamatha Inamdar <minamdar@redhat.com> Approved-by: Steve Best <sbest@redhat.com> Approved-by: Desnes Nunes <desnesn@redhat.com> Approved-by: Baoquan He <5820488-baoquan_he@users.noreply.gitlab.com> Merged-by: Julio Faracco <jfaracco@redhat.com>
2 parents 91cc0d7 + f582f02 commit caeaf63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/crash_core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ int crash_check_hotplug_support(void)
505505
crash_hotplug_lock();
506506
/* Obtain lock while reading crash information */
507507
if (!kexec_trylock()) {
508-
pr_info("kexec_trylock() failed, kdump image may be inaccurate\n");
508+
if (!kexec_in_progress)
509+
pr_info("kexec_trylock() failed, kdump image may be inaccurate\n");
509510
crash_hotplug_unlock();
510511
return 0;
511512
}
@@ -547,7 +548,8 @@ static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu,
547548
crash_hotplug_lock();
548549
/* Obtain lock while changing crash information */
549550
if (!kexec_trylock()) {
550-
pr_info("kexec_trylock() failed, kdump image may be inaccurate\n");
551+
if (!kexec_in_progress)
552+
pr_info("kexec_trylock() failed, kdump image may be inaccurate\n");
551553
crash_hotplug_unlock();
552554
return;
553555
}

0 commit comments

Comments
 (0)