linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: Rob Herring <robherring2@gmail.com>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Stéphane Marchesin" <stephane.marchesin@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Alexander Holler" <holler@ahsoftware.de>,
	"Grant Likely" <grant.likely@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Dan Williams" <dan.j.williams@intel.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	dmaengine@vger.kernel.org,
	dri-devel <dri-devel@lists.freedesktop.org>,
	linux-clk@vger.kernel.org,
	"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"Linux PWM List" <linux-pwm@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"Linux USB List" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 00/21] On-demand device registration
Date: Mon, 22 Jun 2015 17:23:53 +0200	[thread overview]
Message-ID: <CAAObsKCdv_X+YPFacO7NjbRMnvuDisAmiQOWE-Xb3xFFrn6Qog@mail.gmail.com> (raw)
In-Reply-To: <CAL_Jsq+EWLEJhRudTGAwYsOg4tX2-pGhygeQGHae9RL8rBpMiA@mail.gmail.com>

On 28 May 2015 at 06:33, Rob Herring <robherring2@gmail.com> wrote:
> On Mon, May 25, 2015 at 9:53 AM, Tomeu Vizoso
> <tomeu.vizoso@collabora.com> wrote:
>> Hello,
>>
>> I have a problem with the panel on my Tegra Chromebook taking longer than
>> expected to be ready during boot (Stéphane Marchesin reported what is
>> basically the same issue in [0]), and have looked into ordered probing as a
>> better way of solving this than moving nodes around in the DT or playing with
>> initcall levels.
>>
>> While reading the thread [1] 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 registering devices as they are referenced by other
>> devices.
>
> I like the concept and novel approach.
>
>> This basically reuses the information that is already implicit in the probe()
>> implementations, saving us from refactoring existing drivers or adding
>> information to DTBs.
>>
>> Something I'm not completely happy with is that I have had to move the call to
>> of_platform_populate 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.
>
> Yeah, this is the opposite of what we'd really like.

Can you elaborate on the reasons why we would like to have devices
registered before built-in drivers finish registering, even if we
don't probe them yet?

> Ideally, we would
> have a solution that works for modules too. However, we're no worse
> off. We pretty much build-in dependencies to avoid module ordering
> problems.

Nod, I haven't looked yet at requesting modules on-demand, but I guess
it should be doable. Modules that have dependencies described in the
firmware should get them probed automatically already though.

> Perhaps we need to make the probing on-demand rather than simply on
> device<->driver match occurring.

I'm afraid that too much old code depends on that. For example, Rafael
pointed out to the PNP subsystem, which registers a driver that will
probe devices with the EISA ID PNP0c02 to reserve memory regions for
devices that will be probed later.

http://lxr.free-electrons.com/source/drivers/pnp/system.c

My understanding is that probing of PNP0c02 devices must happen before
the actual devices that depend on those regions are probed, so if we
decoupled the probing from the driver/device registration, we would be
breaking that assumption.

>> For machs that don't move of_platform_populate() to a later point, these
>> patches shouldn't cause any problems but it's not guaranteed that we'll avoid
>> all the deferred probes as some drivers may not be registered yet.
>
> Ideally, of_platform_populate is not explicitly called by each
> platform. So I think we need to make this work for the default case.

The problem is that some platforms will need fixing because some
initcalls assume that some devices will have been registered already,
or even probed. I think removing those assumptions shouldn't be
problematic because I haven't had much trouble with this on the four
platforms I have tested with, but I cannot test every board that is
supported upstream.

I can ask though the KernelCI folks to boot my branch in all their
boards and make sure that those work when of_platform_populate is
called in late_initcall.

http://kernelci.org/boot/all/job/next/kernel/next-20150619/

>> I have tested this on boards with Tegra, iMX.6 and Exynos SoCs, and these
>> patches were enough to eliminate all the deferred probes.
>>
>> With this series I get the kernel to output to the panel in 0.5s, instead of 2.8s.
>
> That's certainly compelling.

