2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 22:24:09 +08:00
linux-next/drivers/net/ethernet
Anjali Singhai Jain 09f79fd49d i40e: avoid NVM acquire deadlock during NVM update
X722 devices use the AdminQ to access the NVM, and this requires taking
the AdminQ lock. Because of this, we lock the AdminQ during
i40e_read_nvm(), which is also called in places where the lock is
already held, such as the firmware update path which wants to lock once
and then unlock when finished after performing several tasks.

Although this should have only affected X722 devices, commit
96a39aed25 ("i40e: Acquire NVM lock before reads on all devices",
2016-12-02) added locking for all NVM reads, regardless of device
family.

This resulted in us accidentally causing NVM acquire timeouts on all
devices, causing failed firmware updates which left the eeprom in
a corrupt state.

Create unsafe non-locked variants of i40e_read_nvm_word and
i40e_read_nvm_buffer, __i40e_read_nvm_word and __i40e_read_nvm_buffer
respectively. These variants will not take the NVM lock and are expected
to only be called in places where the NVM lock is already held if
needed.

Since the only caller of i40e_read_nvm_buffer() was in such a path,
remove it entirely in favor of the unsafe version. If necessary we can
always add it back in the future.

Additionally, we now need to hold the NVM lock in i40e_validate_checksum
because the call to i40e_calc_nvm_checksum now assumes that the NVM lock
is held. We can further move the call to read I40E_SR_SW_CHECKSUM_WORD
up a bit so that we do not need to acquire the NVM lock twice.

This should resolve firmware updates and also fix potential raise that
could have caused the driver to report an invalid NVM checksum upon
driver load.

Reported-by: Stefan Assmann <sassmann@kpanic.de>
Fixes: 96a39aed25 ("i40e: Acquire NVM lock before reads on all devices", 2016-12-02)
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-09-05 17:48:22 -07:00
..
3com networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
8390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-05-26 20:46:35 -04:00
adaptec
adi
aeroflex networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
agere networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
alacritech
allwinner networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
alteon
altera
amazon net: ena: update ena driver to version 1.2.0 2017-06-23 14:15:11 -04:00
amd amd-xgbe: fix spelling mistake: "avialable" -> "available" 2017-06-29 15:35:50 -04:00
apm drivers: net: xgene: Correct probe sequence handling 2017-08-29 16:13:08 -07:00
apple networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
aquantia net:ethernet:aquantia: Show info message if bad firmware version detected. 2017-08-29 15:11:44 -07:00
arc net: arc_emac: switch to phy_start()/phy_stop() 2017-04-21 15:23:52 -04:00
atheros net: atl1c: fix spelling mistake: "droppted" -> "dropped" 2017-06-29 12:24:26 -04:00
aurora net: ethernet: nb8800: Handle all 4 RGMII modes identically 2017-07-25 21:27:01 -07:00
broadcom net: systemport: Free DMA coherent descriptors on errors 2017-08-24 18:23:21 -07:00
brocade bna: ethtool: Avoid reading past end of buffer 2017-05-08 14:41:42 -04:00
cadence net: macb: Adding Support for Jumbo Frames up to 10240 Bytes in SAMA5D3 2017-07-08 10:39:46 +01:00
calxeda
cavium net: thunderx: Fix BGX transmit stall due to underflow 2017-07-29 14:17:07 -07:00
chelsio cxgb4: Fix stack out-of-bounds read due to wrong size to t4_record_mbox() 2017-08-28 15:24:23 -07:00
cirrus networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
cisco cisco: enic: Fic an error handling path in 'vnic_dev_init_devcmd2()' 2017-07-11 10:54:15 -07:00
davicom networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
dec networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
dlink
emulex Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-05-26 20:46:35 -04:00
ezchip
faraday net: ftgmac100: Fix oops in probe on failure to find associated PHY 2017-08-22 14:17:47 -07:00
freescale fsl/man: Inherit parent device and of_node 2017-08-22 16:32:08 -07:00
fujitsu
hisilicon net: hns: add acpi function of xge led control 2017-07-14 08:18:07 -07:00
hp networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
i825xx networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
ibm ibmvnic: Initialize SCRQ's during login renegotiation 2017-08-02 10:47:45 -07:00
intel i40e: avoid NVM acquire deadlock during NVM update 2017-09-05 17:48:22 -07:00
marvell net: mvpp2: fix the mac address used when using PPv2.2 2017-08-28 11:24:52 -07:00
mediatek net: ethernet: mediatek: Explicitly include linux/interrupt.h 2017-07-24 13:45:29 -07:00
mellanox mlxsw: spectrum: Forbid linking to devices that have uppers 2017-09-01 09:59:41 -07:00
micrel networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
microchip
moxa
myricom
natsemi format-security: move static strings to const 2017-05-08 17:15:14 -07:00
neterion net: s2io: remove useless variable in fill_rx_buffers 2017-06-15 14:15:13 -04:00
netronome nfp: double free on error in probe 2017-08-29 16:07:23 -07:00
nuvoton net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
nvidia forcedeth: remove unnecessary carrier status check 2017-05-04 10:57:41 -04:00
nxp net: manual clean code which call skb_put_[data:zero] 2017-06-20 13:30:15 -04:00
oki-semi net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
packetengines net: manual clean code which call skb_put_[data:zero] 2017-06-20 13:30:15 -04:00
pasemi
qlogic qlge: avoid memcpy buffer overflow 2017-08-24 14:00:57 -07:00
qualcomm net: qcom/emac: fix double free of SGMII IRQ during shutdown 2017-07-14 08:55:32 -07:00
rdc
realtek r8169: Be drop monitor friendly 2017-08-25 19:13:27 -07:00
renesas net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
rocker Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-06-30 12:43:08 -04:00
samsung net: sxgbe: check memory allocation failure 2017-08-25 20:07:07 -07:00
seeq
sfc sfc: don't try and read ef10 data on non-ef10 NIC 2017-08-15 17:19:34 -07:00
sgi ioc3-eth: store pointer to net_device for priviate area 2017-07-15 14:28:56 -07:00
silan networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
sis net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
smsc smsc911x: Add check for ioremap_nocache() return code 2017-07-12 14:35:43 -07:00
stmicro net: stmmac: sun8i: Remove the compatibles 2017-08-28 15:22:42 -07:00
sun sunhme: fix up GREG_STAT and GREG_IMASK register offsets 2017-07-31 16:23:05 -07:00
synopsys
tehuti net: tehuti: don't process data if it has not been copied from userspace 2017-07-19 22:48:02 -07:00
ti net: ti: cpsw-common: dont print error if ti_cm_get_macid() fails 2017-08-30 10:05:07 -07:00
tile net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
toshiba net: tc35815: fix spelling mistake: "Intterrupt" -> "Interrupt" 2017-07-29 15:22:08 -07:00
tundra net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
via net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
wiznet
xilinx
xircom
xscale
dnet.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
dnet.h
ec_bhf.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
ethoc.c net: ethoc: enable NAPI before poll may be scheduled 2017-06-06 16:22:51 -04:00
fealnx.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
jme.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
jme.h
Kconfig
korina.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
lantiq_etop.c
Makefile
netx-eth.c