From patchwork Thu Nov 19 01:57:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 328374 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp31430ils; Wed, 18 Nov 2020 18:07:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZwtzJpKd9RvAGrJjznVXQfLZua7g7rpUU1v6ls1cpzmzmhhhSVtTAbSWPxBMgprd1+Uub X-Received: by 2002:a17:906:82d9:: with SMTP id a25mr26108710ejy.101.1605751630509; Wed, 18 Nov 2020 18:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605751630; cv=none; d=google.com; s=arc-20160816; b=odesVAykJQvBFAcX6IPhZsdF10RiTObKb8jc0zpqfTKoviqilyyUrRflQyjVrhEhk/ QfXO9NP2mQAhcQUhAgfMYyNwbpgXb9ApelMgm7hChnifd1lPc63d9Affbdw9N2LWJ/2N HYGEIMf0KhRL1Qy647Cebk9l028T1M7I7/BZU2GOVaIWCRdIoG5evPJA219uXmI8lZly JHEJNJYH4GZ3OKs07wGpBu9Lr1rsz1P7fkHW2YLt2mlYdFfc/d1KazQBHL6Oro9i2+Hn POy7IIwNcBcgFWmc2OI7rdCJbtQUJbiINm+/PqAxPpGK3WOuHWUIQp1InSMaQvtIQyp+ gQSg== 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=Q3odPMdykJRZZM9UzR1gyrv+Ta2ekWhmj+tYIBiPjrI=; b=QgPZtN5qLvEvrUCTe+vafZNZnajZcyUhiuzjqDg8mrL/WR4bKaQY5s9+ZvcwRojHl7 ui5ckQbtZaGrexJbnLIUokv/voUZ7w4/R+QhGjAo3JD81MSyC8GOlbfusCPeuMYEwcvg BTjd+tv0yrnw7MH1zwJkrCDnUk1fBSg9J0VzXtBqA1kj5kBQGcaKtrP2eOy72eLlkU16 1ztsy9x34dWvg67WryWL362GqkXkbpHgXWZSwXZHzXzFWpPT5oQaA/ozuINpyX4ofITR IQtRh13x9JqyIKvseE3fTVUKtnu8c3jexqUv8bwlOMOFI2OtvRB8rHel4BclAaeetvOb AkcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-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 ga12si18269361ejc.14.2020.11.18.18.07.10; Wed, 18 Nov 2020 18:07:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726098AbgKSCFm (ORCPT + 5 others); Wed, 18 Nov 2020 21:05:42 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7650 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbgKSCFl (ORCPT ); Wed, 18 Nov 2020 21:05:41 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cc3102Kh8z15KNh; Thu, 19 Nov 2020 10:05:24 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.176.144) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Thu, 19 Nov 2020 10:05:31 +0800 From: Zhen Lei To: Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , "Rafael J . Wysocki" , Len Brown , linux-nvdimm , linux-acpi , linux-kernel CC: Zhen Lei Subject: [PATCH v2 1/1] acpi/nfit: fix badrange insertion in nfit_handle_mce() Date: Thu, 19 Nov 2020 09:57:46 +0800 Message-ID: <20201119015746.1990-2-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 In-Reply-To: <20201119015746.1990-1-thunder.leizhen@huawei.com> References: <20201119015746.1990-1-thunder.leizhen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.174.176.144] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Make sure the badrange to be reported can always cover mce->addr. Fixes: 9ffd6350a103 ("nfit: don't start a full scrub by default for an MCE") Signed-off-by: Zhen Lei Reviewed-by: Vishal Verma --- drivers/acpi/nfit/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.0.106.g9fadedd diff --git a/drivers/acpi/nfit/mce.c b/drivers/acpi/nfit/mce.c index ee8d9973f60b..053e719c7bea 100644 --- a/drivers/acpi/nfit/mce.c +++ b/drivers/acpi/nfit/mce.c @@ -63,7 +63,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, /* If this fails due to an -ENOMEM, there is little we can do */ nvdimm_bus_add_badrange(acpi_desc->nvdimm_bus, - ALIGN(mce->addr, L1_CACHE_BYTES), + ALIGN_DOWN(mce->addr, L1_CACHE_BYTES), L1_CACHE_BYTES); nvdimm_region_notify(nfit_spa->nd_region, NVDIMM_REVALIDATE_POISON);