[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240722154929.GA26317@lst.de>
Date: Mon, 22 Jul 2024 17:49:29 +0200
From: Christoph Hellwig <hch@....de>
To: Leon Romanovsky <leon@...nel.org>
Cc: Christoph Hellwig <hch@....de>, Robin Murphy <robin.murphy@....com>,
Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Easwar Hariharan <eahariha@...ux.microsoft.com>,
linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
Jason Gunthorpe <jgg@...dia.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v3 2/2] dma: add IOMMU static calls with clear default
ops
On Mon, Jul 22, 2024 at 06:44:58PM +0300, Leon Romanovsky wrote:
> On Mon, Jul 22, 2024 at 05:10:37PM +0200, Christoph Hellwig wrote:
> > On Sun, Jul 21, 2024 at 10:49:11AM +0300, Leon Romanovsky wrote:
> > > -static void iommu_dma_free_noncontiguous(struct device *dev, size_t size,
> > > - struct sg_table *sgt, enum dma_data_direction dir)
> > > +void iommu_dma_free_noncontiguous(struct device *dev, size_t size,
> > > + struct sg_table *sgt,
> > > + enum dma_data_direction dir)
> >
> > Why are you reformatting these to a much less readable coding style?
>
> I'm relying on clang-formatter to format the code, see .clang-format
> file in the kernel root directory.
Well, that uses a really horrible default then. Aligning to the opening
brace not only is hard to read, but requireѕ reformatting with every
addition and removal of a static like here, or when trivially changing
the function name.
> > > +static inline void dma_common_free_pages(struct device *dev, size_t size,
> > > + struct page *vaddr,
> > > + dma_addr_t dma_handle,
> > > + enum dma_data_direction dir)
> > > +{
> > > +}
> >
> > dma-iommu very much depends on these. So we'll need to also
> > build ops_helpers.o if dma-iommu is enabled. So we'll probably need
> > a separate Kconfig option for it that the various users select.
> >
>
> I removed them from dma-iommu.c and there are no calls to them in that file.
> ➜ kernel git:(m/dma-v2) git grep dma_common_alloc_pages drivers/iommu/ | wc -l
Well, you replaced them with direct calls from mapping.c, which now
needs them if dma-iommu is supported. So while strictly speaking
dma-iommu doesn't need them, proper operation with dma-iommu still
needs them.
Powered by blists - more mailing lists