Skip to content

Commit cce96d1

Browse files
caildavem330
authored andcommitted
net: aquantia: Regression on reset with 1.x firmware
On ASUS XG-C100C with 1.5.44 firmware a special mode called "dirty wake" is active. With this mode when motherboard gets powered (but no poweron happens yet), NIC automatically enables powersave link and watches for WOL packet. This normally allows to powerup the PC after AC power failures. Not all motherboards or bios settings gives power to PCI slots, so this mode is not enabled on all the hardware. 4.16 linux driver introduced full hardware reset sequence This is required since before that we had no NIC hardware reset implemented and there were side effects of "not clean start". But this full reset is incompatible with "dirty wake" WOL feature it keeps the PHY link in a special mode forever. As a consequence, driver sees no link and no traffic. To fix this we forcibly change FW state to idle state before doing the full reset. This makes FW to restore link state. Fixes: c8c82eb net: aquantia: Introduce global AQC hardware reset sequence Signed-off-by: Igor Russkikh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5376534 commit cce96d1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#define FORCE_FLASHLESS 0
4949

5050
static int hw_atl_utils_ver_match(u32 ver_expected, u32 ver_actual);
51+
static int hw_atl_utils_mpi_set_state(struct aq_hw_s *self,
52+
enum hal_atl_utils_fw_state_e state);
5153

5254
int hw_atl_utils_initfw(struct aq_hw_s *self, const struct aq_fw_ops **fw_ops)
5355
{
@@ -247,6 +249,20 @@ int hw_atl_utils_soft_reset(struct aq_hw_s *self)
247249

248250
self->rbl_enabled = (boot_exit_code != 0);
249251

252+
/* FW 1.x may bootup in an invalid POWER state (WOL feature).
253+
* We should work around this by forcing its state back to DEINIT
254+
*/
255+
if (!hw_atl_utils_ver_match(HW_ATL_FW_VER_1X,
256+
aq_hw_read_reg(self,
257+
HW_ATL_MPI_FW_VERSION))) {
258+
int err = 0;
259+
260+
hw_atl_utils_mpi_set_state(self, MPI_DEINIT);
261+
AQ_HW_WAIT_FOR((aq_hw_read_reg(self, HW_ATL_MPI_STATE_ADR) &
262+
HW_ATL_MPI_STATE_MSK) == MPI_DEINIT,
263+
10, 1000U);
264+
}
265+
250266
if (self->rbl_enabled)
251267
return hw_atl_utils_soft_reset_rbl(self);
252268
else

0 commit comments

Comments
 (0)