[PATCH] drm/etnaviv: don't truncate physical page address

Lucas Stach l.stach at pengutronix.de
Fri Sep 16 08:03:31 UTC 2022


Hi Philipp,

Am Donnerstag, dem 15.09.2022 um 16:40 +0200 schrieb Philipp Zabel:
> Hi Lucas,
> 
> On Do, 2022-09-15 at 16:19 +0200, Lucas Stach wrote:
> > While the interface for the MMU mapping takes phys_addr_t to hold a
> > full 64bit address when necessary and MMUv2 is able to map physical
> > addresses with up to 40bit, etnaviv_iommu_map() truncates the address
> > to 32bits. Fix this by using the correct type.
> > 
> > Fixes: 931e97f3afd8 ("drm/etnaviv: mmuv2: support 40 bit phys address")
> > Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> > ---
> >  drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
> > index dc1aa738c4f1..2ff80d5ccf07 100644
> > --- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
> > +++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c
> > @@ -80,7 +80,7 @@ static int etnaviv_iommu_map(struct etnaviv_iommu_context *context, u32 iova,
> >  		return -EINVAL;
> >  
> > 
> >  	for_each_sgtable_dma_sg(sgt, sg, i) {
> > -		u32 pa = sg_dma_address(sg) - sg->offset;
> > +		phys_addr_t pa = sg_dma_address(sg) - sg->offset;
> >  		size_t bytes = sg_dma_len(sg) + sg->offset;
> >  
> > 
> >  		VERB("map[%d]: %08x %08x(%zx)", i, iova, pa, bytes);
>                                     ^^^^                 ^^
> Use %pap, &pa here?
> 
Yep, I actually thought about this when writing the patch, but then got
distracted and forgot to add this change. :/

Regards,
Lucas




More information about the dri-devel mailing list