net/bnxt: check chip reset in stop and close
authorSomnath Kotur <somnath.kotur@broadcom.com>
Thu, 24 Dec 2020 09:37:34 +0000 (15:07 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 13 Jan 2021 18:24:30 +0000 (19:24 +0100)
commit6f5f3b99821ea5011573f0383582ac2fd3dbb0e0
tree401bdd60ae83c562c0d8ab6de822ca0525cc166a
parent9d276b439aafab582c5e07e82ded75570b4dc9b4
net/bnxt: check chip reset in stop and close

While the error recovery thread is running, an application
can invoke dev_stop or dev_close_op thus triggering a race
and unwanted consequences if dev_close is invoked while the
recovery is not yet completed.
Fix by having another lock to synchronize between the 2 threads and
return EGAIN if adapter is in the middle of recovery when dev_stop
or dev_close ops are invoked

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_cpr.c
drivers/net/bnxt/bnxt_ethdev.c