for multiple disk configurations, it was possible to get an interrupt for a disk that hasn't been configured yet, thus indirecting a nil edma ptr. Notes: Mon Nov 27 11:27:13 EST 2006 geoff no need for the new memsets; the kernel malloc always zeroes memory. Reference: /n/sources/patch/applied/mv50-spinup Date: Mon Nov 20 16:37:02 CET 2006 Signed-off-by: quanstro@quanstro.net Reviewed-by: geoff --- /sys/src/9/pc/sdmv50xx.c Mon Nov 20 16:34:27 2006 +++ /sys/src/9/pc/sdmv50xx.c Mon Nov 20 16:34:19 2006 @@ -798,6 +798,8 @@ for(i=0; indrive; i++){ if(cause & (3<<(i*2+i/4))){ drive = &ctlr->drive[i]; + if(drive->edma == 0) + continue; // not ready yet. ilock(drive); updatedrive(drive, drive->edma->iec); while(ctlr->chip[i/4].arb->ic & (0x0101 << (i%4))){ @@ -846,6 +848,8 @@ free(sdev); continue; } +memset(sdev, 0, sizeof *sdev); +memset(ctlr, 0, sizeof *ctlr); io = p->mem[0].bar & ~0x0F; mem = vmap(io, p->mem[0].size); if(mem == 0){