cxgb4: fix to bring link down after adapter crash
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Thu, 8 Jun 2017 05:22:11 +0000 (10:52 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Jun 2017 18:40:15 +0000 (14:40 -0400)
Use PORT_REG for T4 and T5_PORT_REG for > T4 to write to correct
register to bring down link during shutdown after adapter crash.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index 4618185d6bc20822e6b1cf377f44579e4a57c201..da1322da49250382e0efe41ecc59f487bec06c4d 100644 (file)
@@ -7688,10 +7688,9 @@ int t4_shutdown_adapter(struct adapter *adapter)
        t4_intr_disable(adapter);
        t4_write_reg(adapter, DBG_GPIO_EN_A, 0);
        for_each_port(adapter, port) {
-               u32 a_port_cfg = PORT_REG(port,
-                                         is_t4(adapter->params.chip)
-                                         ? XGMAC_PORT_CFG_A
-                                         : MAC_PORT_CFG_A);
+               u32 a_port_cfg = is_t4(adapter->params.chip) ?
+                                      PORT_REG(port, XGMAC_PORT_CFG_A) :
+                                      T5_PORT_REG(port, MAC_PORT_CFG_A);
 
                t4_write_reg(adapter, a_port_cfg,
                             t4_read_reg(adapter, a_port_cfg)