From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: jmk@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] ATA next In-Reply-To: <20040122162315.D28365@cackle.proxima.alt.za> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 22 Jan 2004 10:22:37 -0500 Topicbox-Message-UUID: bd894454-eacc-11e9-9e20-41e7f4b1d025 On Thu Jan 22 09:24:40 EST 2004, lucio@proxima.alt.za wrote: > ... > Even more seriously (in my opinion) the IDE controller (ATA based, > as this host has no PCI at all) is not recognised as DMA capable, > so I get the dreaded: > disabling dma: not on a busmastering controller > message. > > I think jmk knows how to fix this. ... Remove the lines which enable DMA in whichever rc script is run at boot, e.g. you might have something like for(disk in /dev/sd[C-F]*) echo dma on >$disk/ctl in the cpurc for that system. The code in sdata.c/atawctl() could perhaps be a little smarter and not allow dmactl to be set if ctlr->prdt is nil, then at least you'd get an error when you tried to set dma on, not later when you actually tried some data transfers. Something like if(strcmp(cb->f[0], "dma") == 0){ if(cb->nf != 2 || drive->dma == 0) error(Ebadctl); if(strcmp(cb->f[1], "on") == 0){ ilock(ctlr); if(ctlr->prdt) drive->dmactl = drive->dma; else drive->dmactl = 0; iunlock(ctlr); if(drive->dmactl == 0) error("not on a busmastering controller\n"); } else if(strcmp(cb->f[1], "off") == 0) drive->dmactl = 0; else error(Ebadctl); } although I've just jotted this down and not actually tried it.