Skip to contentSkip to conversation

xlnx-versal-ospi: disable reentrancy detection for iomem_dac

PATCH Applied Sai Pavan Boddu 2 participants 2 messages Feb 19, 2024 – Feb 22, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xlnx-versal-ospi: disable reentrancy detection for iomem_dac

The OSPI DMA reads flash data through the OSPI linear address space (the iomem_dac region), because of this the reentrancy guard introduced in commit a2e1753b ("memory: prevent dma-reentracy issues") is disabled for the memory region.

---
Changes for V2:
Added code comments.

 hw/ssi/xlnx-versal-ospi.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/ssi/xlnx-versal-ospi.c +6 -0
index c7b95b1f37..c479138ec1 100644
@@ -1772,6 +1772,12 @@ static void xlnx_versal_ospi_init(Object *obj)
     memory_region_init_io(&s->iomem_dac, obj, &ospi_dac_ops, s,
                           TYPE_XILINX_VERSAL_OSPI "-dac", 0x20000000);
     sysbus_init_mmio(sbd, &s->iomem_dac);
+    /*
+     * The OSPI DMA reads flash data through the OSPI linear address space (the
+     * iomem_dac region), because of this the reentrancy guard needs to be
+     * disabled.
+     */
+    s->iomem_dac.disable_reentrancy_guard = true;
 
     sysbus_init_irq(sbd, &s->irq);
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 19 lines · Sai Pavan Boddu

The OSPI DMA reads flash data through the OSPI linear address space (the iomem_dac region), because of this the reentrancy guard introduced in commit a2e1753b ("memory: prevent dma-reentracy issues") is disabled for the memory region.

---
Changes for V2:
Added code comments.

 hw/ssi/xlnx-versal-ospi.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/ssi/xlnx-versal-ospi.c +0 -0
index c7b95b1f37..c479138ec1 100644

hw/ssi/xlnx-versal-ospi.c static void xlnx_versal_ospi_init(Object *obj) · line 1780

Quoted 9 lines
hw/ssi/xlnx-versal-ospi.c +6 -0
@@ -1772,6 +1772,12 @@ static void xlnx_versal_ospi_init(Object *obj)
     memory_region_init_io(&s->iomem_dac, obj, &ospi_dac_ops, s,
                           TYPE_XILINX_VERSAL_OSPI "-dac", 0x20000000);
     sysbus_init_mmio(sbd, &s->iomem_dac);
+    /*
+     * The OSPI DMA reads flash data through the OSPI linear address space (the
+     * iomem_dac region), because of this the reentrancy guard needs to be
+     * disabled.
+     */
+    s->iomem_dac.disable_reentrancy_guard = true;

Applied to target-arm.next, thanks.

-- PMM