Skip to content

Commit 98239c9

Browse files
committed
Merge branch 'Aquantia-atlantic-critical-fixes-04-2018'
Igor Russkikh says: ==================== Aquantia atlantic critical fixes 04/2018 Two regressions on latest 4.16 driver reported by users Some of old FW (1.5.44) had a link management logic which prevents driver to make clean reset. Driver of 4.16 has a full hardware reset implemented and that broke the link and traffic on such a cards. Second is oops on shutdown callback in case interface is already closed or was never opened. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5376534 + 9a11aff commit 98239c9

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

drivers/net/ethernet/aquantia/atlantic/aq_nic.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,11 @@ void aq_nic_shutdown(struct aq_nic_s *self)
951951

952952
netif_device_detach(self->ndev);
953953

954-
err = aq_nic_stop(self);
955-
if (err < 0)
956-
goto err_exit;
954+
if (netif_running(self->ndev)) {
955+
err = aq_nic_stop(self);
956+
if (err < 0)
957+
goto err_exit;
958+
}
957959
aq_nic_deinit(self);
958960

959961
err_exit:

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)