summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ibm/ibmvnic.h
diff options
context:
space:
mode:
authorJuliet Kim <julietk@linux.vnet.ibm.com>2020-03-10 17:23:58 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-11 01:50:42 +0300
commit7d7195a026bac47ac9943f11f84b7546276209dd (patch)
tree61bd40679eb2e07fe586f81b0065688b35b01737 /drivers/net/ethernet/ibm/ibmvnic.h
parentece0d7bd74615773268475b6b64d6f1ebbd4b4c6 (diff)
downloadlinux-7d7195a026bac47ac9943f11f84b7546276209dd.tar.xz
ibmvnic: Do not process device remove during device reset
The ibmvnic driver does not check the device state when the device is removed. If the device is removed while a device reset is being processed, the remove may free structures needed by the reset, causing an oops. Fix this by checking the device state before processing device remove. Signed-off-by: Juliet Kim <julietk@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ibm/ibmvnic.h')
-rw-r--r--drivers/net/ethernet/ibm/ibmvnic.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index 60eccaf91b12..f8416e1d4cf0 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -941,7 +941,8 @@ enum vnic_state {VNIC_PROBING = 1,
VNIC_CLOSING,
VNIC_CLOSED,
VNIC_REMOVING,
- VNIC_REMOVED};
+ VNIC_REMOVED,
+ VNIC_RESETTING};
enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1,
VNIC_RESET_MOBILITY,
@@ -1090,4 +1091,7 @@ struct ibmvnic_adapter {
struct ibmvnic_tunables desired;
struct ibmvnic_tunables fallback;
+
+ /* Used for serializatin of state field */
+ spinlock_t state_lock;
};