Received: by 10.213.65.68 with SMTP id h4csp369298imn; Wed, 21 Mar 2018 21:52:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELtmPLk1fA/VPptMvNuWayHcMAngGFYZzpGcpvPtX0lF8ARMxKnJ9nDOoboqY/rPDB87eCAx X-Received: by 2002:a17:902:b7cc:: with SMTP id v12-v6mr7931782plz.237.1521694367834; Wed, 21 Mar 2018 21:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521694367; cv=none; d=google.com; s=arc-20160816; b=zl5p3y1O5LggWPxnhlqbfJLwO0ANa14o+3WrgoEmKfCyy6gj+jNC7XT60SJe6Wz6Il bb6BmAZxl1AD7FIDALpNbnsrfd6bGqUoL/SMPPWcXXnwntztwCa/mrRYH0yRLrMo4qSP IVgg1CCQ6CqgYvnYjCl0tCDHSlUaIbU35Rmoz+/g29mbYx77Qwj7y0xwvs0EKo/NsXfX y8h5S+C9/Km/E8PJ11uIxpGt2+PT89yt1JBB7lhSlr1aaDZRBpKVzK5o/Jmax+0bZKRl Y0XJgotxvg44LEn5CChoNi0yOPkZKIML8XosTDGb0aA5pkdXMIUX5fnbaJN/y2Ubrw6r 9H9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject :arc-authentication-results; bh=0jgK1HcMJv9q88LvH6Y2eHWO8MCKPzAZjYXtPfxYny8=; b=ungXkvshey1KVBw08grwiXOqwF+zkAInXX1rQBwq2UIEKSn9ANheB7cr2LVERDpI24 DDh2/6rxX1oeBhsgoF2gXE0ICqR3aI9CM1Hwqaa/k4B6eu7PtMKjd9pv/4w5jiVq6gQn CaviW2hs1gn/u6bSitMfsRflYco+ExpLIuN+w2zejDOISK3SypFEEkH8+R4QVY4tHEk1 f1I55b1S22RoOoPhs+V2Q1djhdr8VhJ6+CccsbHVJGGWCYGJuYVitAbJSC0YYpa2J2FD sCixVk9uwsHdkh5lMI78tDEx0TmOjTKOy4aGjmonOEydD9NvEMVNhPEmFN2V9Khq3OJg nJDA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1-v6si5230334pls.673.2018.03.21.21.52.33; Wed, 21 Mar 2018 21:52:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752169AbeCVEvc (ORCPT + 99 others); Thu, 22 Mar 2018 00:51:32 -0400 Received: from mga18.intel.com ([134.134.136.126]:32738 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbeCVEva (ORCPT ); Thu, 22 Mar 2018 00:51:30 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2018 21:51:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,342,1517904000"; d="scan'208";a="210324753" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga005.jf.intel.com with ESMTP; 21 Mar 2018 21:51:29 -0700 Subject: [PATCH] nfit: skip region registration for incomplete control regions From: Dan Williams To: linux-nvdimm@lists.01.org Cc: linux-acpi@vger.kernel.org, ross.zwisler@linux.intel.com, linux-kernel@vger.kernel.org Date: Wed, 21 Mar 2018 21:42:24 -0700 Message-ID: <152169374458.19742.14326187212131249042.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Per the ACPI specification the only functional purpose for a DIMM Control Region to be mapped into the system physical address space, from an OSPM perspective, is to support block-apertures. However, there are some BIOSen that publish DIMM Control Region SPA entries for pre-boot environment consumption. Undo the kernel policy of generating disabled 'ndblk' regions when this configuration is detected. Signed-off-by: Dan Williams --- drivers/acpi/nfit/core.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 39ad06143e78..4530d89044db 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2578,7 +2578,7 @@ static int acpi_nfit_init_mapping(struct acpi_nfit_desc *acpi_desc, struct acpi_nfit_system_address *spa = nfit_spa->spa; struct nd_blk_region_desc *ndbr_desc; struct nfit_mem *nfit_mem; - int blk_valid = 0, rc; + int rc; if (!nvdimm) { dev_err(acpi_desc->dev, "spa%d dimm: %#x not found\n", @@ -2598,15 +2598,14 @@ static int acpi_nfit_init_mapping(struct acpi_nfit_desc *acpi_desc, if (!nfit_mem || !nfit_mem->bdw) { dev_dbg(acpi_desc->dev, "spa%d %s missing bdw\n", spa->range_index, nvdimm_name(nvdimm)); - } else { - mapping->size = nfit_mem->bdw->capacity; - mapping->start = nfit_mem->bdw->start_address; - ndr_desc->num_lanes = nfit_mem->bdw->windows; - blk_valid = 1; + break; } + mapping->size = nfit_mem->bdw->capacity; + mapping->start = nfit_mem->bdw->start_address; + ndr_desc->num_lanes = nfit_mem->bdw->windows; ndr_desc->mapping = mapping; - ndr_desc->num_mappings = blk_valid; + ndr_desc->num_mappings = 1; ndbr_desc = to_blk_region_desc(ndr_desc); ndbr_desc->enable = acpi_nfit_blk_region_enable; ndbr_desc->do_io = acpi_desc->blk_do_io;