From: Xie Xianshan <xiexs@cn.fujitsu.com>
To: qemu-devel@nongnu.org, Max Filippov <jcmvbkbc@gmail.com>
Subject: Re: [Qemu-devel] Disabling IRQ error
Date: Wed, 23 Oct 2013 10:38:11 +0800 [thread overview]
Message-ID: <52673693.1050807@cn.fujitsu.com> (raw)
In-Reply-To: <CAMo8BfJgnZCrdQ3rZ5YXN_72MXbOLuxacnz17TxqBHkhLAhduA@mail.gmail.com>
Dear Max,
Sorry for the late reply.
Thanks for your advice about lowering the irqs after raising them,
and that fixed my problem.
Thanks again for your kindness.
Thanks,
Simen
于 2013/09/11 17:29, Max Filippov 写道:
> On Wed, Sep 11, 2013 at 12:12 PM, Xie Xianshan<xiexs@cn.fujitsu.com> wrote:
>> I want to add a new device "fpga" for e500, and trigger an interrupt IRQ3
>> while the register BB_INTR_REG which belongs to device "fpga" is wrote by
>> the device driver of "fpga".
>> For e500, IRQ3 is an external interrupt irq.
>> According the debug log, the disabling error is encoutered during writing
>> BB_INTR_REG register.
>> - write BB_INTR_REG register
>> - qemu_irq_raise() 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_write(FPGAState *s, unsigned int offset, uint32_t value,
>> unsigned size) {
>> switch(offset) {
>> case BB_INTR_REG:
>> qemu_irq_raise(s->irq);
>> break;
> case BB_INTC_REG:
> qemu_irq_lower(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
>
>
>
prev parent reply other threads:[~2013-10-23 2:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-10 7:25 [Qemu-devel] Disabling IRQ error Xie Xianshan
2013-09-10 8:23 ` Max Filippov
2013-09-11 8:12 ` Xie Xianshan
2013-09-11 9:29 ` Max Filippov
2013-09-12 7:49 ` Xie Xianshan
2013-09-12 7:59 ` Max Filippov
2013-09-12 10:51 ` Xie Xianshan
2013-09-12 11:10 ` Max Filippov
2013-10-23 2:38 ` Xie Xianshan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52673693.1050807@cn.fujitsu.com \
--to=xiexs@cn.fujitsu.com \
--cc=jcmvbkbc@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.