From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FB72C43214 for ; Wed, 11 Aug 2021 15:35:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E8D160F11 for ; Wed, 11 Aug 2021 15:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233122AbhHKPgD (ORCPT ); Wed, 11 Aug 2021 11:36:03 -0400 Received: from mail-vs1-f42.google.com ([209.85.217.42]:42700 "EHLO mail-vs1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233010AbhHKPgC (ORCPT ); Wed, 11 Aug 2021 11:36:02 -0400 Received: by mail-vs1-f42.google.com with SMTP id k24so1764345vsg.9; Wed, 11 Aug 2021 08:35:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qe0iSj8XpU18YU856j4Cl+K1mgU1eag6gHjOJIBodYU=; b=NxbMnEOENBHaXg4NMprVdhDf6hm/iv8kojr90GBi/mZJvHW2UBFe3kuT37cSCMFpOJ WSKTIZrLDfHkr3TCElHHczCSfqT94Kl8POn7qJ0H8q4XD+QeFIVI7O5D/ASitH+1RsVz ImwdIRcCp1UJetSE/xdF/uDTnW6WoN0evVQbWoBYLEcLzF4rJUGNwJa/uP9naCWVfW+B 5C7uFG3wWW+2dYv59oZRPPhbDzgWUUYfWyNbf5SDQtHLCFUPjH8pekxT2uziRhGOcxTy PkPqp8ozJMKO2RWf6QFF4q7HbJu1awxrLDiqUidDKLSAugYQYAd9RxKGw4jsRdErdNsf NdNQ== X-Gm-Message-State: AOAM532FKs2F8dhaSJE9z8LbThpgml7plQ1eXadzYFJKB/UZW59xx9Vq MxkfEDSVkqERhRomXeWlr5HDusICQEN7n/4Yzos= X-Google-Smtp-Source: ABdhPJyCg7XeMMJOVeEoBRA0hgH3tr2A9kDf4d5be/Soj53sLrczZ+iXFRzYK6VNuP5kM7qaaKYjO/TzUNz0MI9TmgQ= X-Received: by 2002:a67:8009:: with SMTP id b9mr27769636vsd.18.1628696137555; Wed, 11 Aug 2021 08:35:37 -0700 (PDT) MIME-Version: 1.0 References: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> In-Reply-To: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> From: Geert Uytterhoeven Date: Wed, 11 Aug 2021 17:35:26 +0200 Message-ID: Subject: Re: [PATCH v5 1/9] MIPS: Avoid future duplicate elf core header reservation To: Thomas Bogendoerfer Cc: Russell King , Rob Herring , Nicolas Pitre , Ard Biesheuvel , Linus Walleij , Catalin Marinas , Will Deacon , Nick Kossifidis , Paul Walmsley , Palmer Dabbelt , Albert Ou , Frank Rowand , Dave Young , Baoquan He , Vivek Goyal , Mike Rapoport , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , "open list:BROADCOM NVRAM DRIVER" , linux-riscv , kexec@lists.infradead.org, Linux-Renesas , Linux Kernel Mailing List , Geert Uytterhoeven Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 11, 2021 at 10:51 AM Geert Uytterhoeven wrote: > Prepare for early_init_fdt_scan_reserved_mem() reserving the memory > occupied by an elf core header described in the device tree. > As arch_mem_init() calls early_init_fdt_scan_reserved_mem() before > mips_reserve_vmcore(), the latter needs to check if the memory has > already been reserved before. > > Note that mips_reserve_vmcore() cannot just be removed, as not all MIPS > systems use DT. > > Signed-off-by: Geert Uytterhoeven > --- > v5: > - New. > --- > arch/mips/kernel/setup.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index 23a140327a0bac1b..4693add05743d78b 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -429,7 +429,8 @@ static void __init mips_reserve_vmcore(void) > pr_info("Reserving %ldKB of memory at %ldKB for kdump\n", > (unsigned long)elfcorehdr_size >> 10, (unsigned long)elfcorehdr_addr >> 10); > > - memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > + if (!memblock_is_region_reserved(elfcorehdr_addr, elfcorehdr_size) As pointed out by lkp, there's a closing parenthesis missing. /me hides back under his rock. > + memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > #endif Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BDE6C4338F for ; Wed, 11 Aug 2021 15:36:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5532760EB9 for ; Wed, 11 Aug 2021 15:36:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5532760EB9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KIokh3KXt0A4G/pXq/a2NHe4vJS1unpqBUigkr4YL+0=; b=3nBiScHoVsuC/T QUSr7DoIAJL7h5b1T3lkFwNaAz/86cfuPryezY0fMbbDWtcFQb6pohfnYafE4BxwAbLxfIahb8Ko9 1BWLGRGCrZfeLezRLC+QoMBAkMwQyjo+YnbA7/LSDUvziPW281qyxwvrCFasFuk69Bj5Y8X9UBZop hI5F926lA0AzBUuhrg1NUEsCmGZg8Td5du3aXfxeEF33KEgLJql1xzmgJeIJPkyrF0bqFBuWgQeWo 6tDxaSPq4FuQxIMbwzj4xXRDOpaDn8g/6whaGdkb7FX5BzU7yq/NBvbBh7hkk0uLdvl3jgeozGiO5 +6xiHIJ8lICKTLwik+RA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqGl-007YuR-Tj; Wed, 11 Aug 2021 15:35:51 +0000 Received: from mail-vs1-f52.google.com ([209.85.217.52]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqGY-007YsU-GE; Wed, 11 Aug 2021 15:35:39 +0000 Received: by mail-vs1-f52.google.com with SMTP id a8so1786308vsl.4; Wed, 11 Aug 2021 08:35:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qe0iSj8XpU18YU856j4Cl+K1mgU1eag6gHjOJIBodYU=; b=P8ioM/6aS+6ZSBGhiyt7akiAuJiSscZnECxNbEKOaRe0gagNrlxWqqo4QDdc7RsdJP BLpXrhWoq+EaAShoOU5kDyM55CgSdfeWI5/TRHb3SsG8dj34IA6Ggrs49BhspKqylETg SF59HHaSoW+k00/svX2D9tOR+3+A2WWLF97t6v+sysP/p5q+tEoH78lMzxhp5BldD1Ml QjFMKBVVhVDbwEKBSNkHHdahBmE1cgFKVbgaOYchpdjc3F6hClR61Tg5CE0Kv/sC+ZH6 2umTtefZlItt3OO8lpf6lM9BA5tOwIfM2+EOmT3iTucaMxR3tlS7Kw/qILwek9zncgWy eOHw== X-Gm-Message-State: AOAM530Yff/apTAUomU5Qb8KubcDs7waA6OBbYzPujC47p2Pkl3fVDVh kcsLM87n6Ui99fRji43IXuR90SLYchGjcAJgR3M= X-Google-Smtp-Source: ABdhPJyCg7XeMMJOVeEoBRA0hgH3tr2A9kDf4d5be/Soj53sLrczZ+iXFRzYK6VNuP5kM7qaaKYjO/TzUNz0MI9TmgQ= X-Received: by 2002:a67:8009:: with SMTP id b9mr27769636vsd.18.1628696137555; Wed, 11 Aug 2021 08:35:37 -0700 (PDT) MIME-Version: 1.0 References: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> In-Reply-To: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> From: Geert Uytterhoeven Date: Wed, 11 Aug 2021 17:35:26 +0200 Message-ID: Subject: Re: [PATCH v5 1/9] MIPS: Avoid future duplicate elf core header reservation To: Thomas Bogendoerfer Cc: Russell King , Rob Herring , Nicolas Pitre , Ard Biesheuvel , Linus Walleij , Catalin Marinas , Will Deacon , Nick Kossifidis , Paul Walmsley , Palmer Dabbelt , Albert Ou , Frank Rowand , Dave Young , Baoquan He , Vivek Goyal , Mike Rapoport , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , "open list:BROADCOM NVRAM DRIVER" , linux-riscv , kexec@lists.infradead.org, Linux-Renesas , Linux Kernel Mailing List , Geert Uytterhoeven X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_083538_580745_A4D686EA X-CRM114-Status: GOOD ( 29.64 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Aug 11, 2021 at 10:51 AM Geert Uytterhoeven wrote: > Prepare for early_init_fdt_scan_reserved_mem() reserving the memory > occupied by an elf core header described in the device tree. > As arch_mem_init() calls early_init_fdt_scan_reserved_mem() before > mips_reserve_vmcore(), the latter needs to check if the memory has > already been reserved before. > > Note that mips_reserve_vmcore() cannot just be removed, as not all MIPS > systems use DT. > > Signed-off-by: Geert Uytterhoeven > --- > v5: > - New. > --- > arch/mips/kernel/setup.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index 23a140327a0bac1b..4693add05743d78b 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -429,7 +429,8 @@ static void __init mips_reserve_vmcore(void) > pr_info("Reserving %ldKB of memory at %ldKB for kdump\n", > (unsigned long)elfcorehdr_size >> 10, (unsigned long)elfcorehdr_addr >> 10); > > - memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > + if (!memblock_is_region_reserved(elfcorehdr_addr, elfcorehdr_size) As pointed out by lkp, there's a closing parenthesis missing. /me hides back under his rock. > + memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > #endif Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78B20C4338F for ; Wed, 11 Aug 2021 15:38:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E529460F46 for ; Wed, 11 Aug 2021 15:38:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E529460F46 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OUbyIQGQrwTOcv9PkeCU6rbUUa/Y9YS9KedtV2PGGEg=; b=W1YiBn1OVK/xNh qJhgK+tDX1E/0Gmmu0P0D2fhYH/lq9MfRtG9/lzjR2wKO37oqUKCd+3i8kVlxH1osjT77ARUZKk3/ x3fSbMl0MQHL7TsRtx0XmKLSjiNwXg6iMrfsha91OdiTQXAQf0dAVUch5Oph3Ronye7MxySQla7XM 61mAxCnUSVlf+c+B6h2sZ3EV4picGr3cto/lrI+3w5LOztYrltHEjLbUo/vBaQ3QATaXBQo6QlHqv PzABJ21BGAA+zAb/jCgXGxqdNJdhOJnlOLMp5g/3aUJiQJGnRandWQOKcHZTfhwcoJadjD9V9vvl4 Z2bGEFdvDXxENGWQMvLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqGc-007YtX-FV; Wed, 11 Aug 2021 15:35:42 +0000 Received: from mail-vs1-f52.google.com ([209.85.217.52]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDqGY-007YsU-GE; Wed, 11 Aug 2021 15:35:39 +0000 Received: by mail-vs1-f52.google.com with SMTP id a8so1786308vsl.4; Wed, 11 Aug 2021 08:35:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qe0iSj8XpU18YU856j4Cl+K1mgU1eag6gHjOJIBodYU=; b=P8ioM/6aS+6ZSBGhiyt7akiAuJiSscZnECxNbEKOaRe0gagNrlxWqqo4QDdc7RsdJP BLpXrhWoq+EaAShoOU5kDyM55CgSdfeWI5/TRHb3SsG8dj34IA6Ggrs49BhspKqylETg SF59HHaSoW+k00/svX2D9tOR+3+A2WWLF97t6v+sysP/p5q+tEoH78lMzxhp5BldD1Ml QjFMKBVVhVDbwEKBSNkHHdahBmE1cgFKVbgaOYchpdjc3F6hClR61Tg5CE0Kv/sC+ZH6 2umTtefZlItt3OO8lpf6lM9BA5tOwIfM2+EOmT3iTucaMxR3tlS7Kw/qILwek9zncgWy eOHw== X-Gm-Message-State: AOAM530Yff/apTAUomU5Qb8KubcDs7waA6OBbYzPujC47p2Pkl3fVDVh kcsLM87n6Ui99fRji43IXuR90SLYchGjcAJgR3M= X-Google-Smtp-Source: ABdhPJyCg7XeMMJOVeEoBRA0hgH3tr2A9kDf4d5be/Soj53sLrczZ+iXFRzYK6VNuP5kM7qaaKYjO/TzUNz0MI9TmgQ= X-Received: by 2002:a67:8009:: with SMTP id b9mr27769636vsd.18.1628696137555; Wed, 11 Aug 2021 08:35:37 -0700 (PDT) MIME-Version: 1.0 References: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> In-Reply-To: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> From: Geert Uytterhoeven Date: Wed, 11 Aug 2021 17:35:26 +0200 Message-ID: Subject: Re: [PATCH v5 1/9] MIPS: Avoid future duplicate elf core header reservation To: Thomas Bogendoerfer Cc: Russell King , Rob Herring , Nicolas Pitre , Ard Biesheuvel , Linus Walleij , Catalin Marinas , Will Deacon , Nick Kossifidis , Paul Walmsley , Palmer Dabbelt , Albert Ou , Frank Rowand , Dave Young , Baoquan He , Vivek Goyal , Mike Rapoport , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , "open list:BROADCOM NVRAM DRIVER" , linux-riscv , kexec@lists.infradead.org, Linux-Renesas , Linux Kernel Mailing List , Geert Uytterhoeven X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_083538_580745_A4D686EA X-CRM114-Status: GOOD ( 29.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 11, 2021 at 10:51 AM Geert Uytterhoeven wrote: > Prepare for early_init_fdt_scan_reserved_mem() reserving the memory > occupied by an elf core header described in the device tree. > As arch_mem_init() calls early_init_fdt_scan_reserved_mem() before > mips_reserve_vmcore(), the latter needs to check if the memory has > already been reserved before. > > Note that mips_reserve_vmcore() cannot just be removed, as not all MIPS > systems use DT. > > Signed-off-by: Geert Uytterhoeven > --- > v5: > - New. > --- > arch/mips/kernel/setup.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index 23a140327a0bac1b..4693add05743d78b 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -429,7 +429,8 @@ static void __init mips_reserve_vmcore(void) > pr_info("Reserving %ldKB of memory at %ldKB for kdump\n", > (unsigned long)elfcorehdr_size >> 10, (unsigned long)elfcorehdr_addr >> 10); > > - memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > + if (!memblock_is_region_reserved(elfcorehdr_addr, elfcorehdr_size) As pointed out by lkp, there's a closing parenthesis missing. /me hides back under his rock. > + memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > #endif Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: MIME-Version: 1.0 References: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> In-Reply-To: <92b6718f5618d5469f67b48fbea189cca0c12f4b.1628670468.git.geert+renesas@glider.be> From: Geert Uytterhoeven Date: Wed, 11 Aug 2021 17:35:26 +0200 Message-ID: Subject: Re: [PATCH v5 1/9] MIPS: Avoid future duplicate elf core header reservation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Thomas Bogendoerfer Cc: Russell King , Rob Herring , Nicolas Pitre , Ard Biesheuvel , Linus Walleij , Catalin Marinas , Will Deacon , Nick Kossifidis , Paul Walmsley , Palmer Dabbelt , Albert Ou , Frank Rowand , Dave Young , Baoquan He , Vivek Goyal , Mike Rapoport , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , "open list:BROADCOM NVRAM DRIVER" , linux-riscv , kexec@lists.infradead.org, Linux-Renesas , Linux Kernel Mailing List , Geert Uytterhoeven On Wed, Aug 11, 2021 at 10:51 AM Geert Uytterhoeven wrote: > Prepare for early_init_fdt_scan_reserved_mem() reserving the memory > occupied by an elf core header described in the device tree. > As arch_mem_init() calls early_init_fdt_scan_reserved_mem() before > mips_reserve_vmcore(), the latter needs to check if the memory has > already been reserved before. > > Note that mips_reserve_vmcore() cannot just be removed, as not all MIPS > systems use DT. > > Signed-off-by: Geert Uytterhoeven > --- > v5: > - New. > --- > arch/mips/kernel/setup.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index 23a140327a0bac1b..4693add05743d78b 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -429,7 +429,8 @@ static void __init mips_reserve_vmcore(void) > pr_info("Reserving %ldKB of memory at %ldKB for kdump\n", > (unsigned long)elfcorehdr_size >> 10, (unsigned long)elfcorehdr_addr >> 10); > > - memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > + if (!memblock_is_region_reserved(elfcorehdr_addr, elfcorehdr_size) As pointed out by lkp, there's a closing parenthesis missing. /me hides back under his rock. > + memblock_reserve(elfcorehdr_addr, elfcorehdr_size); > #endif Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec