Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2675680rwb; Mon, 19 Sep 2022 08:22:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Lv0fmQpFuQ/+Fa9uu1vcpk9qml2nUSOkrX7p+x14qWZj17Jk3nht5QJifhjqHoXsEE/Ql X-Received: by 2002:a05:6a00:e16:b0:537:40a7:b095 with SMTP id bq22-20020a056a000e1600b0053740a7b095mr19010394pfb.64.1663600958055; Mon, 19 Sep 2022 08:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663600958; cv=none; d=google.com; s=arc-20160816; b=juyVZGTg9bii+SdBXXMDSEMrtW/3y/Oyu0INkS6I1irrPHwamUHsC1EEV8tHEKuec9 YEzCfYAH1GlCj2fR3JXSiPEP+65Gcepuol+xyoz3DQKDoFsUVIr/qs3HohmZAMYRi1k9 Uv8JyMbAF9QVL6OIkwdsF31arYK5L22zMA314EBKiOqvfVGYo0MiHkN0qiG/GkYiYEPB ol65VWcf19fENGJ4sqhNnYR2nLMOgqnPoivb5UW8nLTTzpiMoNViphFSMPknnmxKqhhd bBZZSbbpjuxUydupyDQjGQZbVkWNTCm9PesrwbYSX/IyQgYB+3pqCJoHTykmdMEWNV1H ikgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=FO5wWOn3ONwax1YxwjpQU9wWpYS3F4tNurhG31VaKKQ=; b=EK5fLQHlg3b0bl16LiATv4iAfF7y8v8NjmTcJe5ICzXBCi3mmltNKmbC8nflhORAMQ dfYLPm14P1CBpOzZZcAT0pIDI3pwh1u1MM9QbnvVVG95n0x5ohW2bTP72QtTRsg9DWXI QxwtElSsgM0ReQWfFnRMzJv3KUVTS+a1lpobvcHE1izCoiWRmsG5v6bfhXQ5ZvcfyKxR jtkgiAxnBPq5lgHE6dEEl5JSbCuaU+TZthmIat/jwQ/T++KMxCKWp9Ypp10MWaAn315z po05FdpJKR4II65jth1YdAnXqg7qEgIpoO2fxx4hzNh3R1Jj8ZGtzxjuxZFGt+Fn4v8J reDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc13-20020a17090b3b8d00b00200435da17asi11725418pjb.128.2022.09.19.08.22.26; Mon, 19 Sep 2022 08:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbiISO7G (ORCPT + 99 others); Mon, 19 Sep 2022 10:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230083AbiISO6v (ORCPT ); Mon, 19 Sep 2022 10:58:51 -0400 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37AEF1C107; Mon, 19 Sep 2022 07:58:50 -0700 (PDT) Received: by mail-qv1-f49.google.com with SMTP id c6so22008095qvn.6; Mon, 19 Sep 2022 07:58:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=FO5wWOn3ONwax1YxwjpQU9wWpYS3F4tNurhG31VaKKQ=; b=hG8syZiLpluIy/oVGfIWQL61BcoVqNSWDPLToJ2YdmpeUZ0lzS+XeX43yp2qN6QIMr mlFv6Ya9bg8GefoFA2WZBEPwUBC3XWB9bK6myO4/Db19IpCt3WCFJc+Rt0FzZHiXd7QF anaR6H0fNcxw1M0gOqQXtRPQOZzCuzMZGr/RRJuXJkrdPDZX883B95qSgG6xq5XpGF/W TpHVT0sHBc873mWm6Uw9PSPtlkzUjHfWl/0wjfnPsiP5+rkKB/VKW4PhYvk5tp+4tfIc WJTahj9+FkG0AEaEt/DAXHPCnB72bR67DGz/7Ho+M3drip2XJyjaRg/rfCatamrEW+lY xhIg== X-Gm-Message-State: ACrzQf0qZvGfzWyLWs/v2aFz46BUYixRqrDbcvikiTbvAZ8t7SQzuC5u bCO1udUbN9MeFwKw9vWY6OvF38L4jQ4M2A== X-Received: by 2002:a05:6214:763:b0:4ac:85f8:84c with SMTP id f3-20020a056214076300b004ac85f8084cmr15191249qvz.123.1663599529202; Mon, 19 Sep 2022 07:58:49 -0700 (PDT) Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com. [209.85.219.181]) by smtp.gmail.com with ESMTPSA id e12-20020ac8670c000000b0035bb6298526sm10633511qtp.17.2022.09.19.07.58.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 07:58:49 -0700 (PDT) Received: by mail-yb1-f181.google.com with SMTP id 125so21607102ybt.12; Mon, 19 Sep 2022 07:58:48 -0700 (PDT) X-Received: by 2002:a0d:dd09:0:b0:344:fca5:9b44 with SMTP id g9-20020a0ddd09000000b00344fca59b44mr14741007ywe.358.1663599116003; Mon, 19 Sep 2022 07:51:56 -0700 (PDT) MIME-Version: 1.0 References: <20220801233403.258871-1-f.fainelli@gmail.com> <27016cc0-f228-748b-ea03-800dda4e5f0c@samsung.com> <8c21e530-8e8f-ce2a-239e-9d3a354996cf@gmail.com> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 19 Sep 2022 16:51:44 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net] net: phy: Warn about incorrect mdio_bus_phy_resume() state To: Florian Fainelli Cc: Marek Szyprowski , netdev , Steve Glendinning , Doug Berger , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list , Linux-Renesas , Sergey Shtylyov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2022 at 3:20 PM Geert Uytterhoeven wrote: > On Fri, Aug 12, 2022 at 6:39 PM Florian Fainelli wrote: > > On 8/12/22 04:19, Marek Szyprowski wrote: > > > On 02.08.2022 01:34, Florian Fainelli wrote: > > >> Calling mdio_bus_phy_resume() with neither the PHY state machine set to > > >> PHY_HALTED nor phydev->mac_managed_pm set to true is a good indication > > >> that we can produce a race condition looking like this: > > >> > > >> CPU0 CPU1 > > >> bcmgenet_resume > > >> -> phy_resume > > >> -> phy_init_hw > > >> -> phy_start > > >> -> phy_resume > > >> phy_start_aneg() > > >> mdio_bus_phy_resume > > >> -> phy_resume > > >> -> phy_write(..., BMCR_RESET) > > >> -> usleep() -> phy_read() > > >> > > >> with the phy_resume() function triggering a PHY behavior that might have > > >> to be worked around with (see bf8bfc4336f7 ("net: phy: broadcom: Fix > > >> brcm_fet_config_init()") for instance) that ultimately leads to an error > > >> reading from the PHY. > > >> > > >> Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM") > > >> Signed-off-by: Florian Fainelli > > > > > > This patch, as probably intended, triggers a warning during system > > > suspend/resume cycle in the SMSC911x driver. I've observed it on ARM > > > Juno R1 board on the kernel compiled from next-202208010: > > > > > > ------------[ cut here ]------------ > > > WARNING: CPU: 1 PID: 398 at drivers/net/phy/phy_device.c:323 > > > mdio_bus_phy_resume+0x34/0xc8 > > I am seeing the same on the ape6evm and kzm9g development > boards with smsc911x Ethernet, and on various boards with Renesas So the smsc911x issue was fixed by commit 3ce9f2bef7552893 ("net: smsc911x: Stop and start PHY during suspend and resume"). > Ethernet (sh_eth or ravb) if Wake-on-LAN is disabled. The issue is still seen with sh_eth and ravb. I have sent to fixes: https://lore.kernel.org/r/c6e1331b9bef61225fa4c09db3ba3e2e7214ba2d.1663598886.git.geert+renesas@glider.be https://lore.kernel.org/r/c6e1331b9bef61225fa4c09db3ba3e2e7214ba2d.1663598886.git.geert+renesas@glider.be Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds