From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760119AbcCEAqu (ORCPT ); Fri, 4 Mar 2016 19:46:50 -0500 Received: from mga09.intel.com ([134.134.136.24]:9336 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759049AbcCEAqt (ORCPT ); Fri, 4 Mar 2016 19:46:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,538,1449561600"; d="scan'208";a="60163445" Subject: [PATCH] nfit: Continue init even if ARS commands are unimplemented From: Dan Williams To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, Haozhong Zhang , Xiao Guangrong , linux-kernel@vger.kernel.org, Vishal Verma Date: Fri, 04 Mar 2016 16:46:24 -0800 Message-ID: <20160305004624.12825.93210.stgit@dwillia2-desk3.jf.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vishal Verma If firmware doesn't implement any of the ARS commands, take that to mean that ARS is unsupported, and continue to initialize regions without bad block lists. We cannot make the assumption that ARS commands will be unconditionally supported on all NVDIMMs. Reported-by: Haozhong Zhang Signed-off-by: Vishal Verma Acked-by: Xiao Guangrong Tested-by: Haozhong Zhang Signed-off-by: Dan Williams --- drivers/acpi/nfit.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c index fb53db187854..35947ac87644 100644 --- a/drivers/acpi/nfit.c +++ b/drivers/acpi/nfit.c @@ -1590,14 +1590,21 @@ static int acpi_nfit_find_poison(struct acpi_nfit_desc *acpi_desc, start = ndr_desc->res->start; len = ndr_desc->res->end - ndr_desc->res->start + 1; + /* + * If ARS is unimplemented, unsupported, or if the 'Persistent Memory + * Scrub' flag in extended status is not set, skip this but continue + * initialization + */ rc = ars_get_cap(nd_desc, ars_cap, start, len); + if (rc == -ENOTTY) { + dev_dbg(acpi_desc->dev, + "Address Range Scrub is not implemented, won't create an error list\n"); + rc = 0; + goto out; + } if (rc) goto out; - /* - * If ARS is unsupported, or if the 'Persistent Memory Scrub' flag in - * extended status is not set, skip this but continue initialization - */ if ((ars_cap->status & 0xffff) || !(ars_cap->status >> 16 & ND_ARS_PERSISTENT)) { dev_warn(acpi_desc->dev,