net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed
diff mbox series

Message ID 20200224153609.24948-1-nsaenzjulienne@suse.de
State Superseded
Headers show
Series
  • net: bcmgenet: Clear ID_MODE_DIS in EXT_RGMII_OOB_CTRL when not needed
Related show

Commit Message

Nicolas Saenz Julienne Feb. 24, 2020, 3:36 p.m. UTC
Outdated Raspberry Pi 4 firmware might configure the external PHY as
rgmii although the kernel currently sets it as rgmii-rxid. This makes
connections unreliable as ID_MODE_DIS is left enabled. To avoid this,
explicitly clear that bit whenever we don't need it.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Fixes: da38802211cc ("net: bcmgenet: Add RGMII_RXID support")
---
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Leon Romanovsky Feb. 24, 2020, 4:28 p.m. UTC | #1
On Mon, Feb 24, 2020 at 04:36:09PM +0100, Nicolas Saenz Julienne wrote:
> Outdated Raspberry Pi 4 firmware might configure the external PHY as
> rgmii although the kernel currently sets it as rgmii-rxid. This makes
> connections unreliable as ID_MODE_DIS is left enabled. To avoid this,
> explicitly clear that bit whenever we don't need it.
>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Fixes: da38802211cc ("net: bcmgenet: Add RGMII_RXID support")

The expectation is that Fixes line comes before SOB line.

Thanks
Nicolas Saenz Julienne Feb. 24, 2020, 4:30 p.m. UTC | #2
On Mon, 2020-02-24 at 18:28 +0200, Leon Romanovsky wrote:
> On Mon, Feb 24, 2020 at 04:36:09PM +0100, Nicolas Saenz Julienne wrote:
> > Outdated Raspberry Pi 4 firmware might configure the external PHY as
> > rgmii although the kernel currently sets it as rgmii-rxid. This makes
> > connections unreliable as ID_MODE_DIS is left enabled. To avoid this,
> > explicitly clear that bit whenever we don't need it.
> > 
> > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > Fixes: da38802211cc ("net: bcmgenet: Add RGMII_RXID support")
> 
> The expectation is that Fixes line comes before SOB line.

Ouch, sorry for that.

I'll edit that on v2.

Regards,
Nicolas
Florian Fainelli Feb. 24, 2020, 5:23 p.m. UTC | #3
On 2/24/20 8:30 AM, Nicolas Saenz Julienne wrote:
> On Mon, 2020-02-24 at 18:28 +0200, Leon Romanovsky wrote:
>> On Mon, Feb 24, 2020 at 04:36:09PM +0100, Nicolas Saenz Julienne wrote:
>>> Outdated Raspberry Pi 4 firmware might configure the external PHY as
>>> rgmii although the kernel currently sets it as rgmii-rxid. This makes
>>> connections unreliable as ID_MODE_DIS is left enabled. To avoid this,
>>> explicitly clear that bit whenever we don't need it.
>>>
>>> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>>> Fixes: da38802211cc ("net: bcmgenet: Add RGMII_RXID support")
>>
>> The expectation is that Fixes line comes before SOB line.
> 
> Ouch, sorry for that.
> 
> I'll edit that on v2.

And you will want to indicate which tree you are targeting:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/netdev-FAQ.rst#n78

Patch
diff mbox series

diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 6392a2530183..10244941a7a6 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -294,6 +294,7 @@  int bcmgenet_mii_config(struct net_device *dev, bool init)
 	 */
 	if (priv->ext_phy) {
 		reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
+		reg &= ~ID_MODE_DIS;
 		reg |= id_mode_dis;
 		if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
 			reg |= RGMII_MODE_EN_V123;