Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3232753rwo; Fri, 4 Aug 2023 01:15:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEb0aoUHbHK3EJOSr5y693wCyg0823dPuQSDsUUK1x0HsV8s7RLKtZlVAlDW43HUzwXxqq5 X-Received: by 2002:a05:6a00:3984:b0:682:f529:6d69 with SMTP id fi4-20020a056a00398400b00682f5296d69mr1264784pfb.7.1691136907298; Fri, 04 Aug 2023 01:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691136907; cv=none; d=google.com; s=arc-20160816; b=TshRJ3T7Z0PCO9jfW6VhiScyEC7D2D4rLsmX7pOc8MdinQ+AD3oDhbZM1GLzDldWhI ZxjGo7LRVMiI8CcI+lMGKjgkh07ytZ24m1BQBouuyToeiiYBnHtY1WzGoUDPu4O63681 Aj3UTEzXzvNES8PoXy6oiEuOoo3GV0zLQ2u2qS8CJhZwkiFqqTbA9iv2OcEJRrsLCX73 BRNhzQZFFBcNPwkvsYwPQkZQRAUSNRXUZXz8KwDeR9AA/aT7v0f2GfFEudf9/FAjanH2 d/1Fd+a5/hc1Y8n3RMDvW3vQ8ZpX9KITLL5bCnTkc2tt4calJESAvjo2yuAQKu5qI7NI E8NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=VGgYLaQgLkPz+JPbyUmyUmAixPLHsMPjXriPDp20u4k=; fh=F37Ow7ujkL2VDyqDqbXHgJuseC9t5gpyd34uGN+rOEA=; b=j8XXReY69R74EXjHqNsp2FYZHGnGaT423XqumTGKGT7Cv9c2yRC4I8YJbABNNm0BLD 67oISg0vVtd+hxWuMjljXRrQ/pw/kqTk+z/WuR9xPb0TINP57SfzqMns7xUxh/OObNY8 Aej1W1Zveejh40BlKqztNAci2Qzvu7C1pOs1qjomZcVmEZ45GidOra193l6tbyRWRzxD +T/kRmRJW70qevi6JsULEFrb10esKca54RE08eeb9Z00KEhixPTCRqArNEfRi6/GZ2d3 q7M/75fHYEU96BhAyHNfBzy+vaUecB1d8ySypAa9ZEw9HVqSJpXjwcf6178m7mC85oMM dzRQ== 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 j17-20020a635951000000b0056416c221d1si1454154pgm.581.2023.08.04.01.14.54; Fri, 04 Aug 2023 01:15:07 -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 S233940AbjHDHSV (ORCPT + 99 others); Fri, 4 Aug 2023 03:18:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231236AbjHDHSU (ORCPT ); Fri, 4 Aug 2023 03:18:20 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D873B35AA for ; Fri, 4 Aug 2023 00:18:18 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qRp4g-00089W-2V; Fri, 04 Aug 2023 09:18:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1qRp4Z-0011I7-TS; Fri, 04 Aug 2023 09:18:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qRp4Y-00AKpv-P8; Fri, 04 Aug 2023 09:18:06 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Ioana Ciornei , Florian Fainelli , "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ioana Ciornei , Alexandru Ardelean , Andre Edich , Antoine Tenart , Baruch Siach , Christophe Leroy , Divya Koppera , Hauke Mehrtens , Jerome Brunet , Kavya Sree Kotagiri , Linus Walleij , Marco Felsch , Marek Vasut , Martin Blumenstingl , Mathias Kresin , Maxim Kochetkov , Michael Walle , Neil Armstrong , Nisar Sayed , Oleksij Rempel , Philippe Schenker , Willy Liu , Yuiko Oshino Subject: [PATCH] net: phy: Don't disable irqs on shutdown if WoL is enabled Date: Fri, 4 Aug 2023 09:17:57 +0200 Message-Id: <20230804071757.383971-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1812; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VS0duhs9tb1uEImz/dcLi5TtuWmMForApzGS0DBMBK8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkzKYciDor+Q+TNs8MJaBvEB+iLLq2b7H93wMrz hWVoLEgUOmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZMymHAAKCRCPgPtYfRL+ TgtLB/4rCgK94PaBx6OWWpN/SUotuLOTzG1Zno3Z2oaqS+Cq0WO/uu37Rl1f4pGu8cxID2GA+AA 6GACcL9AE/HRsC9OCseSTHueJgAkVHBgGv0mkBGlDIa2L47+GmfCrv/IlCCRMLIkLU2X97h8qzI PM85gWHv2saj0EG0SfJVoujIG4CNCA7uq3cME9R2mwNVk7j3PvxOfDLTYX0FXAe1/Dvw4H8WKj1 5TrND0tytLnzmtxgL7P394PNl1lBo77TCmeNVa3fKbr3s3GU4CTpSBPIC8JnYRjkXaI+N7D96TU yvVorW3kfrymHXtF7G2ck2wnJ8tEMjUUuz4B7Bwb3nr4nvWp X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Most PHYs signal WoL using an interrupt. So disabling interrupts breaks WoL at least on PHYs covered by the marvell driver. So skip disabling irqs on shutdown if WoL is enabled. While at it also explain the motivation that irqs are disabled at all. Fixes: e2f016cf7751 ("net: phy: add a shutdown procedure") Signed-off-by: Uwe Kleine-König --- Hello, while I'm not sure that disabling interrupts is a good idea in general, this change at least should fix the WoL case. Note that this change is only compile tested as next doesn't boot on my test machine (because of https://git.kernel.org/linus/b3574f579ece24439c90e9a179742c61205fbcfa) and 6.1 (which is the other kernel I have running) doesn't know about .wol_enabled. I don't want to delay this fix until I bisected this new issue. Assuming this patch is eligible for backporting to stable, maybe point out that it depends on v6.5-rc1~163^2~286^2~2 ("net: phy: Allow drivers to always call into ->suspend()"). Didn't try to backport that. Best regards Uwe drivers/net/phy/phy_device.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 61921d4dbb13..6d1526bdd1d7 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3340,6 +3340,15 @@ static void phy_shutdown(struct device *dev) if (phydev->state == PHY_READY || !phydev->attached_dev) return; + /* Most phys signal WoL via the irq line. So for these irqs shouldn't be + * disabled. + */ + if (phydev->wol_enabled) + return; + + /* On shutdown disable irqs to prevent an irq storm on systems where the + * irq line is shared by several devices. + */ phy_disable_interrupts(phydev); } -- 2.40.1