linux-i2c.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-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
	"Linux USB List" <linux-usb@vger.kernel.org>,
	"Wolfram Sang" <wsa@the-dreams.de>,
	"David Airlie" <airlied@linux.ie>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"Lee Jones" <lee.jones@linaro.org>,
	linux-clk@vger.kernel.org, "Alexandre Courbot" <gnurou@gmail.com>,
	"Terje Bergström" <tbergstrom@nvidia.com>,
	"Javier Martinez Canillas" <javier@osg.samsung.com>,
	"Vinod Koul" <vinod.koul@intel.com>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	linux-acpi@vger.ke
Subject: Re: [PATCH v2 0/22] On-demand device probing
Date: Fri, 31 Jul 2015 12:28:13 +0200	[thread overview]
Message-ID: <CAAObsKDALm94ZFwY+jBv3o8++-trTviiaGctAvvuySw9sxmLRQ@mail.gmail.com> (raw)
In-Reply-To: <CAL_Jsq+2q=c6JbER8EMOGFtR=a6gvHermb8DRo9dKyj6fvdnXg@mail.gmail.com>

On 30 July 2015 at 05:06, Rob Herring <robherring2@gmail.com> wrote:
> On Tue, Jul 28, 2015 at 8:19 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 and linking order.
>>
>> 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 probing devices as they are
>> referenced by other devices.
>>
>> This basically reuses the information that is already implicit in the
>> probe() implementations, saving us from refactoring existing drivers or
>> adding information to DTBs.
>>
>> During review of v1 of this series Linus Walleij suggested that it
>> should be the device driver core to make sure that dependencies are
>> ready before probing a device. I gave this idea a try [2] but Mark Brown
>> pointed out to the logic duplication between the resource acquisition
>> and dependency discovery code paths (though I think it's fairly minor).
>>
>> To address that code duplication I experimented with Arnd's devm_probe
>> [3] concept of having drivers declare their dependencies instead of
>> acquiring them during probe, and while it worked [4], I don't think we
>> end up winning anything when compared to just probing devices on-demand
>> from resource getters.
>>
>> One remaining objection is to the "sprinkling" of calls to
>> fwnode_ensure_device() in the resource getters of each subsystem, but I
>> think it's the right thing to do given that the storage of resources is
>> currently subsystem-specific.
>
> Seems like a minor change to me.
>
>> We could avoid the above by moving resource storage into the core, but I
>> don't think there's a compelling case for that.
>>
>> I have tested this on boards with Tegra, iMX.6, Exynos and OMAP SoCs,
>> and these patches were enough to eliminate all the deferred probes
>> (except one in PandaBoard because omap_dma_system doesn't have a
>> firmware node as of yet).
>>
>> With this series I get the kernel to output to the panel in 0.5s,
>> instead of 2.8s.
>
> Generally, I think this looks pretty good. It is simple and the error
> path is simply falling back to deferred probe.
>
> One overall comment is I'm not so sure if fwnode_ensure_device
> shouldn't just be of_ensure_device. At least currently, it looks like
> all the calling locations are DT specific functions anyway. There's
> very little logic within the function to really benefit sharing with
> ACPI. It is basically just a call to of_platform_device_find and then
> bus_probe_device. I expect the get functions will always call into
> DT/ACPI specific functions which can then call the firmware specific
> device find function.

That's fine with me. I just went that way because I assumed the plan
was for subsystems to move to consume fw data through fwnode and drop
as much fw-specific code as possible.

But I have just looked at fwnode_get_named_gpiod and the OF and ACPI
code paths are so dissimilar that I guess that's not so and would be
better to do as you say.

Thanks,

Tomeu

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2015-07-31 10:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 13:19 [PATCH v2 0/22] On-demand device probing Tomeu Vizoso
2015-07-28 13:19 ` [PATCH v2 13/22] i2c: core: Probe i2c master devices on demand Tomeu Vizoso
2015-08-09 12:34   ` Wolfram Sang
2015-08-09 13:37     ` Tomeu Vizoso
     [not found] ` <1438089593-7696-1-git-send-email-tomeu.vizoso-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2015-07-29  0:36   ` [PATCH v2 0/22] On-demand device probing Rafael J. Wysocki
2015-07-30  3:06 ` Rob Herring
2015-07-31 10:28   ` Tomeu Vizoso [this message]

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=CAAObsKDALm94ZFwY+jBv3o8++-trTviiaGctAvvuySw9sxmLRQ@mail.gmail.com \
    --to=tomeu.vizoso@collabora.com \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gnurou@gmail.com \
    --cc=javier@osg.samsung.com \
    --cc=kishon@ti.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.ke \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=robherring2@gmail.com \
    --cc=swarren@wwwdotorg.org \
    --cc=tbergstrom@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=vinod.koul@intel.com \
    --cc=wsa@the-dreams.de \
    /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).