From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: Re: [PATCH v3 2/2] acpi: nfit: Add support for hot-add Date: Sat, 7 Nov 2015 10:57:17 -0800 Message-ID: References: <1445986707-15395-1-git-send-email-vishal.l.verma@intel.com> <1445986707-15395-3-git-send-email-vishal.l.verma@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-wi0-f171.google.com ([209.85.212.171]:33109 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753551AbbKGS5S (ORCPT ); Sat, 7 Nov 2015 13:57:18 -0500 Received: by wijp11 with SMTP id p11so47652739wij.0 for ; Sat, 07 Nov 2015 10:57:17 -0800 (PST) In-Reply-To: <1445986707-15395-3-git-send-email-vishal.l.verma@intel.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Vishal Verma Cc: "linux-nvdimm@lists.01.org" , "Rafael J. Wysocki" , Linux ACPI , Jeff Moyer , Elliott Robert , Toshi Kani Rafael, awaiting your ack... Vishal, one thing I'll fix up on applying... On Tue, Oct 27, 2015 at 3:58 PM, 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: Jeff Moyer > Cc: > Cc: > Signed-off-by: Vishal Verma [..] > +static int acpi_nfit_add(struct acpi_device *adev) > +{ > + struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; > + struct acpi_nfit_desc *acpi_desc; > + struct device *dev = &adev->dev; > + struct acpi_table_header *tbl; > + acpi_status status = AE_OK; > + acpi_size sz; > + int rc = 0; > + > + device_lock(dev); The device is already locked by the time we reach this point. The unit tests don't trip this path which might be why this wasn't seen earlier.