From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: broadcom: Implement suspend/resume for AC131 and BCM5241
Date: Mon, 15 Aug 2022 19:00:42 +0100 [thread overview]
Message-ID: <YvqJyg3eUusc8jkC@shell.armlinux.org.uk> (raw)
In-Reply-To: <20220815174356.2681127-1-f.fainelli@gmail.com>
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!
next prev parent reply other threads:[~2022-08-15 18:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 17:43 [PATCH net-next] net: phy: broadcom: Implement suspend/resume for AC131 and BCM5241 Florian Fainelli
2022-08-15 18:00 ` Russell King (Oracle) [this message]
2022-08-15 18:09 ` Florian Fainelli
2022-08-15 18:32 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YvqJyg3eUusc8jkC@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox