All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register
@ 2020-03-11 14:41 Darell Tan
  2020-03-11 15:21 ` Andrew Lunn
  2020-03-12  6:45 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Darell Tan @ 2020-03-11 14:41 UTC (permalink / raw)
  To: netdev; +Cc: andrew, f.fainelli, hkallweit1, davem

Fix marvell_set_downshift() from clobbering MSCR register.

A typo in marvell_set_downshift() clobbers the MSCR register. This
register also shares settings with the auto MDI-X detection, set by
marvell_set_polarity(). In the 1116R init, downshift is set after
polarity, causing the polarity settings to be clobbered.

This bug is present on the 5.4 series and was introduced in commit
6ef05eb73c8f ("net: phy: marvell: Refactor setting downshift into a
helper"). This patch need not be forward-ported to 5.5 because the
functions were rewritten.

Signed-off-by: Darell Tan <darell.tan@gmail.com>
---
 drivers/net/phy/marvell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index a7796134e..6ab8fe339 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -282,7 +282,7 @@ static int marvell_set_downshift(struct phy_device *phydev, bool enable,
 	if (reg < 0)
 		return reg;
 
-	reg &= MII_M1011_PHY_SRC_DOWNSHIFT_MASK;
+	reg &= ~MII_M1011_PHY_SRC_DOWNSHIFT_MASK;
 	reg |= ((retries - 1) << MII_M1011_PHY_SCR_DOWNSHIFT_SHIFT);
 	if (enable)
 		reg |= MII_M1011_PHY_SCR_DOWNSHIFT_EN;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register
  2020-03-11 14:41 [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register Darell Tan
@ 2020-03-11 15:21 ` Andrew Lunn
  2020-03-12  6:45 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2020-03-11 15:21 UTC (permalink / raw)
  To: Darell Tan; +Cc: netdev, f.fainelli, hkallweit1, davem

