diff options
author | Lijun Pan <ljp@linux.ibm.com> | 2020-11-23 13:35:47 -0600 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-24 16:28:34 -0800 |
commit | 3ada288150fb17ab3fcce2cf5fce20461f86b2ee (patch) | |
tree | d9ca6e0060d3280d3020aaa94fd57fc137d51617 /drivers | |
parent | 0e435befaea45f7ea58682eecab5e37e05b2ce65 (diff) | |
download | linux-stable-3ada288150fb17ab3fcce2cf5fce20461f86b2ee.tar.gz linux-stable-3ada288150fb17ab3fcce2cf5fce20461f86b2ee.tar.bz2 linux-stable-3ada288150fb17ab3fcce2cf5fce20461f86b2ee.zip |
ibmvnic: enhance resetting status check during module exit
Based on the discussion with Sukadev Bhattiprolu and Dany Madden,
we believe that checking adapter->resetting bit is preferred
since RESETTING state flag is not as strict as resetting bit.
RESETTING state flag is removed since it is verbose now.
Fixes: 7d7195a026ba ("ibmvnic: Do not process device remove during device reset")
Signed-off-by: Lijun Pan <ljp@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/ibm/ibmvnic.h | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 26ba07df404e..2491ebc97871 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -2215,7 +2215,6 @@ static void __ibmvnic_reset(struct work_struct *work) if (!saved_state) { reset_state = adapter->state; - adapter->state = VNIC_RESETTING; saved_state = true; } spin_unlock_irqrestore(&adapter->state_lock, flags); @@ -5280,7 +5279,7 @@ static int ibmvnic_remove(struct vio_dev *dev) unsigned long flags; spin_lock_irqsave(&adapter->state_lock, flags); - if (adapter->state == VNIC_RESETTING) { + if (test_bit(0, &adapter->resetting)) { spin_unlock_irqrestore(&adapter->state_lock, flags); return -EBUSY; } diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h index 217dcc7ded70..47a3fd71c96f 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.h +++ b/drivers/net/ethernet/ibm/ibmvnic.h @@ -942,8 +942,7 @@ enum vnic_state {VNIC_PROBING = 1, VNIC_CLOSING, VNIC_CLOSED, VNIC_REMOVING, - VNIC_REMOVED, - VNIC_RESETTING}; + VNIC_REMOVED}; enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1, VNIC_RESET_MOBILITY, |