Message ID | 20201009040001.310868-3-amitay@ozlabs.org |
---|---|
State | Accepted |
Headers | show |
Series | Fix thread status for sbefifo thread driver | expand |
On Fri, 9 Oct 2020 at 04:00, Amitay Isaacs <amitay@ozlabs.org> wrote: > > Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> Reviewed-by: Joel Stanley <joel@jms.id.au> > --- > libpdbg/p9chip.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c > index f33696e..db6efd5 100644 > --- a/libpdbg/p9chip.c > +++ b/libpdbg/p9chip.c > @@ -90,7 +90,7 @@ static uint64_t thread_write(struct thread *thread, uint64_t addr, uint64_t data > return pib_write(chip, addr, data); > } > > -static struct thread_state p9_get_thread_status(struct thread *thread) > +static struct thread_state p9_thread_state(struct thread *thread) > { > uint64_t value; > struct thread_state thread_state; > @@ -118,7 +118,7 @@ static int p9_thread_probe(struct pdbg_target *target) > struct thread *thread = target_to_thread(target); > > thread->id = pdbg_target_index(target); > - thread->status = p9_get_thread_status(thread); > + thread->status = p9_thread_state(thread); > > return 0; > } > @@ -147,7 +147,7 @@ static int p9_thread_start(struct thread *thread) > thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(6 + 8*thread->id)); > } > > - thread->status = p9_get_thread_status(thread); > + thread->status = p9_thread_state(thread); > > return 0; > } > @@ -157,14 +157,14 @@ static int p9_thread_stop(struct thread *thread) > int i = 0; > > thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(7 + 8*thread->id)); > - while (!(p9_get_thread_status(thread).quiesced)) { > + while (!(p9_thread_state(thread).quiesced)) { > usleep(1000); > if (i++ > RAS_STATUS_TIMEOUT) { > PR_ERROR("Unable to quiesce thread\n"); > break; > } > } > - thread->status = p9_get_thread_status(thread); > + thread->status = p9_thread_state(thread); > > return 0; > } > @@ -214,7 +214,7 @@ static int p9_thread_sreset(struct thread *thread) > > thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(4 + 8*thread->id)); > > - thread->status = p9_get_thread_status(thread); > + thread->status = p9_thread_state(thread); > > return 0; > } > @@ -268,7 +268,7 @@ static int p9_ram_setup(struct thread *thread) > CHECK_ERR_GOTO(out_fail, > thread_write(thread, P9_SCOMC, 0x0)); > > - thread->status = p9_get_thread_status(thread); > + thread->status = p9_thread_state(thread); > > thread->ram_is_setup = true; > > @@ -398,7 +398,7 @@ static int p9_ram_destroy(struct thread *thread) > /* Deactivate thread for ramming */ > CHECK_ERR(thread_write(thread, P9_THREAD_INFO, 0)); > > - thread->status = p9_get_thread_status(thread); > + thread->status = p9_thread_state(thread); > > thread->ram_is_setup = false; > > -- > 2.26.2 > > -- > Pdbg mailing list > Pdbg@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/pdbg
diff --git a/libpdbg/p9chip.c b/libpdbg/p9chip.c index f33696e..db6efd5 100644 --- a/libpdbg/p9chip.c +++ b/libpdbg/p9chip.c @@ -90,7 +90,7 @@ static uint64_t thread_write(struct thread *thread, uint64_t addr, uint64_t data return pib_write(chip, addr, data); } -static struct thread_state p9_get_thread_status(struct thread *thread) +static struct thread_state p9_thread_state(struct thread *thread) { uint64_t value; struct thread_state thread_state; @@ -118,7 +118,7 @@ static int p9_thread_probe(struct pdbg_target *target) struct thread *thread = target_to_thread(target); thread->id = pdbg_target_index(target); - thread->status = p9_get_thread_status(thread); + thread->status = p9_thread_state(thread); return 0; } @@ -147,7 +147,7 @@ static int p9_thread_start(struct thread *thread) thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(6 + 8*thread->id)); } - thread->status = p9_get_thread_status(thread); + thread->status = p9_thread_state(thread); return 0; } @@ -157,14 +157,14 @@ static int p9_thread_stop(struct thread *thread) int i = 0; thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(7 + 8*thread->id)); - while (!(p9_get_thread_status(thread).quiesced)) { + while (!(p9_thread_state(thread).quiesced)) { usleep(1000); if (i++ > RAS_STATUS_TIMEOUT) { PR_ERROR("Unable to quiesce thread\n"); break; } } - thread->status = p9_get_thread_status(thread); + thread->status = p9_thread_state(thread); return 0; } @@ -214,7 +214,7 @@ static int p9_thread_sreset(struct thread *thread) thread_write(thread, P9_DIRECT_CONTROL, PPC_BIT(4 + 8*thread->id)); - thread->status = p9_get_thread_status(thread); + thread->status = p9_thread_state(thread); return 0; } @@ -268,7 +268,7 @@ static int p9_ram_setup(struct thread *thread) CHECK_ERR_GOTO(out_fail, thread_write(thread, P9_SCOMC, 0x0)); - thread->status = p9_get_thread_status(thread); + thread->status = p9_thread_state(thread); thread->ram_is_setup = true; @@ -398,7 +398,7 @@ static int p9_ram_destroy(struct thread *thread) /* Deactivate thread for ramming */ CHECK_ERR(thread_write(thread, P9_THREAD_INFO, 0)); - thread->status = p9_get_thread_status(thread); + thread->status = p9_thread_state(thread); thread->ram_is_setup = false;
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> --- libpdbg/p9chip.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)