Commit 23033fad5be0a2c7838cb9e1579919b64af713f6

Authored by Jesse Brandeburg
Committed by Linus Torvalds
1 parent a8f88ff5a5

e1000e: remove phy read from inside spinlock

thanks to tglx, we're finding some interesting reentrancy issues.
this patch removes the phy read from inside a spinlock, paving
the way for removing the spinlock completely.  The phy read was
only feeding a statistic that wasn't used.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 5 additions and 14 deletions Side-by-side Diff

drivers/net/e1000e/ethtool.c
... ... @@ -432,6 +432,10 @@
432 432 regs_buff[11] = er32(TIDV);
433 433  
434 434 regs_buff[12] = adapter->hw.phy.type; /* PHY type (IGP=1, M88=0) */
  435 +
  436 + /* ethtool doesn't use anything past this point, so all this
  437 + * code is likely legacy junk for apps that may or may not
  438 + * exist */
435 439 if (hw->phy.type == e1000_phy_m88) {
436 440 e1e_rphy(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
437 441 regs_buff[13] = (u32)phy_data; /* cable length */
... ... @@ -447,7 +451,7 @@
447 451 regs_buff[22] = adapter->phy_stats.receive_errors;
448 452 regs_buff[23] = regs_buff[13]; /* mdix mode */
449 453 }
450   - regs_buff[21] = adapter->phy_stats.idle_errors; /* phy idle errors */
  454 + regs_buff[21] = 0; /* was idle_errors */
451 455 e1e_rphy(hw, PHY_1000T_STATUS, &phy_data);
452 456 regs_buff[24] = (u32)phy_data; /* phy local receiver status */
453 457 regs_buff[25] = regs_buff[24]; /* phy remote receiver status */
drivers/net/e1000e/netdev.c
... ... @@ -2954,10 +2954,7 @@
2954 2954 struct e1000_hw *hw = &adapter->hw;
2955 2955 struct pci_dev *pdev = adapter->pdev;
2956 2956 unsigned long irq_flags;
2957   - u16 phy_tmp;
2958 2957  
2959   -#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
2960   -
2961 2958 /*
2962 2959 * Prevent stats update while adapter is being reset, or if the pci
2963 2960 * connection is down.
... ... @@ -3045,15 +3042,6 @@
3045 3042  
3046 3043 /* Tx Dropped needs to be maintained elsewhere */
3047 3044  
3048   - /* Phy Stats */
3049   - if (hw->phy.media_type == e1000_media_type_copper) {
3050   - if ((adapter->link_speed == SPEED_1000) &&
3051   - (!e1e_rphy(hw, PHY_1000T_STATUS, &phy_tmp))) {
3052   - phy_tmp &= PHY_IDLE_ERROR_COUNT_MASK;
3053   - adapter->phy_stats.idle_errors += phy_tmp;
3054   - }
3055   - }
3056   -
3057 3045 /* Management Stats */
3058 3046 adapter->stats.mgptc += er32(MGTPTC);
3059 3047 adapter->stats.mgprc += er32(MGTPRC);
... ... @@ -3072,7 +3060,6 @@
3072 3060 struct e1000_phy_regs *phy = &adapter->phy_regs;
3073 3061 int ret_val;
3074 3062 unsigned long irq_flags;
3075   -
3076 3063  
3077 3064 spin_lock_irqsave(&adapter->stats_lock, irq_flags);
3078 3065