Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp7554715pxu; Fri, 25 Dec 2020 19:32:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkfwqZzYduq9cOoBDUNv//Of43QQrbm+P5pHSzbXFjdCmnbwDqJYzmkUqAQsPeePr7cQsH X-Received: by 2002:a17:906:3f8d:: with SMTP id b13mr20318987ejj.464.1608953530709; Fri, 25 Dec 2020 19:32:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608953530; cv=none; d=google.com; s=arc-20160816; b=nmS+X/Id3Ha8QQ52i5HHfWnHJ7/4Yfv7lFV0trNwN1uJcBeKw4lKMVMnVTxl8dx4Kc oJTqt06biei1yjgIGDXujQmuaCtH7B+dW2nDKpQwiLCU5FmpMRu8dXgh7B8jgTQWWwHX lmDWKeWi0kIRoQjW4QiqpK98zOOgCSYOrUvOFWPfz1GTKq2bYKkDDfG/ZXgnspRTr+Kz VNOED2s7EIvNfxwzJTnxpr4DU3mAev86TemKq2aMyZBNAA9Bh6CMlEdRbnviyzJVDA33 UCwjc6GqYRA7dKfXDCpqFtWFYDLJ/+0ewkjRBF18+ttNwPYaKwYWcDKNQL4MdwdTjoUa BHUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WGLI2FrKo9bLJSOPm2t1tqfxDFlvBkgjHPInP606A+0=; b=tUSN+89FAFGu5yC08PXt7v3ojTXPj3HHxYrlfraZscY7ymoAi5i4e74tt/iaSktK6W v414TkB3obIFXWi1mFjVdiN+Qs7hRCzndcYNpzhGDyy8BN8sV7Vi/LKQ9A403VLjBPwD RzaLMFi/xd36Yo279mXvthLlq3x5sB3Vf0f14PxAy1Uc7PtLBz5eSoHGY8fpS+CEArAY /qogXu6qNsMrw/kGFbFSjLPvftQwMsdURi7KAziQy4G4xk6ZrA8YVSs/GLhPopTUAnPz OTZWCm/F3Fj+MQr4OfIKaYx5T/t7wBHcxQUUTkv1QN6pou7ejCP1jKbAeGFU6Y2LU/Bx FOUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si15180095ejg.481.2020.12.25.19.31.22; Fri, 25 Dec 2020 19:32:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728814AbgLZDaU (ORCPT + 99 others); Fri, 25 Dec 2020 22:30:20 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:9932 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725998AbgLZDaT (ORCPT ); Fri, 25 Dec 2020 22:30:19 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4D2q6N177gzhxWb; Sat, 26 Dec 2020 11:29:00 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Sat, 26 Dec 2020 11:29:27 +0800 From: Chen Zhou To: , CC: , , , , , , , , , Subject: [PATCH 2/2] arm64: mm: fix kdump broken with ZONE_DMA reintroduced Date: Sat, 26 Dec 2020 11:35:57 +0800 Message-ID: <20201226033557.116251-3-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201226033557.116251-1-chenzhou10@huawei.com> References: <20201226033557.116251-1-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the memory reserved for crash dump kernel falled in ZONE_DMA32, the devices in crash dump kernel need to use ZONE_DMA will alloc fail. Fix this by reserving low memory in ZONE_DMA if CONFIG_ZONE_DMA is enabled, otherwise, reserving in ZONE_DMA32. Fixes: bff3b04460a8 ("arm64: mm: reserve CMA and crashkernel in ZONE_DMA32") Signed-off-by: Chen Zhou --- arch/arm64/mm/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 7b9809e39927..5074e945f1a6 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -85,7 +85,8 @@ static void __init reserve_crashkernel(void) if (crash_base == 0) { /* Current arm64 boot protocol requires 2MB alignment */ - crash_base = memblock_find_in_range(0, arm64_dma32_phys_limit, + crash_base = memblock_find_in_range(0, + arm64_dma_phys_limit ? : arm64_dma32_phys_limit, crash_size, SZ_2M); if (crash_base == 0) { pr_warn("cannot allocate crashkernel (size:0x%llx)\n", -- 2.20.1