All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines
@ 2018-03-07 17:37 Guenter Roeck
  2018-03-08 10:50 ` Peter Maydell
  0 siblings, 1 reply; 16+ messages in thread
From: Guenter Roeck @ 2018-03-07 17:37 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Andrey Smirnov, Chris Healy, Jason Wang,
	Jean-Christophe Dubois, wpaul, Guenter Roeck

The sabrelite machine model used by qemu-system-arm is based on the
Freescale/NXP i.MX6Q processor. This SoC has an on-board ethernet
controller which is supported in QEMU using the imx_fec.c module
(actually called imx.enet for this model.)

The include/hw/arm/fsm-imx6.h file defines the interrupt vectors for the
imx.enet device like this:

 #define FSL_IMX6_ENET_MAC_1588_IRQ 118
 #define FSL_IMX6_ENET_MAC_IRQ 119

According to https://www.nxp.com/docs/en/reference-manual/IMX6DQRM.pdf,
page 225, in Table 3-1. ARM Cortex A9 domain interrupt summary,
interrupts are as follows.

150 ENET MAC 0 IRQ
151 ENET MAC 0 1588 Timer interrupt

where

150 - 32 == 118
151 - 32 == 119

In other words, the vector definitions in the fsl-imx6.h file are reversed.

This results in lost interrupt warnings when running recent (v4.15+) Linux
kernels, and the Ethernet interface will fail to probe.

Note that applying this patch will cause problems with older Linux kernels:
The Ethernet interface will fail to probe with Linux v4.9 and earlier.
Linux v4.1 and earlier will crash. This is a Linux kernel problem, not a
qemu problem: the Linux kernel only worked by accident since it requested
both interrupts.

Link: https://bugs.launchpad.net/qemu/+bug/1753309
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 include/hw/arm/fsl-imx6.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h
index ec6c509..06f8aae 100644
--- a/include/hw/arm/fsl-imx6.h
+++ b/include/hw/arm/fsl-imx6.h
@@ -438,8 +438,8 @@ typedef struct FslIMX6State {
 #define FSL_IMX6_HDMI_MASTER_IRQ 115
 #define FSL_IMX6_HDMI_CEC_IRQ 116
 #define FSL_IMX6_MLB150_LOW_IRQ 117
-#define FSL_IMX6_ENET_MAC_1588_IRQ 118
-#define FSL_IMX6_ENET_MAC_IRQ 119
+#define FSL_IMX6_ENET_MAC_IRQ 118
+#define FSL_IMX6_ENET_MAC_1588_IRQ 119
 #define FSL_IMX6_PCIE1_IRQ 120
 #define FSL_IMX6_PCIE2_IRQ 121
 #define FSL_IMX6_PCIE3_IRQ 122
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-03-10  0:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.