File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
drivers/net/ethernet/meta/fbnic Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -933,6 +933,20 @@ int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd)
933
933
return attempts ? 0 : - ETIMEDOUT ;
934
934
}
935
935
936
+ static void __fbnic_fw_evict_cmpl (struct fbnic_fw_completion * cmpl_data )
937
+ {
938
+ cmpl_data -> result = - EPIPE ;
939
+ complete (& cmpl_data -> done );
940
+ }
941
+
942
+ static void fbnic_mbx_evict_all_cmpl (struct fbnic_dev * fbd )
943
+ {
944
+ if (fbd -> cmpl_data ) {
945
+ __fbnic_fw_evict_cmpl (fbd -> cmpl_data );
946
+ fbd -> cmpl_data = NULL ;
947
+ }
948
+ }
949
+
936
950
void fbnic_mbx_flush_tx (struct fbnic_dev * fbd )
937
951
{
938
952
unsigned long timeout = jiffies + 10 * HZ + 1 ;
@@ -950,6 +964,9 @@ void fbnic_mbx_flush_tx(struct fbnic_dev *fbd)
950
964
/* Read tail to determine the last tail state for the ring */
951
965
tail = tx_mbx -> tail ;
952
966
967
+ /* Flush any completions as we are no longer processing Rx */
968
+ fbnic_mbx_evict_all_cmpl (fbd );
969
+
953
970
spin_unlock_irq (& fbd -> fw_tx_lock );
954
971
955
972
/* Give firmware time to process packet,
You can’t perform that action at this time.
0 commit comments