Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2023 11:07:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-arm@FreeBSD.org
Subject:   [Bug 274592] bus_dmamem_alloc()/bus_dmamap_load returns physical address outside the tag low/high bounds
Message-ID:  <bug-274592-7@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274592

            Bug ID: 274592
           Summary: bus_dmamem_alloc()/bus_dmamap_load returns physical
                    address outside the tag low/high bounds
           Product: Base System
           Version: 15.0-CURRENT
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: shafaisal.us@gmail.com

Hello Team,=20
We are using the below 3 routines to alloc DMA memory for one of our devices
connected through PCIe interface.
Out of 10 rebooted 4-5 times we get the address outside greated 32G range of
addresses, due to which our device functionality is effected and there is a
crash seen.

error =3D bus_dma_tag_create(bus_get_dma_tag(dev),
                               PAGE_SIZE,
                               0,
                               BUS_SPACE_MAXADDR_32BIT,
                               BUS_SPACE_MAXADDR,
                               NULL,
                               NULL,
                               128*1024*1024, 1,
                               128*1024*1024, BUS_DMA_COHERENT,
                               NULL, NULL,
                               &dma_tag);

error =3D bus_dmamem_alloc(dma_tag, &vaddr,
                             BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERE=
NT,
                             &dma_map);


error =3D bus_dmamap_load(dma_tag, dma_map, vaddr,
                            128*1024*1024, dma_mem_callback,=20
                            &dma_paddr, BUS_DMA_NOWAIT);=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20


Below are the addresses we get for Working and non-working case

Working case vaddr and dma_paddr:
DMA phys addr with arm64_address_translate is 0xff000000cf000b80 for vaddr
0xffff00007ec00000
DMA phys addr with vtophys is 0xcf000000 for vaddr 0xffff00007ec00000

Non-Working case vaddr and dma_paddr:
DMA phys addr with arm64_address_translate is 0xff00000163000b80 for vaddr
0xffff00007ec00000
DMA phys addr with vtophys is 0x163000000 for vaddr 0xffff00007ec00000

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-274592-7>