]> git.baikalelectronics.ru Git - kernel.git/commit
ibmvnic: delay complete()
authorSukadev Bhattiprolu <sukadev@linux.ibm.com>
Fri, 29 Oct 2021 22:03:16 +0000 (15:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Nov 2021 13:14:52 +0000 (13:14 +0000)
commita00de5bb1d486066c4dd06996347c147e40dfe17
tree3da49b200a3b3852d4f55b06364729bc842d0a03
parentd5e34449d90e60b29bb708a1b2080fa3153543ed
ibmvnic: delay complete()

If we get CRQ_INIT, we set errno to -EIO and first call complete() to
notify the waiter. Then we try to schedule a FAILOVER reset. If this
occurs while adapter is in PROBING state, ibmvnic_reset() changes the
error code to EAGAIN and returns without scheduling the FAILOVER. The
purpose of setting error code to EAGAIN is to ask the waiter to retry.

But due to the earlier complete() call, the waiter may already have seen
the -EIO response and decided not to retry. This can cause intermittent
failures when bringing up ibmvnic adapters during boot, specially in
in kexec/kdump kernels.

Defer the complete() call until after scheduling the reset.

Also streamline the error code to EAGAIN. Don't see why we need EIO
sometimes. All 3 callers of ibmvnic_reset_init() can handle EAGAIN.

Fixes: 3ac975516b57 ("ibmvnic: Return error code if init interrupted by transport event")
Reported-by: Vaishnavi Bhat <vaish123@in.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c