Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2879379rwb; Mon, 15 Aug 2022 13:10:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Ck18Q7EwYSGRvZUVvKEq8ABa98zU1MegG/IwFKqHW8tH7hRu/2lktOrVPX+oezW9B9Vhu X-Received: by 2002:a17:907:7fa1:b0:734:b26a:17bc with SMTP id qk33-20020a1709077fa100b00734b26a17bcmr11273270ejc.157.1660594237307; Mon, 15 Aug 2022 13:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594237; cv=none; d=google.com; s=arc-20160816; b=zFmaA5U1BUtNPiwI04sl/O/N+sMsBZVX8glcA1DKtC3lOF9j4LwOow8D1wB4WGFg6/ QdrL1t7xUUGfiEfDoTgPJqp6L/CcHZPpYoITKwSWHFo6c5eSLz2HRDCac7te3Hfw+nP8 eqgVTm78+SAILUxwQXudpcm38V9Yw6MqRficJ6E7xqDe3hWWT0QFwbcCdw+BjCMd3w8h ga9EnBk0I17EwszbzXXlqQAG3u6b9tRU1TsKkMNfuXaW7syet1HxBirVXG3jgEISzYks LlBmGsCsHe5gF7Gs8wQdWMxTCzh0Xg24FAt3+2u0hkBvKevFNQF3U0F2v74Q2Cooi2Tm VpHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/1Bx4HDcIyS39X1ZLODVkDqCVJcvom8FSa7thBn5AsE=; b=XsQKq22mDYVw/CeJUj+tabemVisLHVpL09uqKe+g17bnTvmhVtVcsxJihCgAI/EtSj quAEZmn8AVmxip7YyfrIFlbgAAafi9rBBNvly1bl6qZUnjwmbtz+LbiYLojhmnDQndSz vye8PsivtHG8rpKk2E2B1DYF8Ajzfrsd1Fybo7r8WW2d1JM2Bl7NiHoJltPcn9/pAlyL LqBSlqZmayNyppeM/y/Q3V4iYu2JsHfnAAfEdin8P+kJgBfajms7v/4TUX4xfn2IJm0y 2QVND5VlvcWJTbq+L1xUorPk71RVbz0qnldnXPO3gjsmtyfbI2h/iFG7W7eYkLBZNEyk C0gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=mENEtynC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v15-20020a056402348f00b0043a10e5e81asi8676189edc.66.2022.08.15.13.10.11; Mon, 15 Aug 2022 13:10:37 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=mENEtynC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232813AbiHOSBQ (ORCPT + 99 others); Mon, 15 Aug 2022 14:01:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233033AbiHOSAw (ORCPT ); Mon, 15 Aug 2022 14:00:52 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964C3BC18; Mon, 15 Aug 2022 11:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/1Bx4HDcIyS39X1ZLODVkDqCVJcvom8FSa7thBn5AsE=; b=mENEtynCU/ALxF5w4Q0Ehssk5Q O5IupNEBxUgN7s73l+WpbLWR7KJDJaAjc/w01JiKOQUfUUGGi8AapQHL0Sf76sM3jAz7nm6amNxmK TAo5EfGIS0GpbTQpicxWprZ+iNJX4vFkTUfGuCjdBtjGYmyNcAMe61WRzJD8wPC9Sm1oZ0FgD+MEA H9gA5RUix9i25JSNE8mDv4y+iR/pEkC5Io094XmSiz61hdyh+XOizyPeQdU4fES4cprdAx114605i tXSIBiSoKYTRADPVzdrlPQosCEccXopfGXUDuik+l8aY4QKpq0sC5VBWz1rramrs1l1sioy08lUKn MAgr9C4w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33802) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oNeOL-0003TT-Hg; Mon, 15 Aug 2022 19:00:45 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oNeOI-00041h-LD; Mon, 15 Aug 2022 19:00:42 +0100 Date: Mon, 15 Aug 2022 19:00:42 +0100 From: "Russell King (Oracle)" To: Florian Fainelli Cc: netdev@vger.kernel.org, Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , open list Subject: Re: [PATCH net-next] net: phy: broadcom: Implement suspend/resume for AC131 and BCM5241 Message-ID: References: <20220815174356.2681127-1-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220815174356.2681127-1-f.fainelli@gmail.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 On Mon, Aug 15, 2022 at 10:43:56AM -0700, Florian Fainelli wrote: > + /* We cannot use a read/modify/write here otherwise the PHY continues > + * to drive LEDs which defeats the purpose of low power mode. > + */ ... > + /* Set standby mode */ > + reg = phy_read(phydev, MII_BRCM_FET_SHDW_AUXMODE4); > + if (reg < 0) { > + err = reg; > + goto done; > + } > + > + reg |= MII_BRCM_FET_SHDW_AM4_STANDBY; > + > + err = phy_write(phydev, MII_BRCM_FET_SHDW_AUXMODE4, reg); Does the read-modify-write problem extend to this register? Why would the PHY behave differently whether you used phy_modify() here or not? On the mdio bus, it should be exactly the same - the only difference is that we're guaranteed to hold the lock over the sequence whereas this drops and re-acquires the lock. If it's sensitive to the timing of the read and the write, it suggests the above code is fragile - maybe there needs to be a minimum delay inserted between the read and the write? -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!