atl1c: Disable L0S when no cable link
authorHuang, Xiong <xiong@qca.qualcomm.com>
Mon, 30 Apr 2012 15:38:57 +0000 (15:38 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 May 2012 01:44:16 +0000 (21:44 -0400)
L0S might be unstable if no cable link, only enable it when link up.

Signed-off-by: xiong <xiong@qca.qualcomm.com>
Tested-by: Liu David <dwliu@qca.qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/atheros/atl1c/atl1c_main.c

index e6c62d0aff05a35ca2183cbe10e5ee0bf9891055..05ce8ec6495698ca44a02b5fa7a79d7ae48c348d 100644 (file)
@@ -1326,7 +1326,7 @@ static void atl1c_set_aspm(struct atl1c_hw *hw, u16 link_speed)
        }
 
        /* L0S/L1 enable */
-       if (hw->ctrl_flags & ATL1C_ASPM_L0S_SUPPORT)
+       if ((hw->ctrl_flags & ATL1C_ASPM_L0S_SUPPORT) && link_speed != SPEED_0)
                pm_ctrl_data |= PM_CTRL_ASPM_L0S_EN | PM_CTRL_MAC_ASPM_CHK;
        if (hw->ctrl_flags & ATL1C_ASPM_L1_SUPPORT)
                pm_ctrl_data |= PM_CTRL_ASPM_L1_EN | PM_CTRL_MAC_ASPM_CHK;