Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752815AbbGIA6I (ORCPT ); Wed, 8 Jul 2015 20:58:08 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:34191 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbbGIA6D (ORCPT ); Wed, 8 Jul 2015 20:58:03 -0400 Date: Wed, 8 Jul 2015 17:57:58 -0700 From: Dmitry Torokhov To: Dan Williams Cc: "Luis R. Rodriguez" , Tom Gundersen , Greg Kroah-Hartman , Tejun Heo , Linux Kernel Mailing List , Arjan van de Ven , Rusty Russell , Olof Johansson , Tetsuo Handa Subject: Re: [PATCH 2/8] driver-core: add asynchronous probing support for drivers Message-ID: <20150709005758.GG379@dtor-ws> References: <20150706233846.GF32140@dtor-ws> <20150709005254.GE379@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1855 Lines: 41 On Wed, Jul 08, 2015 at 05:54:26PM -0700, Dan Williams wrote: > On Wed, Jul 8, 2015 at 5:52 PM, Dmitry Torokhov > wrote: > > On Wed, Jul 08, 2015 at 05:43:23PM -0700, Dan Williams wrote: > >> On Mon, Jul 6, 2015 at 4:38 PM, Dmitry Torokhov > >> wrote: > >> > On Sat, Jul 04, 2015 at 07:09:19AM -0700, Dan Williams wrote: > >> >> The problem I ran into was needing to remove devices that still had > >> >> yet to be probed and not being able to use registration completion vs > >> >> the device_lock() to effectively synchronize the sub-system. > >> > > >> > Why do you need to "synchronize the sub-system"? The asynchronous > >> > probing should be transparent to the driver. Just unregister the device > >> > (or the driver) and driver core will ensure that probe() is not in > >> > flight. > >> > >> Async registration is indeed transparent to the driver. The primary > >> need to "flush registration" is the case of "region" devices that > >> reference a set of NVDIMM devices. A region device requires all > >> related NVDIMMs to be active before the region can be enabled. > > > > Sounds like you need to call into the subsystem to let it know that the > > device is active and activate region devices when they are ready. Could > > be either explicit call or you can try using bus notifiers for > > bind/unbind events. > > > > BTW, do you handle bind/unbind via sysfs (everyone forgets about this > > mechanism)? > > bind/unbind via systs is central to how libnvdimm operates. It's > covered by our unit tests. Ah, excellent then. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/