devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 00/12] On-demand device registration
@ 2015-04-24 14:47 Tomeu Vizoso
  2015-04-24 14:47 ` [RFC 02/12] ARM: tegra: Add gpio-ranges property Tomeu Vizoso
                   ` (10 more replies)
  0 siblings, 11 replies; 19+ messages in thread
From: Tomeu Vizoso @ 2015-04-24 14:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thierry Reding, Stéphane Marchesin, Alexander Holler,
	Olof Johansson, Grant Likely, Rob Herring, devicetree,
	Mark Rutland, Tomeu Vizoso

Hi,

while reading the thread [0] that Alexander Holler started with his series to make probing order deterministic, it occurred to me that it should be possible to achieve the same by probing devices as they are referenced by other devices.

This basically reuses the information that is already embedded in the probe() implementations, saving us from refactoring existing drivers or adding information to DTBs.

The main issue I see is that the registration code path in some subsystems may not be reentrant, so some refactoring of the locking will be needed. In my testing I have found this problem with regulators, as the supply of a regulator might end up being registered during the registration of the first one.

Something I'm not completely happy with is that I have had to move the population of the device tree after all platform drivers have been registered. Otherwise I don't see how I could register drivers on demand as we don't have yet each driver's compatible strings.

I have done my testing on a Tegra124-based Chromebook, and these patches were enough to eliminate all the deferred probes.

Regards,

Tomeu

[0] https://lkml.org/lkml/2014/5/12/452

Tomeu Vizoso (12):
  ARM: tegra: Register drivers before devices
  ARM: tegra: Add gpio-ranges property
  of/platform: add of_platform_device_ensure()
  gpio: Probe GPIO drivers on demand
  gpio: Probe pinctrl devices on demand
  regulator: core: Probe regulators on demand
  drm: Probe panels on demand
  drm/tegra: Probe dpaux devices on demand
  i2c: core: Probe i2c master devices on demand
  pwm: Probe PWM chip devices on demand
  backlight: Probe backlight devices on demand
  usb: phy: Probe phy devices on demand

 arch/arm/boot/dts/tegra124.dtsi     |  1 +
 arch/arm/mach-tegra/tegra.c         | 21 ++++++++-------------
 drivers/gpio/gpiolib-of.c           |  5 +++++
 drivers/gpu/drm/drm_panel.c         |  3 +++
 drivers/gpu/drm/tegra/dpaux.c       |  3 +++
 drivers/i2c/i2c-core.c              |  3 +++
 drivers/of/platform.c               | 28 ++++++++++++++++++++++++++++
 drivers/pwm/core.c                  |  3 +++
 drivers/regulator/core.c            |  2 ++
 drivers/usb/phy/phy.c               |  3 +++
 drivers/video/backlight/backlight.c |  3 +++
 include/linux/of_platform.h         |  2 ++
 12 files changed, 64 insertions(+), 13 deletions(-)

-- 
2.3.6

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

end of thread, other threads:[~2015-04-30  7:44 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-24 14:47 [RFC 00/12] On-demand device registration Tomeu Vizoso
2015-04-24 14:47 ` [RFC 02/12] ARM: tegra: Add gpio-ranges property Tomeu Vizoso
2015-04-24 14:47 ` [RFC 03/12] of/platform: add of_platform_device_ensure() Tomeu Vizoso
     [not found] ` <1429886848-5843-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-04-24 14:47   ` [RFC 01/12] ARM: tegra: Register drivers before devices Tomeu Vizoso
2015-04-24 14:47   ` [RFC 04/12] gpio: Probe GPIO drivers on demand Tomeu Vizoso
2015-04-24 14:47   ` [RFC 08/12] drm/tegra: Probe dpaux devices " Tomeu Vizoso
2015-04-24 14:47 ` [RFC 05/12] gpio: Probe pinctrl " Tomeu Vizoso
2015-04-24 14:47 ` [RFC 06/12] regulator: core: Probe regulators " Tomeu Vizoso
2015-04-24 14:47 ` [RFC 07/12] drm: Probe panels " Tomeu Vizoso
2015-04-24 14:47 ` [RFC 09/12] i2c: core: Probe i2c master devices " Tomeu Vizoso
2015-04-24 14:47 ` [RFC 10/12] pwm: Probe PWM chip " Tomeu Vizoso
2015-04-24 14:47 ` [RFC 11/12] backlight: Probe backlight " Tomeu Vizoso
2015-04-24 14:47 ` [RFC 12/12] usb: phy: Probe phy " Tomeu Vizoso
2015-04-24 23:15 ` [RFC 00/12] On-demand device registration Alexander Holler
2015-04-28 12:49   ` Tomeu Vizoso
2015-04-28 18:17     ` Alexander Holler
     [not found]       ` <553FCECB.7040005-SXC+2es9fhnfWeYVQQPykw@public.gmane.org>
2015-04-29  6:58         ` Tomeu Vizoso
2015-04-29  9:46           ` Alexander Holler
2015-04-30  7:44             ` Alexander Holler

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).