9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] 9front on Raspberry Pi 400
Date: Wed, 27 Jan 2021 15:30:09 +0100	[thread overview]
Message-ID: <1CAC8FBBA866E1F61E9F8D2C72CA8DCB@felloff.net> (raw)
In-Reply-To: <0100017741afd09d-da43b097-8dba-46b2-98d9-05414e118708-000000@email.amazonses.com>

> However, I am not sure what the syntax is to put the console to the serial port for a Pi in the config.txt.
> If it is the same at 9 on a intel machine, or if there is a specific port number or address number that
> needs to be entered.

no, all you need is a line in cmdline.txt like:

console=0

if you use the 9front image, it is already there.

> My cursory search did not turn up anything. (And of course I’d love to have a serial console as it
> would same me from having to transcribe things like that dump.

the dump isnt that interesting. this is a machine check basically, which is asynchronous.
its not the program on the cpu that crashes here, but hardware signaling theres a unrecoverable
system error by raising a nmi interrupt. maybe caused by the xhci doing a invalid memory
transaction on the pcie bus...

if i had actual documentation on the pcie controller, we might be able to handle that
error SError interrupt by reading some status registers on the pcie controller block.

the problem is the VL805 xhci controller is a complete backbox. there isnt even a
datasheet available. and nobody knows what the firmware does exactly in the xhcireset mailbox
command and what the requirements are exactly when to issue it.

the best cause of action now i think is to simplify the test case and remove other components
from the equation like removing the sdhc driver from the kernel.

and once we have that, we check the exact versions of the firmware files and config.txt
settings and file a ticket for the raspberry pi firmware team.

also, i asked before, what about the GIC debug prints i put? the reason i want to know
is because it could indicate if the kernel is entered in that strange misconfigured
state that i'v seen before. that would be a clear indication that somehting is amiss
in the firmware. i'll show the patch again in case the mail got lost:

diff -r 5c327eddc496 sys/src/9/bcm64/gic.c
--- a/sys/src/9/bcm64/gic.c	Sat Jan 23 20:36:09 2021 -0800
+++ b/sys/src/9/bcm64/gic.c	Wed Jan 27 15:25:44 2021 +0100
@@ -126,6 +126,7 @@
 intrsoff(void)
 {
 	int i, n;
+	u32int mask;
 
 	intrcpushutdown();
 
@@ -138,8 +139,17 @@
 	for(i = 0; i < n; i += 32){
 		dregs[GICD_ISENABLER0 + (i/32)] = -1;
 		coherence();
+		mask = ~dregs[GICD_ISENABLER0 + (i/32)];
+		if(mask)
+			print("intrsoff: GIC intids [%d-%d]: %.8ux are locked in disable state\n",
+				i, i+31, mask);
+		coherence();
 		dregs[GICD_ICENABLER0 + (i/32)] = -1;
 		coherence();
+		mask = dregs[GICD_ISENABLER0 + (i/32)];
+		if(mask)
+			print("intrsoff: GIC intids [%d-%d]: %.8ux are locked in enable state\n",
+				i, i+31, mask);
 	}
 	for(i = 0; i < n; i += 4){
 		dregs[GICD_IPRIORITYR0 + (i/4)] = 0;
@@ -202,10 +212,10 @@
 }
 
 void
-intrenable(int irq, void (*f)(Ureg*, void*), void *a, int tbdf, char*)
+intrenable(int irq, void (*f)(Ureg*, void*), void *a, int tbdf, char *name)
 {
 	Vctl *v;
-	u32int intid;
+	u32int intid, mask;
 	int cpu, prio;
 
 	if(BUSTYPE(tbdf) == BusPCI){
@@ -231,7 +241,7 @@
 	case IRQmbox2:
 	case IRQmbox3:
 	case IRQlocaltmr:
-		print("irqenable: missing documentation for local irq %d\n", irq);
+		print("irqenable: missing documentation for local irq %d, %s\n", irq, name);
 		return;
 
 	default:
@@ -252,7 +262,7 @@
 	v->f = f;
 	v->a = a;
 
-	lock(&vctllock);
+	ilock(&vctllock);
 	if(irq == IRQfiq){
 		vfiq = v;
 		prio = 0;
@@ -280,10 +290,14 @@
 	coherence();
 
 	/* turn on */
-	dregs[GICD_ISENABLER0 + (intid/32)] = 1 << (intid%32);
+	mask = 1 << (intid%32);
+	dregs[GICD_ISENABLER0 + (intid/32)] = mask;
 	coherence();
+	mask &= dregs[GICD_ISENABLER0 + (intid/32)];
+	iunlock(&vctllock);
 
-	unlock(&vctllock);
+	if(mask == 0)
+		print("intrenable: GIC intid %ud did not enable irq %d, %s\n", intid, irq, name);
 }
 
 void


--
cinap

  reply	other threads:[~2021-01-28  1:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 17:23 Mack Wallace
2021-01-23 16:11 ` cinap_lenrek
2021-01-23 21:08   ` Mack Wallace
2021-01-23 21:13   ` Mack Wallace
2021-01-23 23:42     ` cinap_lenrek
2021-01-24 15:01       ` cinap_lenrek
2021-01-26  3:33         ` Mack Wallace
2021-01-26  3:35         ` Mack Wallace
2021-01-26 11:21           ` cinap_lenrek
2021-01-26 12:09           ` cinap_lenrek
2021-01-27  2:32             ` Mack Wallace
2021-01-27 14:30               ` cinap_lenrek [this message]
2021-01-27 17:04               ` cinap_lenrek
2021-01-27 17:57               ` cinap_lenrek
2021-01-29 14:58               ` cinap_lenrek
2021-01-30  2:43                 ` Mack Wallace
2021-01-30  5:54                   ` cinap_lenrek
2021-01-30 19:23                     ` Mack Wallace
2021-01-30 19:41                       ` cinap_lenrek
2021-01-30 19:46                       ` cinap_lenrek
2021-02-01  1:16                         ` Mack Wallace

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1CAC8FBBA866E1F61E9F8D2C72CA8DCB@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).