[Skiboot] [PATCH v2 2/9] hdat: Workaround HostBoot bug with fused core

Vaidyanathan Srinivasan svaidy at linux.vnet.ibm.com
Sat Mar 23 00:29:24 AEDT 2019


* Michael Neuling <mikey at neuling.org> [2019-03-19 17:03:58]:

> From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> 
> The TADA array is missing half of the secondary threads
> 
> Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Signed-off-by: Michael Neuling <mikey at neuling.org>

Tested-by: Vaidyanathan Srinivasan <svaidy at linux.vnet.ibm.com>


> ---
>  hdata/pcia.c | 27 +++++++++++++++++++++------
>  1 file changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/hdata/pcia.c b/hdata/pcia.c
> index 9b210e4dfb..7ba5a6e793 100644
> --- a/hdata/pcia.c
> +++ b/hdata/pcia.c
> @@ -103,7 +103,7 @@ static struct dt_node *add_core_node(struct dt_node *cpus,
>  				     const struct sppcia_core_unique *id,
>  				     bool okay)
>  {
> -	const struct sppcia_cpu_thread *t;
> +	const struct sppcia_cpu_thread *t, *t0;
>  	const struct sppcia_cpu_timebase *timebase;
>  	const struct sppcia_cpu_cache *cache;
>  	const struct sppcia_cpu_attr *attr;
> @@ -172,12 +172,27 @@ static struct dt_node *add_core_node(struct dt_node *cpus,
>  	/* Build ibm,ppc-interrupt-server#s with all threads */
>  	for (i = 0; i < threads; i++) {
>  		t = find_tada(pcia, i);
> -		if (!t) {
> -			threads = i;
> -			break;
> +		if (i == 0)
> +			t0 = t;
> +		if (t) {
> +			iserv[i] = t->pir;
> +		} else {
> +			if (i > 0 && i < cpu_thread_count) {
> +				prerror("CORE[%i]: HDAT TADA bug for"
> +					" thread %d, working around"
> +					" using 0x%04x...\n",
> +					pcia_index(pcia),  i, t0->pir + i);
> +				iserv[i] = t0->pir + i;
> +			} else {
> +				prerror("CORE[%i]: Failed to find TADA for"
> +					" thread %d\n",
> +					pcia_index(pcia),  i);
> +				threads = i;
> +				break;
> +			}
>  		}
> -
> -		iserv[i] = t->pir;
> +		prlog(PR_INFO, "CORE[%i]: Thread %d PIR 0x%04x\n",
> +		      pcia_index(pcia), i, iserv[i]);

I have tested this workaround on a FW booted big-core machine where
the HDAT TADA array bug is present.  However, I have also verified
a fix from the HDAT team which actually provides the correct array.
They will roll-up the fix into hdat/hostboot.  In that case we can
drop this patch (workaround) from OPAL.

--Vaidy



More information about the Skiboot mailing list