Re: [PATCH] arch: arm64: dts: apple: Remove stdout-path

From: Hector Martin
Date: Thu Dec 01 2022 - 10:47:02 EST


On 02/12/2022 00.19, Akihiko Odaki wrote:
> So I think we should think more about the case when the kernel is booted
> from m1n1. When using its hypervisor feature, it is more likely that you
> want console on serial and and that is the opposite of this change.
> However, it is still possible to get the console on framebuffer with
> keyboard.

Except if the framebuffer is broken, or everything is broken and it
hangs on early boot, which happens all the time when I'm debugging using
the hypervisor. Or maybe I'm just SSHing in remotely and not physically
in front of the machine, which is also often the case. Or maybe I'm just
booting headless because I didn't feel like swapping around the HDMI cable.

> In contrary, if you boot the kernel without the hypervisor
> feature and this change, you will completely lose the console.

How so? The console goes to both places with stdout-path set to serial0.
What it *does* change is where input is accepted prior to getty startup
(which is why u-boot specifically conditions this on keyboard presence,
modulo the USB issue - because if you *don't* have a keyboard then tty
keyboard input is useless). But if you're booting kernels without u-boot
along the way, you're probably doing it from the hypervisor or linux.py
anyway, especially if you plan to do something like "init=/bin/sh",
because without u-boot (+ optionally some EFI loader) there is no way of
editing command line arguments at boot time stand-alone.

However, while having stdout-path gives you both serial + tty output and
serial input, *not* having stdout-path kills serial entirely. It also
kills earlycon, and makes it so that you have to specify a bunch of
obscure arguments to get earlycon to work, instead of just a plain
"earlycon" argument which is much easier.

So for this to be considered at all, you would first need to propose a
m1n1 patch to re-add stdout-path in boots under the hypervisor and
(optionally?) on linux.py boots, so you don't regress tools that our
developers use every day.

But I still fail to see the benefit of this change. What scenario are
you envisioning that this would improve (something people actually do,
not a hypothetical)?

- Hector