From patchwork Tue Apr 23 22:47:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 10913793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21E5A922 for ; Tue, 23 Apr 2019 22:49:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EF902887A for ; Tue, 23 Apr 2019 22:49:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0017328924; Tue, 23 Apr 2019 22:49:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDD432887A for ; Tue, 23 Apr 2019 22:49:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728627AbfDWWtd (ORCPT ); Tue, 23 Apr 2019 18:49:33 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:36973 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728594AbfDWWtc (ORCPT ); Tue, 23 Apr 2019 18:49:32 -0400 Received: by mail-lf1-f68.google.com with SMTP id h126so2367687lfh.4; Tue, 23 Apr 2019 15:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FrbxXCzbduE6bxqzUV5O8VcSJ/8bNCEge0K7+QXqWcw=; b=C5Z0Eri1E/MgiwW5s2hJ0I1+mpTOAalvY1gdEQyVcQyh4k+SOdcbvwPxE/PwmN+QEI 6L5RaXXhRNFfMEXXelOg9V8ff+GNNUNB5C40hqDz4G3Q8Djt0uRDxI/WKSP1cFdit0PI fUlugbB+qa0GPzP4IFVCeqRQV/h8ikqJ8erozIB8Ox/8stkwW3YGwHHuv0vjfGFOurMw ryncVMimSMKti+L1l0/QyZufwrnCCDY+aMc3X0oGHwajcD6vwD/0GidUyJwf1A1OPpqs 6x84dc+Z39ecs9vxLaVKwJospMybQWYrIoUmyohkvCAo8y4mDNYX9qZiF4rKrdic6hUi hqyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FrbxXCzbduE6bxqzUV5O8VcSJ/8bNCEge0K7+QXqWcw=; b=Cy9wh4o1vzU1fQMt8WDaDiCwjt2zro2KDcorfi8q2hzGqwlVZzWN3i8cK3fKbFMNIE ELojqGAKAKk3/PdoPCS1KqfdUt04SXBT66mhIcTRSgHuayXUY1DD9VDTGgWk4KB7m9iG /J65sa/G3aNaPjnrjF/LcfqOYmevOXS6swYX8fNtafB1rCviNoT5pn4Iq282JDFzPTaA DHK9JagLrNi7cnLeM4kpN+/m6V/m9h58X+foaa7vRg1hHyfvqyJHk3AsG+oO64KgcgPu BvbosEAOyP1YvN0OHuEqm6IeXH4SGl86DYZqe0tqfx0a5IyI33XT5G74Cw44THBjtIgv YcYg== X-Gm-Message-State: APjAAAUmTvFxl6mLEBo1YGfoRhdnBtZu9IWb1mQYDxDl/60kwkGSPrbN U54HUEe9TPczdAaQVaVidCU= X-Google-Smtp-Source: APXvYqyCSnXCGC9FnalNaC5sKIc9QmhN7maCues08BcUfbwk7TStnH3zAzRnlwt60y5xL5hD2JrT3w== X-Received: by 2002:ac2:51a1:: with SMTP id f1mr7455057lfk.129.1556059770067; Tue, 23 Apr 2019 15:49:30 -0700 (PDT) Received: from localhost.localdomain ([5.164.240.123]) by smtp.gmail.com with ESMTPSA id w2sm4904722lfa.63.2019.04.23.15.49.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 15:49:29 -0700 (PDT) From: Serge Semin To: Ralf Baechle , Paul Burton , James Hogan , Matt Redfearn , Mike Rapoport , Andrew Morton , Michal Hocko , Greg Kroah-Hartman , Thomas Bogendoerfer , Huacai Chen , Stefan Agner , Stephen Rothwell , Alexandre Belloni , Juergen Gross Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Serge Semin Subject: [PATCH 05/12] mips: Discard post-CMA-init foreach loop Date: Wed, 24 Apr 2019 01:47:41 +0300 Message-Id: <20190423224748.3765-6-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190423224748.3765-1-fancer.lancer@gmail.com> References: <20190423224748.3765-1-fancer.lancer@gmail.com> MIME-Version: 1.0 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Really the loop is pointless, since it walks over memblock-reserved memory regions and mark them as reserved in memblock. Before bootmem was removed from the kernel, this loop had been used to map the memory reserved by CMA into the legacy bootmem allocator. But now the early memory allocator is memblock, which is used by CMA for reservation, so we don't need any mapping anymore. Reviewed-by: Matt Redfearn Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index f71a7d32a687..2ae6b02b948f 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -708,7 +708,6 @@ static void __init request_crashkernel(struct resource *res) */ static void __init arch_mem_init(char **cmdline_p) { - struct memblock_region *reg; extern void plat_mem_setup(void); /* @@ -814,10 +813,6 @@ static void __init arch_mem_init(char **cmdline_p) plat_swiotlb_setup(); dma_contiguous_reserve(PFN_PHYS(max_low_pfn)); - /* Tell bootmem about cma reserved memblock section */ - for_each_memblock(reserved, reg) - if (reg->size != 0) - memblock_reserve(reg->base, reg->size); reserve_bootmem_region(__pa_symbol(&__nosave_begin), __pa_symbol(&__nosave_end)); /* Reserve for hibernation */