[Skiboot] [PATCH 03/12] psi: Add P9 support

Michael Neuling mikey at neuling.org
Tue Aug 2 16:37:29 AEST 2016


On Fri, 2016-07-22 at 16:59 +1000, Stewart Smith wrote:
> Michael Neuling <mikey at neuling.org> writes:
>> > From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
>> > This reworks interrupt handling a bit and adds support for XIVE
> > based interrupts and the new sources available on POWER9.
>> > Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> > Signed-off-by: Michael Neuling <mikey at neuling.org>
> fails to boot on dual socked P8 fsp machine with:
> 
> [34418453602,7] IRQ: Registering 0010..0015 ops @0x3008d038 (data
> 0x30362880)
> [34418473994,5] PSI[0x000]: Found PSI bridge [working=1, active=1]
> [34418481962,5] PSI[0x001]: Working chip not found
> [34418491714,7] IRQ: Registering 0010..0015 ops @0x3008d038 (data
> 0x30362c80)
> [34418495585,3] register IRQ source overlap !
> [34418497576,3]   new: 10..15 old: 10..15
> [34418500081,0] Assert fail: core/interrupts.c:51:0
> [34418504866,0] Aborting!
> CPU 0870 Backtrace:
>  S: 0000000033dc3a10 R: 0000000030013634   .backtrace+0x24
>  S: 0000000033dc3a90 R: 000000003001871c   ._abort+0x4c
>  S: 0000000033dc3b10 R: 0000000030018798   .assert_fail+0x34
>  S: 0000000033dc3b90 R: 0000000030019ce0   .__register_irq_source+0xe8
>  S: 0000000033dc3c20 R: 0000000030031e10   .psi_init+0x470
>  S: 0000000033dc3e30 R: 00000000300143e4   .main_cpu_entry+0x43c
>  S: 0000000033dc3f00 R: 000000003000259c   boot_entry+0x19c
> 
> the reason being, psi->chip being used before initialized.
> 
> The following fix should likely come in v2 of this patch :)
> 
> Not convinced there isn't another bug somewhere in this series... I had
> a whole bunch of soft lockups on whatever kernel randomly booted by
> default on the machine I was testing on.

I hit this too.  I'm going to repost the patch, but with the below fix
instead.  It inits psi->chip_id earlier so less likely to cause us problems
later.  benh's preference was this way.

Mikey


diff --git a/hw/psi.c b/hw/psi.c
index 5c852ca..340c03f 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -935,6 +935,7 @@ static struct psi *psi_probe_p7(struct proc_chip *chip, u64 base)
 		psi = alloc_psi(base);
 		if (!psi)
 			return NULL;
+		psi->chip_id = chip->id;
 		psi->working = true;
 		rc = val >> 36;	/* Bits 0:1 = 0x00; 2:27 Bridge BAR... */
 		rc <<= 20;	/* ... corresponds to bits 18:43 of base addr */
@@ -961,6 +962,7 @@ static struct psi *psi_probe_p8(struct proc_chip *chip, u64 base)
 		psi = alloc_psi(base);
 		if (!psi)
 			return NULL;
+		psi->chip_id = chip->id;
 		psi->working = true;
 		psi->regs = (void *)(val & ~PSIHB_XSCOM_P8_HBBAR_EN);
 		psi->interrupt = get_psi_interrupt(psi->chip_id);
@@ -992,6 +994,7 @@ static struct psi *psi_probe_p9(struct proc_chip *chip, u64 base)
 	psi = alloc_psi(base);
 	if (!psi)
 		return NULL;
+	psi->chip_id = chip->id;
 	psi->working = true;
 	psi->regs = (void *)(val & ~PSIHB_XSCOM_P9_HBBAR_EN);
 
@@ -1037,7 +1040,6 @@ static bool psi_init_psihb(struct dt_node *psihb)
 		unlock(&psi_lock);
 	}
 
-	psi->chip_id = chip->id;
 	chip->psi = psi;
 
 	psi_activate_phb(psi);


More information about the Skiboot mailing list