All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28
@ 2022-02-28 22:04 Tony Nguyen
  2022-02-28 22:04 ` [PATCH net v2 1/4] igc: igc_read_phy_reg_gpy: drop premature return Tony Nguyen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tony Nguyen @ 2022-02-28 22:04 UTC (permalink / raw)
  To: davem, kuba; +Cc: Tony Nguyen, netdev, sasha.neftin, vitaly.lifshits

This series contains updates to igc and e1000e drivers.

Corinna Vinschen ensures release of hardware sempahore on failed
register read in igc_read_phy_reg_gpy().

Sasha does the same for the write variant, igc_write_phy_reg_gpy(). On
e1000e, he resolves an issue with hardware unit hang on s0ix exit
by disabling some bits and LAN connected device reset during power
management flows. Lastly, he allows for TGP platforms to correct its
NVM checksum.

v2: Fix Fixes tag on patch 3

The following are changes since commit caef14b7530c065fb85d54492768fa48fdb5093e:
  net: ipa: fix a build dependency
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 1GbE

Corinna Vinschen (1):
  igc: igc_read_phy_reg_gpy: drop premature return

Sasha Neftin (3):
  igc: igc_write_phy_reg_gpy: drop premature return
  e1000e: Fix possible HW unit hang after an s0ix exit
  e1000e: Correct NVM checksum verification flow

 drivers/net/ethernet/intel/e1000e/hw.h      |  1 +
 drivers/net/ethernet/intel/e1000e/ich8lan.c |  8 +++++--
 drivers/net/ethernet/intel/e1000e/ich8lan.h |  1 +
 drivers/net/ethernet/intel/e1000e/netdev.c  | 26 +++++++++++++++++++++
 drivers/net/ethernet/intel/igc/igc_phy.c    |  4 ----
 5 files changed, 34 insertions(+), 6 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net v2 1/4] igc: igc_read_phy_reg_gpy: drop premature return
  2022-02-28 22:04 [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 Tony Nguyen
@ 2022-02-28 22:04 ` Tony Nguyen
  2022-02-28 22:04 ` [PATCH net v2 2/4] igc: igc_write_phy_reg_gpy: " Tony Nguyen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2022-02-28 22:04 UTC (permalink / raw)
  To: davem, kuba
  Cc: Corinna Vinschen, netdev, anthony.l.nguyen, sasha.neftin,
	vitaly.lifshits, Naama Meir

From: Corinna Vinschen <vinschen@redhat.com>

igc_read_phy_reg_gpy checks the return value from igc_read_phy_reg_mdic
and if it's not 0, returns immediately. By doing this, it leaves the HW
semaphore in the acquired state.

Drop this premature return statement, the function returns after
releasing the semaphore immediately anyway.

Fixes: 5586838fe9ce ("igc: Add code for PHY support")
Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_phy.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index 5cad31c3c7b0..df91d07ce82a 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -779,8 +779,6 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data)
 		if (ret_val)
 			return ret_val;
 		ret_val = igc_read_phy_reg_mdic(hw, offset, data);
-		if (ret_val)
-			return ret_val;
 		hw->phy.ops.release(hw);
 	} else {
 		ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net v2 2/4] igc: igc_write_phy_reg_gpy: drop premature return
  2022-02-28 22:04 [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 Tony Nguyen
  2022-02-28 22:04 ` [PATCH net v2 1/4] igc: igc_read_phy_reg_gpy: drop premature return Tony Nguyen
@ 2022-02-28 22:04 ` Tony Nguyen
  2022-02-28 22:04 ` [PATCH net v2 3/4] e1000e: Fix possible HW unit hang after an s0ix exit Tony Nguyen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2022-02-28 22:04 UTC (permalink / raw)
  To: davem, kuba
  Cc: Sasha Neftin, netdev, anthony.l.nguyen, vitaly.lifshits,
	Dima Ruinskiy, Corinna Vinschen, Naama Meir

From: Sasha Neftin <sasha.neftin@intel.com>

Similar to "igc_read_phy_reg_gpy: drop premature return" patch.
igc_write_phy_reg_gpy checks the return value from igc_write_phy_reg_mdic
and if it's not 0, returns immediately. By doing this, it leaves the HW
semaphore in the acquired state.

Drop this premature return statement, the function returns after
releasing the semaphore immediately anyway.

Fixes: 5586838fe9ce ("igc: Add code for PHY support")
Suggested-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Reported-by: Corinna Vinschen <vinschen@redhat.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_phy.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index df91d07ce82a..40dbf4b43234 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -746,8 +746,6 @@ s32 igc_write_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 data)
 		if (ret_val)
 			return ret_val;
 		ret_val = igc_write_phy_reg_mdic(hw, offset, data);
