All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] update ixgbe base driver to version 2017-03-29
@ 2017-04-18  6:56 Wei Dai
  2017-04-18  6:57 ` [PATCH 1/4] net/ixgbe/base: acquire PHY semaphore before device reset Wei Dai
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Wei Dai @ 2017-04-18  6:56 UTC (permalink / raw)
  To: helin.zhang, konstantin.ananyev, wenzhuo.lu; +Cc: dev, Wei Dai

This patch set has following 4 patches.
No any new device id is added.

  net/ixgbe/base: acquire PHY semaphore before device reset
  net/ixgbe/base: add support for 2.5G KX physical layer
  net/ixgbe/base: add MAC X550em/X557 LED on/off support
  net/ixgbe/base: update base driver version to 2017.03.29

 drivers/net/ixgbe/base/README        |  2 +-
 drivers/net/ixgbe/base/ixgbe_82598.c |  4 ++--
 drivers/net/ixgbe/base/ixgbe_82598.h |  2 +-
 drivers/net/ixgbe/base/ixgbe_82599.c |  4 ++--
 drivers/net/ixgbe/base/ixgbe_82599.h |  2 +-
 drivers/net/ixgbe/base/ixgbe_api.c   |  2 +-
 drivers/net/ixgbe/base/ixgbe_api.h   |  2 +-
 drivers/net/ixgbe/base/ixgbe_phy.c   |  4 ++--
 drivers/net/ixgbe/base/ixgbe_phy.h   |  2 +-
 drivers/net/ixgbe/base/ixgbe_type.h  | 37 ++++++++++++++++++------------------
 drivers/net/ixgbe/base/ixgbe_x540.c  | 12 ++++++++++--
 drivers/net/ixgbe/base/ixgbe_x540.h  |  2 +-
 drivers/net/ixgbe/base/ixgbe_x550.c  | 33 ++++++++++++++++++++++++++++----
 drivers/net/ixgbe/base/ixgbe_x550.h  |  2 +-
 14 files changed, 72 insertions(+), 38 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 1/4] net/ixgbe/base: acquire PHY semaphore before device reset
@ 2017-04-18  5:15 Wei Dai
  2017-04-18  5:15 ` [PATCH 4/4] net/ixgbe/base: update base driver version to 2017.03.29 Wei Dai
  0 siblings, 1 reply; 10+ messages in thread
From: Wei Dai @ 2017-04-18  5:15 UTC (permalink / raw)
  To: helin.zhang, konstantin.ananyev, wenzhuo.lu; +Cc: dev, Wei Dai

A recent firmware change fixed an issue to acquire the PHY semaphore
before accessing PHY registers. This led to a case where SW can issue
a device reset clearing the MDIO registers. This patch makes SW acquire
the PHY semaphore before issuing a device reset.

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_x540.c | 8 ++++++++
 drivers/net/ixgbe/base/ixgbe_x550.c | 9 +++++++++
 2 files changed, 17 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_x540.c b/drivers/net/ixgbe/base/ixgbe_x540.c
index 499b1fa..f624d55 100644
--- a/drivers/net/ixgbe/base/ixgbe_x540.c
+++ b/drivers/net/ixgbe/base/ixgbe_x540.c
@@ -208,6 +208,7 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw)
 {
 	s32 status;
 	u32 ctrl, i;
+	u32 swfw_mask = hw->phy.phy_semaphore_mask;
 
 	DEBUGFUNC("ixgbe_reset_hw_X540");
 
@@ -220,10 +221,17 @@ s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw)
 	ixgbe_clear_tx_pending(hw);
 
 mac_reset_top:
+	status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
+	if (status != IXGBE_SUCCESS) {
+		ERROR_REPORT2(IXGBE_ERROR_CAUTION,
+			"semaphore failed with %d", status);
+		return IXGBE_ERR_SWFW_SYNC;
+	}
 	ctrl = IXGBE_CTRL_RST;
 	ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
 	IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
 	IXGBE_WRITE_FLUSH(hw);
+	hw->mac.ops.release_swfw_sync(hw, swfw_mask);
 
 	/* Poll for reset bit to self-clear indicating reset is complete */
 	for (i = 0; i < 10; i++) {
diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c
index 3049865..a48155c 100644
--- a/drivers/net/ixgbe/base/ixgbe_x550.c
+++ b/drivers/net/ixgbe/base/ixgbe_x550.c
@@ -2497,6 +2497,7 @@ s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
 	u32 ctrl = 0;
 	u32 i;
 	bool link_up = false;
+	u32 swfw_mask = hw->phy.phy_semaphore_mask;
 
 	DEBUGFUNC("ixgbe_reset_hw_X550em");
 
@@ -2561,9 +2562,17 @@ s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
 			ctrl = IXGBE_CTRL_RST;
 	}
 
+	status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
+	if (status != IXGBE_SUCCESS) {
+		ERROR_REPORT2(IXGBE_ERROR_CAUTION,
+				"semaphore failed with %d", status);
+		return IXGBE_ERR_SWFW_SYNC;
+	}
+
 	ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
 	IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
 	IXGBE_WRITE_FLUSH(hw);
+	hw->mac.ops.release_swfw_sync(hw, swfw_mask);
 
 	/* Poll for reset bit to self-clear meaning reset is complete */
 	for (i = 0; i < 10; i++) {
-- 
2.7.4

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

end of thread, other threads:[~2017-04-21 11:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18  6:56 [PATCH 0/4] update ixgbe base driver to version 2017-03-29 Wei Dai
2017-04-18  6:57 ` [PATCH 1/4] net/ixgbe/base: acquire PHY semaphore before device reset Wei Dai
2017-04-18  6:57 ` [PATCH 2/4] net/ixgbe/base: add support for 2.5G KX physical layer Wei Dai
2017-04-18  6:57 ` [PATCH 3/4] net/ixgbe/base: add MAC X550em/X557 LED on/off support Wei Dai
2017-04-18  6:57 ` [PATCH 4/4] net/ixgbe/base: update base driver version to 2017.03.29 Wei Dai
2017-04-19 13:22 ` [PATCH 0/4] update ixgbe base driver to version 2017-03-29 Ferruh Yigit
2017-04-20 13:29   ` Dai, Wei
2017-04-21  3:50 ` Peng, Yuan
2017-04-21 11:35 ` Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2017-04-18  5:15 [PATCH 1/4] net/ixgbe/base: acquire PHY semaphore before device reset Wei Dai
2017-04-18  5:15 ` [PATCH 4/4] net/ixgbe/base: update base driver version to 2017.03.29 Wei Dai

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.