mirror of
https://github.com/torvalds/linux.git
synced 2026-10-14 11:54:03 +02:00
eth: fbnic: Set AW_FLUSH_MODE alongside AW_FLUSH when flushing the mailbox
When tearing down the FW mailbox Rx ring, fbnic_mbx_reset_desc_ring()
writes AW_CFG with FLUSH set and everything else, BME included, cleared.
Clearing BME halts the device's writes to the host but leaves the staged
requests parked in the PUL write pipeline rather than draining them, so
on the write path FLUSH alone never terminates the outstanding requests
and the flush the firmware waits on never completes.
Add the FLUSH_MODE definition and set both bits so the staged writes
drain out of the pipeline on their own. BME stays cleared, so nothing
lands on the host; it is restored later in fbnic_mbx_init_desc_ring()
when the ring is rebuilt, once the outstanding writes are gone.
The read path is unaffected. AR_CFG has no equivalent mode bit and
AR_FLUSH terminates the outstanding reads by itself, so it is left as
is.
Both writes remain plain stores rather than read-modify-writes. That is
deliberate: the matching write in fbnic_mbx_init_desc_ring() restores
BME and the TLP attributes, and clears both flush bits as a side effect.
Fixes: 3b12f00ddd ("fbnic: Gate AXI read/write enabling on FW mailbox")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/178942022583.7700.11050671998277309744.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
4bcc4a92c6
commit
8947f13e43
|
|
@ -974,6 +974,7 @@ enum {
|
|||
/* PUL User Registers */
|
||||
#define FBNIC_CSR_START_PUL_USER 0x31000 /* CSR section delimiter */
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG 0x3103d /* 0xc40f4 */
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH_MODE CSR_BIT(20)
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH CSR_BIT(19)
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_BME CSR_BIT(18)
|
||||
#define FBNIC_PUL_OB_TLP_HDR_AW_CFG_RDE_ATTR CSR_GENMASK(17, 15)
|
||||
|
|
|
|||
|
|
@ -60,8 +60,15 @@ static void fbnic_mbx_reset_desc_ring(struct fbnic_dev *fbd, int mbx_idx)
|
|||
*/
|
||||
switch (mbx_idx) {
|
||||
case FBNIC_IPC_MBX_RX_IDX:
|
||||
/* Clearing BME blocks the device from writing to the host
|
||||
* but leaves the requests parked in the write pipeline. The
|
||||
* write path only clears outstanding requests when both FLUSH
|
||||
* and FLUSH_MODE are set; FLUSH_MODE lets them drain without
|
||||
* landing on the host.
|
||||
*/
|
||||
wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AW_CFG,
|
||||
FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH);
|
||||
FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH |
|
||||
FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH_MODE);
|
||||
break;
|
||||
case FBNIC_IPC_MBX_TX_IDX:
|
||||
wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AR_CFG,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user