linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] driver core: support bus manage deferred probe
@ 2018-06-29  7:02 ning.a.zhang
  2018-06-29 10:56 ` kbuild test robot
  2018-07-18 17:16 ` Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: ning.a.zhang @ 2018-06-29  7:02 UTC (permalink / raw)
  To: gregkh, rafael.j.wysocki, dmitry.torokhov, linux-kernel
  Cc: mark.gross, Zhang Ning

From: Zhang Ning <ning.a.zhang@intel.com>

deferred probe will be hanlded by deferred_probe_initcall,
starts at late_initcall.

this is too late to handle deferred probe, this will block kernel exec
to userspace, make kernel initial time longer.

if we know when required resources are ready for a list of devices,
related deferred drivers can be probe earlier.

add these kinds of drivers into logical list,
eg, bus_type->deferred_probe_pending_list,
then it can be easily handled by bus driver.

with analysis above:
add manage_deferred to struct bus_type
add deferred_probe_pending_list to struct bus_type

when manage_deferred is true, deferred probe will be
manage by bus.

Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>
---
 drivers/base/bus.c     |  3 ++-
 drivers/base/dd.c      | 24 +++++++++++++++++-------
 include/linux/device.h |  5 +++++
 3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 8bfd27ec73d6..ca8eaf7565db 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -898,7 +898,8 @@ int bus_register(struct bus_type *bus)
 	retval = bus_add_groups(bus, bus->bus_groups);
 	if (retval)
 		goto bus_groups_fail;
-
+	if (bus->manage_deferred)
+		INIT_LIST_HEAD(&bus->deferred_probe_pending_list);
 	pr_debug("bus: '%s': registered\n", bus->name);
 	return 0;
 
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 1435d7281c66..926e57f8dd2f 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -82,10 +82,8 @@ static void deferred_probe_debug(struct device *dev)
 	       dev_name(dev), duration);
 }
 
