From patchwork Thu Mar 3 22:39:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 8496931 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A65D59F9A0 for ; Thu, 3 Mar 2016 22:39:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D70F62039D for ; Thu, 3 Mar 2016 22:39:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E273E201C7 for ; Thu, 3 Mar 2016 22:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757954AbcCCWjv (ORCPT ); Thu, 3 Mar 2016 17:39:51 -0500 Received: from mga03.intel.com ([134.134.136.65]:59784 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757139AbcCCWjv (ORCPT ); Thu, 3 Mar 2016 17:39:51 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 03 Mar 2016 14:39:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,533,1449561600"; d="scan'208";a="900758248" Received: from omniknight.lm.intel.com ([10.232.112.171]) by orsmga001.jf.intel.com with ESMTP; 03 Mar 2016 14:39:50 -0800 From: Vishal Verma To: linux-nvdimm@lists.01.org Cc: Vishal Verma , linux-acpi@vger.kernel.org, Dan Williams , Xiao Guangrong Subject: [PATCH v2] nfit: Continue init even if ARS commands are unimplemented Date: Thu, 3 Mar 2016 15:39:41 -0700 Message-Id: <1457044781-15443-1-git-send-email-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.5.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Cc: Dan Williams Reported-by: Xiao Guangrong Signed-off-by: Vishal Verma Tested-by: Haozhong Zhang --- v2: - improve the debug message when we his this unimplemented case (Dan). 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 fb53db1..35947ac 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,