Received: by 10.223.185.116 with SMTP id b49csp3872250wrg; Tue, 6 Mar 2018 06:26:26 -0800 (PST) X-Google-Smtp-Source: AG47ELv0onqaHe5nlNBKf5M68Jjkoz0MNLaeeR9QOraEZrQMvIYq0/WZmq85PGoQRYLwBORCaQpJ X-Received: by 10.98.180.13 with SMTP id h13mr19036270pfn.139.1520346386490; Tue, 06 Mar 2018 06:26:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520346386; cv=none; d=google.com; s=arc-20160816; b=oBqmDpKRuTwuRDI4n4+puiNCJeGECfmW6H+HBWOuP9rdsN68XaquSPhHNho0EAzKNg 0XeVE6B7mXLvf+yzbaD8uxhlykm1eCx3XdqjNs6CzedCUxqzS5PflypQCYvJYS+pcRzy XKLc/BijrM2G22By7XJCEM6knTyrv28A6HwiOVJxFWRnTCC3WRBg8f3seOW5pkEkWFo6 ZRr2gY7yrHwzosgOEh2q0K3A63N1p11PKhKWPz31KxFRYDrtE0of7HItMd9APJ0a9NCS 7MA+VSWIGQ++r3Fg0b2YKCFcSZOmnpyLwDqeL+xyKCmfTOR5kTSeJwOkD7T19NFSwWcb OjRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=OgJdLwI3Uljih4SmN83rWnok/oWyoi93SwKB/olXRAc=; b=dv2h6fqI6QoRZFkOhwM5szQLdYeaHTk4aW+M+jduhj6BlXPGwX7RKocFK2sdY43qkE ++ggBBUQrpUfsP/AceX4+2qyVcWAc8+Ljgs3f6M+GV4cYhkHptALk1UaYuUl6WuxQwNF p4aCSGliuIw/MfWoVsfCTkBQx/cquu2H/fc6bm9pzlrIS/Ux7gL4FonRV52WSABQ99Dm VqvPFR0XKmJEWjzImCjrpvGS4PsTNFPK/Wvh/ePLj4Qcd55k+JjjDm+90G3UYRG/ZbMr UiScf2x/pDzd02thXIqKLeMRkJWicd6TN/+8ByVV5TCcVGhkGDui5zgtCNSFGtDAjAhb L5lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hBmlOwc4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30-v6si11203184pla.812.2018.03.06.06.26.11; Tue, 06 Mar 2018 06:26:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hBmlOwc4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753616AbeCFOZV (ORCPT + 99 others); Tue, 6 Mar 2018 09:25:21 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:37740 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750817AbeCFOZT (ORCPT ); Tue, 6 Mar 2018 09:25:19 -0500 Received: by mail-pl0-f67.google.com with SMTP id w12-v6so201611plp.4; Tue, 06 Mar 2018 06:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OgJdLwI3Uljih4SmN83rWnok/oWyoi93SwKB/olXRAc=; b=hBmlOwc44c21v8N6kBuGpL6b3m/8eOiqszygQeeDuqlnJ4afntw1itVyGLxmv6WWiT m+ZPvCuhdcHKWhUP/5yyi+EQ7NfnY08aSWo02Qp+xQf8MQP5XE5OaGqGIZnDYi0qoou1 5rT7xH1qh85CoiMf8zMz6cScU4HWwPk+4l/7j8BRD1PUXvE6zsgKnm4LMfadFTftQDbs hToIGT7BbOiE+US14XOR4nSJl9vBep/6mTXJW45k3ZyYtNkwARboTjId8fi7wHExWDW+ YpMelcnSfUIMsKgXwT62KZSYX3izRdkYEGlVr8Pmy+1r3wcBAOkMi9L5fp6twazA9r1b wxzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OgJdLwI3Uljih4SmN83rWnok/oWyoi93SwKB/olXRAc=; b=NvoUSpxNwUI8XyTMpeZZtrvs2WXxzpl7l1R1KAvXLFQCEkITRmTNKEHGEWCp5c0yNJ Yc6ootm27eWdG50L5mRtATbwbJD3gey8x6z3cnKY1ylAGeeqh3T4HsFUuwbTXafKsvPl 777GHfa5cK0AOhzATXT9oRq/BLQ6ymv34kun2a0xUVHWVkj9qPl28pwU6Ki1yjbL89oA l92auYfHjvxxmGZ0tmPIIxJPK+B2DVxzLu76z8YGX2MGA3lZi2YbISJzdoetuUyar5UZ wk5EKRouxpZoJOSm0X+7b4qqmtgLsgvjWxng2pafg+PAhRTaqlW+ZgoWoWDKnS7ke+0y +OCw== X-Gm-Message-State: AElRT7HaI6Hx6rI5qZjmaysf4sNKeOE28ZLy0zaPp4sy8RO+vvoDKNzu EgeVVW4a6KsV5jF0QBz5BXEaj5Bu X-Received: by 2002:a17:902:650c:: with SMTP id b12-v6mr6864930plk.451.1520346319104; Tue, 06 Mar 2018 06:25:19 -0800 (PST) Received: from server.roeck-us.net (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id 10sm26559269pgg.73.2018.03.06.06.25.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 06:25:17 -0800 (PST) Subject: Re: lost interrupts when running sabrelite images (v4.15+) in qemu To: Troy Kisky Cc: Fugang Duan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180303163236.GA29514@roeck-us.net> <88917ab4-ade0-dcfc-e81a-eeaa8a4d15b8@boundarydevices.com> <2801dae5-1334-a127-d36c-244d35e71222@roeck-us.net> <5c5ffdea-7702-c989-0fdb-60803c8e59ab@boundarydevices.com> From: Guenter Roeck Message-ID: <9ee66efa-397c-898a-5cad-64eabc7752b9@roeck-us.net> Date: Tue, 6 Mar 2018 06:25:15 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <5c5ffdea-7702-c989-0fdb-60803c8e59ab@boundarydevices.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/05/2018 09:30 AM, Troy Kisky wrote: > On 3/3/2018 1:12 PM, Guenter Roeck wrote: >> On 03/03/2018 12:48 PM, Guenter Roeck wrote: >>> On 03/03/2018 11:07 AM, Troy Kisky wrote: >>>> On 3/3/2018 8:32 AM, Guenter Roeck wrote: >>>>> Hi, >>>>> >>>>> since v4.15, I get the following runtime warning when running sabrelite images >>>>> in qemu. >>>>> >>>>> irq 65: nobody cared (try booting with the "irqpoll" option) >>>>> ... >>>>> handlers: >>>>> [<26292474>] fec_pps_interrupt >>>>> Disabling IRQ #65 >>>>> fec 2188000.ethernet (unnamed net_device) (uninitialized): MDIO read timeout >>>>> >>>>> Bisect points to commit 4ad1ceec05e491 ("net: fec: Let fec_ptp have its >>>>> own interrupt routine"). Analysis shows that platform_irq_count() >>>>> returns 2, which is reduced to 1 by fec_enet_get_irq_cnt(). >>>>> If I let fec_enet_get_irq_cnt() return 2, the problem is gone. >>>>> Reverting commit 4ad1ceec05e491 also fixes the problem. >>>>> >>>>> Bisect log is attached. >>>>> >>>> >>>> Sounds like you found a bug with qemu. I just booted sabrelite over nfs fine. >>>> My interrupts look like this. >>>> >>>> >>>>   64:      98767          0          0          0     GIC-0 150 Level     2188000.ethernet >>>>   65:          0          0          0          0     GIC-0 151 Level     2188000.ethernet >>>> ___________ >>>> Irq 65 is only for ptp interrrupts now. If qemu is signaling an tx/rx frame interrupt on 65, >>>> then qemu is wrong. Of course, I've never used qemu so feel free to ignore me if I make no sense. >>>> >>> >>> Thanks for checking with real hardware. >>> >>> This is what I see (with your patch reverted): >>> >>>   64:          0     GIC-0 150 Level     2188000.ethernet >>>   65:         64     GIC-0 151 Level     2188000.ethernet >>> >>> Looking into the qemu source, I see: >>> >>> #define FSL_IMX6_ENET_MAC_1588_IRQ 118 >>> #define FSL_IMX6_ENET_MAC_IRQ 119 >>> >>> FSL_IMX6_ENET_MAC_IRQ is then connected to fec interrupt index 0, and FSL_IMX6_ENET_MAC_1588_IRQ >>> is connected to fec interrupt index 1. >>> >>> This may suggest that the defines are reversed. I'll see what happens if I swap them. >>> >> >> Confirmed. If I swap the above defines, everything works fine. At the same time, >> the modified qemu works with older kernels. >> >> Thanks a lot for the hint, and sorry for the noise. >> >> Guenter >> > It definitely was not noise. I bet it helps people searching the mailing list in the future. > Thanks for posting the resolution. > Turns out "works" as I stated above is not entirely accurate. - v4.13 and later work - In v4.12 and earlier, the Ethernet interface fails to instantiate with fec 2188000.ethernet (unnamed net_device) (uninitialized): MDIO read timeout fec: probe of 2188000.ethernet failed with error -5 I have not found the reason yet. Unmodified qemu works fine. - v4.1 and earlier crash. The crash is fixed by commit 32cba57ba74be ("net: fec: introduce fec_ptp_stop and use in probe fail path") There is also a matching bug at lauchpad: https://bugs.launchpad.net/qemu/+bug/1753309 Guenter