On Fri, Jan 13, 2023 at 05:09:09PM +0300, Denis Orlov wrote: > For some reason, we would only use EERD if Flash is used as non-volatile > memory. However, looking at e1000e driver sources from Linux this is how > they are reading NVM on those cards for both EEPROM and Flash. > > This fixes issues with reading EEPROM in driver on QEMU emulated 82574 > PCIe card. > > Signed-off-by: Denis Orlov <denorl2009@xxxxxxxxx> > --- > drivers/net/e1000/eeprom.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied, thanks Sascha > > diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c > index 27143bd6d0..c90faf3a58 100644 > --- a/drivers/net/e1000/eeprom.c > +++ b/drivers/net/e1000/eeprom.c > @@ -495,6 +495,7 @@ int32_t e1000_init_eeprom_params(struct e1000_hw *hw) > case e1000_82571: > case e1000_82572: > e1000_eeprom_uses_spi(eeprom, eecd); > + eeprom->read = e1000_read_eeprom_eerd; > break; > > case e1000_82573: > @@ -502,7 +503,6 @@ int32_t e1000_init_eeprom_params(struct e1000_hw *hw) > if (e1000_is_onboard_nvm_eeprom(hw)) { > e1000_eeprom_uses_spi(eeprom, eecd); > } else { > - eeprom->read = e1000_read_eeprom_eerd; > eeprom->type = e1000_eeprom_flash; > eeprom->word_size = 2048; > > @@ -513,6 +513,7 @@ int32_t e1000_init_eeprom_params(struct e1000_hw *hw) > eecd &= ~E1000_EECD_AUPDEN; > e1000_write_reg(hw, E1000_EECD, eecd); > } > + eeprom->read = e1000_read_eeprom_eerd; > break; > > case e1000_80003es2lan: > -- > 2.30.2 > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |