From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, patches@lists.linux.dev,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
linux@roeck-us.net, shuah@kernel.org, patches@kernelci.org,
lkft-triage@lists.linaro.org, pavel@denx.de,
jonathanh@nvidia.com, sudipm.mukherjee@gmail.com,
srw@sladewatkins.net, rwarsow@gmx.de, conor@kernel.org,
allen.lkml@gmail.com, Doug Berger <opendmb@gmail.com>
Subject: Re: [PATCH 6.1 000/243] 6.1.91-rc2 review
Date: Wed, 15 May 2024 09:54:49 -0700 [thread overview]
Message-ID: <d52e7e4a-2b60-4fdf-9006-12528a91dabf@broadcom.com> (raw)
In-Reply-To: <c1ebf243-00c6-48eb-bb66-b7ca13ecac17@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 3207 bytes --]
On 5/15/24 09:40, Florian Fainelli wrote:
> On 5/15/24 09:20, Linus Torvalds wrote:
>> On Wed, 15 May 2024 at 09:17, Mark Brown <broonie@kernel.org> wrote:
>>>
>>> A bisect claims that "net: bcmgenet:
>>> synchronize EXT_RGMII_OOB_CTRL access" is the first commit that breaks,
>>> I'm not seeing issues with other stables.
>>
>> That's d85cf67a3396 ("net: bcmgenet: synchronize EXT_RGMII_OOB_CTRL
>> access") upstream. Is upstream ok?
>
> Yes, upstream is OK.
>
> Exact same issue on 6.1 not just on Raspberry Pi chips but also on
> ARCH_BRCMSTB systems as well that also make use of the GENET driver.
>
> Doug and I will take a look and provide an updated set of fixes,
> meanwhile, I would recommend dropping all of Doug's patches for now
> until we can post a revised series and/or missing dependencies.
OK, I think I see the problem. The upstream patch was applied to the
wrong context. In upstream, the critical section is added to
bcmgenet_mii_config() which did not run with the phy_device::mutex_lock
held before, and that was the race that we are trying to close. In
linux-stable-rc/linux-6.1.y however the context somehow resolved to
applying the critical section to the bcmgenet_mac_config() section where
we are already running with phy_device::lock being held by virtue of the
PHY library running our bcmgenet_mac_config() callback.
The corrected incremental diff would look like this:
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c
b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 94e0e858266e..46252d96b90e 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -71,12 +71,10 @@ static void bcmgenet_mac_config(struct net_device *dev)
* transmit -- 25MHz(100Mbps) or 125MHz(1Gbps).
* Receive clock is provided by the PHY.
*/
- mutex_lock(&phydev->lock);
reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
reg &= ~OOB_DISABLE;
reg |= RGMII_LINK;
bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
- mutex_unlock(&phydev->lock);
spin_lock_bh(&priv->reg_lock);
reg = bcmgenet_umac_readl(priv, UMAC_CMD);
@@ -271,6 +269,7 @@ int bcmgenet_mii_config(struct net_device *dev, bool
init)
* block for the interface to work
*/
if (priv->ext_phy) {
+ mutex_lock(&phydev->lock);
reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
reg &= ~ID_MODE_DIS;
reg |= id_mode_dis;
@@ -279,6 +278,7 @@ int bcmgenet_mii_config(struct net_device *dev, bool
init)
else
reg |= RGMII_MODE_EN;
bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
+ mutex_unlock(&phydev->lock);
}
if (init)
We could, and should consider taking
696450c05181559a35d4d5bee55c465b1ac6fe2e ("net: bcmgenet: Clear
RGMII_LINK upon link down") as a prerequisite as well to provide the
right context while applying d85cf67a339685beae1d0aee27b7f61da95455be
("net: bcmgenet: synchronize EXT_RGMII_OOB_CTRL access")
Mark, can you try that, too?
--
Florian
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
next prev parent reply other threads:[~2024-05-15 16:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 8:27 [PATCH 6.1 000/243] 6.1.91-rc2 review Greg Kroah-Hartman
2024-05-15 16:17 ` Mark Brown
2024-05-15 16:20 ` Linus Torvalds
2024-05-15 16:40 ` Florian Fainelli
2024-05-15 16:54 ` Florian Fainelli [this message]
2024-05-15 17:02 ` [PATCH stable 6.1 0/4] GENET stable patches for 6.1 Florian Fainelli
2024-05-15 17:02 ` [PATCH stable 6.1 1/4] net: bcmgenet: Clear RGMII_LINK upon link down Florian Fainelli
2024-05-15 17:02 ` [PATCH stable 6.1 2/4] net: bcmgenet: synchronize EXT_RGMII_OOB_CTRL access Florian Fainelli
2024-05-15 17:02 ` [PATCH stable 6.1 3/4] net: bcmgenet: synchronize use of bcmgenet_set_rx_mode() Florian Fainelli
2024-05-15 17:02 ` [PATCH stable 6.1 4/4] net: bcmgenet: synchronize UMAC_CMD access Florian Fainelli
2024-05-15 17:35 ` [PATCH stable 6.1 0/4] GENET stable patches for 6.1 Mark Brown
2024-05-16 9:11 ` Greg Kroah-Hartman
2024-05-15 16:42 ` [PATCH 6.1 000/243] 6.1.91-rc2 review Mark Brown
2024-05-15 16:58 ` Guenter Roeck
2024-05-15 17:00 ` Florian Fainelli
2024-05-15 16:48 ` Conor Dooley
2024-05-15 19:02 ` Ron Economos
2024-05-16 9:10 ` Yann Sionneau
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=d52e7e4a-2b60-4fdf-9006-12528a91dabf@broadcom.com \
--to=florian.fainelli@broadcom.com \
--cc=akpm@linux-foundation.org \
--cc=allen.lkml@gmail.com \
--cc=broonie@kernel.org \
--cc=conor@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lkft-triage@lists.linaro.org \
--cc=opendmb@gmail.com \
--cc=patches@kernelci.org \
--cc=patches@lists.linux.dev \
--cc=pavel@denx.de \
--cc=rwarsow@gmx.de \
--cc=shuah@kernel.org \
--cc=srw@sladewatkins.net \
--cc=stable@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
--cc=torvalds@linux-foundation.org \
/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