]> www.infradead.org Git - users/jedix/linux-maple.git/commit
e1000: remove dead e1000_init_eeprom_params calls
authorFrancois Romieu <romieu@fr.zoreil.com>
Wed, 5 Aug 2015 22:52:37 +0000 (00:52 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 22 Jun 2017 06:24:38 +0000 (23:24 -0700)
commit81b50febb843a685e0185f1fed79984884633ef8
tree08fe73b5e289ace6fa7ccb5c3d318c294453637f
parentace6cc0148bae67d2c90c0e7e7b04bbc5558689e
e1000: remove dead e1000_init_eeprom_params calls

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>
Orabug: 26243014
(cherry picked from commit 307723255a05242ab252dd7047d4970ab60c7dfd)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/net/ethernet/intel/e1000/e1000_hw.c