[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines
From: |
Bill Paul |
Subject: |
Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines |
Date: |
Fri, 9 Mar 2018 15:03:15 -0800 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-28-generic; KDE/4.4.5; x86_64; ; ) |
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,
address@hidden | Master of Unix-Fu - Wind River Systems
=============================================================================
"I put a dollar in a change machine. Nothing changed." - George Carlin
=============================================================================
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, (continued)
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Guenter Roeck, 2018/03/08
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Bill Paul, 2018/03/08
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Guenter Roeck, 2018/03/08
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Peter Maydell, 2018/03/09
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Guenter Roeck, 2018/03/09
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Peter Maydell, 2018/03/09
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Guenter Roeck, 2018/03/09
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Bill Paul, 2018/03/09
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Bill Paul, 2018/03/09
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines, Guenter Roeck, 2018/03/09
- Re: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines,
Bill Paul <=