Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3025088ima; Sun, 3 Feb 2019 11:43:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IYWdywasmDvm14smcoOjRmqZm+vSmHhClhM3ylT/78sOQmEuE7/3maWR1zVdfhM5mGEjNoB X-Received: by 2002:a65:6094:: with SMTP id t20mr10282884pgu.285.1549223019109; Sun, 03 Feb 2019 11:43:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549223019; cv=none; d=google.com; s=arc-20160816; b=wQT3G6clFKRYWjjtRxpF0kVuX34vsBumZ7kWZQZn4lgRw/N5BVmfKRuaVCek/0J90K emlR7YH3nIAM437DMn2H3ZZpZuPK5zC14UXb+jqmDLb/mziDNf6rYG1W1qp/+yCvWMo0 mCNvTu/BxLod/3KXdfZa6t1dvctqEVTdSM/l6KrUSxVBZsHdSppgwu5wPweHg1VTVCbi jVzsGgmrYOn0e72QhPlFHrGFDVkOVMgYRIjuaIEN7Y4N1cbkEb90hRt7zNw6fGQaLVij rp56H9KSXqv9wm8TXVIPxYTa/cmUZ+xWARWCA9IvW71NGt0c1d9ggnio84AinmL0rewM 0e1w== 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:references:in-reply-to:message-id:date:cc:to:from :subject; bh=AWyR/YXLAVddkTzvLMPwZU1nDn8AhHyuoTSRnFuR0C8=; b=i7F2y1e7ZZzUKPZDz/S9eXtgeXoj7uKXj0+bgzFFJIXo/WsyRjZcUkZUZBEjpqmZJp IJs0sUkRd5G4TRPyKJhCqAcbkCuQ8yuATXUakxsMB/eZ8f7jo4ZvClnyHgx4geOr4ael 7pMOYkue+PwGSreJ8fvf22rXb64xnixw87WIVQAk4QGp9rK2si7xBL79Ujvjms9KwgVW BftAM+QwcYdtkdTKH8UDAOOHoejJy/bzGZ7tqXx+gv4Ad+zfVLAEB3kpJqzVJKdb2SIv x/gpIwISGKX1bIzmq47AC90cGSxg+iQ38axXHOWYuKO6DuEQEszCYG3c1F84SMLAiuIV IdAQ== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si13602582pgd.117.2019.02.03.11.43.23; Sun, 03 Feb 2019 11:43:39 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727629AbfBCTl2 (ORCPT + 99 others); Sun, 3 Feb 2019 14:41:28 -0500 Received: from mga04.intel.com ([192.55.52.120]:28844 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726577AbfBCTl2 (ORCPT ); Sun, 3 Feb 2019 14:41:28 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2019 11:41:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,557,1539673200"; d="scan'208";a="112106341" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga007.jf.intel.com with ESMTP; 03 Feb 2019 11:41:27 -0800 Subject: [PATCH] acpi/nfit: Require opt-in for read-only label configurations From: Dan Williams To: linux-nvdimm@lists.01.org Cc: Dexuan Cui , linux-kernel@vger.kernel.org Date: Sun, 03 Feb 2019 11:28:50 -0800 Message-ID: <154922213038.3561630.15221922065373676874.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: References: 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 Recent fixes to command handling enabled Linux to read label configurations that it could not before. Unfortunately that means that configurations that were operating in label-less mode will be broken as the kernel ignores the existing namespace configuration and tries to honor the new found labels. Fortunately this seems limited to a case where Linux can quirk the behavior and maintain the existing label-less semantics by default. When the platform does not emit an _LSW method, disable all label access methods. Provide a 'force_labels' module parameter to allow read-only label operation. Fixes: 11189c1089da ("acpi/nfit: Fix command-supported detection") Reported-by: Dexuan Cui Signed-off-by: Dan Williams --- drivers/acpi/nfit/core.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 811c399a3a76..5b5e802de7b8 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -56,6 +56,10 @@ static bool no_init_ars; module_param(no_init_ars, bool, 0644); MODULE_PARM_DESC(no_init_ars, "Skip ARS run at nfit init time"); +static bool force_labels; +module_param(force_labels, bool, 0444); +MODULE_PARM_DESC(force_labels, "Opt-in to labels despite missing methods"); + LIST_HEAD(acpi_descs); DEFINE_MUTEX(acpi_desc_lock); @@ -1916,6 +1920,19 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, dev_dbg(dev, "%s: has _LSW\n", dev_name(&adev_dimm->dev)); set_bit(NFIT_MEM_LSW, &nfit_mem->flags); } + + /* + * Quirk read-only label configurations to preserve + * access to label-less namespaces by default. + */ + if (!test_bit(NFIT_MEM_LSW, &nfit_mem->flags) + && !force_labels) { + dev_dbg(dev, "%s: No _LSW, disable labels\n", + dev_name(&adev_dimm->dev)); + clear_bit(NFIT_MEM_LSR, &nfit_mem->flags); + } else + dev_dbg(dev, "%s: Force enable labels\n", + dev_name(&adev_dimm->dev)); } populate_shutdown_status(nfit_mem);