-/*
- * deferred_probe_work_func() - Retry probing devices in the active list.
- */
-static void deferred_probe_work_func(struct work_struct *work)
+
+void process_deferred_probe(struct list_head *list)
 {
 	struct device *dev;
 	struct device_private *private;
@@ -102,8 +100,8 @@ static void deferred_probe_work_func(struct work_struct *work)
 	 * from under our feet.
 	 */
 	mutex_lock(&deferred_probe_mutex);
-	while (!list_empty(&deferred_probe_active_list)) {
-		private = list_first_entry(&deferred_probe_active_list,
+	while (!list_empty(list)) {
+		private = list_first_entry(list,
 					typeof(*dev->p), deferred_probe);
 		dev = private->device;
 		list_del_init(&private->deferred_probe);
@@ -136,6 +134,15 @@ static void deferred_probe_work_func(struct work_struct *work)
 	}
 	mutex_unlock(&deferred_probe_mutex);
 }
+
+/*
+ * deferred_probe_work_func() - Retry probing devices in the active list.
+ */
+static void deferred_probe_work_func(struct work_struct *work)
+{
+	process_deferred_probe(&deferred_probe_active_list);
+}
+
 static DECLARE_WORK(deferred_probe_work, deferred_probe_work_func);
 
 static void driver_deferred_probe_add(struct device *dev)
@@ -143,7 +150,10 @@ static void driver_deferred_probe_add(struct device *dev)
 	mutex_lock(&deferred_probe_mutex);
 	if (list_empty(&dev->p->deferred_probe)) {
 		dev_dbg(dev, "Added to deferred list\n");
-		list_add_tail(&dev->p->deferred_probe, &deferred_probe_pending_list);
+		if (dev->bus->manage_deferred)
+			list_add_tail(&dev->p->deferred_probe, &dev->bus->deferred_probe_pending_list);
+		else
+			list_add_tail(&dev->p->deferred_probe, &deferred_probe_pending_list);
 	}
 	mutex_unlock(&deferred_probe_mutex);
 }
diff --git a/include/linux/device.h b/include/linux/device.h
index 055a69dbcd18..2f70f3124d18 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -143,6 +143,9 @@ struct bus_type {
 	struct lock_class_key lock_key;
 
 	bool need_parent_lock;
+
+	bool manage_deferred;
+	struct list_head deferred_probe_pending_list;
 };
 
 extern int __must_check bus_register(struct bus_type *bus);
@@ -151,6 +154,8 @@ extern void bus_unregister(struct bus_type *bus);
 
 extern int __must_check bus_rescan_devices(struct bus_type *bus);
 
+extern void process_deferred_probe(struct list_head *list);
+
 /* iterator helpers for buses */
 struct subsys_dev_iter {
 	struct klist_iter		ki;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver core: support bus manage deferred probe
  2018-06-29  7:02 [PATCH] driver core: support bus manage deferred probe ning.a.zhang
@ 2018-06-29 10:56 ` kbuild test robot
  2018-07-18 17:16 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2018-06-29 10:56 UTC (permalink / raw)
  To: ning.a.zhang
  Cc: kbuild-all, gregkh, rafael.j.wysocki, dmitry.torokhov,
	linux-kernel, mark.gross, Zhang Ning

[-- Attachment #1: Type: text/plain, Size: 19836 bytes --]

Hi Zhang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on driver-core/driver-core-testing]
[also build test WARNING on v4.18-rc2 next-20180628]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/ning-a-zhang-intel-com/driver-core-support-bus-manage-deferred-probe/20180629-150608
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
   mm/mempool.c:228: warning: Function parameter or member 'pool' not described in 'mempool_init'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev'
   include/net/cfg80211.h:4279: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev'
   include/net/mac80211.h:2282: warning: Function parameter or member 'radiotap_timestamp.units_pos' not described in 'ieee80211_hw'
   include/net/mac80211.h:2282: warning: Function parameter or member 'radiotap_timestamp.accuracy' not described in 'ieee80211_hw'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.use_rts' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.use_cts_prot' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.short_preamble' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.skip_table' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.jiffies' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.vif' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.hw_key' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.flags' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'control.enqueue_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'ack' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'ack.cookie' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.ampdu_ack_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.ampdu_len' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.antenna' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.tx_time' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.is_valid_ack_signal' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'status.status_driver_data' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info'
   include/net/mac80211.h:955: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_retries' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.msdu_failed' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.last_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.ack_signal_filled' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'status_stats.avg_ack_signal' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info'
   net/mac80211/sta_info.h:588: warning: Function parameter or member 'tx_stats.msdu' not described in 'sta_info'
   kernel/sched/fair.c:3760: warning: Function parameter or member 'flags' not described in 'attach_entity_load_avg'
   include/linux/device.h:93: warning: bad line: this bus.
   include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf'
   include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf'
   include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf'
   include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf'
   include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf'
   include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf'
   include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array'
   include/linux/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip'
   include/linux/iio/hw-consumer.h:1: warning: no structured comments found
   include/linux/device.h:94: warning: bad line: this bus.
>> include/linux/device.h:150: warning: Function parameter or member 'manage_deferred' not described in 'bus_type'
>> include/linux/device.h:150: warning: Function parameter or member 'deferred_probe_pending_list' not described in 'bus_type'
   include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry'
   include/linux/regulator/driver.h:227: warning: Function parameter or member 'resume_early' not described in 'regulator_ops'
   drivers/regulator/core.c:4465: warning: Excess function parameter 'state' description in 'regulator_suspend_late'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb'
   drivers/usb/dwc3/gadget.c:510: warning: Excess function parameter 'dwc' description in 'dwc3_gadget_start_config'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver'
   include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver'
   drivers/gpu/drm/i915/i915_vma.h:48: warning: cannot understand function prototype: 'struct i915_vma '
   drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found
   include/drm/tinydrm/tinydrm.h:34: warning: Function parameter or member 'fb_dirty' not described in 'tinydrm_device'
   drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'crtc_state' not described in 'mipi_dbi_enable_flush'
   drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'plane_state' not described in 'mipi_dbi_enable_flush'

vim +150 include/linux/device.h

^1da177e4 Linus Torvalds        2005-04-16   62  
880ffb5c6 Wanlong Gao           2011-05-05   63  /**
880ffb5c6 Wanlong Gao           2011-05-05   64   * struct bus_type - The bus type of the device
880ffb5c6 Wanlong Gao           2011-05-05   65   *
880ffb5c6 Wanlong Gao           2011-05-05   66   * @name:	The name of the bus.
ca22e56de Kay Sievers           2011-12-14   67   * @dev_name:	Used for subsystems to enumerate devices like ("foo%u", dev->id).
ca22e56de Kay Sievers           2011-12-14   68   * @dev_root:	Default device to use as the parent.
12478ba07 Greg Kroah-Hartman    2013-08-08   69   * @bus_groups:	Default attributes of the bus.
fa6fdb33b Greg Kroah-Hartman    2013-08-08   70   * @dev_groups:	Default attributes of the devices on the bus.
ed0617b5c Greg Kroah-Hartman    2013-08-08   71   * @drv_groups: Default attributes of the device drivers on the bus.
880ffb5c6 Wanlong Gao           2011-05-05   72   * @match:	Called, perhaps multiple times, whenever a new device or driver
656b8035b Tomeu Vizoso          2016-02-15   73   *		is added for this bus. It should return a positive value if the
656b8035b Tomeu Vizoso          2016-02-15   74   *		given device can be handled by the given driver and zero
656b8035b Tomeu Vizoso          2016-02-15   75   *		otherwise. It may also return error code if determining that
656b8035b Tomeu Vizoso          2016-02-15   76   *		the driver supports the device is not possible. In case of
656b8035b Tomeu Vizoso          2016-02-15   77   *		-EPROBE_DEFER it will queue the device for deferred probing.
880ffb5c6 Wanlong Gao           2011-05-05   78   * @uevent:	Called when a device is added, removed, or a few other things
880ffb5c6 Wanlong Gao           2011-05-05   79   *		that generate uevents to add the environment variables.
880ffb5c6 Wanlong Gao           2011-05-05   80   * @probe:	Called when a new device or driver add to this bus, and callback
880ffb5c6 Wanlong Gao           2011-05-05   81   *		the specific driver's probe to initial the matched device.
880ffb5c6 Wanlong Gao           2011-05-05   82   * @remove:	Called when a device removed from this bus.
880ffb5c6 Wanlong Gao           2011-05-05   83   * @shutdown:	Called at shut-down time to quiesce the device.
4f3549d72 Rafael J. Wysocki     2013-05-02   84   *
4f3549d72 Rafael J. Wysocki     2013-05-02   85   * @online:	Called to put the device back online (after offlining it).
4f3549d72 Rafael J. Wysocki     2013-05-02   86   * @offline:	Called to put the device offline for hot-removal. May fail.
4f3549d72 Rafael J. Wysocki     2013-05-02   87   *
880ffb5c6 Wanlong Gao           2011-05-05   88   * @suspend:	Called when a device on this bus wants to go to sleep mode.
880ffb5c6 Wanlong Gao           2011-05-05   89   * @resume:	Called to bring a device on this bus out of sleep mode.
582a686f5 Phil Sutter           2017-01-18   90   * @num_vf:	Called to find out how many virtual functions a device on this
582a686f5 Phil Sutter           2017-01-18   91   *		bus supports.
07397df29 Nipun Gupta           2018-04-28   92   * @dma_configure:	Called to setup DMA configuration on a device on
07397df29 Nipun Gupta           2018-04-28   93  			this bus.
880ffb5c6 Wanlong Gao           2011-05-05  @94   * @pm:		Power management operations of this bus, callback the specific
880ffb5c6 Wanlong Gao           2011-05-05   95   *		device driver's pm-ops.
7b08fae8f Marcos Paulo de Souza 2011-11-01   96   * @iommu_ops:  IOMMU specific operations for this bus, used to attach IOMMU
ff21776d1 Joerg Roedel          2011-08-26   97   *              driver implementations to a bus and allow the driver to do
ff21776d1 Joerg Roedel          2011-08-26   98   *              bus-specific setup
880ffb5c6 Wanlong Gao           2011-05-05   99   * @p:		The private data of the driver core, only the driver core can
880ffb5c6 Wanlong Gao           2011-05-05  100   *		touch this.
bfd63cd24 Michael Opdenacker    2013-06-26  101   * @lock_key:	Lock class key for use by the lock validator
8c97a46af Martin Liu            2018-05-31  102   * @need_parent_lock:	When probing or removing a device on this bus, the
8c97a46af Martin Liu            2018-05-31  103   *			device core should lock the device's parent.
880ffb5c6 Wanlong Gao           2011-05-05  104   *
880ffb5c6 Wanlong Gao           2011-05-05  105   * A bus is a channel between the processor and one or more devices. For the
880ffb5c6 Wanlong Gao           2011-05-05  106   * purposes of the device model, all devices are connected via a bus, even if
880ffb5c6 Wanlong Gao           2011-05-05  107   * it is an internal, virtual, "platform" bus. Buses can plug into each other.
880ffb5c6 Wanlong Gao           2011-05-05  108   * A USB controller is usually a PCI device, for example. The device model
880ffb5c6 Wanlong Gao           2011-05-05  109   * represents the actual connections between buses and the devices they control.
880ffb5c6 Wanlong Gao           2011-05-05  110   * A bus is represented by the bus_type structure. It contains the name, the
880ffb5c6 Wanlong Gao           2011-05-05  111   * default attributes, the bus' methods, PM operations, and the driver core's
880ffb5c6 Wanlong Gao           2011-05-05  112   * private data.
880ffb5c6 Wanlong Gao           2011-05-05  113   */
^1da177e4 Linus Torvalds        2005-04-16  114  struct bus_type {
8d790d740 Dmitry Torokhov       2005-04-26  115  	const char		*name;
ca22e56de Kay Sievers           2011-12-14  116  	const char		*dev_name;
ca22e56de Kay Sievers           2011-12-14  117  	struct device		*dev_root;
12478ba07 Greg Kroah-Hartman    2013-08-08  118  	const struct attribute_group **bus_groups;
fa6fdb33b Greg Kroah-Hartman    2013-08-08  119  	const struct attribute_group **dev_groups;
ed0617b5c Greg Kroah-Hartman    2013-08-08  120  	const struct attribute_group **drv_groups;
^1da177e4 Linus Torvalds        2005-04-16  121  
^1da177e4 Linus Torvalds        2005-04-16  122  	int (*match)(struct device *dev, struct device_driver *drv);
7eff2e7a8 Kay Sievers           2007-08-14  123  	int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
594c8281f Russell King          2006-01-05  124  	int (*probe)(struct device *dev);
594c8281f Russell King          2006-01-05  125  	int (*remove)(struct device *dev);
594c8281f Russell King          2006-01-05  126  	void (*shutdown)(struct device *dev);
7c8265f51 Linus Torvalds        2006-06-24  127  
4f3549d72 Rafael J. Wysocki     2013-05-02  128  	int (*online)(struct device *dev);
4f3549d72 Rafael J. Wysocki     2013-05-02  129  	int (*offline)(struct device *dev);
4f3549d72 Rafael J. Wysocki     2013-05-02  130  
^1da177e4 Linus Torvalds        2005-04-16  131  	int (*suspend)(struct device *dev, pm_message_t state);
^1da177e4 Linus Torvalds        2005-04-16  132  	int (*resume)(struct device *dev);
b8c5cec23 Kay Sievers           2007-02-16  133  
582a686f5 Phil Sutter           2017-01-18  134  	int (*num_vf)(struct device *dev);
582a686f5 Phil Sutter           2017-01-18  135  
07397df29 Nipun Gupta           2018-04-28  136  	int (*dma_configure)(struct device *dev);
07397df29 Nipun Gupta           2018-04-28  137  
8150f32b9 Dmitry Torokhov       2009-07-24  138  	const struct dev_pm_ops *pm;
1eede070a Rafael J. Wysocki     2008-05-20  139  
b22f6434c Thierry Reding        2014-06-27  140  	const struct iommu_ops *iommu_ops;
ff21776d1 Joerg Roedel          2011-08-26  141  
6b6e39a6a Kay Sievers           2010-11-15  142  	struct subsys_private *p;
be871b7e5 Michal Hocko          2013-03-12  143  	struct lock_class_key lock_key;
d89e2378a Robin Murphy          2017-10-12  144  
8c97a46af Martin Liu            2018-05-31  145  	bool need_parent_lock;
1bb174019 Zhang Ning            2018-06-29  146  
1bb174019 Zhang Ning            2018-06-29  147  	bool manage_deferred;
1bb174019 Zhang Ning            2018-06-29  148  	struct list_head deferred_probe_pending_list;
^1da177e4 Linus Torvalds        2005-04-16  149  };
^1da177e4 Linus Torvalds        2005-04-16 @150  

:::::: The code at line 150 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6443 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] driver core: support bus manage deferred probe
  2018-06-29  7:02 [PATCH] driver core: support bus manage deferred probe ning.a.zhang
  2018-06-29 10:56 ` kbuild test robot
@ 2018-07-18 17:16 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2018-07-18 17:16 UTC (permalink / raw)
  To: ning.a.zhang; +Cc: gregkh, rafael.j.wysocki, linux-kernel, mark.gross

Hi,

On Fri, Jun 29, 2018 at 03:02:26PM +0800, ning.a.zhang@intel.com wrote:
> From: Zhang Ning <ning.a.zhang@intel.com>
> 
> deferred probe will be hanlded by deferred_probe_initcall,
> starts at late_initcall.
> 
> this is too late to handle deferred probe, this will block kernel exec
> to userspace, make kernel initial time longer.
> 
> if we know when required resources are ready for a list of devices,
> related deferred drivers can be probe earlier.
> 
> add these kinds of drivers into logical list,
> eg, bus_type->deferred_probe_pending_list,
> then it can be easily handled by bus driver.

I do not see why bus driver would have a better knowledge about its
device dependencies to accelerate deferred probe retries; it all depends
on the platform. On some platform PCI is essential and devices on PCI
bus are needed early, on others we can push PCI initialization to the
very end as there only a couple devices hanging off PCI bus.

You need to find a better way to decide when to reprobe a device, and
that requires analyzing and tracking the dependencies between devices.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-18 17:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29  7:02 [PATCH] driver core: support bus manage deferred probe ning.a.zhang
2018-06-29 10:56 ` kbuild test robot
2018-07-18 17:16 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).