Commit dba7bf03 authored by David S. Miller's avatar David S. Miller
Browse files


Jeff Kirsher says:

====================
1GbE Intel Wired LAN Driver Updates 2019-10-29

This series contains updates to e1000e, igb, ixgbe and i40e drivers.

Sasha adds support for Intel client platforms Comet Lake and Tiger Lake
to the e1000e driver.  Also adds a fix for a compiler warning that was
recently introduced, when CONFIG_PM_SLEEP is not defined, so wrap the
code that requires this kernel configuration to be defined.

Alex fixes a potential race condition between network configuration and
power management for e1000e, which is similar to a past issue in the igb
driver.  Also provided a bit of code cleanup since the driver no longer
checks for __E1000_DOWN.

Josh Hunt adds UDP segmentation offload support for igb, ixgbe and i40e.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 84e93d99 203bddfd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -894,8 +894,9 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
	case e1000_pch2lan:
	case e1000_pch_lpt:
	case e1000_pch_spt:
		/* fall through */
	case e1000_pch_cnp:
		/* fall through */
	case e1000_pch_tgp:
		mask |= BIT(18);
		break;
	default:
@@ -1559,6 +1560,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
	switch (hw->mac.type) {
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_tgp:
		fext_nvm11 = er32(FEXTNVM11);
		fext_nvm11 &= ~E1000_FEXTNVM11_DISABLE_MULR_FIX;
		ew32(FEXTNVM11, fext_nvm11);
+12 −0
Original line number Diff line number Diff line
@@ -86,6 +86,17 @@ struct e1000_hw;
#define E1000_DEV_ID_PCH_ICP_I219_V8		0x15E0
#define E1000_DEV_ID_PCH_ICP_I219_LM9		0x15E1
#define E1000_DEV_ID_PCH_ICP_I219_V9		0x15E2
#define E1000_DEV_ID_PCH_CMP_I219_LM10		0x0D4E
#define E1000_DEV_ID_PCH_CMP_I219_V10		0x0D4F
#define E1000_DEV_ID_PCH_CMP_I219_LM11		0x0D4C
#define E1000_DEV_ID_PCH_CMP_I219_V11		0x0D4D
#define E1000_DEV_ID_PCH_CMP_I219_LM12		0x0D53
#define E1000_DEV_ID_PCH_CMP_I219_V12		0x0D55
#define E1000_DEV_ID_PCH_TGP_I219_LM13		0x15FB
#define E1000_DEV_ID_PCH_TGP_I219_V13		0x15FC
#define E1000_DEV_ID_PCH_TGP_I219_LM14		0x15F9
#define E1000_DEV_ID_PCH_TGP_I219_V14		0x15FA
#define E1000_DEV_ID_PCH_TGP_I219_LM15		0x15F4

#define E1000_REVISION_4	4

@@ -109,6 +120,7 @@ enum e1000_mac_type {
	e1000_pch_lpt,
	e1000_pch_spt,
	e1000_pch_cnp,
	e1000_pch_tgp,
};

enum e1000_media_type {
+7 −0
Original line number Diff line number Diff line
@@ -316,6 +316,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_tgp:
		if (e1000_phy_is_accessible_pchlan(hw))
			break;

@@ -458,6 +459,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
		case e1000_pch_lpt:
		case e1000_pch_spt:
		case e1000_pch_cnp:
		case e1000_pch_tgp:
			/* In case the PHY needs to be in mdio slow mode,
			 * set slow mode and try to get the PHY id again.
			 */
@@ -700,6 +702,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_tgp:
	case e1000_pchlan:
		/* check management mode */
		mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan;
@@ -1638,6 +1641,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter)
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_tgp:
		rc = e1000_init_phy_params_pchlan(hw);
		break;
	default:
@@ -2090,6 +2094,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_tgp:
		sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
		break;
	default:
@@ -3127,6 +3132,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
	switch (hw->mac.type) {
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_tgp:
		bank1_offset = nvm->flash_bank_size;
		act_offset = E1000_ICH_NVM_SIG_WORD;

@@ -4070,6 +4076,7 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
	case e1000_pch_tgp:
		word = NVM_COMPAT;
		valid_csum_mask = NVM_COMPAT_VALID_CSUM;
		break;
+52 −39
Original line number Diff line number Diff line
@@ -3538,6 +3538,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)
		adapter->cc.shift = shift;
		break;
	case e1000_pch_cnp:
	case e1000_pch_tgp:
		if (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI) {
			/* Stable 24MHz frequency */
			incperiod = INCPERIOD_24MHZ;
@@ -4049,6 +4050,8 @@ void e1000e_reset(struct e1000_adapter *adapter)
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
		/* fall-through */
	case e1000_pch_tgp:
		fc->refresh_time = 0xFFFF;
		fc->pause_time = 0xFFFF;

@@ -4715,12 +4718,12 @@ int e1000e_close(struct net_device *netdev)

	pm_runtime_get_sync(&pdev->dev);

	if (!test_bit(__E1000_DOWN, &adapter->state)) {
	if (netif_device_present(netdev)) {
		e1000e_down(adapter, true);
		e1000_free_irq(adapter);

		/* Link status message must follow this format */
		pr_info("%s NIC Link is Down\n", adapter->netdev->name);
		pr_info("%s NIC Link is Down\n", netdev->name);
	}

	napi_disable(&adapter->napi);
@@ -6294,6 +6297,7 @@ fl_out:
	pm_runtime_put_sync(netdev->dev.parent);
}

#ifdef CONFIG_PM_SLEEP
/* S0ix implementation */
static void e1000e_s0ix_entry_flow(struct e1000_adapter *adapter)
{
@@ -6461,15 +6465,20 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter)
	mac_data &= ~E1000_CTRL_EXT_FORCE_SMBUS;
	ew32(CTRL_EXT, mac_data);
}
#endif /* CONFIG_PM_SLEEP */

static int e1000e_pm_freeze(struct device *dev)
{
	struct net_device *netdev = dev_get_drvdata(dev);
	struct e1000_adapter *adapter = netdev_priv(netdev);
	bool present;

	rtnl_lock();

	present = netif_device_present(netdev);
	netif_device_detach(netdev);

	if (netif_running(netdev)) {
	if (present && netif_running(netdev)) {
		int count = E1000_CHECK_RESET_COUNT;

		while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
@@ -6481,6 +6490,8 @@ static int e1000e_pm_freeze(struct device *dev)
		e1000e_down(adapter, false);
		e1000_free_irq(adapter);
	}
	rtnl_unlock();

	e1000e_reset_interrupt_capability(adapter);

	/* Allow time for pending master requests to run */
@@ -6728,6 +6739,30 @@ static void e1000e_disable_aspm_locked(struct pci_dev *pdev, u16 state)
	__e1000e_disable_aspm(pdev, state, 1);
}

static int e1000e_pm_thaw(struct device *dev)
{
	struct net_device *netdev = dev_get_drvdata(dev);
	struct e1000_adapter *adapter = netdev_priv(netdev);
	int rc = 0;

	e1000e_set_interrupt_capability(adapter);

	rtnl_lock();
	if (netif_running(netdev)) {
		rc = e1000_request_irq(adapter);
		if (rc)
			goto err_irq;

		e1000e_up(adapter);
	}

	netif_device_attach(netdev);
err_irq:
	rtnl_unlock();

	return rc;
}

#ifdef CONFIG_PM
static int __e1000_resume(struct pci_dev *pdev)
{
@@ -6795,26 +6830,6 @@ static int __e1000_resume(struct pci_dev *pdev)
}

#ifdef CONFIG_PM_SLEEP
static int e1000e_pm_thaw(struct device *dev)
{
	struct net_device *netdev = dev_get_drvdata(dev);
	struct e1000_adapter *adapter = netdev_priv(netdev);

	e1000e_set_interrupt_capability(adapter);
	if (netif_running(netdev)) {
		u32 err = e1000_request_irq(adapter);

		if (err)
			return err;

		e1000e_up(adapter);
	}

	netif_device_attach(netdev);

	return 0;
}

static int e1000e_pm_suspend(struct device *dev)
{
	struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
@@ -7000,16 +7015,11 @@ static void e1000_netpoll(struct net_device *netdev)
static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,
						pci_channel_state_t state)
{
	struct net_device *netdev = pci_get_drvdata(pdev);
	struct e1000_adapter *adapter = netdev_priv(netdev);

	netif_device_detach(netdev);
	e1000e_pm_freeze(&pdev->dev);

	if (state == pci_channel_io_perm_failure)
		return PCI_ERS_RESULT_DISCONNECT;

	if (netif_running(netdev))
		e1000e_down(adapter, true);
	pci_disable_device(pdev);

	/* Request a slot slot reset. */
@@ -7075,10 +7085,7 @@ static void e1000_io_resume(struct pci_dev *pdev)

	e1000_init_manageability_pt(adapter);

	if (netif_running(netdev))
		e1000e_up(adapter);

	netif_device_attach(netdev);
	e1000e_pm_thaw(&pdev->dev);

	/* If the controller has AMT, do not set DRV_LOAD until the interface
	 * is up.  For all other cases, let the f/w know that the h/w is now
@@ -7589,14 +7596,12 @@ static void e1000_remove(struct pci_dev *pdev)
{
	struct net_device *netdev = pci_get_drvdata(pdev);
	struct e1000_adapter *adapter = netdev_priv(netdev);
	bool down = test_bit(__E1000_DOWN, &adapter->state);

	e1000e_ptp_remove(adapter);

	/* The timers may be rescheduled, so explicitly disable them
	 * from being rescheduled.
	 */
	if (!down)
	set_bit(__E1000_DOWN, &adapter->state);
	del_timer_sync(&adapter->phy_info_timer);

@@ -7617,9 +7622,6 @@ static void e1000_remove(struct pci_dev *pdev)
		}
	}

	/* Don't lie to e1000_close() down the road. */
	if (!down)
		clear_bit(__E1000_DOWN, &adapter->state);
	unregister_netdev(netdev);

	if (pci_dev_run_wake(pdev))
@@ -7749,6 +7751,17 @@ static const struct pci_device_id e1000_pci_tbl[] = {
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V8), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_LM9), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_ICP_I219_V9), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM10), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V10), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM11), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V11), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_LM12), board_pch_spt },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_CMP_I219_V12), board_pch_spt },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM13), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V13), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM14), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_V14), board_pch_cnp },
	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_TGP_I219_LM15), board_pch_cnp },

	{ 0, 0, 0, 0, 0, 0, 0 }	/* terminate list */
};
+2 −0
Original line number Diff line number Diff line
@@ -295,6 +295,8 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
	case e1000_pch_lpt:
	case e1000_pch_spt:
	case e1000_pch_cnp:
		/* fall-through */
	case e1000_pch_tgp:
		if ((hw->mac.type < e1000_pch_lpt) ||
		    (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)) {
			adapter->ptp_clock_info.max_adj = 24000000 - 1;
Loading