Thread (61 messages) 61 messages, 7 authors, 2023-12-28

Re: [PATCH 05/13] tty: serial: samsung: add gs101 earlycon support

From: Tudor Ambarus <tudor.ambarus@linaro.org>
Date: 2023-12-14 14:31:35
Also in: linux-clk, linux-devicetree, linux-i2c, linux-samsung-soc, linux-serial, lkml


On 12/14/23 14:19, Arnd Bergmann wrote:
On Thu, Dec 14, 2023, at 13:52, Tudor Ambarus wrote:
quoted
On 12/14/23 12:01, Arnd Bergmann wrote:
quoted
On Thu, Dec 14, 2023, at 11:52, Tudor Ambarus wrote:
quoted
+static int __init gs101_early_console_setup(struct earlycon_device *device,
It works if in device tree one specifies the reg-io-width property and
sets it to 4. If the reg-io-width is not specified, the iotype defaults
to UPIO_MEM causing the SError interrupt on gs101 which makes the system
unusable.
In the case of incorrect DT data like a missing reg-io-width property,
I would expect it to still fail once the regular console or tty takes
over from earlycon.
quoted
Also, if the earlycon comes specified from the kernel params, the
of_setup_earlycon() is no longer called and the earlycon will be set
solely based on the kernel params buffer, thus allowing users to crash
the kernel on wrong earlycon definitions.
But that in turn is the same as specifying any other incorrect earlycon.
I don't think you can crash the kernel if you use other earlycon as you
don't make accesses on the 32bit restricted bus. But I agree that if
using the correct earlycon name, and mmio instead mmio32, is equivalent
to not specifying reg-io-width in dt.
quoted
If you think the change is fine, I can amend the commit message with the
description from above.
I'm still not convinced we need a special case here when everything else
just requires passing the correct data.
Well, I made this patch because I used a wrong bootargs earlycon
configuration and I ended up crashing the kernel. I couldn't see what
happens as kgdb is not available at that stage. Figuring out what was
going on made me spend some time. I hoped I'll be helpful and spare
others of the same mistakes and wasted time.

I'm ok to drop the patch as well, no pushing here. Please ignore.
Thanks for the review!

Cheers,
ta

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help