DMA issue

Adrian McMenamin <[email protected]> Mon, 21 Jun 2004 23:59:38 +0100
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.ports.sh.general
Message-ID <[email protected]>
I suspect this is more to do with how the kernel works than SH coding, but 
I'll ask anayway...

Writing some maple driver code on the Dreamcast which is called by the kernel 
at start up ...

	for (i=0; i<(1<<MAPLE_DMA_PAGES); i++)
		dma_cache_wback_inv(maple_sendbuf+i*PAGE_SIZE, PAGE_SIZE);
	ctrl_outl(1, MAPLE_STATE); /*Start maple DMA transfer */
	do {
	}while (wait_event_interruptible(maple_dma_wait, maple_dma_done())!= 0); 


with...

int maple_dma_done(void)
{
//	pr_info("Testing DMA\n");
	return (ctrl_inl(MAPLE_STATE) & 1) == 0;
}

When this is run on start up it hangs the box. Uncomment the pr_info line (as 
I will do in the patch I am about to post) and it works as I expect it (ie 
waits till maple dma is done and then reads off the reply).

What have I got wrong here?

Adrian



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com