Received: by 10.192.165.148 with SMTP id m20csp2524503imm; Sun, 22 Apr 2018 08:50:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+M7Np1sklp+2I1JYltr82QjI4DyOlMH+G4YWterR/fhv6ue9OF6MZlJTauZqDmrPkteH8e X-Received: by 10.101.97.85 with SMTP id o21mr12110911pgv.23.1524412225654; Sun, 22 Apr 2018 08:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412225; cv=none; d=google.com; s=arc-20160816; b=OYEpy+QK8i550Ig6yPQ2Zqca0/9jfoxGTtEj/tviMqLjw3v9F3C54+pYTrcSfmHh8E H7Lihw7Td4DoWuNK3eM1r/HU+z1gmvnaKg5+sddixBVwC7DM5+uH2JBEI58MZOKb234s 9hdI+VeOQkSV1Ithpo19DDq8o145zknclqeA0fI8EnDfzpnSRVJQn7FSFtJcT3eMFo8f vADJdjhmdWbLgE+rrKJXhAtLHcBwGS0UGfpLRi+8LulHNI7g5am+wlSzQdaMxJW0R9BS CJfcMsD8fOXarYvxryP5+Yc9YEaHRS3becCrP0vBcJbeyGG7B4UguJ+JSaFfe3zILj7g ITqQ== 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:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jVu4AZnk93YIqENmC4cfpAtVVZY4As+y90weueFd4BA=; b=E2jga7eMsF0G5iIB7hVe+G2q4bkjF+sCByu59Y9ODRjqJy2kbcm2NzccfkyS+fTFaO th3HVNRJ1vtln0tlXbsRXirmNMZd0YNdd3GfbSkdMlRjuP1xBIxqeujG6Sd0clQ51djb QeE+WecbyvJz/q0utUVx1UBFXbaAa7rZWpWkHjGS3Ohyu9c6mWwUjHgHiU3Md/C5LwQZ MqbuaFaXmY8daCoPH5AUh+2CmKMVIqEDXzW1/FgRH5nvDi8SbWqpmIzoNTfUQJoa4LGl IAUJSHztQvtJo2WG0SXSTmoh6Vwg3J50L6EAtg09WymIxWWN9ZSQsF5d21PAj3HPltLD fqdw== 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 e66-v6si8707720plb.499.2018.04.22.08.50.11; Sun, 22 Apr 2018 08:50:25 -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 S1754888AbeDVPs2 (ORCPT + 99 others); Sun, 22 Apr 2018 11:48:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48032 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753643AbeDVOBh (ORCPT ); Sun, 22 Apr 2018 10:01:37 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C8DA2941; Sun, 22 Apr 2018 14:01:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Toshi Kani , Dan Williams Subject: [PATCH 4.16 126/196] nfit: skip region registration for incomplete control regions Date: Sun, 22 Apr 2018 15:52:26 +0200 Message-Id: <20180422135110.768930335@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Williams commit 0731de476a37c33485af82d64041c9d193208df8 upstream. 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. Cc: Fixes: 1f7df6f88b92 ("libnvdimm, nfit: regions (block-data-window...)") Reviewed-by: Toshi Kani Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/nfit/core.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -2583,7 +2583,7 @@ static int acpi_nfit_init_mapping(struct 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", @@ -2603,15 +2603,14 @@ static int acpi_nfit_init_mapping(struct 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;