This commit is contained in:
parent
7a7685aef8
commit
186915d7a9
68
kexec-tools-ppc64-reinit.diff
Normal file
68
kexec-tools-ppc64-reinit.diff
Normal file
@ -0,0 +1,68 @@
|
||||
From: Chandru S <chandru@linux.vnet.ibm.com>
|
||||
Subject: [PATCH] powerpc: initialize drconf variables
|
||||
References: bnc #468571
|
||||
|
||||
The ppc64-memory-ranges-dynamic.diff patch which added
|
||||
realloc_memory_ranges() code to kexec-tools somehow removed
|
||||
the initialization of lmb-size and num_of_lmbs required in
|
||||
case of /proc/ibm,dynamic-reconfiguration-memory node.
|
||||
Add the code here to initialize them back again in kexec-tools
|
||||
|
||||
Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
|
||||
Acked-by: Bernhard Walle <bwalle@suse.de>
|
||||
|
||||
---
|
||||
kexec/arch/ppc64/kexec-ppc64.c | 27 +++++++++++++++++++++++++--
|
||||
1 file changed, 25 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/kexec/arch/ppc64/kexec-ppc64.c
|
||||
+++ b/kexec/arch/ppc64/kexec-ppc64.c
|
||||
@@ -96,7 +96,7 @@ err1:
|
||||
|
||||
}
|
||||
|
||||
-static int realloc_memory_ranges()
|
||||
+static int realloc_memory_ranges(void)
|
||||
{
|
||||
size_t memory_range_len;
|
||||
|
||||
@@ -150,6 +150,23 @@ static int get_dyn_reconf_base_ranges(vo
|
||||
FILE *file;
|
||||
int i, n;
|
||||
|
||||
+ strcpy(fname, "/proc/device-tree/");
|
||||
+ strcat(fname, "ibm,dynamic-reconfiguration-memory/ibm,lmb-size");
|
||||
+ if ((file = fopen(fname, "r")) == NULL) {
|
||||
+ perror(fname);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (fread(buf, 1, 8, file) != 8) {
|
||||
+ perror(fname);
|
||||
+ fclose(file);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ /*
|
||||
+ * lmb_size, num_of_lmbs(global variables) are
|
||||
+ * initialized once here.
|
||||
+ */
|
||||
+ lmb_size = ((uint64_t *)buf)[0];
|
||||
+ fclose(file);
|
||||
|
||||
strcpy(fname, "/proc/device-tree/");
|
||||
strcat(fname,
|
||||
@@ -158,8 +175,14 @@ static int get_dyn_reconf_base_ranges(vo
|
||||
perror(fname);
|
||||
return -1;
|
||||
}
|
||||
+ /* first 4 bytes tell the number of lmbs */
|
||||
+ if (fread(buf, 1, 4, file) != 4) {
|
||||
+ perror(fname);
|
||||
+ fclose(file);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ num_of_lmbs = ((unsigned int *)buf)[0];
|
||||
|
||||
- fseek(file, 4, SEEK_SET);
|
||||
for (i = 0; i < num_of_lmbs; i++) {
|
||||
if ((n = fread(buf, 1, 24, file)) < 0) {
|
||||
perror(fname);
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 5 13:06:38 CET 2009 - bwalle@suse.de
|
||||
|
||||
- Re-initialize drconf variables for PPC64 (bnc #468571).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 4 12:23:50 CET 2009 - tiwai@suse.de
|
||||
|
||||
- fix build failure due to missing xsltproc
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 16 18:57:47 CET 2009 - bwalle@suse.de
|
||||
|
||||
|
@ -29,7 +29,7 @@ PreReq: %insserv_prereq %fillup_prereq
|
||||
AutoReqProv: on
|
||||
Summary: Tools for fast kernel loading
|
||||
Version: 2.0.0
|
||||
Release: 51
|
||||
Release: 54
|
||||
Source: %{name}-%{version}.tar.bz2
|
||||
Source1: kexec-bootloader
|
||||
Source2: kexec-bootloader.8.txt
|
||||
@ -56,12 +56,13 @@ Patch17: %{name}-ppc64-memory-ranges-dynamic.diff
|
||||
Patch18: %{name}-ppc64-dynamic-fix-1.diff
|
||||
Patch19: %{name}-ppc64-dynamic-fix-2.diff
|
||||
Patch20: %{name}-ppc64-dynamic-fix-3.diff
|
||||
Patch21: %{name}-ppc64-reinit.diff
|
||||
Url: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
#!BuildIgnore: fop
|
||||
BuildRequires: zlib-devel
|
||||
%if 0%{?suse_version} >= 1110
|
||||
BuildRequires: asciidoc
|
||||
BuildRequires: asciidoc libxslt
|
||||
%endif
|
||||
%ifarch %ix86 x86_64
|
||||
BuildRequires: xen-devel
|
||||
@ -107,6 +108,7 @@ Authors:
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
|
||||
%build
|
||||
%{?suse_update_config -f}
|
||||
@ -174,6 +176,10 @@ install -m 0755 kexec.init ${RPM_BUILD_ROOT}/etc/init.d/kexec
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Feb 05 2009 bwalle@suse.de
|
||||
- Re-initialize drconf variables for PPC64 (bnc #468571).
|
||||
* Wed Feb 04 2009 tiwai@suse.de
|
||||
- fix build failure due to missing xsltproc
|
||||
* Fri Jan 16 2009 bwalle@suse.de
|
||||
- The dynamic reallocation for PPC64 broke kdump completely.
|
||||
Fix the patch so that dynamic reallocation actually works
|
||||
|
Loading…
Reference in New Issue
Block a user