[PATCH v2] xlnx-versal-ospi: disable reentrancy detection for iomem_dac

Sai Pavan Boddu posted 1 patch 8 months, 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240219105637.65052-1-sai.pavan.boddu@amd.com
Maintainers: Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Francisco Iglesias <francisco.iglesias@xilinx.com>
hw/ssi/xlnx-versal-ospi.c | 6 ++++++
1 file changed, 6 insertions(+)
[PATCH v2] xlnx-versal-ospi: disable reentrancy detection for iomem_dac
Posted by Sai Pavan Boddu 8 months, 3 weeks ago
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.

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@amd.com>
---
Changes for V2:
	Added code comments.

 hw/ssi/xlnx-versal-ospi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/ssi/xlnx-versal-ospi.c b/hw/ssi/xlnx-versal-ospi.c
index c7b95b1f37..c479138ec1 100644
--- a/hw/ssi/xlnx-versal-ospi.c
+++ b/hw/ssi/xlnx-versal-ospi.c
@@ -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);
 
-- 
2.25.1
Re: [PATCH v2] xlnx-versal-ospi: disable reentrancy detection for iomem_dac
Posted by Peter Maydell 8 months, 3 weeks ago
On Mon, 19 Feb 2024 at 10:56, Sai Pavan Boddu <sai.pavan.boddu@amd.com> wrote:
>
> 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.
>
> Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@amd.com>
> ---
> Changes for V2:
>         Added code comments.
>
>  hw/ssi/xlnx-versal-ospi.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/hw/ssi/xlnx-versal-ospi.c b/hw/ssi/xlnx-versal-ospi.c
> index c7b95b1f37..c479138ec1 100644
> --- a/hw/ssi/xlnx-versal-ospi.c
> +++ b/hw/ssi/xlnx-versal-ospi.c
> @@ -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