w/drivers/net/ethernet/marvell/sky2.c
@@ -5175,6 +5175,7 @@ static int sky2_suspend(struct device *dev)
}
sky2_power_aux(hw);
+ hw->suspended = true;
rtnl_unlock();
return 0;
@@ -5198,6 +5199,7 @@ static int sky2_resume(struct device *dev)
}
rtnl_lock();
+ hw->suspended = false;
sky2_reset(hw);
sky2_all_up(hw);
rtnl_unlock();
w/drivers/net/ethernet/marvell/sky2.h
@@ -2308,6 +2308,7 @@ struct sky2_hw {
wait_queue_head_t msi_wait;
char irq_name[0];
+ bool suspended;
};
static inline int sky2_is_copper(const struct sky2_hw *hw)
@@ -2378,6 +2379,9 @@ static inline u32 get_stats32(struct sky2_hw *hw,
unsigned port, unsigned reg)
{
u32 val;
+ if (hw->suspended)
+ return 0;
+
do {
val = gma_read32(hw, port, reg);