mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Arnd Bergmann <arnd@kernel.org>,
	Maarten Lankhorst	 <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	 Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Matthew Brost <matthew.brost@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Himal Prasad Ghimiray	 <himal.prasad.ghimiray@intel.com>,
	Matthew Auld <matthew.auld@intel.com>,
	 Francois Dugast <francois.dugast@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
		dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
		intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] [v2] drm/pagemap: pass pagemap_addr by reference
Date: Tue, 17 Feb 2026 13:21:09 +0100	[thread overview]
Message-ID: <9973d23893b3ce8ca4132e72fe833b6066b277c0.camel@linux.intel.com> (raw)
In-Reply-To: <bf08403abbacbd656a4ba78ae83a4e9163719cbc.camel@linux.intel.com>

On Mon, 2026-02-16 at 14:59 +0100, Thomas Hellström wrote:
> On Mon, 2026-02-16 at 14:46 +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> > 
> > Passing a structure by value into a function is sometimes
> > problematic,
> > for a number of reasons. Of of these is a warning from the 32-bit
> > arm
> > compiler:
> > 
> > drivers/gpu/drm/drm_gpusvm.c: In function
> > '__drm_gpusvm_unmap_pages':
> > drivers/gpu/drm/drm_gpusvm.c:1152:33: note: parameter passing for
> > argument of type 'struct drm_pagemap_addr' changed in GCC 9.1
> >  1152 |                                 dpagemap->ops-
> > > device_unmap(dpagemap,
> >       |                                
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >  1153 |                                                            
> > dev, *addr);
> >       |                                                            
> > ~~~~~~~~~~~
> > 
> > This particular problem is harmless since we are not mixing
> > compiler
> > versions
> > inside of the compiler. However, passing this by reference avoids
> > the
> > warning
> > along with providing slightly better calling conventions as it
> > avoids
> > an
> > extra copy on the stack.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Thanks.
> 
> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> 
> Will push to drm-misc-fixes once CI is complete.

Merged to drm-xe-next. Will likely appear after the next drm-xe-fixes
PR in 7.0-rc2.

Thanks,
Thomas



> 
> /Thomas
> 
> 
> > ---
> >  drivers/gpu/drm/drm_gpusvm.c  | 2 +-
> >  drivers/gpu/drm/drm_pagemap.c | 2 +-
> >  drivers/gpu/drm/xe/xe_svm.c   | 8 ++++----
> >  include/drm/drm_pagemap.h     | 2 +-
> >  4 files changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_gpusvm.c
> > b/drivers/gpu/drm/drm_gpusvm.c
> > index c25f50cad6fe..81626b00b755 100644
> > --- a/drivers/gpu/drm/drm_gpusvm.c
> > +++ b/drivers/gpu/drm/drm_gpusvm.c
> > @@ -1150,7 +1150,7 @@ static void __drm_gpusvm_unmap_pages(struct
> > drm_gpusvm *gpusvm,
> >  					       addr->dir);
> >  			else if (dpagemap && dpagemap->ops-
> > > device_unmap)
> >  				dpagemap->ops-
> > > device_unmap(dpagemap,
> > -							    dev,
> > *addr);
> > +							    dev,
> > addr);
> >  			i += 1 << addr->order;
> >  		}
> >  
> > diff --git a/drivers/gpu/drm/drm_pagemap.c
> > b/drivers/gpu/drm/drm_pagemap.c
> > index d0041c947a28..22579806c055 100644
> > --- a/drivers/gpu/drm/drm_pagemap.c
> > +++ b/drivers/gpu/drm/drm_pagemap.c
> > @@ -318,7 +318,7 @@ static void
> > drm_pagemap_migrate_unmap_pages(struct device *dev,
> >  			struct drm_pagemap_zdd *zdd = page-
> > > zone_device_data;
> >  			struct drm_pagemap *dpagemap = zdd-
> > > dpagemap;
> >  
> > -			dpagemap->ops->device_unmap(dpagemap, dev,
> > pagemap_addr[i]);
> > +			dpagemap->ops->device_unmap(dpagemap, dev,
> > &pagemap_addr[i]);
> >  		} else {
> >  			dma_unmap_page(dev, pagemap_addr[i].addr,
> >  				       PAGE_SIZE <<
> > pagemap_addr[i].order, dir);
> > diff --git a/drivers/gpu/drm/xe/xe_svm.c
> > b/drivers/gpu/drm/xe/xe_svm.c
> > index 213f0334518a..78f4b2c60670 100644
> > --- a/drivers/gpu/drm/xe/xe_svm.c
> > +++ b/drivers/gpu/drm/xe/xe_svm.c
> > @@ -1676,13 +1676,13 @@ xe_drm_pagemap_device_map(struct
> > drm_pagemap
> > *dpagemap,
> >  
> >  static void xe_drm_pagemap_device_unmap(struct drm_pagemap
> > *dpagemap,
> >  					struct device *dev,
> > -					struct drm_pagemap_addr
> > addr)
> > +					const struct
> > drm_pagemap_addr *addr)
> >  {
> > -	if (addr.proto != XE_INTERCONNECT_P2P)
> > +	if (addr->proto != XE_INTERCONNECT_P2P)
> >  		return;
> >  
> > -	dma_unmap_resource(dev, addr.addr, PAGE_SIZE <<
> > addr.order,
> > -			   addr.dir, DMA_ATTR_SKIP_CPU_SYNC);
> > +	dma_unmap_resource(dev, addr->addr, PAGE_SIZE << addr-
> > > order,
> > +			   addr->dir, DMA_ATTR_SKIP_CPU_SYNC);
> >  }
> >  
> >  static void xe_pagemap_destroy_work(struct work_struct *work)
> > diff --git a/include/drm/drm_pagemap.h b/include/drm/drm_pagemap.h
> > index 2baf0861f78f..c848f578e3da 100644
> > --- a/include/drm/drm_pagemap.h
> > +++ b/include/drm/drm_pagemap.h
> > @@ -95,7 +95,7 @@ struct drm_pagemap_ops {
> >  	 */
> >  	void (*device_unmap)(struct drm_pagemap *dpagemap,
> >  			     struct device *dev,
> > -			     struct drm_pagemap_addr addr);
> > +			     const struct drm_pagemap_addr *addr);
> >  
> >  	/**
> >  	 * @populate_mm: Populate part of the mm with @dpagemap
> > memory,

      reply	other threads:[~2026-02-17 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 13:46 Arnd Bergmann
2026-02-16 13:59 ` Thomas Hellström
2026-02-17 12:21   ` Thomas Hellström [this message]

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=9973d23893b3ce8ca4132e72fe833b6066b277c0.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francois.dugast@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome