Hi Saravana,

On 04.03.2021 20:51, Saravana Kannan wrote:
> The uevents generated for an amba device need PID and CID information
> that's available only when the amba device is powered on, clocked and
> out of reset. So, if those resources aren't available, the information
> can't be read to generate the uevents. To workaround this requirement,
> if the resources weren't available, the device addition was deferred and
> retried periodically.
>
> However, this deferred addition retry isn't based on resources becoming
> available. Instead, it's retried every 5 seconds and causes arbitrary
> probe delays for amba devices and their consumers.
>
> Also, maintaining a separate deferred-probe like mechanism is
> maintenance headache.
>
> With this commit, instead of deferring the device addition, we simply
> defer the generation of uevents for the device and probing of the device
> (because drivers needs PID and CID to match) until the PID and CID
> information can be read. This allows us to delete all the amba specific
> deferring code and also avoid the arbitrary probing delays.
>
> Cc: Rob Herring <r...@kernel.org>
> Cc: Ulf Hansson <ulf.hans...@linaro.org>
> Cc: John Stultz <john.stu...@linaro.org>
> Cc: Saravana Kannan <sarava...@google.com>
> Cc: Linus Walleij <linus.wall...@linaro.org>
> Cc: Sudeep Holla <sudeep.ho...@arm.com>
> Cc: Nicolas Saenz Julienne <nsaenzjulie...@suse.de>
> Cc: Geert Uytterhoeven <geert+rene...@glider.be>
> Cc: Marek Szyprowski <m.szyprow...@samsung.com>
> Cc: Russell King <li...@armlinux.org.uk>
> Signed-off-by: Saravana Kannan <sarava...@google.com>
> ---
>
> v1 -> v2:
> - Dropped RFC tag
> - Complete rewrite to not use stub devices.
> v2 -> v3:
> - Flipped the if() condition for hard-coded periphids.
> - Added a stub driver to handle the case where all amba drivers are
>    modules loaded by uevents.
> - Cc Marek after I realized I forgot to add him.
>
> Marek,
>
> Would you mind testing this? It looks okay with my limited testing.

It looks it works fine on my test systems. I've checked current 
linux-next and this patch. You can add:

Tested-by: Marek Szyprowski <m.szyprow...@samsung.com>

I've briefly scanned the code and I'm curious how does it work. Does it 
depend on the recently introduced "fw_devlink=on" feature? I don't see 
other mechanism, which would trigger matching amba device if pm domains, 
clocks or resets were not available on time to read pid/cid while adding 
a device...

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Reply via email to