serial: kgdboc: Allow earlycon initialization to be deferred
authorDaniel Thompson <daniel.thompson@linaro.org>
Thu, 30 Apr 2020 16:17:41 +0000 (17:17 +0100)
committerDaniel Thompson <daniel.thompson@linaro.org>
Tue, 2 Jun 2020 14:15:45 +0000 (15:15 +0100)
commita4912303ac6fede434acf5c23a9108cdaf79844a
treed1691d0b2f4795740ca5c5438b87f2d6f9a9de70
parentf71fc3bc7b3279cb7d0ab78c1fcc78825779bb65
serial: kgdboc: Allow earlycon initialization to be deferred

Currently there is no guarantee that an earlycon will be initialized
before kgdboc tries to adopt it. Almost the opposite: on systems
with ACPI then if earlycon has no arguments then it is guaranteed that
earlycon will not be initialized.

This patch mitigates the problem by giving kgdboc_earlycon a second
chance during console_init(). This isn't quite as good as stopping during
early parameter parsing but it is still early in the kernel boot.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20200430161741.1832050-1-daniel.thompson@linaro.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
drivers/tty/serial/kgdboc.c