On Wed, Mar 11, 2020 at 10:41:38PM +0800, Darell Tan wrote:
> Fix marvell_set_downshift() from clobbering MSCR register.
> 
> A typo in marvell_set_downshift() clobbers the MSCR register. This
> register also shares settings with the auto MDI-X detection, set by
> marvell_set_polarity(). In the 1116R init, downshift is set after
> polarity, causing the polarity settings to be clobbered.
> 
> This bug is present on the 5.4 series and was introduced in commit
> 6ef05eb73c8f ("net: phy: marvell: Refactor setting downshift into a
> helper"). This patch need not be forward-ported to 5.5 because the
> functions were rewritten.
> 
> Signed-off-by: Darell Tan <darell.tan@gmail.com>

Hi Darell

You should put net into the subject line: [patch net] ...  to indicate
this is a fix. But you have a bit of a special case here. Also, you
should indicate what it fixes:

Fixes: 6ef05eb73c8f ("net: phy: marvell: Refactor setting downshift into a helper")

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register
  2020-03-11 14:41 [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register Darell Tan
  2020-03-11 15:21 ` Andrew Lunn
@ 2020-03-12  6:45 ` David Miller
  2020-03-12 14:14   ` Darell Tan
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2020-03-12  6:45 UTC (permalink / raw)
  To: darell.tan; +Cc: netdev, andrew, f.fainelli, hkallweit1

From: Darell Tan <darell.tan@gmail.com>
Date: Wed, 11 Mar 2020 22:41:38 +0800

> Fix marvell_set_downshift() from clobbering MSCR register.
> 
> A typo in marvell_set_downshift() clobbers the MSCR register. This
> register also shares settings with the auto MDI-X detection, set by
> marvell_set_polarity(). In the 1116R init, downshift is set after
> polarity, causing the polarity settings to be clobbered.
> 
> This bug is present on the 5.4 series and was introduced in commit
> 6ef05eb73c8f ("net: phy: marvell: Refactor setting downshift into a
> helper"). This patch need not be forward-ported to 5.5 because the
> functions were rewritten.
> 
> Signed-off-by: Darell Tan <darell.tan@gmail.com>

I don't see marvell_set_downshift() in 'net' nor 'net-next'.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register
  2020-03-12  6:45 ` David Miller
@ 2020-03-12 14:14   ` Darell Tan
  2020-03-15  3:51     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Darell Tan @ 2020-03-12 14:14 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, andrew, f.fainelli, hkallweit1

On Thu, Mar 12, 2020 at 2:45 PM David Miller <davem@davemloft.net> wrote:
>
> From: Darell Tan <darell.tan@gmail.com>
> Date: Wed, 11 Mar 2020 22:41:38 +0800
>
> > Fix marvell_set_downshift() from clobbering MSCR register.
> >
> > A typo in marvell_set_downshift() clobbers the MSCR register. This
> > register also shares settings with the auto MDI-X detection, set by
> > marvell_set_polarity(). In the 1116R init, downshift is set after
> > polarity, causing the polarity settings to be clobbered.
> >
> > This bug is present on the 5.4 series and was introduced in commit
> > 6ef05eb73c8f ("net: phy: marvell: Refactor setting downshift into a
> > helper"). This patch need not be forward-ported to 5.5 because the
> > functions were rewritten.
> >
> > Signed-off-by: Darell Tan <darell.tan@gmail.com>
>
> I don't see marvell_set_downshift() in 'net' nor 'net-next'.

This patch applies to the 5.4.x long term series and earlier, but not
to -stable or -next because the affected functions have already been
refactored.

Sorry I'm new to this. Should I be incorporating Andrew's comments and
sending a v2 to the linux-kernel list instead?

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register
  2020-03-12 14:14   ` Darell Tan
@ 2020-03-15  3:51     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-03-15  3:51 UTC (permalink / raw)
  To: darell.tan; +Cc: netdev, andrew, f.fainelli, hkallweit1

From: Darell Tan <darell.tan@gmail.com>
Date: Thu, 12 Mar 2020 22:14:08 +0800

> On Thu, Mar 12, 2020 at 2:45 PM David Miller <davem@davemloft.net> wrote:
>>
>> From: Darell Tan <darell.tan@gmail.com>
>> Date: Wed, 11 Mar 2020 22:41:38 +0800
>>
>> > Fix marvell_set_downshift() from clobbering MSCR register.
>> >
>> > A typo in marvell_set_downshift() clobbers the MSCR register. This
>> > register also shares settings with the auto MDI-X detection, set by
>> > marvell_set_polarity(). In the 1116R init, downshift is set after
>> > polarity, causing the polarity settings to be clobbered.
>> >
>> > This bug is present on the 5.4 series and was introduced in commit
>> > 6ef05eb73c8f ("net: phy: marvell: Refactor setting downshift into a
>> > helper"). This patch need not be forward-ported to 5.5 because the
>> > functions were rewritten.
>> >
>> > Signed-off-by: Darell Tan <darell.tan@gmail.com>
>>
>> I don't see marvell_set_downshift() in 'net' nor 'net-next'.
> 
> This patch applies to the 5.4.x long term series and earlier, but not
> to -stable or -next because the affected functions have already been
> refactored.
> 
> Sorry I'm new to this. Should I be incorporating Andrew's comments and
> sending a v2 to the linux-kernel list instead?

Submit it to stable@vger.kernel.org, include my:

Acked-by: David S. Miller <davem@davemloft.net>

And be sure to CC: me and make it clear that I directed you to do this.

Thank you.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-15  3:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 14:41 [PATCH] net: phy: Fix marvell_set_downshift() from clobbering MSCR register Darell Tan
2020-03-11 15:21 ` Andrew Lunn
2020-03-12  6:45 ` David Miller
2020-03-12 14:14   ` Darell Tan
2020-03-15  3:51     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.