Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1902020rda; Tue, 24 Oct 2023 06:53:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMFozgllF/b5LgS3bAJx/xIpUau3H/z/Oj98Izawemi1E6ta5Oqb+GYH5pgFhPUgjzfaot X-Received: by 2002:a17:902:d2d1:b0:1c7:398c:a437 with SMTP id n17-20020a170902d2d100b001c7398ca437mr10991381plc.69.1698155619772; Tue, 24 Oct 2023 06:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698155619; cv=none; d=google.com; s=arc-20160816; b=oEXO/4BmOy61ulH0X6/+fZYlXVHPH8h1SlDKqxf8fNT7Q/6EpZRbBkss0C+LtBK5gR Pz6m3r3eBJquTZu6KB4DCMpcFaHQ9VyWMgL/IM+zW7YK9ZOEsOocMED7KMx3QglXk/KC QclxXTiwhnMIVVQWF/EkH4KXd5UQ+XbLCr6rUJWlr2k2IxaindzrbUMRo4eCiE4oVGaZ FCa98iNuQgDEzNfeVLfrD63KigFdVc1PHkaoUCaxATN1tuIZ5a0u8w5nWBb/orblqgGt arQ1Z8bakNULKTGs6kv+725i1tXLPj0iLs+DM5zDp0LSqMeLFXJTqX0SFqnOG5fDcpF3 f4BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id; bh=jz2tCe7L3efrepW8BUMNFUjMQXFCIKUZ9EuoTx3xu74=; fh=L2of6ZD4GlZOnQ1VoLFiG/ovFPsdP5Tq3t6+bGaHOlk=; b=ipUt+lmvOeIt5HXIG8+XXZUnd+qngTvu2a5EDzYM3Zdd47bcD5V8pJfJqC6atSeMJq m432YmJcCsLzM1Sh9jc35d6t1TYoy5PjQgEtbS3RSsqVK9YiGLOUIkkKwURF8Cf23d73 rRiVYaHYRsSn9879yXxug+Vkt6yFXbsydANcFbJhIwvwXSfUQIzscX0H5e/aG46XsBsE xsxJ4XZYYJwS5wVthb0/ccQGG9vziNLlTcQh5at8sdY16D9f7bg+U32kqKnvI3Ow5uqk p+tki4gnvpzNo/ptY5GSwqzN2wUTylegc86P3FEF7OQafbo/5xYhO5dGV/AWnunqTuEW u2CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id g19-20020a170902869300b001c9b172c35fsi8054515plo.40.2023.10.24.06.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 06:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4C3D480C61A3; Tue, 24 Oct 2023 06:53:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234565AbjJXNxY (ORCPT + 99 others); Tue, 24 Oct 2023 09:53:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343546AbjJXNxH (ORCPT ); Tue, 24 Oct 2023 09:53:07 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96D9B30ED for ; Tue, 24 Oct 2023 06:49:07 -0700 (PDT) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qvHm2-0007R6-1x; Tue, 24 Oct 2023 15:48:46 +0200 Message-ID: <9c1c9408-88ac-4ade-b8ec-2ae5d8922cac@pengutronix.de> Date: Tue, 24 Oct 2023 15:48:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US, de-DE To: Shawn Guo , Fabio Estevam , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , "netdev@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Cc: Pengutronix Kernel Team From: Johannes Zink Subject: BUG: stmmac: Timeout accessing MAC_VLAN_Tag_Filter when EEE is enabled Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: j.zink@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 06:53:37 -0700 (PDT) Hi everyone, for a vanilla kernel version 6.5.2 I observed the following behaviour on an i.MX8MP-EVK: root@:~# ethtool -s eth1 autoneg on speed 100 duplex full root@:~# ethtool --show-eee eth1 EEE settings for eth1: EEE status: enabled - inactive Tx LPI: disabled Supported EEE link modes: 100baseT/Full 1000baseT/Full Advertised EEE link modes: 100baseT/Full Link partner advertised EEE link modes: Not reported root@:~# ip link add link eth1 name eqos.5 type vlan id 5 RTNETLINK answers: Device or resource busy root@:~# dmesg | tail -n 1 [ 819.085069] imx-dwmac 30bf0000.ethernet eth1: Timeout accessing MAC_VLAN_Tag_Filter root@:~# ip link show dev eqos.5@eth1 Device "eqos.5@eth1" does not exist. root@:~# ethtool --set-eee eth1 eee off root@:~# ethtool --show-eee eth1 EEE settings for eth1: EEE status: disabled Tx LPI: disabled Supported EEE link modes: 100baseT/Full 1000baseT/Full Advertised EEE link modes: Not reported Link partner advertised EEE link modes: Not reported root@:~# ip link add link eth1 name eqos.5 type vlan id 5 root@:~# ip link show dev eqos.5 5: eqos.5@eth1: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 00:04:9f:07:9c:42 brd ff:ff:ff:ff:ff:ff The same holds for removing VLANs when EEE is enabled: (after reboot) root@:~# ethtool --set-eee eth1 eee off root@:~# ip link add link eth1 name eqos.5 type vlan id 5 root@:~# ethtool --set-eee eth1 eee on root@:~# ip link del link eth1 name eqos.5 type vlan id 5 root@beluga-1311a8001168e9dc:~# dmesg | tail -n2 [ 240.918085] imx-dwmac 30bf0000.ethernet eth1: Timeout accessing MAC_VLAN_Tag_Filter [ 240.925827] imx-dwmac 30bf0000.ethernet eth1: failed to kill vid 0081/5 Which is even a bit more concerning, because there is no error reported to userspace, only a netdev_err print to the kernel log In my debugging session I found that this behaviour is only linked to EEE being enabled or disabled. On 1Gbps links, the eee-broken-1000t property is set for the ethphy node, which is why the behaviour usually does not occur for 1GBps (which is probably the most common usecase). Maybe someone on this list has more insight in the inner workings of the dwmac/stmmac/eqos and could point out how to fix this issue, I'd be happy to send patches and fix it. Also, maybe someone has other implementations at hand and can check if this can be reproduced Do you deem disabling EEE while setting the VLAN up a valid workaround or should we rather add a warning when the timeout occurs and EEE is still enabled? Best regards Johannes -- Pengutronix e.K. | Johannes Zink | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686| Fax: +49-5121-206917-5555 |