Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138483
b: refs/heads/master
c: f52862f
h: refs/heads/master
i:
  138481: 5925d88
  138479: 761cdf7
v: v3
  • Loading branch information
Brian King authored and Benjamin Herrenschmidt committed Feb 23, 2009
1 parent 34b992b commit 2c3b965
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 448e2ca0e32a5c437650d634b6032ab732662338
refs/heads/master: f52862f4070fb930e407d466aa82d8efcc98c9ed
10 changes: 8 additions & 2 deletions trunk/arch/powerpc/kernel/rtas.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ EXPORT_SYMBOL(rtas);

struct rtas_suspend_me_data {
atomic_t working; /* number of cpus accessing this struct */
atomic_t done;
int token; /* ibm,suspend-me */
int error;
struct completion *complete; /* wait on this until working == 0 */
Expand Down Expand Up @@ -689,7 +690,7 @@ static int ibm_suspend_me_token = RTAS_UNKNOWN_SERVICE;
#ifdef CONFIG_PPC_PSERIES
static void rtas_percpu_suspend_me(void *info)
{
long rc;
long rc = H_SUCCESS;
unsigned long msr_save;
int cpu;
struct rtas_suspend_me_data *data =
Expand All @@ -701,7 +702,8 @@ static void rtas_percpu_suspend_me(void *info)
msr_save = mfmsr();
mtmsr(msr_save & ~(MSR_EE));

rc = plpar_hcall_norets(H_JOIN);
while (rc == H_SUCCESS && !atomic_read(&data->done))
rc = plpar_hcall_norets(H_JOIN);

mtmsr(msr_save);

Expand All @@ -724,6 +726,9 @@ static void rtas_percpu_suspend_me(void *info)
smp_processor_id(), rc);
data->error = rc;
}

atomic_set(&data->done, 1);

/* This cpu did the suspend or got an error; in either case,
* we need to prod all other other cpus out of join state.
* Extra prods are harmless.
Expand Down Expand Up @@ -766,6 +771,7 @@ static int rtas_ibm_suspend_me(struct rtas_args *args)
}

atomic_set(&data.working, 0);
atomic_set(&data.done, 0);
data.token = rtas_token("ibm,suspend-me");
data.error = 0;
data.complete = &done;
Expand Down

0 comments on commit 2c3b965

Please sign in to comment.