]> www.infradead.org Git - users/dwmw2/linux.git/commit
fbnic: Do not allow mailbox to toggle to ready outside fbnic_mbx_poll_tx_ready
authorAlexander Duyck <alexanderduyck@fb.com>
Tue, 6 May 2025 16:00:25 +0000 (09:00 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 8 May 2025 09:33:30 +0000 (11:33 +0200)
commitce2fa1dba204c761582674cf2eb9cbe0b949b5c7
tree3baf16afff6a649edfaa5944f45321136a3975b2
parent1b34d1c1dc8384884febd83140c9afbc7c4b9eb8
fbnic: Do not allow mailbox to toggle to ready outside fbnic_mbx_poll_tx_ready

We had originally thought to have the mailbox go to ready in the background
while we were doing other things. One issue with this though is that we
can't disable it by clearing the ready state without also blocking
interrupts or calls to mbx_poll as it will just pop back to life during an
interrupt.

In order to prevent that from happening we can pull the code for toggling
to ready out of the interrupt path and instead place it in the
fbnic_mbx_poll_tx_ready path so that it becomes the only spot where the
Rx/Tx can toggle to the ready state. By doing this we can prevent races
where we disable the DMA and/or free buffers only to have an interrupt fire
and undo what we have done.

Fixes: da3cde08209e ("eth: fbnic: Add FW communication mechanism")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/174654722518.499179.11612865740376848478.stgit@ahduyck-xeon-server.home.arpa
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_fw.c