Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-15 10:23:48 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-15 10:24:08 +0100
commit1c49681b9127aeb652ab4945c7d14818e9f04777 (patch)
treefe2c023eddd532cc2609e0e7b251f8492271390c
parent0b69ecc2e0c12af1047c3e47ee260d80af744f3d (diff)
powerpc/papr_scm: Use the correct bind address (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.9-033-powerpc-papr_scm-Use-the-correct-bind-address.patch67
-rw-r--r--series.conf1
2 files changed, 68 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.9-033-powerpc-papr_scm-Use-the-correct-bind-address.patch b/patches.kernel.org/4.20.9-033-powerpc-papr_scm-Use-the-correct-bind-address.patch
new file mode 100644
index 0000000000..ff3c04fe9e
--- /dev/null
+++ b/patches.kernel.org/4.20.9-033-powerpc-papr_scm-Use-the-correct-bind-address.patch
@@ -0,0 +1,67 @@
+From: Oliver O'Halloran <oohall@gmail.com>
+Date: Thu, 31 Jan 2019 12:53:47 +1100
+Subject: [PATCH] powerpc/papr_scm: Use the correct bind address
+References: bnc#1012628
+Patch-mainline: 4.20.9
+Git-commit: 5a3840a470c41ec0b85cd36ca80370330656b163
+
+commit 5a3840a470c41ec0b85cd36ca80370330656b163 upstream.
+
+When binding an SCM volume to a physical address the hypervisor has the
+option to return early with a continue token with the expectation that
+the guest will resume the bind operation until it completes. A quirk of
+this interface is that the bind address will only be returned by the
+first bind h-call and the subsequent calls will return
+0xFFFF_FFFF_FFFF_FFFF for the bind address.
+
+We currently do not save the address returned by the first h-call. As a
+result we will use the junk address as the base of the bound region if
+the hypervisor decides to split the bind across multiple h-calls. This
+bug was found when testing with very large SCM volumes where the bind
+process would take more time than they hypervisor's internal h-call time
+limit would allow. This patch fixes the issue by saving the bind address
+from the first call.
+
+Cc: stable@vger.kernel.org
+Fixes: b5beae5e224f ("powerpc/pseries: Add driver for PAPR SCM regions")
+Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ arch/powerpc/platforms/pseries/papr_scm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/arch/powerpc/platforms/pseries/papr_scm.c b/arch/powerpc/platforms/pseries/papr_scm.c
+index 7d6457ab5d34..bba281b1fe1b 100644
+--- a/arch/powerpc/platforms/pseries/papr_scm.c
++++ b/arch/powerpc/platforms/pseries/papr_scm.c
+@@ -43,6 +43,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
+ {
+ unsigned long ret[PLPAR_HCALL_BUFSIZE];
+ uint64_t rc, token;
++ uint64_t saved = 0;
+
+ /*
+ * When the hypervisor cannot map all the requested memory in a single
+@@ -56,6 +57,8 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
+ rc = plpar_hcall(H_SCM_BIND_MEM, ret, p->drc_index, 0,
+ p->blocks, BIND_ANY_ADDR, token);
+ token = ret[0];
++ if (!saved)
++ saved = ret[1];
+ cond_resched();
+ } while (rc == H_BUSY);
+
+@@ -64,7 +67,7 @@ static int drc_pmem_bind(struct papr_scm_priv *p)
+ return -ENXIO;
+ }
+
+- p->bound_addr = ret[1];
++ p->bound_addr = saved;
+
+ dev_dbg(&p->pdev->dev, "bound drc %x to %pR\n", p->drc_index, &p->res);
+
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 2c385d0da4..217cdb2202 100644
--- a/series.conf
+++ b/series.conf
@@ -1115,6 +1115,7 @@
patches.kernel.org/4.20.9-030-ARM-tango-Improve-ARCH_MULTIPLATFORM-compatibi.patch
patches.kernel.org/4.20.9-031-ARM-dts-da850-fix-interrupt-numbers-for-clocks.patch
patches.kernel.org/4.20.9-032-firmware-arm_scmi-provide-the-mandatory-device.patch
+ patches.kernel.org/4.20.9-033-powerpc-papr_scm-Use-the-correct-bind-address.patch
########################################################
# Build fixes that apply to the vanilla kernel too.