From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost.localdomain (85-21-157-111.broadband.corbina.ru [85.21.157.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id A746C67B42 for ; Sat, 11 Feb 2006 06:22:19 +1100 (EST) Message-ID: <43ECE5C4.5090308@ru.mvista.com> Date: Fri, 10 Feb 2006 22:13:08 +0300 From: Andrei Konovalov MIME-Version: 1.0 To: =?ISO-8859-1?Q?Eckart_G=F6hler?= Subject: Re: mv-linux: Problem to implement custom driver interrupt handling References: <43E74FB2.6010603@ifen.com> <43E767DE.4060003@ru.mvista.com> <43ECB078.4080209@ifen.com> In-Reply-To: <43ECB078.4080209@ifen.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Eckart Göhler wrote: > > Andrei Konovalov wrote: > > Hi, > > > > In the Linux driver you should not access the interrupt controller > > directly. > > The relevant XIntc_* calls are done by arch/ppc/syslib/xilinx_pic.c > code. > > E.g. the particular interrupt is unmasked when one calls request_irq(). > > > > Few more comments below. > > > Hi, > > Thanks a lot. Actually I inserted the low-level code below after > request_irq() did not work. The note about xilinx_pic.c code (that is > located in my implementation in arch/ppc/kernel/xilinx_pic.c) lead me to Correct. arch/ppc/syslib/xilinx_pic.c is the 2.6 kernel case. > the problem origin that should be reported here for the community (which > I presume already know the very fact): > The interrupt numbering generated by the EDK is opposite to the one used > by linux, i.e. interrupt number 4 reported in EDK-generated > xparameters.h/xparameters_ml300.h becomes 31-4 = 27 when using request_irq. Yes, this is true for 2.4 kernels. In 2.6 the "natural" irq numbering is used. I.e. for irq number of 4 (as per xparameters.h) one should pass to request_irq() 31-4 = 27 if using 2.4 kernel and 4 if using 2.6 kernel. Thanks, Andrei > Therefore the handler was not called because he was attached to the > wrong interrupt, and also was not able to reset the interrupt pending > flag, that must be done as you noted below. > > cheers > > eckart