All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH v3 3/4] ARM: dma-mapping: Switch to physical address mapping callbacks
Date: Wed, 17 Sep 2025 10:58:19 -0300	[thread overview]
Message-ID: <20250917135819.GA1391379@nvidia.com> (raw)
In-Reply-To: <20250917134128.GC6464@unreal>

On Wed, Sep 17, 2025 at 04:41:28PM +0300, Leon Romanovsky wrote:
> On Wed, Sep 17, 2025 at 08:32:48AM -0300, Jason Gunthorpe wrote:
> > On Wed, Sep 17, 2025 at 01:36:44PM +0300, Leon Romanovsky wrote:
> > > On Tue, Sep 16, 2025 at 03:46:17PM -0300, Jason Gunthorpe wrote:
> > > > On Tue, Sep 16, 2025 at 10:32:06AM +0300, Leon Romanovsky wrote:
> > > > > +	if (!dev->dma_coherent &&
> > > > > +	    !(attrs & (DMA_ATTR_SKIP_CPU_SYNC | DMA_ATTR_MMIO)))
> > > > > +		__dma_page_cpu_to_dev(phys_to_page(phys), offset, size, dir);
> > > > 
> > > > I'd keep going and get rid of the page here too, maybe as a second
> > > > patch in this series:
> > > 
> > > Thanks, it is always unclear how far to go with cleanups.
> > 
> > IMHO to maximally support what Matthew is working on I'd remove all
> > the struct page things and prefer the pfn/phys variations from the MM
> > side.
> 
> ok, my patches can be found here:
> https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/log/?h=dmabuf-vfio
> 
> I converted "struct page" path from all archs with .map_page.

Yeah, that's right, I would split this into a few series

This group is all fairly trivial stuff that didn't use the struct
page or virt address at all:

 MIPS/jazzdma
 x86
 vdpa
 xen: swiotlb:  (though make a phys_to_xen_pfn() macro)

I'd also drop the ATTR_MMIO checks from x86 and jazzdma
since the code is obviously fine with any phys.

vdpa can support ATTR_MMIO with the same iommu prot MMIO adjustment,
that would be a good additional patch.

Then there are more conversions that don't use struct page or va but
are not so trivial

alpha
parisc

Then the last ones sparc/power are quite complicated and do use
__va/etc.

Jason


  reply	other threads:[~2025-09-17 13:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16  7:32 [PATCH v3 0/4] Preparation to .map_page and .unmap_page removal Leon Romanovsky
2025-09-16  7:32 ` [PATCH v3 1/4] dma-mapping: prepare dma_map_ops to conversion to physical address Leon Romanovsky
2025-09-16 13:52   ` Jason Gunthorpe
2025-09-16  7:32 ` [PATCH v3 2/4] dma-mapping: convert dummy ops to physical address mapping Leon Romanovsky
2025-09-16 13:53   ` Jason Gunthorpe
2025-09-16  7:32 ` [PATCH v3 3/4] ARM: dma-mapping: Switch to physical address mapping callbacks Leon Romanovsky
2025-09-16 18:46   ` Jason Gunthorpe
2025-09-17 10:36     ` Leon Romanovsky
2025-09-17 11:32       ` Jason Gunthorpe
2025-09-17 13:41         ` Leon Romanovsky
2025-09-17 13:58           ` Jason Gunthorpe [this message]
2025-09-17 18:46             ` Leon Romanovsky
2025-09-17 19:08               ` Jason Gunthorpe
2025-09-17 19:46                 ` Leon Romanovsky
2025-09-16  7:32 ` [PATCH v3 4/4] dma-mapping: remove unused mapping resource callbacks Leon Romanovsky
2025-09-16 12:19   ` Leon Romanovsky
2025-09-16 18:49   ` Jason Gunthorpe

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=20250917135819.GA1391379@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=leon@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    /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.