mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
media: intel/ipu6: Fix dma mask for non-secure mode
We use dma_get_mask() of auxdev device for calculate iova pfn limit.
This is always 32 bit mask as we do not initialize the mask (and we can
not do so, since dev->dev_mask is NULL anyways for auxdev).
Since we need 31 bit mask for non-secure mode use mmu_info->aperture_end
which is properly initialized to correct mask for both modes.
Fixes: daabc5c647 ("media: ipu6: not override the dma_ops of device in driver")
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
parent
1284c96939
commit
0209916ebe
|
|
@ -172,7 +172,7 @@ void *ipu6_dma_alloc(struct ipu6_bus_device *sys, size_t size,
|
|||
count = PHYS_PFN(size);
|
||||
|
||||
iova = alloc_iova(&mmu->dmap->iovad, count,
|
||||
PHYS_PFN(dma_get_mask(dev)), 0);
|
||||
PHYS_PFN(mmu->dmap->mmu_info->aperture_end), 0);
|
||||
if (!iova)
|
||||
goto out_kfree;
|
||||
|
||||
|
|
@ -398,7 +398,7 @@ int ipu6_dma_map_sg(struct ipu6_bus_device *sys, struct scatterlist *sglist,
|
|||
nents, npages);
|
||||
|
||||
iova = alloc_iova(&mmu->dmap->iovad, npages,
|
||||
PHYS_PFN(dma_get_mask(dev)), 0);
|
||||
PHYS_PFN(mmu->dmap->mmu_info->aperture_end), 0);
|
||||
if (!iova)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user