From patchwork Wed Mar 7 17:37:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 10264615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D811602BD for ; Wed, 7 Mar 2018 17:37:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D18628ADD for ; Wed, 7 Mar 2018 17:37:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4171B28B24; Wed, 7 Mar 2018 17:37:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 92B6F28B87 for ; Wed, 7 Mar 2018 17:37:57 +0000 (UTC) Received: from localhost ([::1]:34713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etd0m-0007pY-2J for patchwork-qemu-devel@patchwork.kernel.org; Wed, 07 Mar 2018 12:37:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etd05-0007VZ-K5 for qemu-devel@nongnu.org; Wed, 07 Mar 2018 12:37:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etd01-0002TP-K2 for qemu-devel@nongnu.org; Wed, 07 Mar 2018 12:37:13 -0500 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:43429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etd01-0002SB-Ea for qemu-devel@nongnu.org; Wed, 07 Mar 2018 12:37:09 -0500 Received: by mail-pl0-x244.google.com with SMTP id f23-v6so1716094plr.10 for ; Wed, 07 Mar 2018 09:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=PHsg2XEpBzrTKo5e6Xv34HMrPGPy1eY2x3rJcUkEslM=; b=Jed5prlY+/AmDIhkABG0MfFazPA+ItJaCMZFKXnLpo1EoSaiWHorN78EAQDgVJomdc E8X9g65MrBeQHqXXkN9yS229ph0Fa2Qi+QUBVmoql5K33SdQOIumVFqnG73IJmPHVZ79 tfZYHgdEVRUbuoh6shV7KknsvlRBxhgE35w0M2b13uTeOEdiqXmiYmDzvts283OjjoUh 2Kt/3I6OzH+wZjAcTho3IlfSqfz/SEHsL/59uHtO7C90NkYwQDnJLw6NA37yTD/xpOsZ mHnzOmAk7YWbQdc4PNGIWAjRo2o7bPScYsdClvkmduv/WrczHJsoaZhQGxurT+qe3nxg Dc+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=PHsg2XEpBzrTKo5e6Xv34HMrPGPy1eY2x3rJcUkEslM=; b=d4N53mcVQQjy3ifddESpe6dHGncvHwV/hcHKYSwpW2tfK/IUzSzMoAweYtf2G6bHnL 7X2PA5KfRr53sbCI0g3joa6zbnQpRYvz43v3VXN0UD5mzfeD9fYlkEskAKRv0pcCgkiy /5AG1eKaLAI2Gsm8X6MJmsoGA8nWIp3MhiF9gSpIzLkecDD6kHj1y7aATXycJGqAJUb7 wdGm13ud/VopT7ru4kh0jOeOv6aJqO7dEtzEQSb+E/pjFyiw7J2E4j3W9qZEqd9jm0th klcDrU7qSEG8jtVWa79MJaYMof2WaWBEzmIGxzfyyMUGoHPlRcmutUdOpuqWARQbWqkt Jalg== X-Gm-Message-State: APf1xPCvbfN26rN63AMZ49M1mEzD0TM72RS/8ryy4bHyo9Nmiv8KFzbN zQ8g1AxWdwKdFwwrhr347vKgDA== X-Google-Smtp-Source: AG47ELtbH/nc95f+P4XVbRi8TwpkcbP2apO9zAmIoSFu6h+zlLNgPLnF6coLaw0mRb7j4aQEeX1iCA== X-Received: by 2002:a17:902:24d:: with SMTP id 71-v6mr21116785plc.282.1520444228122; Wed, 07 Mar 2018 09:37:08 -0800 (PST) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id m3sm32670892pgs.90.2018.03.07.09.37.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 09:37:06 -0800 (PST) From: Guenter Roeck To: qemu-devel@nongnu.org Date: Wed, 7 Mar 2018 09:37:03 -0800 Message-Id: <1520444223-8389-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH] fsl-imx6: Swap Ethernet interrupt defines X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , wpaul@windriver.com, Andrey Smirnov , Jason Wang , Jean-Christophe Dubois , Guenter Roeck , Chris Healy Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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