From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Francois Romieu <romieu@fr.zoreil.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 08/17] e1000: remove dead e1000_init_eeprom_params calls
Date: Tue, 22 Sep 2015 16:54:27 -0700 [thread overview]
Message-ID: <1442966076-14359-9-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1442966076-14359-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Francois Romieu <romieu@fr.zoreil.com>
The device probe method e1000_probe calls e1000_init_eeprom_params
itself so there's no reason to call it again from e1000_do_write_eeprom
or e1000_do_read_eeprom.
The sentence above assumes that e1000_init_eeprom_params is effective.
e1000_init_eeprom_params depends mostly on hw->mac_type and e1000_probe
bails out early if it can't set mac_type (see e1000_init_hw_struct, then
e1000_set_mac_type), qed.
Btw, if effective, the removed paths would had been deadlock prone when
e1000_eeprom_spi was set:
-> e1000_write_eeprom (takes e1000_eeprom_lock)
-> e1000_do_write_eeprom
-> e1000_init_eeprom_params
-> e1000_read_eeprom (takes e1000_eeprom_lock)
(same narrative with e1000_read_eeprom -> e1000_do_read_eeprom etc.)
As a final note, the candidate deadlock above can't happen in e1000_probe
due to the way eeprom->word_size is set / tested.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000/e1000_hw.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c
index 45c8c864..b1af0d6 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_hw.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c
@@ -3900,10 +3900,6 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
return E1000_SUCCESS;
}
- /* If eeprom is not yet detected, do so now */
- if (eeprom->word_size == 0)
- e1000_init_eeprom_params(hw);
-
/* A check for invalid values: offset too large, too many words, and
* not enough words.
*/
@@ -4074,10 +4070,6 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
return E1000_SUCCESS;
}
- /* If eeprom is not yet detected, do so now */
- if (eeprom->word_size == 0)
- e1000_init_eeprom_params(hw);
-
/* A check for invalid values: offset too large, too many words, and
* not enough words.
*/
--
2.4.3
next prev parent reply other threads:[~2015-09-22 23:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 23:54 [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2015-09-22 Jeff Kirsher
2015-09-22 23:54 ` [net-next 01/17] fm10k: remove comment about rtnl_lock around mbx operations Jeff Kirsher
2015-09-22 23:54 ` [net-next 02/17] ixgbe: Add SFP+ detection for X550 hardware Jeff Kirsher
2015-09-22 23:54 ` [net-next 03/17] ixgbe: Add fdir support for SCTP on X550 Jeff Kirsher
2015-09-22 23:54 ` [net-next 04/17] fm10k: drop transmitted messages in Tx FIFO as part of reset_work Jeff Kirsher
2015-09-22 23:54 ` [net-next 05/17] fm10k: create "correct" header for the remote end on connect Jeff Kirsher
2015-09-22 23:54 ` [net-next 06/17] fm10k: TRIVIAL remove unnecessary comma Jeff Kirsher
2015-09-22 23:54 ` [net-next 07/17] fm10k: add support for extra debug statistics Jeff Kirsher
2015-09-22 23:54 ` Jeff Kirsher [this message]
2015-09-22 23:54 ` [net-next 09/17] igbvf: Enable TSO for stacked VLAN Jeff Kirsher
2015-09-22 23:54 ` [net-next 10/17] e1000e: " Jeff Kirsher
2015-09-22 23:54 ` [net-next 11/17] ixgbevf: Enables " Jeff Kirsher
2015-09-22 23:54 ` [net-next 12/17] ixgbe: Accept SFP not present errors on all devices Jeff Kirsher
2015-09-22 23:54 ` [net-next 13/17] ixgbe: Add X550EM support for SFP insertion interrupt Jeff Kirsher
2015-09-22 23:54 ` [net-next 14/17] ixgbe: Provide I2C combined on X550EM Jeff Kirsher
2015-09-22 23:54 ` [net-next 15/17] ixgbe: Provide unlocked I2C methods Jeff Kirsher
2015-09-22 23:54 ` [net-next 16/17] ixgbe: Set lan_id before first I2C eeprom access Jeff Kirsher
2015-09-22 23:54 ` [net-next 17/17] ixgbe: Enable bit-banging mode on X550 Jeff Kirsher
2015-09-23 21:52 ` [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2015-09-22 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=1442966076-14359-9-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=romieu@fr.zoreil.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).