Have to say that those numbers are with the serial console enabled
(without, it's 0.5s vs 1.5s), but on machines that take longer to boot
we should see bigger gains because we won't be sending devices to the
end of the queue when their probe is deferred.

Regards,

Tomeu

> Rob
>
>>
>> Regards,
>>
>> Tomeu
>>
>> [0] http://lists.freedesktop.org/archives/dri-devel/2014-August/066527.html
>>
>> [1] https://lkml.org/lkml/2014/5/12/452
>>
>> Tomeu Vizoso (21):
>>   regulator: core: Reduce critical area in _regulator_get
>>   ARM: tegra: Add gpio-ranges property
>>   ARM: tegra: Register drivers before devices
>>   ARM: EXYNOS: Register drivers before devices
>>   ARM i.MX6q: Register drivers before devices
>>   of/platform: Add of_platform_device_ensure()
>>   of/platform: Ensure device registration on lookup
>>   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
>>   clk: Probe clk providers on demand
>>   pinctrl: Probe pinctrl devices on demand
>>   phy: core: Probe phy providers on demand
>>   dma: of: Probe DMA controllers on demand
>>   power-supply: Probe power supplies on demand
>>
>>  arch/arm/boot/dts/tegra124.dtsi     |  1 +
>>  arch/arm/mach-exynos/exynos.c       |  4 +--
>>  arch/arm/mach-imx/mach-imx6q.c      | 12 ++++-----
>>  arch/arm/mach-tegra/tegra.c         | 21 ++++++---------
>>  drivers/clk/clk.c                   |  3 +++
>>  drivers/dma/of-dma.c                |  3 +++
>>  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               | 53 +++++++++++++++++++++++++++++++++++++
>>  drivers/phy/phy-core.c              |  3 +++
>>  drivers/pinctrl/devicetree.c        |  2 ++
>>  drivers/power/power_supply_core.c   |  3 +++
>>  drivers/pwm/core.c                  |  3 +++
>>  drivers/regulator/core.c            | 45 +++++++++++++++----------------
>>  drivers/usb/phy/phy.c               |  3 +++
>>  drivers/video/backlight/backlight.c |  3 +++
>>  include/linux/of_platform.h         |  2 ++
>>  19 files changed, 130 insertions(+), 45 deletions(-)
>>
>> --
>> 2.4.1
>>
> --
> 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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

  parent reply	other threads:[~2015-06-22 15:24 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 14:53 [PATCH 00/21] On-demand device registration Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 01/21] regulator: core: Reduce critical area in _regulator_get Tomeu Vizoso
2015-05-25 17:18   ` Mark Brown
2015-05-25 17:45   ` Mark Brown
2015-05-25 14:53 ` [PATCH 02/21] ARM: tegra: Add gpio-ranges property Tomeu Vizoso
2015-05-26 19:41   ` Stephen Warren
2015-05-27 14:18     ` Tomeu Vizoso
2015-05-27 14:49       ` Stephen Warren
2015-05-28  8:26         ` Tomeu Vizoso
2015-05-28 15:50           ` Stephen Warren
2015-06-16  7:53             ` Tomeu Vizoso
2015-06-02 11:28     ` Linus Walleij
2015-06-02 15:40       ` Stephen Warren
2015-06-16  8:42         ` Tomeu Vizoso
2015-06-16 20:32           ` Stephen Warren
2015-06-17 10:04             ` Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 03/21] ARM: tegra: Register drivers before devices Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 04/21] ARM: EXYNOS: " Tomeu Vizoso
2015-05-26  0:41   ` Krzysztof Kozlowski
2015-05-25 14:53 ` [PATCH 05/21] ARM i.MX6q: " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 06/21] of/platform: Add of_platform_device_ensure() Tomeu Vizoso
2015-05-26 18:56   ` Dmitry Torokhov
2015-05-27  8:04     ` Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 07/21] of/platform: Ensure device registration on lookup Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 08/21] gpio: Probe GPIO drivers on demand Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 09/21] gpio: Probe pinctrl devices " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 10/21] regulator: core: Probe regulators " Tomeu Vizoso
2015-05-25 17:32   ` Mark Brown
2015-05-26  6:17     ` Tomeu Vizoso
2015-05-26  9:36       ` Mark Brown
2015-05-26 15:08         ` Tomeu Vizoso
2015-05-26 16:54           ` Mark Brown
2015-05-26 17:53             ` Tomeu Vizoso
2015-05-26 19:55               ` Mark Brown
2015-05-25 14:53 ` [PATCH 11/21] drm: Probe panels " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 12/21] drm/tegra: Probe dpaux devices " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 13/21] i2c: core: Probe i2c master " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 14/21] pwm: Probe PWM chip " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 15/21] backlight: Probe backlight " Tomeu Vizoso
2015-05-26  7:18   ` Lee Jones
2015-05-26  7:25     ` Sascha Hauer
2015-05-26  8:39       ` Lee Jones
2015-05-26 12:01         ` Tomeu Vizoso
2015-05-26 13:34           ` Lee Jones
2015-05-25 14:53 ` [PATCH 16/21] usb: phy: Probe phy " Tomeu Vizoso
2015-05-26 14:44   ` Felipe Balbi
2015-05-25 14:53 ` [PATCH 17/21] clk: Probe clk providers " Tomeu Vizoso
2015-05-28  6:16   ` Michael Turquette
2015-05-25 14:53 ` [PATCH 18/21] pinctrl: Probe pinctrl devices " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 19/21] phy: core: Probe phy providers " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 20/21] dma: of: Probe DMA controllers " Tomeu Vizoso
2015-05-25 14:53 ` [PATCH 21/21] power-supply: Probe power supplies " Tomeu Vizoso
2015-05-28  4:33 ` [PATCH 00/21] On-demand device registration Rob Herring
2015-06-03 19:57   ` Grygorii.Strashko@linaro.org
2015-06-04  8:39     ` Tomeu Vizoso
2015-06-04 16:51       ` Grygorii.Strashko@linaro.org
2015-06-04 20:39     ` Alexander Holler
2015-06-08 12:26       ` Enrico Weigelt, metux IT consult
2015-06-08 18:14         ` Alexander Holler
2015-06-08 18:18           ` Alexander Holler
2015-06-22 15:23   ` Tomeu Vizoso [this message]
2015-06-23  0:01     ` Rob Herring
2015-06-02  8:48 ` Linus Walleij
2015-06-02 10:14   ` Tomeu Vizoso
2015-06-10  7:30     ` Linus Walleij
2015-06-10 10:19       ` Tomeu Vizoso
2015-06-10 12:23         ` Andrzej Hajda
2015-06-11  8:15         ` Linus Walleij
     [not found]       ` <5577F533.1060007@ahsoftware.de>
2015-06-11  8:12         ` Linus Walleij
2015-06-11 10:17           ` Alexander Holler
2015-06-11 11:24             ` Alexander Holler
2015-06-11 11:49               ` Alexander Holler
2015-06-11 12:30             ` Linus Walleij
2015-06-11 16:40               ` Alexander Holler
2015-06-12  7:25                 ` Linus Walleij
2015-06-12 11:19                   ` Alexander Holler
2015-06-12 11:36                     ` Alexander Holler
2015-06-13 18:27                       ` Alexander Holler
2015-06-15  8:58                         ` Linus Walleij
2015-06-15  9:42                           ` Alexander Holler
2015-06-11 13:09             ` Tomeu Vizoso
2015-06-03 21:12 ` Rob Clark
2015-06-04 21:03   ` Alexander Holler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAObsKCdv_X+YPFacO7NjbRMnvuDisAmiQOWE-Xb3xFFrn6Qog@mail.gmail.com \
    --to=tomeu.vizoso@collabora.com \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=grant.likely@linaro.org \
    --cc=holler@ahsoftware.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robherring2@gmail.com \
    --cc=stephane.marchesin@gmail.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).