poky-contrib/meta-yocto-bsp/recipes-kernel/linux/linux-yocto_6.12.bbappend
Ross Burton 959db9cb12 linux-yocto: revert omap8250 power management changes on genericarm64
The genericarm64 machine sets SERIAL_CONSOLES to a number of potential
devices:

SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0 115200;ttyS0 115200;ttyS1 115200;ttyS2"

With sysvinit this turns into getty lines in inittab, and with systemd
the systemd-serialgetty recipe creates explicit units to spawn gettys.

This worked fine with 6.6, but since "serial: 8250_omap: Drop
pm_runtime_irq_safe()"[1] in 6.7 onwards we see kernel hangs:

BUG: scheduling while atomic: getty/957/0x00000002
Call trace:
 dump_stack+0x1c/0x30
 __schedule_bug+0x60/0x90
 __schedule+0x83c/0xcf8
 schedule+0x40/0x158
 schedule_timeout+0xb0/0x1b0
 wait_for_completion_timeout+0x84/0x188
 ti_sci_set_device_state+0x134/0x220
 ti_sci_cmd_get_device_exclusive+0x24/0x40
 ti_sci_pd_power_on+0x34/0x68 [ti_sci_pm_domains]
 _genpd_power_on+0xa4/0x178
 genpd_power_on+0xb4/0x190
 genpd_runtime_resume+0xc8/0x260
 __rpm_callback+0x54/0x200
 rpm_callback+0x78/0x90
 rpm_resume+0x420/0x690
 __pm_runtime_resume+0x5c/0xb0
 omap8250_set_mctrl+0x38/0xe0 [8250_omap]
 serial8250_set_mctrl+0x2c/0x60
 uart_update_mctrl+0x98/0x120
 uart_shutdown+0x124/0x180
 uart_hangup+0x7c/0x180
 __tty_hangup.part.0+0x408/0x440
 tty_vhangup_session+0x24/0x40
 disassociate_ctty.part.0+0x48/0x1b0
 disassociate_ctty+0x30/0x48
(full backtrace elided)

With many thanks to TI, my understanding is that it was determined that
the problem here is that we have a getty connected to ttyS1 which is
actually the expansion port uart and on the BeaglePlay wired up to the
wifi controller's debug port. The getty receives noise it doesn't know
what to do with, and at some point the power management code does a
suspend/result cycle of the device.  The serial drivers assume that
child nodes use the serdev driver and they manage runtime_pm, but the
getty opening the tty breaks a series of bad assumptions in the drivers.

So, there are two bugs:
1) The kernel shouldn't crash if this tty is opened
2) The only serial port for a console on the BeaglePlay is ttyS2,
   despite others existing.

TI are looking at (1) and other patches to follow will deal with (2).
Until one of these is resolved entirely, reverting this change to power
management stops the crashes.

[ YOCTO #15704 ]
[1] linux 8700a7ea5519fb0b3bad2362adfeac358c2119ce

(From meta-yocto rev: 49519579f8b6bacf181d2f00bdd256e71d0880c4)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-18 11:08:36 +00:00

12 lines
482 B
Plaintext

COMPATIBLE_MACHINE:genericarm64 = "genericarm64"
COMPATIBLE_MACHINE:beaglebone-yocto = "beaglebone-yocto"
COMPATIBLE_MACHINE:genericx86 = "genericx86"
COMPATIBLE_MACHINE:genericx86-64 = "genericx86-64"
KMACHINE:beaglebone-yocto ?= "beaglebone"
KMACHINE:genericx86 ?= "common-pc"
KMACHINE:genericx86-64 ?= "common-pc-64"
FILESEXTRAPATHS:prepend:genericarm64 := "${THISDIR}/files:"
SRC_URI:append:genericarm64 = " file://0001-Revert-serial-8250_omap-Drop-pm_runtime_irq_safe.patch"