Re: [PATCH 6.6 230/341] change alloc_pages name in dma_map_ops to avoid name conflicts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 30, 2024 at 3:12 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> Hi Greg and Sasha,
>
> On Tue, Aug 27, 2024 at 04:37:41PM +0200, Greg Kroah-Hartman wrote:
> > 6.6-stable review patch.  If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> >
> > [ Upstream commit 8a2f11878771da65b8ac135c73b47dae13afbd62 ]
> >
> > After redefining alloc_pages, all uses of that name are being replaced.
> > Change the conflicting names to prevent preprocessor from replacing them
> > when it's not intended.
> >
> > Link: https://lkml.kernel.org/r/20240321163705.3067592-18-surenb@xxxxxxxxxx
> > Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
> > Tested-by: Kees Cook <keescook@xxxxxxxxxxxx>
> > Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
> > Cc: Alex Gaynor <alex.gaynor@xxxxxxxxx>
> > Cc: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> > Cc: Andreas Hindborg <a.hindborg@xxxxxxxxxxx>
> > Cc: Benno Lossin <benno.lossin@xxxxxxxxx>
> > Cc: "Björn Roy Baron" <bjorn3_gh@xxxxxxxxxxxxxx>
> > Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
> > Cc: Christoph Lameter <cl@xxxxxxxxx>
> > Cc: Dennis Zhou <dennis@xxxxxxxxxx>
> > Cc: Gary Guo <gary@xxxxxxxxxxx>
> > Cc: Kent Overstreet <kent.overstreet@xxxxxxxxx>
> > Cc: Miguel Ojeda <ojeda@xxxxxxxxxx>
> > Cc: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>
> > Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > Cc: Tejun Heo <tj@xxxxxxxxxx>
> > Cc: Vlastimil Babka <vbabka@xxxxxxx>
> > Cc: Wedson Almeida Filho <wedsonaf@xxxxxxxxx>
> > Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> > Stable-dep-of: 61ebe5a747da ("mm/vmalloc: fix page mapping if vm_area_alloc_pages() with high order fallback to order 0")
> > Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> > ---
> >  arch/alpha/kernel/pci_iommu.c           | 2 +-
> >  arch/mips/jazz/jazzdma.c                | 2 +-
> >  arch/powerpc/kernel/dma-iommu.c         | 2 +-
> >  arch/powerpc/platforms/ps3/system-bus.c | 4 ++--
> >  arch/powerpc/platforms/pseries/vio.c    | 2 +-
> >  arch/x86/kernel/amd_gart_64.c           | 2 +-
> >  drivers/iommu/dma-iommu.c               | 2 +-
> >  drivers/parisc/ccio-dma.c               | 2 +-
> >  drivers/parisc/sba_iommu.c              | 2 +-
> >  drivers/xen/grant-dma-ops.c             | 2 +-
> >  drivers/xen/swiotlb-xen.c               | 2 +-
> >  include/linux/dma-map-ops.h             | 2 +-
> >  kernel/dma/mapping.c                    | 4 ++--
> >  13 files changed, 15 insertions(+), 15 deletions(-)
>
> This patch breaks the build for s390:
>
> arch/s390/pci/pci_dma.c:724:10: error: 'const struct dma_map_ops' has no member named 'alloc_pages'; did you mean 'alloc_pages_op'?
>   724 |         .alloc_pages    = dma_common_alloc_pages,
>       |          ^~~~~~~~~~~
>       |          alloc_pages_op
>
> https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2lNUl0tacZpSlu9Edrlk3QoSElM/build.log
>
> This change happened after commit c76c067e488c ("s390/pci: Use dma-iommu
> layer") in mainline, which explains how it was missed for stable.
>
> The fix seems simple:
>
> diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c
> index 99209085c75b..ce0f2990cb04 100644
> --- a/arch/s390/pci/pci_dma.c
> +++ b/arch/s390/pci/pci_dma.c
> @@ -721,7 +721,7 @@ const struct dma_map_ops s390_pci_dma_ops = {
>         .unmap_page     = s390_dma_unmap_pages,
>         .mmap           = dma_common_mmap,
>         .get_sgtable    = dma_common_get_sgtable,
> -       .alloc_pages    = dma_common_alloc_pages,
> +       .alloc_pages_op = dma_common_alloc_pages,
>         .free_pages     = dma_common_free_pages,
>         /* dma_supported is unconditionally true without a callback */
>  };
>
> but I think the better question is why this patch is even needed in the
> first place? It claims that it is a stable dependency of 61ebe5a747da
> but this patch does not even touch mm/vmalloc.c and 61ebe5a747da does
> not mention or touch anything with alloc_pages_op, so it seems like this
> change should just be reverted from 6.6?

Hmm, Nathan is right. I don't see any dependency between this patch
and 61ebe5a747da. Maybe some other patch that uses .alloc_pages_op got
backported and that caused a dependency but then that other patch
should be changed to use .alloc_pages. I'm syncing stable 6.6 to
check. Thanks for pointing this out Nathan!


>
> Cheers,
> Nathan





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux