Skip to content

Commit cac2ca9

Browse files
ldesrochesclaudiubeznea
authored andcommitted
net: macb: fix for suspend-to-mem feature
When suspending the macb, the management port for the MIIM interface was disabled. When resuming, the PHY (KSZ8081RNB) was no longer responding. We have to keep the management port enable to fix this issue. Moreover, to get an up-to-date backup of the NCFGR register, it has to be done just before suspending the macb. Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com> [claudiu.beznea@microchip.com: removed code from macb_suspend()] Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
1 parent f2d887c commit cac2ca9

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,14 +2028,23 @@ static void macb_reset_hw(struct macb *bp)
20282028
{
20292029
struct macb_queue *queue;
20302030
unsigned int q;
2031+
unsigned long ctrl;
2032+
2033+
/*
2034+
* Be careful to not disable port management, it seems that some
2035+
* PHYs don't like it.
2036+
*/
2037+
ctrl = macb_readl(bp, NCR);
20312038

20322039
/* Disable RX and TX (XXX: Should we halt the transmission
20332040
* more gracefully?)
20342041
*/
2035-
macb_writel(bp, NCR, 0);
2042+
ctrl &= ~(MACB_BIT(RE) | MACB_BIT(TE));
2043+
macb_writel(bp, NCR, ctrl);
20362044

20372045
/* Clear the stats registers (XXX: Update stats first?) */
2038-
macb_writel(bp, NCR, MACB_BIT(CLRSTAT));
2046+
ctrl |= MACB_BIT(CLRSTAT);
2047+
macb_writel(bp, NCR, ctrl);
20392048

20402049
/* Clear all status flags */
20412050
macb_writel(bp, TSR, -1);

0 commit comments

Comments
 (0)