Skip to content

Commit e8ad878

Browse files
committed
net: macb: solve BSR after commit cb765f5
Commit cb765f5 "net: macb: do not disable MDIO bus at open/close time" introduced the enable of management port only at probe and not every time the interface was up. Doing so, the MPE bit of NCR must be saved in suspend and restored in resume for BSR to work. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
1 parent 6b97a19 commit e8ad878

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/net/ethernet/cadence/macb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ struct macb_ptp_info {
10801080
struct macb_sama5d2_pm_data {
10811081
u32 etht;
10821082
u32 usrio;
1083+
u32 ncr;
10831084
};
10841085

10851086
struct macb_pm_ops {

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3919,6 +3919,8 @@ static int __maybe_unused macb_sama5d2_suspend(struct macb *bp)
39193919
if (!(bp->caps & MACB_CAPS_USRIO_DISABLED))
39203920
pm_data->usrio = macb_or_gem_readl(bp, USRIO);
39213921

3922+
pm_data->ncr = macb_readl(bp, NCR);
3923+
39223924
if (netif_running(netdev))
39233925
macb_close(netdev);
39243926

@@ -3933,6 +3935,8 @@ static int __maybe_unused macb_sama5d2_resume(struct macb *bp)
39333935
if (!macb_sama5d2_backup())
39343936
return -EPERM;
39353937

3938+
macb_writel(bp, NCR, pm_data->ncr & MACB_BIT(MPE));
3939+
39363940
if (netdev->hw_features & NETIF_F_NTUPLE)
39373941
gem_writel_n(bp, ETHT, SCRT2_ETHT, pm_data->etht);
39383942

0 commit comments

Comments
 (0)