powerpc/pseries/mobility: use struct for shared state

The atomic_t counter is the only shared state for the join/suspend
sequence so far, but that will change. Contain it in a
struct (pseries_suspend_info), and document its intended use. No
functional change.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210315080045.460331-2-nathanl@linux.ibm.com

authored by Nathan Lynch and committed by Michael Ellerman e834df6c cc7a0bb0

+19 -3
+19 -3
arch/powerpc/platforms/pseries/mobility.c
··· 452 452 return ret; 453 453 } 454 454 455 + /** 456 + * struct pseries_suspend_info - State shared between CPUs for join/suspend. 457 + * @counter: Threads are to increment this upon resuming from suspend 458 + * or if an error is received from H_JOIN. The thread which performs 459 + * the first increment (i.e. sets it to 1) is responsible for 460 + * waking the other threads. 461 + */ 462 + struct pseries_suspend_info { 463 + atomic_t counter; 464 + }; 465 + 455 466 static int do_join(void *arg) 456 467 { 457 - atomic_t *counter = arg; 468 + struct pseries_suspend_info *info = arg; 469 + atomic_t *counter = &info->counter; 458 470 long hvrc; 459 471 int ret; 460 472 ··· 547 535 int ret; 548 536 549 537 while (true) { 550 - atomic_t counter = ATOMIC_INIT(0); 538 + struct pseries_suspend_info info; 551 539 unsigned long vasi_state; 552 540 int vasi_err; 553 541 554 - ret = stop_machine(do_join, &counter, cpu_online_mask); 542 + info = (struct pseries_suspend_info) { 543 + .counter = ATOMIC_INIT(0), 544 + }; 545 + 546 + ret = stop_machine(do_join, &info, cpu_online_mask); 555 547 if (ret == 0) 556 548 break; 557 549 /*