diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 4f767f3b19b6aa..6e336d455c96f9 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -9,6 +9,15 @@ function agnos_init { sudo rm -f /data/etc/NetworkManager/system-connections/*.nmmeta rm -f /data/scons_cache/config.lock + # The SDE display driver panics the kernel when a command-mode panel misses two + # consecutive pingpong-done IRQs (sde_encoder_phys_cmd.c, SDE_DBG_DUMP("panic")), + # which heat-soaked EA8074 panels do ~20-45s into boot - so a recoverable panel + # fault becomes a reboot loop. Disarming panic_on_err keeps the register dump and + # the PANEL_DEAD/ctl-reset recovery path; it only skips the panic() call. + # See commaai/openpilot#34971 and commaai/agnos-kernel-sdm845#85. + # Done here rather than in hardwared: this runs before any openpilot DRM client. + echo 0 | sudo tee /sys/kernel/debug/dri/0/debug/panic > /dev/null || true + # set success flag for current boot slot sudo abctl --set_success diff --git a/openpilot/system/hardware/hardwared.py b/openpilot/system/hardware/hardwared.py index 69f118d337d4bf..43b618d9578fa0 100755 --- a/openpilot/system/hardware/hardwared.py +++ b/openpilot/system/hardware/hardwared.py @@ -10,7 +10,7 @@ import openpilot.cereal.messaging as messaging from openpilot.cereal import log from openpilot.cereal.services import SERVICE_LIST -from openpilot.common.utils import strip_deprecated_keys +from openpilot.common.utils import strip_deprecated_keys, sudo_read from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.params import Params from openpilot.common.realtime import DT_HW @@ -192,6 +192,13 @@ def hardware_thread(end_event, hw_queue) -> None: last_uptime_ts: float = time.monotonic() HARDWARE.initialize_hardware() + + if TICI: + # panic-on-display-error is disarmed in launch_chffrplus.sh. journald is only_onroad, + # so nothing else records the state during the offroad boot window where a heat-soaked + # panel faults - log the readback so that boot is diagnosable after the fact. + cloudlog.event("hardwared.sde_panic_on_err", value=sudo_read("/sys/kernel/debug/dri/0/debug/panic")) + thermal_config = HARDWARE.get_thermal_config() fan_controller = FanController(int(1./DT_HW))