From: Bill Paul <wpaul@windriver.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Andrey Smirnov <andrew.smirnov@gmail.com>,
Chris Healy <cphealy@gmail.com>, Jason Wang <jasowang@redhat.com>,
Jean-Christophe Dubois <jcd@tribudubois.net>
Subject: Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines
Date: Fri, 9 Mar 2018 15:03:15 -0800 [thread overview]
Message-ID: <201803091503.16120.wpaul@windriver.com> (raw)
In-Reply-To: <20180309213832.GA8594@roeck-us.net>
Of all the gin joints in all the towns in all the world, Guenter Roeck had to
walk into mine at 13:38 on Friday 09 March 2018 and say:
[...]
> > > > Do I have that right?
> > >
> > > Pretty much.
> >
> > There may be a 4th option.
> >
> > Since older kernels work because they were looking at vector 151, you
> > could patch the imx_fec.c module so that when it signals an event for
> > vector 150, it also signals vector 151 too. This would keep newer
> > versions of QEMU "bug- compatible" with older versions while also fixing
> > support for newer Linux kernels and other guests (e.g. VxWorks) that
> > follow the hardware spec correctly.
> >
> > I think this would require only a small modification to this function:
> >
> > static void imx_eth_update(IMXFECState *s)
> > {
> >
> > if (s->regs[ENET_EIR] & s->regs[ENET_EIMR] & ENET_INT_TS_TIMER) {
> >
> > qemu_set_irq(s->irq[1], 1);
> >
> > } else {
> >
> > qemu_set_irq(s->irq[1], 0);
> >
> > }
> >
> > if (s->regs[ENET_EIR] & s->regs[ENET_EIMR] & ENET_INT_MAC) {
> >
> > qemu_set_irq(s->irq[0], 1);
> >
> > } else {
> >
> > qemu_set_irq(s->irq[0], 0);
> >
> > }
> >
> > }
> >
> > (For ENET_INT_MAC events, just signal both s->irq[0] and s->irq[1]).
>
> Now this is an excellent idea.
>
> > This of course means signaling spurious events on vector 151, but you're
> > doing that now anyway. :)
>
> Actually, it doesn't. It looks like the first interrupt is handled,
> resetting the interrupt status, and the second interrupt is never even
> executed. I tested this with all kernel releases back to v3.16.
I just did a quick test with your patch and I can confirm that VxWorks 7 also
works correctly.
-Bill
> I'll send out patch v2 with this change and let Peter decide which version
> to apply.
>
> Thanks,
> Guenter
--
=============================================================================
-Bill Paul (510) 749-2329 | Senior Member of Technical Staff,
wpaul@windriver.com | Master of Unix-Fu - Wind River Systems
=============================================================================
"I put a dollar in a change machine. Nothing changed." - George Carlin
=============================================================================
prev parent reply other threads:[~2018-03-10 0:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 17:37 [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines Guenter Roeck
2018-03-08 10:50 ` Peter Maydell
2018-03-08 14:47 ` Guenter Roeck
2018-03-08 14:51 ` Peter Maydell
2018-03-08 15:05 ` Guenter Roeck
2018-03-08 17:12 ` Guenter Roeck
2018-03-08 18:28 ` Bill Paul
2018-03-08 19:22 ` Guenter Roeck
2018-03-09 17:47 ` Peter Maydell
2018-03-09 18:20 ` Guenter Roeck
2018-03-09 18:48 ` Peter Maydell
2018-03-09 20:19 ` Guenter Roeck
2018-03-09 18:53 ` Bill Paul
2018-03-09 18:57 ` Bill Paul
2018-03-09 21:38 ` Guenter Roeck
2018-03-09 23:03 ` Bill Paul [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=201803091503.16120.wpaul@windriver.com \
--to=wpaul@windriver.com \
--cc=andrew.smirnov@gmail.com \
--cc=cphealy@gmail.com \
--cc=jasowang@redhat.com \
--cc=jcd@tribudubois.net \
--cc=linux@roeck-us.net \
--cc=peter.maydell@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).