[Pdbg] [PATCH v2 4/7] libpdbg/p8chip.c: release special wakeups for P8
Nicholas Piggin
npiggin at gmail.com
Tue Mar 26 17:01:56 AEDT 2019
Alistair Popple's on March 26, 2019 11:10 am:
> Hi Nick,
>
>> +static void p8_core_release(struct pdbg_target *target)
>> +{
>> + struct pdbg_target *child;
>> + struct core *core = target_to_core(target);
>> + enum pdbg_target_status status;
>> +
>> + usleep(1); /* enforce small delay before and after it is cleared */
>> +
>> + /* Probe and release all threads to ensure release_spwkup is up to
>> + * date */
>> + pdbg_for_each_target("thread", target, child) {
>> + status = pdbg_target_status(child);
>> +
>> + /* This thread has already been release so should have set
>> + * release_spwkup to false if it was quiesced, */
>> + if (status == PDBG_TARGET_RELEASED)
>> + continue;
>> +
>> + status = pdbg_target_probe(child);
>> + if (status != PDBG_TARGET_ENABLED)
>> + continue;
>> +
>> + /* Release the thread to ensure release_spwkup is updated. */
>> + pdbg_target_release(child);
>> + }
>
> So the intent of this loop is ensure all threads have their release methods
> called prior to doing the release for the core?
Yes, from memory.
> The pdbg core should ensure
> that is the case - ie. pdbg_target_release(core) should release all the child
> threads first which I think makes this code redundant.
>
Okay, this is taken from P9 code, so maybe we could remove the
redundant bits from both in a later patch?
Thanks,
Nick
More information about the Pdbg
mailing list