[Pdbg] [PATCH v2 4/7] libpdbg/p8chip.c: release special wakeups for P8

Alistair Popple alistair at popple.id.au
Tue Mar 26 12:10:08 AEDT 2019


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? 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.

- Alistair

> +
> +	if (!core->release_spwkup)
> +		return;
> +
> +	deassert_special_wakeup(core);
> +	usleep(10000);
> +}
> +
>  static struct core p8_core = {
>  	.target = {
>  		.name = "POWER8 Core",
>  		.compatible = "ibm,power8-core",
>  		.class = "core",
>  		.probe = p8_core_probe,
> +		.release = p8_core_release,
>  	},
>  };
>  DECLARE_HW_UNIT(p8_core);




More information about the Pdbg mailing list