Stop trying to bounce in memory allocated by bus dma

Memory allocated by bus_dmamem_alloc will take into account any alignment
requirements of the CPU it's running on. Stop trying to bounce in this case
as there is no bounce zone allocated.

Reported by:	manu, tuexen
Tested by:	manu
Sponsored by:	Innovate UK
This commit is contained in:
Andrew Turner 2020-11-05 09:55:55 +00:00
parent 0357fa2632
commit d3d8ca7425
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367365

View File

@ -206,6 +206,10 @@ might_bounce(bus_dma_tag_t dmat, bus_dmamap_t map, bus_addr_t paddr,
bus_size_t size)
{
/* Memory allocated by bounce_bus_dmamem_alloc won't bounce */
if ((map->flags & DMAMAP_FROM_DMAMEM) != 0)
return (false);
if ((dmat->bounce_flags & BF_COULD_BOUNCE) != 0)
return (true);