diff --git a/SOURCES/librtas-papr.patch b/SOURCES/librtas-papr.patch new file mode 100644 index 0000000..1ae37fa --- /dev/null +++ b/SOURCES/librtas-papr.patch @@ -0,0 +1,50 @@ +From 4e46c718f42bf05e797c7fcfdd6cfc2a21fb4c91 Mon Sep 17 00:00:00 2001 +From: Tyrel Datwyler +Date: Wed, 7 Jan 2015 14:26:15 -0500 +Subject: [PATCH] PAPR requires that the status word is the first parameter in + the return buffer for rtas calls. Due to this requirement the librtas + sc_rtas_call function always performs a be32toh operation on the first + parameter in the return buffer. However, the ibm,open-errinjct rtas is + special in that its return buffer is switched. The "Open Token" is the first + return parameter while the "Status" word is second. + +This patch fixes this special case in the sc_errinjct_open function such +that the byteswapping of "status" and "otoken" are handled correctly. + +Signed-off-by: Tyrel Datwyler +--- + librtas_src/syscall_calls.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/librtas_src/syscall_calls.c b/librtas_src/syscall_calls.c +index dc52370..a81c25c 100644 +--- a/librtas_src/syscall_calls.c ++++ b/librtas_src/syscall_calls.c +@@ -493,20 +493,20 @@ int sc_errinjct_close(int token, int otoken) + int sc_errinjct_open(int token, int *otoken) + { + uint64_t elapsed = 0; +- __be32 be_otoken; ++ __be32 be_status; + int status; + int rc; + + do { +- rc = sc_rtas_call(token, 0, 2, &be_otoken, &status); ++ rc = sc_rtas_call(token, 0, 2, otoken, &be_status); + if (rc) + return rc; + ++ status = be32toh(be_status); ++ + rc = handle_delay(status, &elapsed); + } while (rc == CALL_AGAIN); + +- *otoken = be32toh(be_otoken); +- + dbg1("(%p) = %d, %d\n", otoken, rc ? rc : status, *otoken); + return rc ? rc : status; + } +-- +1.9.3 + diff --git a/SPECS/librtas.spec b/SPECS/librtas.spec index c86d1e0..839aa6b 100644 --- a/SPECS/librtas.spec +++ b/SPECS/librtas.spec @@ -1,7 +1,7 @@ Summary: Libraries to provide access to RTAS calls and RTAS events Name: librtas Version: 1.3.13 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://librtas.ozlabs.org License: CPL Group: System Environment/Libraries @@ -10,6 +10,8 @@ Source: http://downloads.sourceforge.net/project/%{name}/%{name}-%{version}.tar. #Fedora specific patch Patch0: %{name}-1.3.4-libdir.patch Patch1: %{name}-1.3.6-ln.patch +# Resolves #1184466 +Patch2: %{name}-papr.patch Obsoletes: librtas(ppc) @@ -38,6 +40,7 @@ developing programs using librtas. %setup %patch0 -p1 -b .libdir %patch1 -p1 -b .ln +%patch2 -p1 -b .papr find . -name "*.so.*" -print -delete @@ -80,6 +83,9 @@ mkdir -p %{buildroot}/%{_libdir} %{_libdir}/libofdt.so %changelog +* Mon Jun 08 2015 Jakub Čajka 1.3.13-2 +- Resolves: #1184466 - errinct failed with error " errinjct: RTAS: ioa-bus-error: Argument error (-3)" + * Mon Nov 10 2014 Jakub Čajka 1.3.13-1 - Resolves: #1161551 - librtas package update for RHEL7.1 Beta