Skip to contentSkip to conversation

net: ena: PHC: Add missing barrier

PATCH Applied Arthur Kiyanovski 2 participants 2 messages Jun 4 – Jun 6

Subsystems (3)
lore
Share & tools
lore

Arthur Kiyanovski

author maintainer
#0 lore raw

PATCH v2 1/1 net: ena: PHC: Add missing barrier

Add dma_rmb() barrier after req_id completion check in ena_com_phc_get_timestamp(). On weakly-ordered architectures, payload fields may be read before req_id is observed as updated.

Fixes e0ea34158ee8 ("net: ena: Add PHC support in the ENA driver")
---
 drivers/net/ethernet/amazon/ena/ena_com.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/amazon/ena/ena_com.c +5 -0
index 8c86789d867a..297fb36ab8c1 100644
@@ -1880,6 +1880,11 @@ int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp)
 			continue;
 		}
 
+		/* Ensure PHC payload (timestamp, error_flags) is read
+		 * after req_id update is observed
+		 */
+		dma_rmb();
+
 		/* req_id was updated by the device which indicates that
 		 * PHC timestamp and error_flags are updated too,
 		 * checking errors before retrieving timestamp
Signature · 1 line
2.47.3
#1 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Thu, 4 Jun 2026 08:07:04 +0000 you wrote:

Add dma_rmb() barrier after req_id completion check in ena_com_phc_get_timestamp(). On weakly-ordered architectures, payload fields may be read before req_id is observed as updated.

Fixes e0ea34158ee8 ("net: ena: Add PHC support in the ENA driver")

[...]

Here is the summary with links:
- [v2,net] net: ena: PHC: Add missing barrier

    https://git.kernel.org/netdev/net/c/954981dbbfbd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html