From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from felloff.net ([199.191.58.38]) by pp; Sat Jan 3 21:59:11 EST 2015 Message-ID: List-ID: <9front.9front.org> X-Glyph: ➈ X-Bullshit: scale-out managed database method markup Date: Sun, 4 Jan 2015 03:58:59 +0100 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] CDROM on third drive? In-Reply-To: <3e17c96c8907381879ff6e2dcb58fe68@mars.jitaku.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit found it, i made a new kernel under: http://felloff.net/usr/cinap_lenrek/9pcfkenji2 the problem is that the ahci pci bar is probably wrong. i added checks for this now so it shouldnt crash in this place anymore. if there are still issues, pass the *noahci=1 boot parameter to the kernel in non-legacy mode. that should at least get the kernel up and we can inspect the pci device (using pci(1)) from netbooted plan9. -- cinap PS: term% ktrace -i /tmp/9pcfkenji0 f010852c f0018c40 src(0xf010852c); // dumpstack+0x10 // data at 0xf0018c48? f016376c src(0xf016376c); // panic+0xd2 // data at 0xf0018d70? f0108670 src(0xf0108670); // fault386+0xa3 // data at 0xf0018e20? f0107c39 src(0xf0107c39); // trap+0x15b // data at 0xf0018ee0? f01005f0 src(0xf01005f0); // forkret //passing interrupt frame; last pc found at sp=0xf0018ee0 // data at 0xf0018f20? f01b6736 src(0xf01b6736); // ahciidle+0x12 // data at 0xf0018f44? f01b6a25 src(0xf01b6a25); // ahciconfigdrive+0x78 // data at 0xf0018f64? f01b7424 src(0xf01b7424); // configdrive+0x2c // data at 0xf0018f7c? f01ba366 src(0xf01ba366); // iapnp+0x337 // data at 0xf0018fc0? f01d157b src(0xf01d157b); // sdreset+0x3d // data at 0xf0018fd8? f0203550 src(0xf0203550); // chandevreset+0x24 acid: src(0xf01b6736); // ahciidle+0x12 /sys/src/9/pc/sdiahci.c:510 505 ahciidle(Aport *port) 506 { 507 ulong *p, i, r; 508 509 p = &port->cmd; >510 if((*p & Arun) == 0) 511 return 0; 512 *p &= ~Ast; 513 r = 0; 514 for(i = 0; i < 500; i += 25){ 515 if((*p & Acr) == 0) diff -r 1ccba5ce1e27 sys/src/9/pc/sdiahci.c --- a/sys/src/9/pc/sdiahci.c Sat Jan 03 18:33:35 2015 +0100 +++ b/sys/src/9/pc/sdiahci.c Sun Jan 04 03:50:30 2015 +0100 @@ -2159,7 +2159,9 @@ while((p = pcimatch(p, 0, 0)) != nil){ if((type = didtype(p)) == -1) continue; - if(p->mem[Abar].bar == 0) + if((p->mem[Abar].bar & ~0xf) == 0 || (p->mem[Abar].bar & 1) != 0) + continue; + if(p->mem[Abar].size < 0x180) continue; if(niactlr == NCtlr){ print("iapnp: %s: too many controllers\n", tname[type]); @@ -2208,11 +2210,14 @@ d->ctlr = c; if((c->hba->pi & 1<name, sizeof d->name, "iahci%d.%d", niactlr, i); - d->port = (Aport*)(c->mmio + 0x80*i + 0x100); + io = 0x100 + 0x80*i; + if((io + 0x80) > p->mem[Abar].size) + continue; + d->port = (Aport*)(c->mmio + io); d->portc.p = d->port; d->portc.m = &d->portm; d->driveno = n++; + snprint(d->name, sizeof d->name, "iahci%d.%d", niactlr, i); c->drive[d->driveno] = d; iadrive[niadrive + d->driveno] = d; }