All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
	"toshi.kani@hpe.com" <toshi.kani@hpe.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	"elliott@hpe.com" <elliott@hpe.com>
Subject: Re: [PATCH v2 2/2] acpi: nfit: Add support for hot-add
Date: Fri, 16 Oct 2015 22:23:37 +0000	[thread overview]
Message-ID: <1445034217.11973.13.camel@intel.com> (raw)
In-Reply-To: <1444863866-19173-3-git-send-email-vishal.l.verma@intel.com>

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 <dan.j.williams@intel.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Cc: Toshi Kani <toshi.kani@hpe.com>
> Cc: Elliott, Robert <elliott@hpe.com>
> Cc: <linux-acpi@vger.kernel.org>
> Cc: <linux-nvdimm@lists.01.org>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
>  drivers/acpi/nfit.c              | 197 +++++++++++++++++++++++++++++
> ----------
>  drivers/acpi/nfit.h              |   2 +
>  tools/testing/nvdimm/test/nfit.c | 156
> ++++++++++++++++++++++++++++++-
>  3 files changed, 304 insertions(+), 51 deletions(-)
> 

<snip>

> 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

<snip>

>  
> +	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) */

  reply	other threads:[~2015-10-16 22:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 23:04 [PATCH v2 0/2] Hotplug support for libnvdimm Vishal Verma
2015-10-14 23:04 ` [PATCH v2 1/2] nfit: in acpi_nfit_init, break on a 0-length table Vishal Verma
2015-10-14 23:04 ` [PATCH v2 2/2] acpi: nfit: Add support for hot-add Vishal Verma
2015-10-16 22:23   ` Verma, Vishal L [this message]
2015-10-20  2:02   ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445034217.11973.13.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=elliott@hpe.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=toshi.kani@hpe.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.