-		if (ret_val)
-			return ret_val;
 		hw->phy.ops.release(hw);
 	} else {
 		ret_val = igc_write_xmdio_reg(hw, (u16)offset, dev_addr,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net v2 3/4] e1000e: Fix possible HW unit hang after an s0ix exit
  2022-02-28 22:04 [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 Tony Nguyen
  2022-02-28 22:04 ` [PATCH net v2 1/4] igc: igc_read_phy_reg_gpy: drop premature return Tony Nguyen
  2022-02-28 22:04 ` [PATCH net v2 2/4] igc: igc_write_phy_reg_gpy: " Tony Nguyen
@ 2022-02-28 22:04 ` Tony Nguyen
  2022-02-28 22:04 ` [PATCH net v2 4/4] e1000e: Correct NVM checksum verification flow Tony Nguyen
  2022-03-01  8:40 ` [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2022-02-28 22:04 UTC (permalink / raw)
  To: davem, kuba
  Cc: Sasha Neftin, netdev, anthony.l.nguyen, vitaly.lifshits,
	Dima Ruinskiy, Nir Efrati, Kai-Heng Feng

From: Sasha Neftin <sasha.neftin@intel.com>

Disable the OEM bit/Gig Disable/restart AN impact and disable the PHY
LAN connected device (LCD) reset during power management flows. This
fixes possible HW unit hangs on the s0ix exit on some corporate ADL
platforms.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214821
Fixes: 3e55d231716e ("e1000e: Add handshake with the CSME to support S0ix")
Suggested-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Suggested-by: Nir Efrati <nir.efrati@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/e1000e/hw.h      |  1 +
 drivers/net/ethernet/intel/e1000e/ich8lan.c |  4 ++++
 drivers/net/ethernet/intel/e1000e/ich8lan.h |  1 +
 drivers/net/ethernet/intel/e1000e/netdev.c  | 26 +++++++++++++++++++++
 4 files changed, 32 insertions(+)

diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index bcf680e83811..13382df2f2ef 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -630,6 +630,7 @@ struct e1000_phy_info {
 	bool disable_polarity_correction;
 	bool is_mdix;
 	bool polarity_correction;
+	bool reset_disable;
 	bool speed_downgraded;
 	bool autoneg_wait_to_complete;
 };
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index c908c84b86d2..e298da712758 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -2050,6 +2050,10 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw)
 	bool blocked = false;
 	int i = 0;
 
+	/* Check the PHY (LCD) reset flag */
+	if (hw->phy.reset_disable)
+		return true;
+
 	while ((blocked = !(er32(FWSM) & E1000_ICH_FWSM_RSPCIPHY)) &&
 	       (i++ < 30))
 		usleep_range(10000, 11000);
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h
index 2504b11c3169..638a3ddd7ada 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h
@@ -271,6 +271,7 @@
 #define I217_CGFREG_ENABLE_MTA_RESET	0x0002
 #define I217_MEMPWR			PHY_REG(772, 26)
 #define I217_MEMPWR_DISABLE_SMB_RELEASE	0x0010
+#define I217_MEMPWR_MOEM		0x1000
 
 /* Receive Address Initial CRC Calculation */
 #define E1000_PCH_RAICC(_n)	(0x05F50 + ((_n) * 4))
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index a42aeb555f34..c5bdef3ffe26 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6987,8 +6987,21 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev)
 	struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct e1000_hw *hw = &adapter->hw;
+	u16 phy_data;
 	int rc;
 
+	if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID &&
+	    hw->mac.type >= e1000_pch_adp) {
+		/* Mask OEM Bits / Gig Disable / Restart AN (772_26[12] = 1) */
+		e1e_rphy(hw, I217_MEMPWR, &phy_data);
+		phy_data |= I217_MEMPWR_MOEM;
+		e1e_wphy(hw, I217_MEMPWR, phy_data);
+
+		/* Disable LCD reset */
+		hw->phy.reset_disable = true;
+	}
+
 	e1000e_flush_lpic(pdev);
 
 	e1000e_pm_freeze(dev);
@@ -7010,6 +7023,8 @@ static __maybe_unused int e1000e_pm_resume(struct device *dev)
 	struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct e1000_hw *hw = &adapter->hw;
+	u16 phy_data;
 	int rc;
 
 	/* Introduce S0ix implementation */
@@ -7020,6 +7035,17 @@ static __maybe_unused int e1000e_pm_resume(struct device *dev)
 	if (rc)
 		return rc;
 
+	if (er32(FWSM) & E1000_ICH_FWSM_FW_VALID &&
+	    hw->mac.type >= e1000_pch_adp) {
+		/* Unmask OEM Bits / Gig Disable / Restart AN 772_26[12] = 0 */
+		e1e_rphy(hw, I217_MEMPWR, &phy_data);
+		phy_data &= ~I217_MEMPWR_MOEM;
+		e1e_wphy(hw, I217_MEMPWR, phy_data);
+
+		/* Enable LCD reset */
+		hw->phy.reset_disable = false;
+	}
+
 	return e1000e_pm_thaw(dev);
 }
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net v2 4/4] e1000e: Correct NVM checksum verification flow
  2022-02-28 22:04 [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 Tony Nguyen
                   ` (2 preceding siblings ...)
  2022-02-28 22:04 ` [PATCH net v2 3/4] e1000e: Fix possible HW unit hang after an s0ix exit Tony Nguyen
@ 2022-02-28 22:04 ` Tony Nguyen
  2022-03-01  8:40 ` [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Tony Nguyen @ 2022-02-28 22:04 UTC (permalink / raw)
  To: davem, kuba
  Cc: Sasha Neftin, netdev, anthony.l.nguyen, vitaly.lifshits,
	Thomas Bogendoerfer, Naama Meir

From: Sasha Neftin <sasha.neftin@intel.com>

Update MAC type check e1000_pch_tgp because for e1000_pch_cnp,
NVM checksum update is still possible.
Emit a more detailed warning message.

Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1191663
Fixes: 4051f68318ca ("e1000e: Do not take care about recovery NVM checksum")
Reported-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/e1000e/ich8lan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index e298da712758..d60e2016d03c 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -4140,9 +4140,9 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
 		return ret_val;
 
 	if (!(data & valid_csum_mask)) {
-		e_dbg("NVM Checksum Invalid\n");
+		e_dbg("NVM Checksum valid bit not set\n");
 
-		if (hw->mac.type < e1000_pch_cnp) {
+		if (hw->mac.type < e1000_pch_tgp) {
 			data |= valid_csum_mask;
 			ret_val = e1000_write_nvm(hw, word, 1, &data);
 			if (ret_val)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28
  2022-02-28 22:04 [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 Tony Nguyen
                   ` (3 preceding siblings ...)
  2022-02-28 22:04 ` [PATCH net v2 4/4] e1000e: Correct NVM checksum verification flow Tony Nguyen
@ 2022-03-01  8:40 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-01  8:40 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, netdev, sasha.neftin, vitaly.lifshits

Hello:

This series was applied to netdev/net.git (master)
by Tony Nguyen <anthony.l.nguyen@intel.com>:

On Mon, 28 Feb 2022 14:04:08 -0800 you wrote:
> This series contains updates to igc and e1000e drivers.
> 
> Corinna Vinschen ensures release of hardware sempahore on failed
> register read in igc_read_phy_reg_gpy().
> 
> Sasha does the same for the write variant, igc_write_phy_reg_gpy(). On
> e1000e, he resolves an issue with hardware unit hang on s0ix exit
> by disabling some bits and LAN connected device reset during power
> management flows. Lastly, he allows for TGP platforms to correct its
> NVM checksum.
> 
> [...]

Here is the summary with links:
  - [net,v2,1/4] igc: igc_read_phy_reg_gpy: drop premature return
    https://git.kernel.org/netdev/net/c/fda2635466cd
  - [net,v2,2/4] igc: igc_write_phy_reg_gpy: drop premature return
    https://git.kernel.org/netdev/net/c/c4208653a327
  - [net,v2,3/4] e1000e: Fix possible HW unit hang after an s0ix exit
    https://git.kernel.org/netdev/net/c/1866aa0d0d64
  - [net,v2,4/4] e1000e: Correct NVM checksum verification flow
    https://git.kernel.org/netdev/net/c/ffd24fa2fcc7

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-03-01  8:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 22:04 [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 Tony Nguyen
2022-02-28 22:04 ` [PATCH net v2 1/4] igc: igc_read_phy_reg_gpy: drop premature return Tony Nguyen
2022-02-28 22:04 ` [PATCH net v2 2/4] igc: igc_write_phy_reg_gpy: " Tony Nguyen
2022-02-28 22:04 ` [PATCH net v2 3/4] e1000e: Fix possible HW unit hang after an s0ix exit Tony Nguyen
2022-02-28 22:04 ` [PATCH net v2 4/4] e1000e: Correct NVM checksum verification flow Tony Nguyen
2022-03-01  8:40 ` [PATCH net v2 0/4][pull request] Intel Wired LAN Driver Updates 2022-02-28 patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.