Re: [PATCH] media: intel/ipu6: Fix dma mask for non-secure mode

Stanislaw Gruszka
2025-04-09T10:20:32Z

On Wed, Apr 09, 2025 at 11:58:25AM +0200, Stanislaw Gruszka wrote:
> 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 create wrapper of
> alloc_iova() which use mmu_info->aperture_end. This give us always
> the correct mask.
>
> Fixes: daabc5c64703 ("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>
<snip>
> void __iomem *base, int mmid,
> const struct ipu6_hw_variants *hw);
> @@ -70,4 +76,11 @@ void ipu6_mmu_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
> size_t size);
> phys_addr_t ipu6_mmu_iova_to_phys(struct ipu6_mmu_info *mmu_info,
> dma_addr_t iova);
> +
> +static inline struct iova *ipu_alloc_iova(struct ipu6_mmu *mmu,
> + unsigned long n_pages)
Before posing one of my vim macro accidentally mangled this patch.
Will send v2.

Regards
Stanislaw