Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1652573ybi; Wed, 17 Jul 2019 19:30:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJycVnGuitMW343rpXxunk7qHiFuHVQOgshw27gwR3WYK2axNDUOJQ+DJAa7vBXFEQQdQF X-Received: by 2002:a17:90a:22c6:: with SMTP id s64mr48924944pjc.5.1563417015731; Wed, 17 Jul 2019 19:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563417015; cv=none; d=google.com; s=arc-20160816; b=Mg1+NytVgHrmbhfZ0WwijUqW3BL0TjTRphCHfObRcSf0NoVr4h4bPBBGXP8XzqafcO mVEb3ViogIkZMIJF394cKxCbkb8iZsZc29TBJPsRcryzTMcwQF9GTBNGwAxoBcd4WzkG icVj6k165ktfJ0zDdZSjLaloklLYUDouvPSAr3QxR5N7x9+R6x7nLd4NdBelyn9NBle7 mY+K/IqGw5hA5/DlJ/GLtKUbyx92gpPzOKsKTF7bvRWY+YbyyA+mUAAjZxdYjk/fOZPB DI7knoS2LdbnG3lA6L6Tkj2oi+jPKCtV/EGH2WfIWzbv/cEkXujsdQTuOqM8uiL1lWwi id9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HtfRQ3WNg4nkgkxoE7HLAacAsNVrT6MrBt9P9aDkVE4=; b=zGP85Tpt10fZUxkEsGnOmW1W2xQN2l4Z4dXE0rxuLPmGOA8fSoiuwt9ao7eIKLOLF7 ml8DVk6csTCd3vJpneMvhpdf1/eiCQNEbDigZona35wr4yANhMIfRTGcTv3WNlusmXdq WAlDEIc2p1tqNz25b9QuXu+F7VKLD+hJ4cCuJHe/7nRMH76IKXSDleENqMzL6/i0GkBK 3AcccckKi1szNbDMRISk86EpJ2UUz1FdTB8pcu9RPfvT48yMwrIbQZZBcTQ2YCpoGDtR uALf8pQ4ZZI6kFenvJMz3dctLEBcISaJyW/Mf+eC4V8nHwZ1w7GMwPVbxKmiHjYDqxOJ Bs7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="PU/9ZjOI"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si12768116pgj.71.2019.07.17.19.29.59; Wed, 17 Jul 2019 19:30:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="PU/9ZjOI"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732517AbfGRC3N (ORCPT + 99 others); Wed, 17 Jul 2019 22:29:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727787AbfGRC3N (ORCPT ); Wed, 17 Jul 2019 22:29:13 -0400 Received: from localhost (115.42.148.210.bf.2iij.net [210.148.42.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D4E5420693; Thu, 18 Jul 2019 02:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563416952; bh=2al5dDB1QGuCWB3Crm/8rt8z8AxFdOWfnkgmI4UzPSc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PU/9ZjOIjOfP/JFyzI5gfIjK6E62q03dwuuvLF2mL1b+ZBi3Tkg1MajanCgM/uVEG e+LyDtZ/Tr8sO60aevE5G5MgcPIiLeMk6TuIFZyLSa141UgiOiobEl5AyHJwY8Uuyr Lz3uaee2o4zEAnjP69PTvk7SRKwSmJ6zIlF83MfY= Date: Thu, 18 Jul 2019 11:29:09 +0900 From: Greg Kroah-Hartman To: Dan Williams Cc: linux-nvdimm@lists.01.org, "Rafael J. Wysocki" , stable@vger.kernel.org, Jane Chu , peterz@infradead.org, vishal.l.verma@intel.com, linux-kernel@vger.kernel.org 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <156341207332.292348.14959761496009347574.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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