initiating DMA and going to sleep while holding spinlock

Chan Kim ckim at etri.re.kr
Fri May 15 08:29:41 EDT 2015


Hello,
Ok,I know the thing in my email title should be avoided but I have this basic question (I'm still a newbie).
I'm modifying smsc911x Ethernet driver so that writing to/readng from the FIFO can be done by our own DMA controller.
Since FIFO should not be messed up, the original driver uses spinlock during the FIFO burst access. I wanted to do this FIFO access using DMA, so I changed some code of the FIFO access code to use DMA and inserted wait_event_interruptible to go to sleep (that's bad) and this caused BUG : scheduling while atomic.
I could separate it before holding the spinlock to avoid this(DMA and PIO loop). But what if during the DMA, some other process tries to access FIFO? (other network processes can access the network anyway). How do people prevent this 'FIFO access by other process while in DMA' ? I have to sleep during DMA. Any standard method? Any help will be appreciated.
Best regards,
Chan Kim



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150515/830de445/attachment.html 


More information about the Kernelnewbies mailing list