From patchwork Fri Oct 16 22:23:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 7421261 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 308089F6E4 for ; Fri, 16 Oct 2015 22:23:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94D8B208D5 for ; Fri, 16 Oct 2015 22:23:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFC8D20726 for ; Fri, 16 Oct 2015 22:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751201AbbJPWXk (ORCPT ); Fri, 16 Oct 2015 18:23:40 -0400 Received: from mga09.intel.com ([134.134.136.24]:54503 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750880AbbJPWXj (ORCPT ); Fri, 16 Oct 2015 18:23:39 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 16 Oct 2015 15:23:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,690,1437462000"; d="scan'208";a="795302732" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 16 Oct 2015 15:23:38 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 16 Oct 2015 15:23:38 -0700 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.155]) by fmsmsx123.amr.corp.intel.com ([169.254.2.23]) with mapi id 14.03.0248.002; Fri, 16 Oct 2015 15:23:38 -0700 From: "Verma, Vishal L" To: "linux-nvdimm@lists.01.org" CC: "Williams, Dan J" , "toshi.kani@hpe.com" , "linux-acpi@vger.kernel.org" , "Wysocki, Rafael J" , "elliott@hpe.com" Subject: Re: [PATCH v2 2/2] acpi: nfit: Add support for hot-add Thread-Topic: [PATCH v2 2/2] acpi: nfit: Add support for hot-add Thread-Index: AQHRBtTCXamdCDAP7E6D+IyBxmMobZ5vKkmA Date: Fri, 16 Oct 2015 22:23:37 +0000 Message-ID: <1445034217.11973.13.camel@intel.com> References: <1444863866-19173-1-git-send-email-vishal.l.verma@intel.com> <1444863866-19173-3-git-send-email-vishal.l.verma@intel.com> In-Reply-To: <1444863866-19173-3-git-send-email-vishal.l.verma@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.232.112.76] Content-ID: <4AB82BD662322D408A73DEF012C393D5@intel.com> MIME-Version: 1.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, T_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 On Wed, 2015-10-14 at 17:04 -0600, Vishal Verma wrote: > Add a .notify callback to the acpi_nfit_driver that gets called on a > hotplug event. From this, evaluate the _FIT ACPI method which returns > the updated NFIT with handles for the hot-plugged NVDIMM. > > Iterate over the new NFIT, and add any new tables found, and > register/enable the corresponding regions. > > In the nfit test framework, after normal initialization, update the > NFIT > with a new hot-plugged NVDIMM, and directly call into the driver to > update its view of the available regions. > > Cc: Dan Williams > Cc: Rafael J. Wysocki > Cc: Toshi Kani > Cc: Elliott, Robert > Cc: > Cc: > Signed-off-by: Vishal Verma > --- > drivers/acpi/nfit.c | 197 +++++++++++++++++++++++++++++ > ---------- > drivers/acpi/nfit.h | 2 + > tools/testing/nvdimm/test/nfit.c | 156 > ++++++++++++++++++++++++++++++- > 3 files changed, 304 insertions(+), 51 deletions(-) > > diff --git a/tools/testing/nvdimm/test/nfit.c > b/tools/testing/nvdimm/test/nfit.c > index 021e6f9..d803e68 100644 > --- a/tools/testing/nvdimm/test/nfit.c > +++ b/tools/testing/nvdimm/test/nfit.c > > + if (t->setup_hotplug) { > + offset = offset + sizeof(struct acpi_nfit_flush_address) * 4; > + /* dcr-descriptor4 */ > + dcr = nfit_buf + offset; > + dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION; > + dcr->header.length = sizeof(struct acpi_nfit_control_region); > + dcr->region_index = 4+1; > + dcr->vendor_id = 0xabcd; > + dcr->device_id = 0; > + dcr->revision_id = 1; > + dcr->serial_number = ~handle[4]; > + dcr->windows = 0; > + dcr->window_size = 0; > + dcr->command_offset = 0; > + dcr->command_size = 0; > + dcr->status_offset = 0; > + dcr->status_size = 0; > + I just noticed that while we do add a block window for this new hotplug DIMM, the dcr fields talking about block windows were not initialized correctly. While this still _works_ because of a correct bdw structure, we should fix it to be a well formed nfit. If there's a v3 due to additional feedback, I'll include the following patch. If not, Dan, perhaps you can squash it in? (Or I could send a v3 regardless if you prefer that). diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c index d803e68..6f695ee 100644 --- a/tools/testing/nvdimm/test/nfit.c +++ b/tools/testing/nvdimm/test/nfit.c @@ -978,12 +978,12 @@ static void nfit_test0_setup(struct nfit_test *t) dcr->device_id = 0; dcr->revision_id = 1; dcr->serial_number = ~handle[4]; - dcr->windows = 0; - dcr->window_size = 0; + dcr->windows = 1; + dcr->window_size = DCR_SIZE; dcr->command_offset = 0; - dcr->command_size = 0; - dcr->status_offset = 0; - dcr->status_size = 0; + dcr->command_size = 8; + dcr->status_offset = 8; + dcr->status_size = 4; offset = offset + sizeof(struct acpi_nfit_control_region); /* bdw4 (spa/dcr4, dimm4) */