From patchwork Fri Jul 22 21:09:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 9244231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 60D2660757 for ; Fri, 22 Jul 2016 21:09:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F6551FFD6 for ; Fri, 22 Jul 2016 21:09:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 441DA28047; Fri, 22 Jul 2016 21:09:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A76041FFD6 for ; Fri, 22 Jul 2016 21:09:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 751821A1DF8; Fri, 22 Jul 2016 14:10:29 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ml01.01.org (Postfix) with ESMTP id 89AF11A1DF8 for ; Fri, 22 Jul 2016 14:10:28 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 22 Jul 2016 14:09:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,405,1464678000"; d="scan'208";a="738436588" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by FMSMGA003.fm.intel.com with ESMTP; 22 Jul 2016 14:09:36 -0700 Received: from orsmsx112.amr.corp.intel.com (10.22.240.13) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 22 Jul 2016 14:09:35 -0700 Received: from orsmsx107.amr.corp.intel.com ([169.254.1.218]) by ORSMSX112.amr.corp.intel.com ([169.254.3.162]) with mapi id 14.03.0248.002; Fri, 22 Jul 2016 14:09:35 -0700 From: "Williams, Dan J" To: "torvalds@linux-foundation.org" Subject: [GIT PULL] libnvdimm regression fix for 4.7-final Thread-Topic: [GIT PULL] libnvdimm regression fix for 4.7-final Thread-Index: AQHR5F1YGkMImYfT9Ea8wPUH46fSfA== Date: Fri, 22 Jul 2016 21:09:34 +0000 Message-ID: <1469221772.2244.16.camel@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.7.201.32] Content-ID: <15A181BF4EE4C549B2DCFA132FA2677C@intel.com> MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-nvdimm@lists.01.org" Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Hi Linus, please pull from:   git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm libnvdimm-fixes ...to receive a regression fix for a problem that was introduced in v4.7-rc6. In 4.7-rc1 we introduced auto-probing for the ACPI DSM (device- specific-method) format that the platform firmware implements for nvdimm devices. We initially fixed a regression in probing the QEMU DSM implementation by making acpi_check_dsm() tolerant of the way QEMU reports the "0 DSMs supported" condition. However, that broke HPE platforms since that tolerance caused the driver to mistakenly match the 1-zero-byte response those platforms give to "unknown" commands. Instead, we simply make the driver tolerant of not finding any supported DSMs.  This has been tested to work with both QEMU and HPE platforms. This commit has appeared in a -next release with no reported issues. The following changes since commit a99cde438de0c4c0cecc1d1af1a55a75b10bfdef:   Linux 4.7-rc6 (2016-07-03 23:01:00 -0700) are available in the git repository at:   git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm libnvdimm-fixes for you to fetch changes up to a72255983f12f31f0c8d8275fb1a781546cfacb7:   nfit: make DIMM DSMs optional (2016-07-19 12:32:39 -0700) ---------------------------------------------------------------- Dan Williams (1):       nfit: make DIMM DSMs optional  drivers/acpi/nfit.c  | 11 ++++++-----  drivers/acpi/utils.c |  6 +++---  2 files changed, 9 insertions(+), 8 deletions(-) commit a72255983f12f31f0c8d8275fb1a781546cfacb7 Author: Dan Williams Date:   Tue Jul 19 12:32:39 2016 -0700     nfit: make DIMM DSMs optional          Commit 4995734e973a "acpi, nfit: fix acpi_check_dsm() vs zero functions     implemented" attempted to fix a QEMU regression by supporting its usage     of a zero-mask as a valid response to a DSM-family probe request.     However, this behavior breaks HP platforms that return a zero-mask by     default causing the probe to misidentify the DSM-family.          Instead, the QEMU regression can be fixed by simply not requiring the DSM     family to be identified.          This effectively reverts commit 4995734e973a, and removes the DSM     requirement from the init path.          Cc: "Rafael J. Wysocki"     Cc: Xiao Guangrong     Cc: Linda Knippers     Fixes: 4995734e973a ("acpi, nfit: fix acpi_check_dsm() vs zero functions implemented")     Reported-by: Jerry Hoemann     Tested-by: Jerry Hoemann     Signed-off-by: Dan Williams diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c index ac6ddcc080d4..1f0e06065ae6 100644 --- a/drivers/acpi/nfit.c +++ b/drivers/acpi/nfit.c @@ -1131,11 +1131,11 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,     /*    * Until standardization materializes we need to consider up to 3 -  * different command sets.  Note, that checking for zero functions -  * tells us if any commands might be reachable through this uuid. +  * different command sets.  Note, that checking for function0 (bit0) +  * tells us if any commands are reachable through this uuid.    */   for (i = NVDIMM_FAMILY_INTEL; i <= NVDIMM_FAMILY_HPE2; i++) - if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 0)) + if (acpi_check_dsm(adev_dimm->handle, to_nfit_uuid(i), 1, 1))   break;     /* limit the supported commands to those that are publicly documented */ @@ -1151,9 +1151,10 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,   if (disable_vendor_specific)   dsm_mask &= ~(1 << 8);   } else { - dev_err(dev, "unknown dimm command family\n"); + dev_dbg(dev, "unknown dimm command family\n");   nfit_mem->family = -1; - return force_enable_dimms ? 0 : -ENODEV; + /* DSMs are optional, continue loading the driver... */ + return 0;   }     uuid = to_nfit_uuid(nfit_mem->family); diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index b4de130f2d57..22c09952e177 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -680,6 +680,9 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs)   u64 mask = 0;   union acpi_object *obj;   + if (funcs == 0) + return false; +   obj = acpi_evaluate_dsm(handle, uuid, rev, 0, NULL);   if (!obj)   return false; @@ -692,9 +695,6 @@ bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, u64 rev, u64 funcs)   mask |= (((u64)obj->buffer.pointer[i]) << (i * 8));   ACPI_FREE(obj);   - if (funcs == 0) - return true; -   /*    * Bit 0 indicates whether there's support for any functions other than    * function 0 for the specified UUID and revision.