Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp28838rwl; Wed, 9 Aug 2023 10:22:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgFS6ufvjyzgVdKC94sBYw9fOpSFlniUq+Wk+EQND+axlyaNQ4/GdM268FoGJpLxgS9pJ3 X-Received: by 2002:a05:6a20:8f0f:b0:140:d536:d435 with SMTP id b15-20020a056a208f0f00b00140d536d435mr4297131pzk.38.1691601774620; Wed, 09 Aug 2023 10:22:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691601774; cv=none; d=google.com; s=arc-20160816; b=frh3AR5Hq70yIF2PUwCOtuNM2kOPffWXP+FP6RY1KWtTo2MLZtk4wZusm3hrSqHvlQ b0gZuW5ipBFe8xhF/J61Dmmc10pxo4rsA+CU4pS1C/OBjUkuq4Fw9HRd2qPSPk87OCca isnJfHQIes8XGEfFRA/JLGVVF2ndIZDMlMBevAHRchJ4u7QsDiVDVcMbkTh0ZDFenrrB WcFmGUck9NyJRkDiD0x7jQajszpT4JXt/DlJZ2wKWCJ2mJCiJWXm+XmGU3+niy+VAJob xWZhVZW/Vgj9b3qMS/ouTFvr0lVIfFEi9JbKIyAWpKNYeI5w2OG9N8vQAe2UbSvCxpkN 7gQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vNh9sRdmMwRNZB9dpYFP0p0p4eAm0Xeb7TBvjnG8gGU=; fh=HyEN4uCyxbFnb9zkrlpolaN8stwfIaOIUkI/uLp95fk=; b=nbY3BiichenduWvDipLMY1tKB2A6Ah85gSn1U5s3RbSVgF0N7qC3WRRhkYTHDM7OFo eGysRRPAwljiOC3l4zmkI63lNql5K7Vjh4j8eN2rc3flRpaLinhf/sKVmJ8xk9/IGvrH QLlcMNHfBs/dAb3wMGomQ98zpd60tVBZJwp3vzv5nQbmOIC+S5XVVzXduAMIBsHh79EE SDe3pBvaFNh4VldZW4BJTQ/BFEQfA+96L9qc/yL66bpmhh1fx+8keutQeKC9ROSgbxlv mCSsbzzOfJDAnlgJczw77EsNfKhVpfI+oAIgCgg82kJBqQGRpaxvXVjzDXiPY/McJ3k2 rXjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=R6ugOU5T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 196-20020a6300cd000000b0056462226a19si9454088pga.732.2023.08.09.10.22.41; Wed, 09 Aug 2023 10:22:54 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=R6ugOU5T; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbjHIQWN (ORCPT + 99 others); Wed, 9 Aug 2023 12:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjHIQWM (ORCPT ); Wed, 9 Aug 2023 12:22:12 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DD04ED; Wed, 9 Aug 2023 09:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=vNh9sRdmMwRNZB9dpYFP0p0p4eAm0Xeb7TBvjnG8gGU=; b=R6ugOU5Tlm6ASl+dQ1QM6iWYQC 0PuS0VwOlMM9oxwwg3GP5Fxb7sCSUjDal7QTPdr7LdGId/NaqwTb6UDhO6ELcgSCAIGSJpw/654o2 Y8/VNIJJRC8WMXjwcWg8UmQTOp3MSGhz2edBTbCfQqXCRfr0k5BDbGxXdSFOUyqSR7yo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qTlwc-003b9L-U6; Wed, 09 Aug 2023 18:21:58 +0200 Date: Wed, 9 Aug 2023 18:21:58 +0200 From: Andrew Lunn To: "Russell King (Oracle)" Cc: Ioana Ciornei , Florian Fainelli , Jakub Kicinski , Heiner Kallweit , Uwe =?utf-8?B?S2xlaW5lLUvilJzDgm5pZw==?= , Ioana Ciornei , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 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: Re: [PATCH] net: phy: Don't disable irqs on shutdown if WoL is enabled Message-ID: <2f717c52-0ae5-4702-ab34-7ce0bffe8c86@lunn.ch> References: <20230804071757.383971-1-u.kleine-koenig@pengutronix.de> <20230808145325.343c5098@kernel.org> <1e438a02-6964-ce65-5584-e8ea57a694bb@gmail.com> <20230809142155.4dtmnmmecaycbtum@LXL00007.wbi.nxp.com> <20230809154418.hjkf43ndwfzretiy@LXL00007.wbi.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 > Thinking about this, I wonder whether we could solve your issue by > disabling interrupts when the PHY is probed, rather than disabling > them on shutdown - something like this? (not build tested) > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > index 3e9909b30938..4d1a37487923 100644 > --- a/drivers/net/phy/phy_device.c > +++ b/drivers/net/phy/phy_device.c > @@ -3216,6 +3216,8 @@ static int phy_probe(struct device *dev) > goto out; > } > > + phy_disable_interrupts(phydev); > + > /* Start out supporting everything. Eventually, > * a controller will attach, and may modify one > * or both of these values At some point, the interrupt is going to be enabled again. And then the WoL interrupt will fire. I think some PHY drivers actually need to see that WoL interrupt. e.g. the marvell driver has this comment: static int m88e1318_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) { .... /* If WOL event happened once, the LED[2] interrupt pin * will not be cleared unless we reading the interrupt status * register. If interrupts are in use, the normal interrupt * handling will clear the WOL event. Clear the WOL event * before enabling it if !phy_interrupt_is_valid() */ So it seems like just probing the marvell PHY is not enough to clear the WoL interrupt. Can we be sure that the other PHY has reached a state it can handle and clear an interrupt when we come to enable the interrupt? I think not, especially in cases like NFS root, where the interface will be put into use as soon as it exists, maybe before the other interface has probed. Andrew