]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nvme: Remove pause while resetting
authorWarner Losh <imp@FreeBSD.org>
Fri, 1 Oct 2021 17:09:05 +0000 (11:09 -0600)
committerWarner Losh <imp@FreeBSD.org>
Fri, 1 Oct 2021 17:09:05 +0000 (11:09 -0600)
commite5e26e4a24a1142e02a9b477877e13ed0c194f36
tree71c4096b1d4e3fe5d94a21632715a4d0f3265d43
parent77054a897f6440632267e75ebe31793c7555b79e
nvme: Remove pause while resetting

After some study of the code and the standard, I think we can just drop
the pause(), unconditionally.  If we're not initialized, then there's
nothing to wait for from a software perspective.  If we are initialized,
then there might be outstanding I/O. If so, then the qpair 'recovery
state' will transition to WAITING in nvme_ctrlr_disable_qpairs, which
will ignore any interrupts for items that complete before we complete
the reset by setting cc.en=0.

If we go on to fail the controller, we'll cancel the outstanding I/O
transactions.  If we reset the controller, the hardware throws away
pending transactions and we retry all the pending I/O transactions. Any
transactions that happend to complete before cc.en=0 will have the same
effect in the end (doing the same transaction twice is just inefficient,
it won't affect the state of the device any differently than having done
it once).

The standard imposes no wait times here, so it isn't needed from that
perspective.

Unanswered Question: Do we may need to disable interrupts while we
disable in legacy mode since those are level-sensitive.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D32248
sys/dev/nvme/nvme_ctrlr.c