<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:굴림;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"맑은 고딕";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@맑은 고딕";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"\@굴림";
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The reason I received “</span><span style="font-size:10.0pt;font-family:굴림">IRQ 2 device ald_dmac returned IRQ_WAKE_THREAD but no thread function available”
was that in the interrupt handler, I didn’t return IRQ_HANDLED properly.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:굴림">I guess if I don’t return IRQ_HANDLED, the basic handler interprets it as having returned IRQ_WAKE_THREAD and tries to run the thread given by the thread_fn argument of the request_threaded_irq
function. (which is NULL in my case).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:굴림">So when I made the interrupt handler return IRQ_HANDLED, that message is gone.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:굴림">Chan Kim<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> kernelnewbies-bounces+ckim=etri.re.kr@kernelnewbies.org [mailto:kernelnewbies-bounces+ckim=etri.re.kr@kernelnewbies.org]
<b>On Behalf Of </b>Cha<br>
<b>Sent:</b> Monday, May 18, 2015 6:46 PM<br>
<b>To:</b> kernelnewbies@kernelnewbies.org<br>
<b>Subject:</b> device returned IRQ_WAKE_THREAD but no thread function avable error<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="ezFormProc_div">
<div id="msgbody">
<div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림"><br>
In the smsc911x Ethernet chip driver, I'm changing the FIFO write and read to DMA write and read.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">By the way, this driver uses loopback test during initialization using a simple test packet.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">I registered the DMA controller irq using request_irq(irq, handler, flags, name, dev) which calls request_threaded_irq(irq, handler, NULL, flags, name, dev).
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">The process goes into sleep using wait_event_interruptible() after DMA command and I've seen the ISR handler is called by the DMA completion, and during the ISR, wake_up_interruptible()
is called to wake up the process.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림"> <o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">But when the program runs I get this error message below during the first interrupt processing.
<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">"IRQ 2 device ald_dmac returned IRQ_WAKE_THREAD but no thread function available"<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">I don't know why ald_dmac returned IRQ_WAKE_THREAD (because my interrupt handler only returns IRQ_HANDLED), and I have a feeling that in this case (processing going
to sleep and woken up by the ISR), I should use some other method to register my interrupt.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">Can anybody give me some advice?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">Thanks a lot in advance.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림">Chan Kim<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="line-height:15.0pt"><span style="font-size:10.0pt;font-family:굴림"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>