All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Emil Tantilov <emil.s.tantilov@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 12/15] ixgbe: add write flush when configuring CS4223/7
Date: Wed, 31 May 2017 14:19:33 -0700	[thread overview]
Message-ID: <20170531211936.63417-13-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20170531211936.63417-1-jeffrey.t.kirsher@intel.com>

From: Emil Tantilov <emil.s.tantilov@intel.com>

Make sure the writes are processed immediately. Without the flush it
is possible for operations on one port to spill over the other as the
resource is shared.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index 32b35efde2df..80824fec15d2 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -1824,12 +1824,28 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
 
 	/* Configure CS4227/CS4223 LINE side to proper mode. */
 	reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + slice_offset;
+
+	ret_val = hw->phy.ops.read_reg(hw, reg_slice,
+				       IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
+	if (ret_val)
+		return ret_val;
+
+	reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
+			 (IXGBE_CS4227_EDC_MODE_SR << 1));
+
 	if (setup_linear)
 		reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 1;
 	else
 		reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 1;
-	return hw->phy.ops.write_reg(hw, reg_slice, IXGBE_MDIO_ZERO_DEV_TYPE,
-				     reg_phy_ext);
+
+	ret_val = hw->phy.ops.write_reg(hw, reg_slice,
+					IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext);
+	if (ret_val)
+		return ret_val;
+
+	/* Flush previous write with a read */
+	return hw->phy.ops.read_reg(hw, reg_slice,
+				    IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
 }
 
 /**
-- 
2.12.2

  parent reply	other threads:[~2017-05-31 21:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 21:19 [net-next 00/15][pull request] 10GbE Intel Wired LAN Driver Updates 2017-05-31 Jeff Kirsher
2017-05-31 21:19 ` [net-next 01/15] ixgbe/ixgbevf: Enables TSO for MPLS encapsulated packets Jeff Kirsher
2017-05-31 21:19 ` [net-next 02/15] ixgbe: initialize u64_stats_sync structures early at ixgbe_probe Jeff Kirsher
2017-05-31 21:19 ` [net-next 03/15] ixgbe: Remove MAC X550EM_X 1Gbase-t led_[on|off] support Jeff Kirsher
2017-05-31 21:19 ` [net-next 04/15] ixgbe: enable L3/L4 filtering for Tx switched packets Jeff Kirsher
2017-05-31 21:19 ` [net-next 05/15] ixgbe: Correct thermal sensor event check Jeff Kirsher
2017-05-31 21:19 ` [net-next 06/15] ixgbe: Add error checking to setting VF MAC Jeff Kirsher
2017-05-31 21:19 ` [net-next 07/15] ixgbe: Resolve truncation warning for q_vector->name Jeff Kirsher
2017-05-31 21:19 ` [net-next 08/15] ixgbe: Resolve warnings for -Wimplicit-fallthrough Jeff Kirsher
2017-05-31 21:19 ` [net-next 09/15] ixgbevf: Resolve truncation warning for q_vector->name Jeff Kirsher
2017-06-01  9:30   ` Sergei Shtylyov
2017-05-31 21:19 ` [net-next 10/15] ixgbevf: Resolve warnings for -Wimplicit-fallthrough Jeff Kirsher
2017-05-31 21:19 ` [net-next 11/15] ixgbe: correct CS4223/7 PHY identification Jeff Kirsher
2017-05-31 21:19 ` Jeff Kirsher [this message]
2017-05-31 21:19 ` [net-next 13/15] ixgbe: always call setup_mac_link for multispeed fiber Jeff Kirsher
2017-05-31 21:19 ` [net-next 14/15] ixgbe: add missing configuration for rate select 1 Jeff Kirsher
2017-05-31 21:19 ` [net-next 15/15] ixgbe: fix incorrect status check Jeff Kirsher
2017-05-31 21:55 ` [net-next 00/15][pull request] 10GbE Intel Wired LAN Driver Updates 2017-05-31 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170531211936.63417-13-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=emil.s.tantilov@intel.com \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.