From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Luis R. Rodriguez" Subject: Re: [PATCH 1/3] driver core: enable drivers to use deferred probe from init Date: Mon, 28 Jul 2014 18:52:48 +0200 Message-ID: <20140728165248.GE21930@wotan.suse.de> References: <1406558067-25308-1-git-send-email-mcgrof@do-not-panic.com> <20140728153811.GD21930@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Yuval Mintz Cc: "Luis R. Rodriguez" , "gregkh@linuxfoundation.org" , linux-kernel , Tetsuo Handa , Joseph Salisbury , Kay Sievers , One Thousand Gnomes , Tim Gardner , Pierre Fersing , Andrew Morton , Oleg Nesterov , Benjamin Poirier , Nagalakshmi Nandigama , Praveen Krishnamoorthy , Sreekanth Reddy , Abhijit Mahajan , Hariprasad S , Santosh Rastapur , "MPT-FusionLinux.pdl@avagotech.com" List-Id: linux-scsi@vger.kernel.org On Mon, Jul 28, 2014 at 03:46:32PM +0000, Yuval Mintz wrote: > > Subject: Re: [PATCH 1/3] driver core: enable drivers to use deferred probe from > > init > > > > On Mon, Jul 28, 2014 at 03:12:11PM +0000, Yuval Mintz wrote: > > > Perhaps this is a silly question, but what guarantees that the > > > deferred probe list will actually be triggered, e.g., in case the > > > delayed device is the last device in the system? > > > > The dev->init_delayed_probe is used to ensure that we'd add the device to the > > deferred probe list once making this a per device thing if the driver has the field > > delay_probe set to true. This technically also allows this to be a per device thing > > so with some more work we could enable drivers to only enable this for specific > > devices but at this point this did not seem required. > > Sorry for not being clear, but I didn't meant 'what guarantees that the device > will be added to the deferred probe', but rather what guarantees that the > deferred workqueue will be scheduled. > > To the best of my knowledge the deferring mechanism works only if one device > is dependent upon another, e.g., for Multi-function devices where one device > probe is dependent upon the others - which are soon-to-be probed. The workqueue will be kicked when driver_deferred_probe_trigger() gets poked, we do that in the late_initcall(deferred_probe_initcall), it also gets flushed there with a flush_workqueue(deferred_wq). Luis