Commit a10a5a17 authored by Nathan Lynch's avatar Nathan Lynch Committed by Michael Ellerman

powerpc/pseries/hibernation: pass stream id via function arguments

There is no need for the stream id to be a file-global variable; pass
it from hibernate_store() to pseries_suspend_begin() for the
H_VASI_STATE call.
Signed-off-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201207215200.1785968-19-nathanl@linux.ibm.com
parent 52719fce
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <asm/topology.h> #include <asm/topology.h>
#include "../../kernel/cacheinfo.h" #include "../../kernel/cacheinfo.h"
static u64 stream_id;
static struct device suspend_dev; static struct device suspend_dev;
static DECLARE_COMPLETION(suspend_work); static DECLARE_COMPLETION(suspend_work);
static struct rtas_suspend_me_data suspend_data; static struct rtas_suspend_me_data suspend_data;
...@@ -29,7 +28,7 @@ static atomic_t suspending; ...@@ -29,7 +28,7 @@ static atomic_t suspending;
* Return value: * Return value:
* 0 on success / other on failure * 0 on success / other on failure
**/ **/
static int pseries_suspend_begin(suspend_state_t state) static int pseries_suspend_begin(u64 stream_id)
{ {
long vasi_state, rc; long vasi_state, rc;
unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
...@@ -132,6 +131,7 @@ static ssize_t store_hibernate(struct device *dev, ...@@ -132,6 +131,7 @@ static ssize_t store_hibernate(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
u64 stream_id;
int rc; int rc;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
...@@ -140,7 +140,7 @@ static ssize_t store_hibernate(struct device *dev, ...@@ -140,7 +140,7 @@ static ssize_t store_hibernate(struct device *dev,
stream_id = simple_strtoul(buf, NULL, 16); stream_id = simple_strtoul(buf, NULL, 16);
do { do {
rc = pseries_suspend_begin(PM_SUSPEND_MEM); rc = pseries_suspend_begin(stream_id);
if (rc == -EAGAIN) if (rc == -EAGAIN)
ssleep(1); ssleep(1);
} while (rc == -EAGAIN); } while (rc == -EAGAIN);
...@@ -148,8 +148,6 @@ static ssize_t store_hibernate(struct device *dev, ...@@ -148,8 +148,6 @@ static ssize_t store_hibernate(struct device *dev,
if (!rc) if (!rc)
rc = pm_suspend(PM_SUSPEND_MEM); rc = pm_suspend(PM_SUSPEND_MEM);
stream_id = 0;
if (!rc) if (!rc)
rc = count; rc = count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment