From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYoL7-0001WD-Ei for qemu-devel@nongnu.org; Tue, 22 Oct 2013 22:38:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYoL2-0008Nb-Mj for qemu-devel@nongnu.org; Tue, 22 Oct 2013 22:38:29 -0400 Received: from [222.73.24.84] (port=6871 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYoL1-0008LN-Mz for qemu-devel@nongnu.org; Tue, 22 Oct 2013 22:38:24 -0400 Message-ID: <52673693.1050807@cn.fujitsu.com> Date: Wed, 23 Oct 2013 10:38:11 +0800 From: Xie Xianshan MIME-Version: 1.0 References: <522EC970.2000804@cn.fujitsu.com> <523025EF.6010406@cn.fujitsu.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Disabling IRQ error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Max Filippov Dear Max, Sorry for the late reply. Thanks for your advice about lowering the irqs after raising them,=20 and that fixed my problem. Thanks again for your kindness. Thanks, Simen =E4=BA=8E 2013/09/11 17:29, Max Filippov =E5=86=99=E9=81=93: > On Wed, Sep 11, 2013 at 12:12 PM, Xie Xianshan wro= te: >> I want to add a new device "fpga" for e500, and trigger an interrupt = IRQ3 >> while the register BB=5FINTR=5FREG which belongs to device "fpga" is wro= te by >> the device driver of "fpga". >> For e500, IRQ3 is an external interrupt irq. >> According the debug log, the disabling error is encoutered during wri= ting >> BB=5FINTR=5FREG register. >> - write BB=5FINTR=5FREG register >> - qemu=5Firq=5Fraise() is called. >> - after serval minutes, >> the error message about disabling irq is displayed. >> - continue the next execution without error(with poll?) > > So your device raises IRQ, but it doesn't lower it. Real devices > usually don't do that, they either generate a short pulse on the > IRQ line (in case of edge-triggered IRQ) or raise IRQ line on > some event and then lower it on a command from its driver > (level-triggered IRQ). > > You can do the following to make your device behave that way: > - make your fpga device capable of lowering its IRQ, e.g. by adding > another register: > >> static void fpga=5Fwrite(FPGAState *s, unsigned int offset, uint32=5Ft v= alue, >> unsigned size) { >> switch(offset) { >> case BB=5FINTR=5FREG: >> qemu=5Firq=5Fraise(s->irq); >> break; > case BB=5FINTC=5FREG: > qemu=5Firq=5Flower(s->irq); > break; >> } >> } > > - provide an interrupt service routine in the linux driver for your fpga > device that would check whether the interrupt was caused by its > device, and if so lower the device's IRQ. > > Thanks. > -- Max > > > =