amba: Retry adding deferred devices at late_initcall
authorRob Herring <robh@kernel.org>
Wed, 29 Apr 2020 20:58:12 +0000 (15:58 -0500)
committerRob Herring <robh@kernel.org>
Tue, 5 May 2020 16:43:01 +0000 (11:43 -0500)
commit039599c92d3b2e73689e8b6e519d653fd4770abb
treee0acc2f0d6b7d981eec7186a04de3a61069f625e
parent6aec54a649576e59d20c7ed0b3f000b8b5dff56b
amba: Retry adding deferred devices at late_initcall

If amba bus devices defer when adding, the amba bus code simply retries
adding the devices every 5 seconds. This doesn't work well as it
completely unsynchronized with starting the init process which can
happen in less than 5 secs. Add a retry during late_initcall. If the
amba devices are added, then deferred probe takes over. If the
dependencies have not probed at this point, then there's no improvement
over previous behavior. To completely solve this, we'd need to retry
after every successful probe as deferred probe does.

The list_empty() check now happens outside the mutex, but the mutex
wasn't necessary in the first place.

This needed to use deferred probe instead of fragile initcall ordering
on 32-bit VExpress systems where the apb_pclk has a number of probe
dependencies (vexpress-sysregs, vexpress-config).

Cc: John Stultz <john.stultz@linaro.org>
Cc: Saravana Kannan <saravanak@google.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Russell King <linux@armlinux.org.uk>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/amba/bus.c