Received: by 10.192.165.148 with SMTP id m20csp1087557imm; Wed, 2 May 2018 13:57:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoLfN84DhpmBzT+Lgh1+Uj6LTxpwMXgxwZNHS3eauEfhsUenV2rtNNtqOJgoqxc7DFK+kID X-Received: by 2002:a63:642:: with SMTP id 63-v6mr17194427pgg.10.1525294638098; Wed, 02 May 2018 13:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525294638; cv=none; d=google.com; s=arc-20160816; b=BgpPo66IulcrJGWT0vdPRKNYRlQgUseXWRIx8aqk4xlBrRRr5A9FRN4v+rMJxBFnQD 5wPHPYlYzxN+6i8s46gHBcA7BNtJ+URPau+4PYzVfbl+qCLaRgGVVghqoMUnpb05dlOd IYs26OBWUjaixs1H5RycGD2PVQO9a8KAQsP+VSbXJY13fOIBkckA06YCLTdiil3cIlmS 7/Erd6oG75oJpEeO2lkH1EB1XYLXTZ9MbuI9RTRyLDJMDQSMHvvLUkzDJ4BNbIRzauI5 fEGWrS4AE6cLzQL8EgDmqfCoeUeywLJ1x+3SHMipIxqzkt8kwd2QsHB4lGxn/7SSsws/ IDhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=Yk+wJ/9RjLk1QQvxLuCpPyCmxjY3q5r4CNXWpI356A0=; b=tavGVxYv/cMH7AbJwa2qjj7ZTzbg6ky9JeKoItSxaFY1V0vdIC5kmNmttV+IPst53S Zlj1KDYbW++AJSQOwnMYfxpRMnLZHaC8f+7Z+uJAjBU7nlzbNW0T9rCi5hEgW6iT5zVT 1mN5GPtMJPze7kVrVBkreq09jzIhm5ItZD4VIDuA0dxrXhqYfU1rGZr6KdrCOII+MHaV 3yJ5sqcmIkMfoRZQZwgq7rsYpQzpoTJUimMuxh5JVTNoqwYkYNX0jkzZcrUqWgA0JjKF wc07sA3AjJiJwWcFh32hhuF+ePJqBrUPz4uSqKsB+SAtsacpKWrtjQlmlcwTwPlrP8BS h6oA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14-v6si2865078pll.24.2018.05.02.13.57.03; Wed, 02 May 2018 13:57:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751439AbeEBU4q (ORCPT + 99 others); Wed, 2 May 2018 16:56:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbeEBU4m (ORCPT ); Wed, 2 May 2018 16:56:42 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC9A12820B; Wed, 2 May 2018 20:56:42 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 12E63600C0; Wed, 2 May 2018 20:56:41 +0000 (UTC) From: Jeff Moyer To: Toshi Kani Cc: dan.j.williams@intel.com, stable@vger.kernel.org, Christoph Hellwig , linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org Subject: Re: [PATCH] pmem: fix badblocks population for raw mode References: <20180425161125.8082-1-toshi.kani@hpe.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Wed, 02 May 2018 16:56:41 -0400 In-Reply-To: <20180425161125.8082-1-toshi.kani@hpe.com> (Toshi Kani's message of "Wed, 25 Apr 2018 10:11:25 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 02 May 2018 20:56:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Toshi Kani writes: > pmem_attach_disk() calls nvdimm_badblocks_populate() with resource > range uninitialized in the case of raw mode. This leads the pmem > driver to hit MCE despite of ARS reporting the range bad. > > Initialize 'bb_res' for raw mode. > > Fixes: e8d513483300 ("memremap: change devm_memremap_pages interface to use struct dev_pagemap") > Signed-off-by: Toshi Kani > Cc: Christoph Hellwig > Cc: Dan Williams > Cc: Reviewed-by: Jeff Moyer > --- > drivers/nvdimm/pmem.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c > index 9d714926ecf5..2d7875209bce 100644 > --- a/drivers/nvdimm/pmem.c > +++ b/drivers/nvdimm/pmem.c > @@ -367,9 +367,11 @@ static int pmem_attach_disk(struct device *dev, > addr = devm_memremap_pages(dev, &pmem->pgmap); > pmem->pfn_flags |= PFN_MAP; > memcpy(&bb_res, &pmem->pgmap.res, sizeof(bb_res)); > - } else > + } else { > addr = devm_memremap(dev, pmem->phys_addr, > pmem->size, ARCH_MEMREMAP_PMEM); > + memcpy(&bb_res, res, sizeof(bb_res)); > + } > > /* > * At release time the queue must be frozen before > _______________________________________________ > Linux-nvdimm mailing list > Linux-nvdimm@lists.01.org > https://lists.01.org/mailman/listinfo/linux-nvdimm