Skip to contentSkip to conversation

dma/idxd: mark portal pointer as volatile

PATCH Applied Bruce Richardson 2 participants 2 messages Jan 26 – Feb 16 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 dma/idxd: mark portal pointer as volatile

The portal pointer for writing descriptors to the idxd device should be volatile for consistency with how it is used. Only time we need to cast away the volatility is when unmapping it.

Bugzilla ID: 1871

Fixes e888bb1278c6 ("dma/idxd: add bus device probing")
---
 drivers/dma/idxd/idxd_bus.c      | 2 +-
 drivers/dma/idxd/idxd_internal.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/dma/idxd/idxd_bus.c +1 -1
index 5ae42151e6..9a8213bbbe 100644
@@ -93,7 +93,7 @@ static int
 idxd_dev_close(struct rte_dma_dev *dev)
 {
 	struct idxd_dmadev *idxd = dev->data->dev_private;
-	munmap(idxd->portal, 0x1000);
+	munmap(RTE_CAST_PTR(void *, idxd->portal), 0x1000);
 	return 0;
 }
 
drivers/dma/idxd/idxd_internal.h +1 -1
index b80a113455..d409213148 100644
@@ -56,7 +56,7 @@ struct idxd_dmadev {
 	unsigned short batch_start; /* start+size == write pointer for hdls/desc */
 	unsigned short batch_size;
 
-	void *portal; /* address to write the batch descriptor */
+	volatile void *portal; /* address to write the batch descriptor */
 
 	struct idxd_completion *batch_comp_ring;
 	unsigned short *batch_idx_ring; /* store where each batch ends */
Signature · 1 line
2.51.0
#2 lore raw

26/01/2026 11:13, Bruce Richardson:

Quoted 9 lines

The portal pointer for writing descriptors to the idxd device should be volatile for consistency with how it is used. Only time we need to cast away the volatility is when unmapping it.

Bugzilla ID: 1871

Fixes e888bb1278c6 ("dma/idxd: add bus device probing")

Applied, thanks.