From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CE61E212C01EA for ; Wed, 17 Jul 2019 19:31:40 -0700 (PDT) Date: Thu, 18 Jul 2019 11:29:09 +0900 From: Greg Kroah-Hartman Subject: Re: [PATCH v2 1/7] drivers/base: Introduce kill_device() Message-ID: <20190718022909.GB15376@kroah.com> References: <156341206785.292348.1660822720191643298.stgit@dwillia2-desk3.amr.corp.intel.com> <156341207332.292348.14959761496009347574.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <156341207332.292348.14959761496009347574.stgit@dwillia2-desk3.amr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Dan Williams Cc: "Rafael J. Wysocki" , peterz@infradead.org, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org List-ID: On Wed, Jul 17, 2019 at 06:07:53PM -0700, Dan Williams wrote: > The libnvdimm subsystem arranges for devices to be destroyed as a result > of a sysfs operation. Since device_unregister() cannot be called from > an actively running sysfs attribute of the same device libnvdimm > arranges for device_unregister() to be performed in an out-of-line async > context. > > The driver core maintains a 'dead' state for coordinating its own racing > async registration / de-registration requests. Rather than add local > 'dead' state tracking infrastructure to libnvdimm device objects, export > the existing state tracking via a new kill_device() helper. > > The kill_device() helper simply marks the device as dead, i.e. that it > is on its way to device_del(), or returns that the device was already > dead. This can be used in advance of calling device_unregister() for > subsystems like libnvdimm that might need to handle multiple user > threads racing to delete a device. > > This refactoring does not change any behavior, but it is a pre-requisite > for follow-on fixes and therefore marked for -stable. > > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Fixes: 4d88a97aa9e8 ("libnvdimm, nvdimm: dimm driver and base libnvdimm device-driver...") > Cc: > Tested-by: Jane Chu > Signed-off-by: Dan Williams Reviewed-by: Greg Kroah-Hartman _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm