Skip to content

Commit 3ada288

Browse files
Lijun Pankuba-moo
authored andcommitted
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: 7d7195a ("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>
1 parent 0e435be commit 3ada288

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,6 @@ static void __ibmvnic_reset(struct work_struct *work)
22152215

22162216
if (!saved_state) {
22172217
reset_state = adapter->state;
2218-
adapter->state = VNIC_RESETTING;
22192218
saved_state = true;
22202219
}
22212220
spin_unlock_irqrestore(&adapter->state_lock, flags);
@@ -5280,7 +5279,7 @@ static int ibmvnic_remove(struct vio_dev *dev)
52805279
unsigned long flags;
52815280

52825281
spin_lock_irqsave(&adapter->state_lock, flags);
5283-
if (adapter->state == VNIC_RESETTING) {
5282+
if (test_bit(0, &adapter->resetting)) {
52845283
spin_unlock_irqrestore(&adapter->state_lock, flags);
52855284
return -EBUSY;
52865285
}

drivers/net/ethernet/ibm/ibmvnic.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,8 +942,7 @@ enum vnic_state {VNIC_PROBING = 1,
942942
VNIC_CLOSING,
943943
VNIC_CLOSED,
944944
VNIC_REMOVING,
945-
VNIC_REMOVED,
946-
VNIC_RESETTING};
945+
VNIC_REMOVED};
947946

948947
enum ibmvnic_reset_reason {VNIC_RESET_FAILOVER = 1,
949948
VNIC_RESET_MOBILITY,

0 commit comments

Comments
 (0)