All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: Philipp Zabel <p.zabel@pengutronix.de>, etnaviv@lists.freedesktop.org
Cc: patchwork-lst@pengutronix.de, kernel@pengutronix.de,
	dri-devel@lists.freedesktop.org,
	Russell King <linux+etnaviv@armlinux.org.uk>
Subject: Re: [PATCH] drm/etnaviv: don't truncate physical page address
Date: Fri, 16 Sep 2022 10:03:31 +0200	[thread overview]
Message-ID: <22d3a4d54fbc0a527315f25c0a97441f3102c0bd.camel@pengutronix.de> (raw)
In-Reply-To: <b3377fc111a704e8666cd6a71e2762dff63a6b75.camel@pengutronix.de>

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@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



  reply	other threads:[~2022-09-16  8:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 14:19 [PATCH] drm/etnaviv: don't truncate physical page address Lucas Stach
2022-09-15 14:40 ` Philipp Zabel
2022-09-16  8:03   ` Lucas Stach [this message]
2022-09-15 19:48 ` kernel test robot
2022-09-15 19:48   ` kernel test robot
2022-09-16  0:22 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22d3a4d54fbc0a527315f25c0a97441f3102c0bd.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etnaviv@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=linux+etnaviv@armlinux.org.uk \
    --cc=p.zabel@pengutronix.de \
    --cc=patchwork-lst@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.