All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: macb: do not disable MDIO bus when closing interface
@ 2018-08-08 12:19 Anssi Hannula
  2018-08-09  8:26 ` Claudiu Beznea
  0 siblings, 1 reply; 11+ messages in thread
From: Anssi Hannula @ 2018-08-08 12:19 UTC (permalink / raw)
  To: Nicolas Ferre, David S. Miller; +Cc: netdev

macb_close() calls macb_reset_hw() which zeroes NCR register, including
the MPE (Management Port Enable) bit.

This will prevent accessing any other PHYs for other Ethernet MACs on
the MDIO bus which is still registered.

Fix that by keeping the MPE bit set.

Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
---
 drivers/net/ethernet/cadence/macb_main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index dc09f9a8a49b..3ca98fc32144 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -2030,12 +2030,13 @@ static void macb_reset_hw(struct macb *bp)
 	unsigned int q;
 
 	/* Disable RX and TX (XXX: Should we halt the transmission
-	 * more gracefully?)
+	 * more gracefully?) but keep management port open since there
+	 * may be other users of the mdio bus
 	 */
-	macb_writel(bp, NCR, 0);
+	macb_writel(bp, NCR, MACB_BIT(MPE));
 
 	/* Clear the stats registers (XXX: Update stats first?) */
-	macb_writel(bp, NCR, MACB_BIT(CLRSTAT));
+	macb_writel(bp, NCR, MACB_BIT(CLRSTAT) | MACB_BIT(MPE));
 
 	/* Clear all status flags */
 	macb_writel(bp, TSR, -1);
-- 
2.16.3

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

end of thread, other threads:[~2018-08-26  4:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 12:19 [PATCH] net: macb: do not disable MDIO bus when closing interface Anssi Hannula
2018-08-09  8:26 ` Claudiu Beznea
2018-08-09 14:54   ` Anssi Hannula
2018-08-09 15:14     ` Andrew Lunn
2018-08-10  6:22       ` Anssi Hannula
2018-08-13  9:08         ` Claudiu Beznea
2018-08-20 14:55           ` [PATCH] net: macb: do not disable MDIO bus at open/close time Anssi Hannula
2018-08-22 15:33             ` Claudiu Beznea
2018-08-23  7:45               ` [PATCH v2] " Anssi Hannula
2018-08-24 14:47                 ` Claudiu Beznea
2018-08-26  0:35                 ` 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.