Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1566913imm; Wed, 26 Sep 2018 21:53:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV60WU3NRd298zzZlWnZcJkEatNRtSa0+RRs074bE1wISxyN9cb00HaSrryC0V74XKgEWanjJ X-Received: by 2002:a17:902:82c9:: with SMTP id u9-v6mr8956114plz.138.1538024013194; Wed, 26 Sep 2018 21:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538024013; cv=none; d=google.com; s=arc-20160816; b=S8qoaRNDpWOxET+pkX0sSWf52lboO4QVgSUZH0wtd5iAfPt42oyCXLULlkk+KSnAzF YG9KPBXJAJ+5VG7K14kApkUt2FtcfUbL8KARL+joPx9wdasWZLn2MOW7WCB+Gjud3x/a jYHF6RPW1WL6BS9a5uOM0j1KPznFcMYXpzbNh3k0s2jLFP45lCUNEAPhXz4f8jbK0tiq KUoqo58F0efsudsKO9Mwfdue9u9wwWTV4TNJvcyyXMkelSZImDZmFF+kxTBmYCEvQ2YX iAG4A5zmO2oJIUC/tWKq8L/Ma/GQp6RQNtRTftdMSJ4j477N1u7ctoTg5iKD4dTiaBNg q0mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yrw4MfBRtLOhUTxgvwWOaqkAprtr3dECyP/VPaJU2Io=; b=ZEy45yy/L6+h6BHUyBn1TDS9+l2k4jCV/1afwXBrs+UPgH4rMIIsN8UhHrddsGMiZy Xxi9lrqBEODaVZJr3PwpGpBQU/mqRNHFJu487yB3a+v7nerOThHWSs2jNue0dSrCOPOd c+fR2ae/aNRjjwWh04fDTijND8jYBq/Xb4XOXmd9DzU5Cyl+N5awuQ52sgQZikx2zSC4 ycm0mzLucY8nWU+ZxDIuUKX2U5koNiE/pUglI3JFyrib6lGpGvR63DdIKlXNDfBCf9pA vEA1HbPbGuAvSf6E3u/tvsDr7+gyiL5ZMauqWgfP7rT3jEMDighbv9DZUrTNTYCTCyzC larQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5-v6si911223pgp.678.2018.09.26.21.53.18; Wed, 26 Sep 2018 21:53:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726957AbeI0LJ0 (ORCPT + 99 others); Thu, 27 Sep 2018 07:09:26 -0400 Received: from smtp2200-217.mail.aliyun.com ([121.197.200.217]:46042 "EHLO smtp2200-217.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726641AbeI0LJ0 (ORCPT ); Thu, 27 Sep 2018 07:09:26 -0400 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07437836|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03310;MF=ren_guo@c-sky.com;NM=1;PH=DS;RN=5;RT=5;SR=0;TI=SMTPD_---.CwOr12R_1538023958; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.CwOr12R_1538023958) by smtp.aliyun-inc.com(10.147.44.118); Thu, 27 Sep 2018 12:52:38 +0800 Date: Thu, 27 Sep 2018 12:52:38 +0800 From: Guo Ren To: Mike Rapoport Cc: Andrew Morton , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] csky: fixups after bootmem removal Message-ID: <20180927045237.GA2820@guoren> References: <20180926112744.GC4628@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180926112744.GC4628@rapoport-lnx> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 26, 2018 at 02:27:45PM +0300, Mike Rapoport wrote: > Hi, > > The below patch fixes the bootmem leftovers in csky. It is based on the > current mmots and csky build there fails because of undefined reference to > dma_direct_ops: > > MODPOST vmlinux.o > kernel/dma/mapping.o: In function `dmam_alloc_attrs': > kernel/dma/mapping.c:143: undefined reference to `dma_direct_ops' > kernel/dma/mapping.o: In function `dmam_declare_coherent_memory': > kernel/dma/mapping.c:184: undefined reference to `dma_direct_ops' > mm/dmapool.o: In function `dma_free_attrs': > include/linux/dma-mapping.h:558: undefined reference to `dma_direct_ops' > > I've blindly added "select DMA_DIRECT_OPS" to arch/csky/Kconfig and it > fixed the build, but I really have no idea if this the right thing to do... You are almost right, the issue is come from the patch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=bc3ec75de5452db59b683487867ba562b950708a we need: - select DMA_NONCOHERENT_OPS + select DMA_DIRECT_OPS I'll fixup it in my repo. > From 63c3b24e661e6cad88f0432dd460d35a16741871 Mon Sep 17 00:00:00 2001 > From: Mike Rapoport > Date: Wed, 26 Sep 2018 13:40:13 +0300 > Subject: [PATCH] csky: fixups after bootmem removal > > The bootmem removal patchest didn't take into account csky architecture and > it still had bootmem leftovers. Remove them now. > > Signed-off-by: Mike Rapoport > --- > arch/csky/Kconfig | 1 - > arch/csky/kernel/setup.c | 1 - > arch/csky/mm/highmem.c | 4 ++-- > arch/csky/mm/init.c | 3 +-- > 4 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig > index fb2a0ae..fc25ea6 100644 > --- a/arch/csky/Kconfig > +++ b/arch/csky/Kconfig > @@ -35,7 +35,6 @@ config CSKY > select HAVE_C_RECORDMCOUNT > select HAVE_DMA_API_DEBUG > select HAVE_DMA_CONTIGUOUS > - select HAVE_MEMBLOCK > select MAY_HAVE_SPARSE_IRQ > select MODULES_USE_ELF_RELA if MODULES > select OF > diff --git a/arch/csky/kernel/setup.c b/arch/csky/kernel/setup.c > index 27f9e10..bee4d26 100644 > --- a/arch/csky/kernel/setup.c > +++ b/arch/csky/kernel/setup.c > @@ -3,7 +3,6 @@ > > #include > #include > -#include > #include > #include > #include > diff --git a/arch/csky/mm/highmem.c b/arch/csky/mm/highmem.c > index 149921a..5b90501 100644 > --- a/arch/csky/mm/highmem.c > +++ b/arch/csky/mm/highmem.c > @@ -4,7 +4,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > @@ -138,7 +138,7 @@ static void __init fixrange_init (unsigned long start, unsigned long end, > pmd = (pmd_t *)pud; > for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { > if (pmd_none(*pmd)) { > - pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); > + pte = (pte_t *) memblock_alloc_low(PAGE_SIZE, PAGE_SIZE); > set_pmd(pmd, __pmd(__pa(pte))); > BUG_ON(pte != pte_offset_kernel(pmd, 0)); > } > diff --git a/arch/csky/mm/init.c b/arch/csky/mm/init.c > index fd2791b..46c5aaa 100644 > --- a/arch/csky/mm/init.c > +++ b/arch/csky/mm/init.c > @@ -14,7 +14,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -44,7 +43,7 @@ void __init mem_init(void) > #endif > high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); > > - free_all_bootmem(); > + memblock_free_all(); > > #ifdef CONFIG_HIGHMEM > for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { The patch looks good for me. Thx Guo Ren