diff options
| -rw-r--r-- | drivers/net/ethernet/intel/e100.c | 15 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/e1000e/82571.c | 1 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/e1000e/e1000.h | 3 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/e1000e/ethtool.c | 105 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/e1000e/hw.h | 10 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/e1000e/ich8lan.c | 140 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/e1000e/ich8lan.h | 6 | ||||
| -rw-r--r-- | drivers/net/ethernet/intel/e1000e/netdev.c | 38 |
8 files changed, 217 insertions, 101 deletions
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 5115ae76a5d1..ada6e210279f 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c | |||
| @@ -1175,15 +1175,12 @@ static int e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb) | |||
| 1175 | config->rx_discard_short_frames = 0x0; /* 1=discard, 0=save */ | 1175 | config->rx_discard_short_frames = 0x0; /* 1=discard, 0=save */ |
| 1176 | } | 1176 | } |
| 1177 | 1177 | ||
| 1178 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, | 1178 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, "[00-07]=%8ph\n", |
| 1179 | "[00-07]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", | 1179 | c + 0); |
| 1180 | c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); | 1180 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, "[08-15]=%8ph\n", |
| 1181 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, | 1181 | c + 8); |
| 1182 | "[08-15]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", | 1182 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, "[16-23]=%8ph\n", |
| 1183 | c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15]); | 1183 | c + 16); |
| 1184 | netif_printk(nic, hw, KERN_DEBUG, nic->netdev, | ||
| 1185 | "[16-23]=%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", | ||
| 1186 | c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23]); | ||
| 1187 | return 0; | 1184 | return 0; |
| 1188 | } | 1185 | } |
| 1189 | 1186 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c index 4c303e2a7cb3..104fcec86af3 100644 --- a/drivers/net/ethernet/intel/e1000e/82571.c +++ b/drivers/net/ethernet/intel/e1000e/82571.c | |||
| @@ -2057,6 +2057,7 @@ const struct e1000_info e1000_82583_info = { | |||
| 2057 | | FLAG_HAS_JUMBO_FRAMES | 2057 | | FLAG_HAS_JUMBO_FRAMES |
| 2058 | | FLAG_HAS_CTRLEXT_ON_LOAD, | 2058 | | FLAG_HAS_CTRLEXT_ON_LOAD, |
| 2059 | .flags2 = FLAG2_DISABLE_ASPM_L0S | 2059 | .flags2 = FLAG2_DISABLE_ASPM_L0S |
| 2060 | | FLAG2_DISABLE_ASPM_L1 | ||
| 2060 | | FLAG2_NO_DISABLE_RX, | 2061 | | FLAG2_NO_DISABLE_RX, |
| 2061 | .pba = 32, | 2062 | .pba = 32, |
| 2062 | .max_hw_frame_size = DEFAULT_JUMBO, | 2063 | .max_hw_frame_size = DEFAULT_JUMBO, |
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index ffbc08f56c40..ad0edd11015d 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h | |||
| @@ -90,9 +90,6 @@ struct e1000_info; | |||
| 90 | 90 | ||
| 91 | #define E1000_MNG_VLAN_NONE (-1) | 91 | #define E1000_MNG_VLAN_NONE (-1) |
| 92 | 92 | ||
| 93 | /* Number of packet split data buffers (not including the header buffer) */ | ||
| 94 | #define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1) | ||
| 95 | |||
| 96 | #define DEFAULT_JUMBO 9234 | 93 | #define DEFAULT_JUMBO 9234 |
| 97 | 94 | ||
| 98 | /* Time to wait before putting the device into D3 if there's no link (in ms). */ | 95 | /* Time to wait before putting the device into D3 if there's no link (in ms). */ |
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index 59c22bf18701..e4ebd7ddf5f2 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c | |||
| @@ -173,7 +173,7 @@ static int e1000_get_settings(struct net_device *netdev, | |||
| 173 | speed = adapter->link_speed; | 173 | speed = adapter->link_speed; |
| 174 | ecmd->duplex = adapter->link_duplex - 1; | 174 | ecmd->duplex = adapter->link_duplex - 1; |
| 175 | } | 175 | } |
| 176 | } else { | 176 | } else if (!pm_runtime_suspended(netdev->dev.parent)) { |
| 177 | u32 status = er32(STATUS); | 177 | u32 status = er32(STATUS); |
| 178 | if (status & E1000_STATUS_LU) { | 178 | if (status & E1000_STATUS_LU) { |
| 179 | if (status & E1000_STATUS_SPEED_1000) | 179 | if (status & E1000_STATUS_SPEED_1000) |
| @@ -264,6 +264,9 @@ static int e1000_set_settings(struct net_device *netdev, | |||
| 264 | { | 264 | { |
| 265 | struct e1000_adapter *adapter = netdev_priv(netdev); | 265 | struct e1000_adapter *adapter = netdev_priv(netdev); |
| 266 | struct e1000_hw *hw = &adapter->hw; | 266 | struct e1000_hw *hw = &adapter->hw; |
| 267 | int ret_val = 0; | ||
| 268 | |||
| 269 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 267 | 270 | ||
| 268 | /* When SoL/IDER sessions are active, autoneg/speed/duplex | 271 | /* When SoL/IDER sessions are active, autoneg/speed/duplex |
| 269 | * cannot be changed | 272 | * cannot be changed |
| @@ -271,7 +274,8 @@ static int e1000_set_settings(struct net_device *netdev, | |||
| 271 | if (hw->phy.ops.check_reset_block && | 274 | if (hw->phy.ops.check_reset_block && |
| 272 | hw->phy.ops.check_reset_block(hw)) { | 275 | hw->phy.ops.check_reset_block(hw)) { |
| 273 | e_err("Cannot change link characteristics when SoL/IDER is active.\n"); | 276 | e_err("Cannot change link characteristics when SoL/IDER is active.\n"); |
| 274 | return -EINVAL; | 277 | ret_val = -EINVAL; |
| 278 | goto out; | ||
| 275 | } | 279 | } |
| 276 | 280 | ||
| 277 | /* MDI setting is only allowed when autoneg enabled because | 281 | /* MDI setting is only allowed when autoneg enabled because |
| @@ -279,13 +283,16 @@ static int e1000_set_settings(struct net_device *netdev, | |||
| 279 | * duplex is forced. | 283 | * duplex is forced. |
| 280 | */ | 284 | */ |
| 281 | if (ecmd->eth_tp_mdix_ctrl) { | 285 | if (ecmd->eth_tp_mdix_ctrl) { |
| 282 | if (hw->phy.media_type != e1000_media_type_copper) | 286 | if (hw->phy.media_type != e1000_media_type_copper) { |
| 283 | return -EOPNOTSUPP; | 287 | ret_val = -EOPNOTSUPP; |
| 288 | goto out; | ||
| 289 | } | ||
| 284 | 290 | ||
| 285 | if ((ecmd->eth_tp_mdix_ctrl != ETH_TP_MDI_AUTO) && | 291 | if ((ecmd->eth_tp_mdix_ctrl != ETH_TP_MDI_AUTO) && |
| 286 | (ecmd->autoneg != AUTONEG_ENABLE)) { | 292 | (ecmd->autoneg != AUTONEG_ENABLE)) { |
| 287 | e_err("forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\n"); | 293 | e_err("forcing MDI/MDI-X state is not supported when link speed and/or duplex are forced\n"); |
| 288 | return -EINVAL; | 294 | ret_val = -EINVAL; |
| 295 | goto out; | ||
| 289 | } | 296 | } |
| 290 | } | 297 | } |
| 291 | 298 | ||
| @@ -307,8 +314,8 @@ static int e1000_set_settings(struct net_device *netdev, | |||
| 307 | u32 speed = ethtool_cmd_speed(ecmd); | 314 | u32 speed = ethtool_cmd_speed(ecmd); |
| 308 | /* calling this overrides forced MDI setting */ | 315 | /* calling this overrides forced MDI setting */ |
| 309 | if (e1000_set_spd_dplx(adapter, speed, ecmd->duplex)) { | 316 | if (e1000_set_spd_dplx(adapter, speed, ecmd->duplex)) { |
| 310 | clear_bit(__E1000_RESETTING, &adapter->state); | 317 | ret_val = -EINVAL; |
| 311 | return -EINVAL; | 318 | goto out; |
| 312 | } | 319 | } |
| 313 | } | 320 | } |
| 314 | 321 | ||
| @@ -331,8 +338,10 @@ static int e1000_set_settings(struct net_device *netdev, | |||
| 331 | e1000e_reset(adapter); | 338 | e1000e_reset(adapter); |
| 332 | } | 339 | } |
| 333 | 340 | ||
| 341 | out: | ||
| 342 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 334 | clear_bit(__E1000_RESETTING, &adapter->state); | 343 | clear_bit(__E1000_RESETTING, &adapter->state); |
| 335 | return 0; | 344 | return ret_val; |
| 336 | } | 345 | } |
| 337 | 346 | ||
| 338 | static void e1000_get_pauseparam(struct net_device *netdev, | 347 | static void e1000_get_pauseparam(struct net_device *netdev, |
| @@ -366,6 +375,8 @@ static int e1000_set_pauseparam(struct net_device *netdev, | |||
| 366 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) | 375 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) |
| 367 | usleep_range(1000, 2000); | 376 | usleep_range(1000, 2000); |
| 368 | 377 | ||
| 378 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 379 | |||
| 369 | if (adapter->fc_autoneg == AUTONEG_ENABLE) { | 380 | if (adapter->fc_autoneg == AUTONEG_ENABLE) { |
| 370 | hw->fc.requested_mode = e1000_fc_default; | 381 | hw->fc.requested_mode = e1000_fc_default; |
| 371 | if (netif_running(adapter->netdev)) { | 382 | if (netif_running(adapter->netdev)) { |
| @@ -398,6 +409,7 @@ static int e1000_set_pauseparam(struct net_device *netdev, | |||
| 398 | } | 409 | } |
| 399 | 410 | ||
| 400 | out: | 411 | out: |
| 412 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 401 | clear_bit(__E1000_RESETTING, &adapter->state); | 413 | clear_bit(__E1000_RESETTING, &adapter->state); |
| 402 | return retval; | 414 | return retval; |
| 403 | } | 415 | } |
| @@ -428,6 +440,8 @@ static void e1000_get_regs(struct net_device *netdev, | |||
| 428 | u32 *regs_buff = p; | 440 | u32 *regs_buff = p; |
| 429 | u16 phy_data; | 441 | u16 phy_data; |
| 430 | 442 | ||
| 443 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 444 | |||
| 431 | memset(p, 0, E1000_REGS_LEN * sizeof(u32)); | 445 | memset(p, 0, E1000_REGS_LEN * sizeof(u32)); |
| 432 | 446 | ||
| 433 | regs->version = (1 << 24) | (adapter->pdev->revision << 16) | | 447 | regs->version = (1 << 24) | (adapter->pdev->revision << 16) | |
| @@ -472,6 +486,8 @@ static void e1000_get_regs(struct net_device *netdev, | |||
| 472 | e1e_rphy(hw, MII_STAT1000, &phy_data); | 486 | e1e_rphy(hw, MII_STAT1000, &phy_data); |
| 473 | regs_buff[24] = (u32)phy_data; /* phy local receiver status */ | 487 | regs_buff[24] = (u32)phy_data; /* phy local receiver status */ |
| 474 | regs_buff[25] = regs_buff[24]; /* phy remote receiver status */ | 488 | regs_buff[25] = regs_buff[24]; /* phy remote receiver status */ |
| 489 | |||
| 490 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 475 | } | 491 | } |
| 476 | 492 | ||
| 477 | static int e1000_get_eeprom_len(struct net_device *netdev) | 493 | static int e1000_get_eeprom_len(struct net_device *netdev) |
| @@ -504,6 +520,8 @@ static int e1000_get_eeprom(struct net_device *netdev, | |||
| 504 | if (!eeprom_buff) | 520 | if (!eeprom_buff) |
| 505 | return -ENOMEM; | 521 | return -ENOMEM; |
| 506 | 522 | ||
| 523 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 524 | |||
| 507 | if (hw->nvm.type == e1000_nvm_eeprom_spi) { | 525 | if (hw->nvm.type == e1000_nvm_eeprom_spi) { |
| 508 | ret_val = e1000_read_nvm(hw, first_word, | 526 | ret_val = e1000_read_nvm(hw, first_word, |
| 509 | last_word - first_word + 1, | 527 | last_word - first_word + 1, |
| @@ -517,6 +535,8 @@ static int e1000_get_eeprom(struct net_device *netdev, | |||
| 517 | } | 535 | } |
| 518 | } | 536 | } |
| 519 | 537 | ||
| 538 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 539 | |||
| 520 | if (ret_val) { | 540 | if (ret_val) { |
| 521 | /* a read error occurred, throw away the result */ | 541 | /* a read error occurred, throw away the result */ |
| 522 | memset(eeprom_buff, 0xff, sizeof(u16) * | 542 | memset(eeprom_buff, 0xff, sizeof(u16) * |
| @@ -566,6 +586,8 @@ static int e1000_set_eeprom(struct net_device *netdev, | |||
| 566 | 586 | ||
| 567 | ptr = (void *)eeprom_buff; | 587 | ptr = (void *)eeprom_buff; |
| 568 | 588 | ||
| 589 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 590 | |||
| 569 | if (eeprom->offset & 1) { | 591 | if (eeprom->offset & 1) { |
| 570 | /* need read/modify/write of first changed EEPROM word */ | 592 | /* need read/modify/write of first changed EEPROM word */ |
| 571 | /* only the second byte of the word is being modified */ | 593 | /* only the second byte of the word is being modified */ |
| @@ -606,6 +628,7 @@ static int e1000_set_eeprom(struct net_device *netdev, | |||
| 606 | ret_val = e1000e_update_nvm_checksum(hw); | 628 | ret_val = e1000e_update_nvm_checksum(hw); |
| 607 | 629 | ||
| 608 | out: | 630 | out: |
| 631 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 609 | kfree(eeprom_buff); | 632 | kfree(eeprom_buff); |
| 610 | return ret_val; | 633 | return ret_val; |
| 611 | } | 634 | } |
| @@ -701,6 +724,8 @@ static int e1000_set_ringparam(struct net_device *netdev, | |||
| 701 | } | 724 | } |
| 702 | } | 725 | } |
| 703 | 726 | ||
| 727 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 728 | |||
| 704 | e1000e_down(adapter); | 729 | e1000e_down(adapter); |
| 705 | 730 | ||
| 706 | /* We can't just free everything and then setup again, because the | 731 | /* We can't just free everything and then setup again, because the |
| @@ -739,6 +764,7 @@ err_setup_rx: | |||
| 739 | e1000e_free_tx_resources(temp_tx); | 764 | e1000e_free_tx_resources(temp_tx); |
| 740 | err_setup: | 765 | err_setup: |
| 741 | e1000e_up(adapter); | 766 | e1000e_up(adapter); |
| 767 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 742 | free_temp: | 768 | free_temp: |
| 743 | vfree(temp_tx); | 769 | vfree(temp_tx); |
| 744 | vfree(temp_rx); | 770 | vfree(temp_rx); |
| @@ -1732,6 +1758,8 @@ static void e1000_diag_test(struct net_device *netdev, | |||
| 1732 | u8 autoneg; | 1758 | u8 autoneg; |
| 1733 | bool if_running = netif_running(netdev); | 1759 | bool if_running = netif_running(netdev); |
| 1734 | 1760 | ||
| 1761 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 1762 | |||
| 1735 | set_bit(__E1000_TESTING, &adapter->state); | 1763 | set_bit(__E1000_TESTING, &adapter->state); |
| 1736 | 1764 | ||
| 1737 | if (!if_running) { | 1765 | if (!if_running) { |
| @@ -1817,6 +1845,8 @@ static void e1000_diag_test(struct net_device *netdev, | |||
| 1817 | } | 1845 | } |
| 1818 | 1846 | ||
| 1819 | msleep_interruptible(4 * 1000); | 1847 | msleep_interruptible(4 * 1000); |
| 1848 | |||
| 1849 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 1820 | } | 1850 | } |
| 1821 | 1851 | ||
| 1822 | static void e1000_get_wol(struct net_device *netdev, | 1852 | static void e1000_get_wol(struct net_device *netdev, |
| @@ -1891,6 +1921,8 @@ static int e1000_set_phys_id(struct net_device *netdev, | |||
| 1891 | 1921 | ||
| 1892 | switch (state) { | 1922 | switch (state) { |
| 1893 | case ETHTOOL_ID_ACTIVE: | 1923 | case ETHTOOL_ID_ACTIVE: |
| 1924 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 1925 | |||
| 1894 | if (!hw->mac.ops.blink_led) | 1926 | if (!hw->mac.ops.blink_led) |
| 1895 | return 2; /* cycle on/off twice per second */ | 1927 | return 2; /* cycle on/off twice per second */ |
| 1896 | 1928 | ||
| @@ -1902,6 +1934,7 @@ static int e1000_set_phys_id(struct net_device *netdev, | |||
| 1902 | e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0); | 1934 | e1e_wphy(hw, IFE_PHY_SPECIAL_CONTROL_LED, 0); |
| 1903 | hw->mac.ops.led_off(hw); | 1935 | hw->mac.ops.led_off(hw); |
| 1904 | hw->mac.ops.cleanup_led(hw); | 1936 | hw->mac.ops.cleanup_led(hw); |
| 1937 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 1905 | break; | 1938 | break; |
| 1906 | 1939 | ||
| 1907 | case ETHTOOL_ID_ON: | 1940 | case ETHTOOL_ID_ON: |
| @@ -1912,6 +1945,7 @@ static int e1000_set_phys_id(struct net_device *netdev, | |||
| 1912 | hw->mac.ops.led_off(hw); | 1945 | hw->mac.ops.led_off(hw); |
| 1913 | break; | 1946 | break; |
| 1914 | } | 1947 | } |
| 1948 | |||
| 1915 | return 0; | 1949 | return 0; |
| 1916 | } | 1950 | } |
| 1917 | 1951 | ||
| @@ -1950,11 +1984,15 @@ static int e1000_set_coalesce(struct net_device *netdev, | |||
| 1950 | adapter->itr_setting = adapter->itr & ~3; | 1984 | adapter->itr_setting = adapter->itr & ~3; |
| 1951 | } | 1985 | } |
| 1952 | 1986 | ||
| 1987 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 1988 | |||
| 1953 | if (adapter->itr_setting != 0) | 1989 | if (adapter->itr_setting != 0) |
| 1954 | e1000e_write_itr(adapter, adapter->itr); | 1990 | e1000e_write_itr(adapter, adapter->itr); |
| 1955 | else | 1991 | else |
| 1956 | e1000e_write_itr(adapter, 0); | 1992 | e1000e_write_itr(adapter, 0); |
| 1957 | 1993 | ||
| 1994 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 1995 | |||
| 1958 | return 0; | 1996 | return 0; |
| 1959 | } | 1997 | } |
| 1960 | 1998 | ||
| @@ -1968,7 +2006,9 @@ static int e1000_nway_reset(struct net_device *netdev) | |||
| 1968 | if (!adapter->hw.mac.autoneg) | 2006 | if (!adapter->hw.mac.autoneg) |
| 1969 | return -EINVAL; | 2007 | return -EINVAL; |
| 1970 | 2008 | ||
| 2009 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 1971 | e1000e_reinit_locked(adapter); | 2010 | e1000e_reinit_locked(adapter); |
| 2011 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 1972 | 2012 | ||
| 1973 | return 0; | 2013 | return 0; |
| 1974 | } | 2014 | } |
| @@ -1982,7 +2022,12 @@ static void e1000_get_ethtool_stats(struct net_device *netdev, | |||
| 1982 | int i; | 2022 | int i; |
| 1983 | char *p = NULL; | 2023 | char *p = NULL; |
| 1984 | 2024 | ||
| 2025 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 2026 | |||
| 1985 | e1000e_get_stats64(netdev, &net_stats); | 2027 | e1000e_get_stats64(netdev, &net_stats); |
| 2028 | |||
| 2029 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 2030 | |||
| 1986 | for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) { | 2031 | for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) { |
| 1987 | switch (e1000_gstrings_stats[i].type) { | 2032 | switch (e1000_gstrings_stats[i].type) { |
| 1988 | case NETDEV_STATS: | 2033 | case NETDEV_STATS: |
| @@ -2033,7 +2078,11 @@ static int e1000_get_rxnfc(struct net_device *netdev, | |||
| 2033 | case ETHTOOL_GRXFH: { | 2078 | case ETHTOOL_GRXFH: { |
| 2034 | struct e1000_adapter *adapter = netdev_priv(netdev); | 2079 | struct e1000_adapter *adapter = netdev_priv(netdev); |
| 2035 | struct e1000_hw *hw = &adapter->hw; | 2080 | struct e1000_hw *hw = &adapter->hw; |
| 2036 | u32 mrqc = er32(MRQC); | 2081 | u32 mrqc; |
| 2082 | |||
| 2083 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 2084 | mrqc = er32(MRQC); | ||
| 2085 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 2037 | 2086 | ||
| 2038 | if (!(mrqc & E1000_MRQC_RSS_FIELD_MASK)) | 2087 | if (!(mrqc & E1000_MRQC_RSS_FIELD_MASK)) |
| 2039 | return 0; | 2088 | return 0; |
| @@ -2096,9 +2145,13 @@ static int e1000e_get_eee(struct net_device *netdev, struct ethtool_eee *edata) | |||
| 2096 | return -EOPNOTSUPP; | 2145 | return -EOPNOTSUPP; |
| 2097 | } | 2146 | } |
| 2098 | 2147 | ||
| 2148 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 2149 | |||
| 2099 | ret_val = hw->phy.ops.acquire(hw); | 2150 | ret_val = hw->phy.ops.acquire(hw); |
| 2100 | if (ret_val) | 2151 | if (ret_val) { |
| 2152 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 2101 | return -EBUSY; | 2153 | return -EBUSY; |
| 2154 | } | ||
| 2102 | 2155 | ||
| 2103 | /* EEE Capability */ | 2156 | /* EEE Capability */ |
| 2104 | ret_val = e1000_read_emi_reg_locked(hw, cap_addr, &phy_data); | 2157 | ret_val = e1000_read_emi_reg_locked(hw, cap_addr, &phy_data); |
| @@ -2117,14 +2170,11 @@ static int e1000e_get_eee(struct net_device *netdev, struct ethtool_eee *edata) | |||
| 2117 | 2170 | ||
| 2118 | /* EEE PCS Status */ | 2171 | /* EEE PCS Status */ |
| 2119 | ret_val = e1000_read_emi_reg_locked(hw, pcs_stat_addr, &phy_data); | 2172 | ret_val = e1000_read_emi_reg_locked(hw, pcs_stat_addr, &phy_data); |
| 2173 | if (ret_val) | ||
| 2174 | goto release; | ||
| 2120 | if (hw->phy.type == e1000_phy_82579) | 2175 | if (hw->phy.type == e1000_phy_82579) |
| 2121 | phy_data <<= 8; | 2176 | phy_data <<= 8; |
| 2122 | 2177 | ||
| 2123 | release: | ||
| 2124 | hw->phy.ops.release(hw); | ||
| 2125 | if (ret_val) | ||
| 2126 | return -ENODATA; | ||
| 2127 | |||
| 2128 | /* Result of the EEE auto negotiation - there is no register that | 2178 | /* Result of the EEE auto negotiation - there is no register that |
| 2129 | * has the status of the EEE negotiation so do a best-guess based | 2179 | * has the status of the EEE negotiation so do a best-guess based |
| 2130 | * on whether Tx or Rx LPI indications have been received. | 2180 | * on whether Tx or Rx LPI indications have been received. |
| @@ -2136,7 +2186,14 @@ release: | |||
| 2136 | edata->tx_lpi_enabled = true; | 2186 | edata->tx_lpi_enabled = true; |
| 2137 | edata->tx_lpi_timer = er32(LPIC) >> E1000_LPIC_LPIET_SHIFT; | 2187 | edata->tx_lpi_timer = er32(LPIC) >> E1000_LPIC_LPIET_SHIFT; |
| 2138 | 2188 | ||
| 2139 | return 0; | 2189 | release: |
| 2190 | hw->phy.ops.release(hw); | ||
| 2191 | if (ret_val) | ||
| 2192 | ret_val = -ENODATA; | ||
| 2193 | |||
| 2194 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 2195 | |||
| 2196 | return ret_val; | ||
| 2140 | } | 2197 | } |
| 2141 | 2198 | ||
| 2142 | static int e1000e_set_eee(struct net_device *netdev, struct ethtool_eee *edata) | 2199 | static int e1000e_set_eee(struct net_device *netdev, struct ethtool_eee *edata) |
| @@ -2169,12 +2226,16 @@ static int e1000e_set_eee(struct net_device *netdev, struct ethtool_eee *edata) | |||
| 2169 | 2226 | ||
| 2170 | hw->dev_spec.ich8lan.eee_disable = !edata->eee_enabled; | 2227 | hw->dev_spec.ich8lan.eee_disable = !edata->eee_enabled; |
| 2171 | 2228 | ||
| 2229 | pm_runtime_get_sync(netdev->dev.parent); | ||
| 2230 | |||
| 2172 | /* reset the link */ | 2231 | /* reset the link */ |
| 2173 | if (netif_running(netdev)) | 2232 | if (netif_running(netdev)) |
| 2174 | e1000e_reinit_locked(adapter); | 2233 | e1000e_reinit_locked(adapter); |
| 2175 | else | 2234 | else |
| 2176 | e1000e_reset(adapter); | 2235 | e1000e_reset(adapter); |
| 2177 | 2236 | ||
| 2237 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 2238 | |||
| 2178 | return 0; | 2239 | return 0; |
| 2179 | } | 2240 | } |
| 2180 | 2241 | ||
| @@ -2212,19 +2273,7 @@ static int e1000e_get_ts_info(struct net_device *netdev, | |||
| 2212 | return 0; | 2273 | return 0; |
| 2213 | } | 2274 | } |
| 2214 | 2275 | ||
| 2215 | static int e1000e_ethtool_begin(struct net_device *netdev) | ||
| 2216 | { | ||
| 2217 | return pm_runtime_get_sync(netdev->dev.parent); | ||
| 2218 | } | ||
| 2219 | |||
| 2220 | static void e1000e_ethtool_complete(struct net_device *netdev) | ||
| 2221 | { | ||
| 2222 | pm_runtime_put_sync(netdev->dev.parent); | ||
| 2223 | } | ||
| 2224 | |||
| 2225 | static const struct ethtool_ops e1000_ethtool_ops = { | 2276 | static const struct ethtool_ops e1000_ethtool_ops = { |
| 2226 | .begin = e1000e_ethtool_begin, | ||
| 2227 | .complete = e1000e_ethtool_complete, | ||
| 2228 | .get_settings = e1000_get_settings, | 2277 | .get_settings = e1000_get_settings, |
| 2229 | .set_settings = e1000_set_settings, | 2278 | .set_settings = e1000_set_settings, |
| 2230 | .get_drvinfo = e1000_get_drvinfo, | 2279 | .get_drvinfo = e1000_get_drvinfo, |
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h index a6f903a9b773..b799fd9b6aa9 100644 --- a/drivers/net/ethernet/intel/e1000e/hw.h +++ b/drivers/net/ethernet/intel/e1000e/hw.h | |||
| @@ -90,6 +90,10 @@ struct e1000_hw; | |||
| 90 | #define E1000_DEV_ID_PCH_LPT_I217_V 0x153B | 90 | #define E1000_DEV_ID_PCH_LPT_I217_V 0x153B |
| 91 | #define E1000_DEV_ID_PCH_LPTLP_I218_LM 0x155A | 91 | #define E1000_DEV_ID_PCH_LPTLP_I218_LM 0x155A |
| 92 | #define E1000_DEV_ID_PCH_LPTLP_I218_V 0x1559 | 92 | #define E1000_DEV_ID_PCH_LPTLP_I218_V 0x1559 |
| 93 | #define E1000_DEV_ID_PCH_I218_LM2 0x15A0 | ||
| 94 | #define E1000_DEV_ID_PCH_I218_V2 0x15A1 | ||
| 95 | #define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */ | ||
| 96 | #define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */ | ||
| 93 | 97 | ||
| 94 | #define E1000_REVISION_4 4 | 98 | #define E1000_REVISION_4 4 |
| 95 | 99 | ||
| @@ -227,6 +231,9 @@ union e1000_rx_desc_extended { | |||
| 227 | }; | 231 | }; |
| 228 | 232 | ||
| 229 | #define MAX_PS_BUFFERS 4 | 233 | #define MAX_PS_BUFFERS 4 |
| 234 | |||
| 235 | /* Number of packet split data buffers (not including the header buffer) */ | ||
| 236 | #define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1) | ||
| 230 | /* Receive Descriptor - Packet Split */ | 237 | /* Receive Descriptor - Packet Split */ |
| 231 | union e1000_rx_desc_packet_split { | 238 | union e1000_rx_desc_packet_split { |
| 232 | struct { | 239 | struct { |
| @@ -251,7 +258,8 @@ union e1000_rx_desc_packet_split { | |||
| 251 | } middle; | 258 | } middle; |
| 252 | struct { | 259 | struct { |
| 253 | __le16 header_status; | 260 | __le16 header_status; |
| 254 | __le16 length[3]; /* length of buffers 1-3 */ | 261 | /* length of buffers 1-3 */ |
| 262 | __le16 length[PS_PAGE_BUFFERS]; | ||
| 255 | } upper; | 263 | } upper; |
| 256 | __le64 reserved; | 264 | __le64 reserved; |
| 257 | } wb; /* writeback */ | 265 | } wb; /* writeback */ |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index 9dde390f7e71..af08188d7e62 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
| @@ -185,6 +185,7 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) | |||
| 185 | u32 phy_id = 0; | 185 | u32 phy_id = 0; |
| 186 | s32 ret_val; | 186 | s32 ret_val; |
| 187 | u16 retry_count; | 187 | u16 retry_count; |
| 188 | u32 mac_reg = 0; | ||
| 188 | 189 | ||
| 189 | for (retry_count = 0; retry_count < 2; retry_count++) { | 190 | for (retry_count = 0; retry_count < 2; retry_count++) { |
| 190 | ret_val = e1e_rphy_locked(hw, MII_PHYSID1, &phy_reg); | 191 | ret_val = e1e_rphy_locked(hw, MII_PHYSID1, &phy_reg); |
| @@ -203,11 +204,11 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) | |||
| 203 | 204 | ||
| 204 | if (hw->phy.id) { | 205 | if (hw->phy.id) { |
| 205 | if (hw->phy.id == phy_id) | 206 | if (hw->phy.id == phy_id) |
| 206 | return true; | 207 | goto out; |
| 207 | } else if (phy_id) { | 208 | } else if (phy_id) { |
| 208 | hw->phy.id = phy_id; | 209 | hw->phy.id = phy_id; |
| 209 | hw->phy.revision = (u32)(phy_reg & ~PHY_REVISION_MASK); | 210 | hw->phy.revision = (u32)(phy_reg & ~PHY_REVISION_MASK); |
| 210 | return true; | 211 | goto out; |
| 211 | } | 212 | } |
| 212 | 213 | ||
| 213 | /* In case the PHY needs to be in mdio slow mode, | 214 | /* In case the PHY needs to be in mdio slow mode, |
| @@ -219,7 +220,22 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) | |||
| 219 | ret_val = e1000e_get_phy_id(hw); | 220 | ret_val = e1000e_get_phy_id(hw); |
| 220 | hw->phy.ops.acquire(hw); | 221 | hw->phy.ops.acquire(hw); |
| 221 | 222 | ||
| 222 | return !ret_val; | 223 | if (ret_val) |
| 224 | return false; | ||
| 225 | out: | ||
| 226 | if (hw->mac.type == e1000_pch_lpt) { | ||
| 227 | /* Unforce SMBus mode in PHY */ | ||
| 228 | e1e_rphy_locked(hw, CV_SMB_CTRL, &phy_reg); | ||
| 229 | phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; | ||
| 230 | e1e_wphy_locked(hw, CV_SMB_CTRL, phy_reg); | ||
| 231 | |||
| 232 | /* Unforce SMBus mode in MAC */ | ||
| 233 | mac_reg = er32(CTRL_EXT); | ||
| 234 | mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; | ||
| 235 | ew32(CTRL_EXT, mac_reg); | ||
| 236 | } | ||
| 237 | |||
| 238 | return true; | ||
| 223 | } | 239 | } |
| 224 | 240 | ||
| 225 | /** | 241 | /** |
| @@ -233,7 +249,6 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
| 233 | { | 249 | { |
| 234 | u32 mac_reg, fwsm = er32(FWSM); | 250 | u32 mac_reg, fwsm = er32(FWSM); |
| 235 | s32 ret_val; | 251 | s32 ret_val; |
| 236 | u16 phy_reg; | ||
| 237 | 252 | ||
| 238 | /* Gate automatic PHY configuration by hardware on managed and | 253 | /* Gate automatic PHY configuration by hardware on managed and |
| 239 | * non-managed 82579 and newer adapters. | 254 | * non-managed 82579 and newer adapters. |
| @@ -262,22 +277,16 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
| 262 | mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS; | 277 | mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS; |
| 263 | ew32(CTRL_EXT, mac_reg); | 278 | ew32(CTRL_EXT, mac_reg); |
| 264 | 279 | ||
| 280 | /* Wait 50 milliseconds for MAC to finish any retries | ||
| 281 | * that it might be trying to perform from previous | ||
| 282 | * attempts to acknowledge any phy read requests. | ||
| 283 | */ | ||
| 284 | msleep(50); | ||
| 285 | |||
| 265 | /* fall-through */ | 286 | /* fall-through */ |
| 266 | case e1000_pch2lan: | 287 | case e1000_pch2lan: |
| 267 | if (e1000_phy_is_accessible_pchlan(hw)) { | 288 | if (e1000_phy_is_accessible_pchlan(hw)) |
| 268 | if (hw->mac.type == e1000_pch_lpt) { | ||
| 269 | /* Unforce SMBus mode in PHY */ | ||
| 270 | e1e_rphy_locked(hw, CV_SMB_CTRL, &phy_reg); | ||
| 271 | phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; | ||
| 272 | e1e_wphy_locked(hw, CV_SMB_CTRL, phy_reg); | ||
| 273 | |||
| 274 | /* Unforce SMBus mode in MAC */ | ||
| 275 | mac_reg = er32(CTRL_EXT); | ||
| 276 | mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; | ||
| 277 | ew32(CTRL_EXT, mac_reg); | ||
| 278 | } | ||
| 279 | break; | 289 | break; |
| 280 | } | ||
| 281 | 290 | ||
| 282 | /* fall-through */ | 291 | /* fall-through */ |
| 283 | case e1000_pchlan: | 292 | case e1000_pchlan: |
| @@ -287,6 +296,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
| 287 | 296 | ||
| 288 | if (hw->phy.ops.check_reset_block(hw)) { | 297 | if (hw->phy.ops.check_reset_block(hw)) { |
| 289 | e_dbg("Required LANPHYPC toggle blocked by ME\n"); | 298 | e_dbg("Required LANPHYPC toggle blocked by ME\n"); |
| 299 | ret_val = -E1000_ERR_PHY; | ||
| 290 | break; | 300 | break; |
| 291 | } | 301 | } |
| 292 | 302 | ||
| @@ -298,15 +308,6 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
| 298 | mac_reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC; | 308 | mac_reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC; |
| 299 | ew32(FEXTNVM3, mac_reg); | 309 | ew32(FEXTNVM3, mac_reg); |
| 300 | 310 | ||
| 301 | if (hw->mac.type == e1000_pch_lpt) { | ||
| 302 | /* Toggling LANPHYPC brings the PHY out of SMBus mode | ||
| 303 | * So ensure that the MAC is also out of SMBus mode | ||
| 304 | */ | ||
| 305 | mac_reg = er32(CTRL_EXT); | ||
| 306 | mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; | ||
| 307 | ew32(CTRL_EXT, mac_reg); | ||
| 308 | } | ||
| 309 | |||
| 310 | /* Toggle LANPHYPC Value bit */ | 311 | /* Toggle LANPHYPC Value bit */ |
| 311 | mac_reg = er32(CTRL); | 312 | mac_reg = er32(CTRL); |
| 312 | mac_reg |= E1000_CTRL_LANPHYPC_OVERRIDE; | 313 | mac_reg |= E1000_CTRL_LANPHYPC_OVERRIDE; |
| @@ -325,6 +326,21 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
| 325 | usleep_range(5000, 10000); | 326 | usleep_range(5000, 10000); |
| 326 | } while (!(er32(CTRL_EXT) & | 327 | } while (!(er32(CTRL_EXT) & |
| 327 | E1000_CTRL_EXT_LPCD) && count--); | 328 | E1000_CTRL_EXT_LPCD) && count--); |
| 329 | usleep_range(30000, 60000); | ||
| 330 | if (e1000_phy_is_accessible_pchlan(hw)) | ||
| 331 | break; | ||
| 332 | |||
| 333 | /* Toggling LANPHYPC brings the PHY out of SMBus mode | ||
| 334 | * so ensure that the MAC is also out of SMBus mode | ||
| 335 | */ | ||
| 336 | mac_reg = er32(CTRL_EXT); | ||
| 337 | mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; | ||
| 338 | ew32(CTRL_EXT, mac_reg); | ||
| 339 | |||
| 340 | if (e1000_phy_is_accessible_pchlan(hw)) | ||
| 341 | break; | ||
| 342 | |||
| 343 | ret_val = -E1000_ERR_PHY; | ||
| 328 | } | 344 | } |
| 329 | break; | 345 | break; |
| 330 | default: | 346 | default: |
| @@ -332,13 +348,14 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
| 332 | } | 348 | } |
| 333 | 349 | ||
| 334 | hw->phy.ops.release(hw); | 350 | hw->phy.ops.release(hw); |
| 335 | 351 | if (!ret_val) { | |
| 336 | /* Reset the PHY before any access to it. Doing so, ensures | 352 | /* Reset the PHY before any access to it. Doing so, ensures |
| 337 | * that the PHY is in a known good state before we read/write | 353 | * that the PHY is in a known good state before we read/write |
| 338 | * PHY registers. The generic reset is sufficient here, | 354 | * PHY registers. The generic reset is sufficient here, |
| 339 | * because we haven't determined the PHY type yet. | 355 | * because we haven't determined the PHY type yet. |
| 340 | */ | 356 | */ |
| 341 | ret_val = e1000e_phy_hw_reset_generic(hw); | 357 | ret_val = e1000e_phy_hw_reset_generic(hw); |
| 358 | } | ||
| 342 | 359 | ||
| 343 | out: | 360 | out: |
| 344 | /* Ungate automatic PHY configuration on non-managed 82579 */ | 361 | /* Ungate automatic PHY configuration on non-managed 82579 */ |
| @@ -793,29 +810,31 @@ release: | |||
| 793 | * When K1 is enabled for 1Gbps, the MAC can miss 2 DMA completion indications | 810 | * When K1 is enabled for 1Gbps, the MAC can miss 2 DMA completion indications |
| 794 | * preventing further DMA write requests. Workaround the issue by disabling | 811 | * preventing further DMA write requests. Workaround the issue by disabling |
| 795 | * the de-assertion of the clock request when in 1Gpbs mode. | 812 | * the de-assertion of the clock request when in 1Gpbs mode. |
| 813 | * Also, set appropriate Tx re-transmission timeouts for 10 and 100Half link | ||
| 814 | * speeds in order to avoid Tx hangs. | ||
| 796 | **/ | 815 | **/ |
| 797 | static s32 e1000_k1_workaround_lpt_lp(struct e1000_hw *hw, bool link) | 816 | static s32 e1000_k1_workaround_lpt_lp(struct e1000_hw *hw, bool link) |
| 798 | { | 817 | { |
| 799 | u32 fextnvm6 = er32(FEXTNVM6); | 818 | u32 fextnvm6 = er32(FEXTNVM6); |
| 819 | u32 status = er32(STATUS); | ||
| 800 | s32 ret_val = 0; | 820 | s32 ret_val = 0; |
| 821 | u16 reg; | ||
| 801 | 822 | ||
| 802 | if (link && (er32(STATUS) & E1000_STATUS_SPEED_1000)) { | 823 | if (link && (status & E1000_STATUS_SPEED_1000)) { |
| 803 | u16 kmrn_reg; | ||
| 804 | |||
| 805 | ret_val = hw->phy.ops.acquire(hw); | 824 | ret_val = hw->phy.ops.acquire(hw); |
| 806 | if (ret_val) | 825 | if (ret_val) |
| 807 | return ret_val; | 826 | return ret_val; |
| 808 | 827 | ||
| 809 | ret_val = | 828 | ret_val = |
| 810 | e1000e_read_kmrn_reg_locked(hw, E1000_KMRNCTRLSTA_K1_CONFIG, | 829 | e1000e_read_kmrn_reg_locked(hw, E1000_KMRNCTRLSTA_K1_CONFIG, |
| 811 | &kmrn_reg); | 830 | ®); |
| 812 | if (ret_val) | 831 | if (ret_val) |
| 813 | goto release; | 832 | goto release; |
| 814 | 833 | ||
| 815 | ret_val = | 834 | ret_val = |
| 816 | e1000e_write_kmrn_reg_locked(hw, | 835 | e1000e_write_kmrn_reg_locked(hw, |
| 817 | E1000_KMRNCTRLSTA_K1_CONFIG, | 836 | E1000_KMRNCTRLSTA_K1_CONFIG, |
| 818 | kmrn_reg & | 837 | reg & |
| 819 | ~E1000_KMRNCTRLSTA_K1_ENABLE); | 838 | ~E1000_KMRNCTRLSTA_K1_ENABLE); |
| 820 | if (ret_val) | 839 | if (ret_val) |
| 821 | goto release; | 840 | goto release; |
| @@ -827,12 +846,45 @@ static s32 e1000_k1_workaround_lpt_lp(struct e1000_hw *hw, bool link) | |||
| 827 | ret_val = | 846 | ret_val = |
| 828 | e1000e_write_kmrn_reg_locked(hw, | 847 | e1000e_write_kmrn_reg_locked(hw, |
| 829 | E1000_KMRNCTRLSTA_K1_CONFIG, | 848 | E1000_KMRNCTRLSTA_K1_CONFIG, |
| 830 | kmrn_reg); | 849 | reg); |
| 831 | release: | 850 | release: |
| 832 | hw->phy.ops.release(hw); | 851 | hw->phy.ops.release(hw); |
| 833 | } else { | 852 | } else { |
| 834 | /* clear FEXTNVM6 bit 8 on link down or 10/100 */ | 853 | /* clear FEXTNVM6 bit 8 on link down or 10/100 */ |
| 835 | ew32(FEXTNVM6, fextnvm6 & ~E1000_FEXTNVM6_REQ_PLL_CLK); | 854 | fextnvm6 &= ~E1000_FEXTNVM6_REQ_PLL_CLK; |
| 855 | |||
| 856 | if (!link || ((status & E1000_STATUS_SPEED_100) && | ||
| 857 | (status & E1000_STATUS_FD))) | ||
| 858 | goto update_fextnvm6; | ||
| 859 | |||
| 860 | ret_val = e1e_rphy(hw, I217_INBAND_CTRL, ®); | ||
| 861 | if (ret_val) | ||
| 862 | return ret_val; | ||
| 863 | |||
| 864 | /* Clear link status transmit timeout */ | ||
| 865 | reg &= ~I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_MASK; | ||
| 866 | |||
| 867 | if (status & E1000_STATUS_SPEED_100) { | ||
| 868 | /* Set inband Tx timeout to 5x10us for 100Half */ | ||
| 869 | reg |= 5 << I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_SHIFT; | ||
| 870 | |||
| 871 | /* Do not extend the K1 entry latency for 100Half */ | ||
| 872 | fextnvm6 &= ~E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION; | ||
| 873 | } else { | ||
| 874 | /* Set inband Tx timeout to 50x10us for 10Full/Half */ | ||
| 875 | reg |= 50 << | ||
| 876 | I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_SHIFT; | ||
| 877 | |||
| 878 | /* Extend the K1 entry latency for 10 Mbps */ | ||
| 879 | fextnvm6 |= E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION; | ||
| 880 | } | ||
| 881 | |||
| 882 | ret_val = e1e_wphy(hw, I217_INBAND_CTRL, reg); | ||
| 883 | if (ret_val) | ||
| 884 | return ret_val; | ||
| 885 | |||
| 886 | update_fextnvm6: | ||
| 887 | ew32(FEXTNVM6, fextnvm6); | ||
| 836 | } | 888 | } |
| 837 | 889 | ||
| 838 | return ret_val; | 890 | return ret_val; |
| @@ -993,7 +1045,9 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | |||
| 993 | 1045 | ||
| 994 | /* Work-around I218 hang issue */ | 1046 | /* Work-around I218 hang issue */ |
| 995 | if ((hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_LM) || | 1047 | if ((hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_LM) || |
| 996 | (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_V)) { | 1048 | (hw->adapter->pdev->device == E1000_DEV_ID_PCH_LPTLP_I218_V) || |
| 1049 | (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_LM3) || | ||
| 1050 | (hw->adapter->pdev->device == E1000_DEV_ID_PCH_I218_V3)) { | ||
| 997 | ret_val = e1000_k1_workaround_lpt_lp(hw, link); | 1051 | ret_val = e1000_k1_workaround_lpt_lp(hw, link); |
| 998 | if (ret_val) | 1052 | if (ret_val) |
| 999 | return ret_val; | 1053 | return ret_val; |
| @@ -4168,7 +4222,9 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) | |||
| 4168 | u16 phy_reg, device_id = hw->adapter->pdev->device; | 4222 | u16 phy_reg, device_id = hw->adapter->pdev->device; |
| 4169 | 4223 | ||
| 4170 | if ((device_id == E1000_DEV_ID_PCH_LPTLP_I218_LM) || | 4224 | if ((device_id == E1000_DEV_ID_PCH_LPTLP_I218_LM) || |
| 4171 | (device_id == E1000_DEV_ID_PCH_LPTLP_I218_V)) { | 4225 | (device_id == E1000_DEV_ID_PCH_LPTLP_I218_V) || |
| 4226 | (device_id == E1000_DEV_ID_PCH_I218_LM3) || | ||
| 4227 | (device_id == E1000_DEV_ID_PCH_I218_V3)) { | ||
| 4172 | u32 fextnvm6 = er32(FEXTNVM6); | 4228 | u32 fextnvm6 = er32(FEXTNVM6); |
| 4173 | 4229 | ||
| 4174 | ew32(FEXTNVM6, fextnvm6 & ~E1000_FEXTNVM6_REQ_PLL_CLK); | 4230 | ew32(FEXTNVM6, fextnvm6 & ~E1000_FEXTNVM6_REQ_PLL_CLK); |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h index 80034a2b297c..59865695b282 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.h +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h | |||
| @@ -93,6 +93,7 @@ | |||
| 93 | #define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3 | 93 | #define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3 |
| 94 | 94 | ||
| 95 | #define E1000_FEXTNVM6_REQ_PLL_CLK 0x00000100 | 95 | #define E1000_FEXTNVM6_REQ_PLL_CLK 0x00000100 |
| 96 | #define E1000_FEXTNVM6_ENABLE_K1_ENTRY_CONDITION 0x00000200 | ||
| 96 | 97 | ||
| 97 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL | 98 | #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL |
| 98 | 99 | ||
| @@ -197,6 +198,11 @@ | |||
| 197 | 198 | ||
| 198 | #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */ | 199 | #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */ |
| 199 | 200 | ||
| 201 | /* Inband Control */ | ||
| 202 | #define I217_INBAND_CTRL PHY_REG(770, 18) | ||
| 203 | #define I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_MASK 0x3F00 | ||
| 204 | #define I217_INBAND_CTRL_LINK_STAT_TX_TIMEOUT_SHIFT 8 | ||
| 205 | |||
| 200 | /* PHY Low Power Idle Control */ | 206 | /* PHY Low Power Idle Control */ |
| 201 | #define I82579_LPI_CTRL PHY_REG(772, 20) | 207 | #define I82579_LPI_CTRL PHY_REG(772, 20) |
| 202 | #define I82579_LPI_CTRL_100_ENABLE 0x2000 | 208 | #define I82579_LPI_CTRL_100_ENABLE 0x2000 |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 77f81cbb601a..e6d2c0f8f76a 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
| @@ -2979,17 +2979,10 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
| 2979 | u32 pages = 0; | 2979 | u32 pages = 0; |
| 2980 | 2980 | ||
| 2981 | /* Workaround Si errata on PCHx - configure jumbo frame flow */ | 2981 | /* Workaround Si errata on PCHx - configure jumbo frame flow */ |
| 2982 | if (hw->mac.type >= e1000_pch2lan) { | 2982 | if ((hw->mac.type >= e1000_pch2lan) && |
| 2983 | s32 ret_val; | 2983 | (adapter->netdev->mtu > ETH_DATA_LEN) && |
| 2984 | 2984 | e1000_lv_jumbo_workaround_ich8lan(hw, true)) | |
| 2985 | if (adapter->netdev->mtu > ETH_DATA_LEN) | 2985 | e_dbg("failed to enable jumbo frame workaround mode\n"); |
| 2986 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, true); | ||
| 2987 | else | ||
| 2988 | ret_val = e1000_lv_jumbo_workaround_ich8lan(hw, false); | ||
| 2989 | |||
| 2990 | if (ret_val) | ||
| 2991 | e_dbg("failed to enable jumbo frame workaround mode\n"); | ||
| 2992 | } | ||
| 2993 | 2986 | ||
| 2994 | /* Program MC offset vector base */ | 2987 | /* Program MC offset vector base */ |
| 2995 | rctl = er32(RCTL); | 2988 | rctl = er32(RCTL); |
| @@ -3826,6 +3819,8 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
| 3826 | break; | 3819 | break; |
| 3827 | } | 3820 | } |
| 3828 | 3821 | ||
| 3822 | pba = 14; | ||
| 3823 | ew32(PBA, pba); | ||
| 3829 | fc->high_water = ((pba << 10) * 9 / 10) & E1000_FCRTH_RTH; | 3824 | fc->high_water = ((pba << 10) * 9 / 10) & E1000_FCRTH_RTH; |
| 3830 | fc->low_water = ((pba << 10) * 8 / 10) & E1000_FCRTL_RTL; | 3825 | fc->low_water = ((pba << 10) * 8 / 10) & E1000_FCRTL_RTL; |
| 3831 | break; | 3826 | break; |
| @@ -4034,6 +4029,12 @@ void e1000e_down(struct e1000_adapter *adapter) | |||
| 4034 | adapter->link_speed = 0; | 4029 | adapter->link_speed = 0; |
| 4035 | adapter->link_duplex = 0; | 4030 | adapter->link_duplex = 0; |
| 4036 | 4031 | ||
| 4032 | /* Disable Si errata workaround on PCHx for jumbo frame flow */ | ||
| 4033 | if ((hw->mac.type >= e1000_pch2lan) && | ||
| 4034 | (adapter->netdev->mtu > ETH_DATA_LEN) && | ||
| 4035 | e1000_lv_jumbo_workaround_ich8lan(hw, false)) | ||
| 4036 | e_dbg("failed to disable jumbo frame workaround mode\n"); | ||
| 4037 | |||
| 4037 | if (!pci_channel_offline(adapter->pdev)) | 4038 | if (!pci_channel_offline(adapter->pdev)) |
| 4038 | e1000e_reset(adapter); | 4039 | e1000e_reset(adapter); |
| 4039 | 4040 | ||
| @@ -4683,11 +4684,11 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) | |||
| 4683 | struct e1000_hw *hw = &adapter->hw; | 4684 | struct e1000_hw *hw = &adapter->hw; |
| 4684 | struct e1000_phy_regs *phy = &adapter->phy_regs; | 4685 | struct e1000_phy_regs *phy = &adapter->phy_regs; |
| 4685 | 4686 | ||
| 4686 | if ((er32(STATUS) & E1000_STATUS_LU) && | 4687 | if (!pm_runtime_suspended((&adapter->pdev->dev)->parent) && |
| 4688 | (er32(STATUS) & E1000_STATUS_LU) && | ||
| 4687 | (adapter->hw.phy.media_type == e1000_media_type_copper)) { | 4689 | (adapter->hw.phy.media_type == e1000_media_type_copper)) { |
| 4688 | int ret_val; | 4690 | int ret_val; |
| 4689 | 4691 | ||
| 4690 | pm_runtime_get_sync(&adapter->pdev->dev); | ||
| 4691 | ret_val = e1e_rphy(hw, MII_BMCR, &phy->bmcr); | 4692 | ret_val = e1e_rphy(hw, MII_BMCR, &phy->bmcr); |
| 4692 | ret_val |= e1e_rphy(hw, MII_BMSR, &phy->bmsr); | 4693 | ret_val |= e1e_rphy(hw, MII_BMSR, &phy->bmsr); |
| 4693 | ret_val |= e1e_rphy(hw, MII_ADVERTISE, &phy->advertise); | 4694 | ret_val |= e1e_rphy(hw, MII_ADVERTISE, &phy->advertise); |
| @@ -4698,7 +4699,6 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) | |||
| 4698 | ret_val |= e1e_rphy(hw, MII_ESTATUS, &phy->estatus); | 4699 | ret_val |= e1e_rphy(hw, MII_ESTATUS, &phy->estatus); |
| 4699 | if (ret_val) | 4700 | if (ret_val) |
| 4700 | e_warn("Error reading PHY register\n"); | 4701 | e_warn("Error reading PHY register\n"); |
| 4701 | pm_runtime_put_sync(&adapter->pdev->dev); | ||
| 4702 | } else { | 4702 | } else { |
| 4703 | /* Do not read PHY registers if link is not up | 4703 | /* Do not read PHY registers if link is not up |
| 4704 | * Set values to typical power-on defaults | 4704 | * Set values to typical power-on defaults |
| @@ -5995,6 +5995,8 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime) | |||
| 5995 | */ | 5995 | */ |
| 5996 | e1000e_release_hw_control(adapter); | 5996 | e1000e_release_hw_control(adapter); |
| 5997 | 5997 | ||
| 5998 | pci_clear_master(pdev); | ||
| 5999 | |||
| 5998 | /* The pci-e switch on some quad port adapters will report a | 6000 | /* The pci-e switch on some quad port adapters will report a |
| 5999 | * correctable error when the MAC transitions from D0 to D3. To | 6001 | * correctable error when the MAC transitions from D0 to D3. To |
| 6000 | * prevent this we need to mask off the correctable errors on the | 6002 | * prevent this we need to mask off the correctable errors on the |
| @@ -6723,10 +6725,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 6723 | adapter->hw.fc.current_mode = e1000_fc_default; | 6725 | adapter->hw.fc.current_mode = e1000_fc_default; |
| 6724 | adapter->hw.phy.autoneg_advertised = 0x2f; | 6726 | adapter->hw.phy.autoneg_advertised = 0x2f; |
| 6725 | 6727 | ||
| 6726 | /* ring size defaults */ | ||
| 6727 | adapter->rx_ring->count = E1000_DEFAULT_RXD; | ||
| 6728 | adapter->tx_ring->count = E1000_DEFAULT_TXD; | ||
| 6729 | |||
| 6730 | /* Initial Wake on LAN setting - If APM wake is enabled in | 6728 | /* Initial Wake on LAN setting - If APM wake is enabled in |
| 6731 | * the EEPROM, enable the ACPI Magic Packet filter | 6729 | * the EEPROM, enable the ACPI Magic Packet filter |
| 6732 | */ | 6730 | */ |
| @@ -6976,6 +6974,10 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { | |||
| 6976 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_V), board_pch_lpt }, | 6974 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_V), board_pch_lpt }, |
| 6977 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_LM), board_pch_lpt }, | 6975 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_LM), board_pch_lpt }, |
| 6978 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_V), board_pch_lpt }, | 6976 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPTLP_I218_V), board_pch_lpt }, |
| 6977 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_LM2), board_pch_lpt }, | ||
| 6978 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_V2), board_pch_lpt }, | ||
| 6979 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_LM3), board_pch_lpt }, | ||
| 6980 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_I218_V3), board_pch_lpt }, | ||
| 6979 | 6981 | ||
| 6980 | { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */ | 6982 | { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */ |
| 6981 | }; | 6983 | }; |
