<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Dave,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I've just tried it and it failed.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Before I had tried using the function</FONT></DIV>
<DIV><FONT face=Arial size=2>int virq = of_irq_to_resource(GPIO_IRQ, 0, 
NULL);</FONT></DIV>
<DIV><FONT face=Arial size=2>and it failed the same way</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I call request_irq() in the operation init and 
open, it behaves the same</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I greatky appreciate your help, Dave.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Best Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Duy-Ky</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>//////////////////////////////////////////////////////////////////////////</FONT></DIV>
<DIV><FONT face=Arial size=2>// Start of capture</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Unable to handle kernel paging request for data at 
address 0x0000005e<BR>Faulting instruction address: 0xc000d1e8<BR>Oops: Kernel 
access of bad area, sig: 11 [#1]</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Modules linked in: ppc_drv<BR>NIP: C000D1E8 LR: 
C000D274 CTR: C0006088<BR>REGS: c7883d20 TRAP: 0300&nbsp;&nbsp; Not 
tainted&nbsp; (2.6.20)<BR>MSR: 00009032 &lt;EE,ME,IR,DR&gt;&nbsp; CR: 
22000448&nbsp; XER: 00000000<BR>DAR: 0000005E, DSISR: 20000000<BR>TASK = 
c053a810[767] 'rrgg' THREAD: c7882000<BR>GPR00: C000D274 C7883DD0 C053A810 
0000004A C0282BA8 C7883E08 C7FD9440 C0273EEC<BR>GPR08: 00000000 00000000 
00000100 C0006088 22000448 10018D00 07FFD000 28000422<BR>GPR16: 10090000 
100B0000 100B7328 00000000 00000000 00000000 100C8968 100C89A8<BR>GPR24: 
100BDFE8 00000000 00000000 C7FD9440 FFFFFFEA C7883E08 C0282BA8 0000004A<BR>Call 
Trace:<BR>[C7883DD0] [C7FD5EE8]&nbsp; (unreliable)<BR>[C7883DF0] 
[C000D274]<BR>[C7883E00] [C0009FC8]<BR>[C7883E30] [C000609C]<BR>[C7883E60] 
[C9072030]<BR>[C7883E70] [C0063E5C]<BR>[C7883EA0] [C005FFAC]<BR>[C7883EC0] 
[C0060244]<BR>[C7883F20] [C00602B8]<BR>[C7883F40] [C000F540]<BR>--- Exception: 
c01Instruction dump:<BR>409effc8 80030024 900b0020 4e800020 7d800026 9421ffe0 
7c0802a6 bfa10014<BR>7c9e2378 7cbd2b78 91810010 90010024 &lt;83e30014&gt; 
2f9f0000 419e0028 2e050000<BR>&nbsp;Segmentation fault<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>// End of Capture</DIV></FONT>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=DaveLiu@freescale.com href="mailto:DaveLiu@freescale.com">Liu 
  Dave</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=duykynguyen@hotmail.com 
  href="mailto:duykynguyen@hotmail.com">Duy-Ky Nguyen</A> ; <A 
  title=linuxppc-embedded@ozlabs.org 
  href="mailto:linuxppc-embedded@ozlabs.org">linuxppc-embedded@ozlabs.org</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, July 15, 2008 7:09 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: Failure of request_irq() for 
  MPC8313 using arch=powerpc</DIV>
  <DIV><BR></DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2>Hi Nguyen,</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2>If current PowerPC linux is using the virq to 
  request_irq,</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2>you need do the irq_of_parse_and_map(np, 0) to get the 
  virq.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2>like.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2>virq = irq_of_parse_and_map(np, 0)</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=317245801-16072008><FONT face=Arial 
  color=#0000ff size=2>request_irq(virq,...);</FONT></SPAN></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><SPAN class=317245801-16072008></SPAN><FONT face=Arial><FONT 
  color=#0000ff><FONT size=2>H<SPAN class=317245801-16072008>ope it can help 
  you.</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=+0><FONT color=#0000ff><FONT size=2><SPAN 
  class=317245801-16072008></SPAN></FONT></FONT></FONT><SPAN 
  class=317245801-16072008></SPAN><FONT face=Arial><FONT color=#0000ff><FONT 
  size=2>T<SPAN 
class=317245801-16072008>hanks,</SPAN></FONT></FONT></FONT></DIV>
  <DIV><FONT size=+0><FONT color=#0000ff><FONT size=2><SPAN 
  class=317245801-16072008></SPAN></FONT></FONT></FONT><SPAN 
  class=317245801-16072008></SPAN><FONT face=Arial><FONT color=#0000ff><FONT 
  size=2>D<SPAN class=317245801-16072008>ave</SPAN></FONT></FONT></FONT></DIV>
  <BLOCKQUOTE dir=ltr 
  style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
    <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
    <HR tabIndex=-1>
    <FONT face=Tahoma size=2><B>From:</B> <A 
    href="mailto:linuxppc-embedded-bounces+daveliu=freescale.com@ozlabs.org">linuxppc-embedded-bounces+daveliu=freescale.com@ozlabs.org</A> 
    [mailto:linuxppc-embedded-bounces+daveliu=freescale.com@ozlabs.org] <B>On 
    Behalf Of </B>Duy-Ky Nguyen<BR><B>Sent:</B> 2008年7月16日 8:59 AM<BR><B>To:</B> 
    <A 
    href="mailto:linuxppc-embedded@ozlabs.org">linuxppc-embedded@ozlabs.org</A><BR><B>Subject:</B> 
    Failure of request_irq() for MPC8313 using arch=powerpc<BR></FONT><BR></DIV>
    <DIV></DIV>
    <DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>I had no problem in using request_irq() for 
    MPC8272 with arch=ppc from Montavista Linux</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>But I have failure for MPC8313 with 
    arch=powerpc from FreeScale LTIB Linux with error code -38</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>I found its header file mpc83xx.h under 
    include/asm-ppc, while it's supposed to be under 
    include/asm-powerpc.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>I did try to copy the header file to directory 
    asm-powerpc</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>From MPC8313 datasheet, I have </FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>GPIO_IRQ = 74</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>and I use</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>DEVICE_NAME = "ppc"</FONT></DIV>
    <DIV><FONT face=Arial size=2>IRQ_FLAG = IRQF_SHARED&nbsp;&nbsp;&nbsp; // use 
    new flag</FONT></DIV>
    <DIV><FONT face=Arial size=2>here my function call</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>request_irq (GPIO_IRQ,</FONT></DIV>
    <DIV><FONT face=Arial 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ppc_ISR,&nbsp;&nbsp;</FONT></DIV>
    <DIV><FONT face=Arial 
    size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IRQ_FLAG,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DEVICE_NAME,&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NULL);&nbsp;&nbsp;&nbsp;<BR></FONT></DIV>
    <DIV><FONT face=Arial size=2>I'd appreciate any help on this 
    problem.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>Best Regards,</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>Duy-Kyng</FONT></DIV>
    <DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT>
    <DIV><FONT face=Arial 
size=2>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></FONT></BODY></HTML>