Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] drm: atomic_sro_install_state API forces drivers to ignore fallible 
resource acquisition errors
--

commit 5d8a38d52cf88932aa75f1dc6ea53c59a6c116b9
Author: Maxime Ripard <[email protected]>

drm/atomic_sro: Create documentation

This commit adds documentation for the State Read-Out (SRO) infrastructure.
It explains how drivers should integrate with the SRO phases to initialize
KMS atomic state from the hardware state left by the firmware at boot.

> diff --git a/drivers/gpu/drm/drm_atomic_sro.c 
> b/drivers/gpu/drm/drm_atomic_sro.c
> index 14fddd7601658..6cd002e857d98 100644
> --- a/drivers/gpu/drm/drm_atomic_sro.c
> +++ b/drivers/gpu/drm/drm_atomic_sro.c
> @@ -14,6 +14,37 @@
>  #include "drm_internal.h"
>  #include "drm_crtc_internal.h"
>  
> +/**
> + * DOC: overview

[ ... ]

> + * The second phase is the installation. Once all states have been read
> + * out, drm_atomic_sro_install_state() walks through the
> + * &struct drm_atomic_sro_state and assigns each readout state as the
> + * object's current state. Before doing so, it calls the optional
> + * atomic_sro_install_state hook on each object. This gives drivers a
> + * chance to acquire the resources needed to keep the hardware state
> + * active, such as power domains, clocks, or interrupts. This hook
> + * cannot fail.

[Severity: Medium]
By designing the atomic_sro_install_state hook so it cannot fail, does this
API force drivers to silently ignore fallible resource acquisition errors?

Resource acquisitions like clk_prepare_enable and pm_runtime_get_sync can
fail due to temporary resource issues. If a clock or power domain enable
fails when the infrastructure calls atomic_sro_install_state, the driver
cannot propagate the error.

Could this lead to a situation where the DRM core installs the state and
proceeds as if the display is active, while the underlying hardware remains
unclocked or unpowered, potentially causing a hardware lockup or system
crash on subsequent register access?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=10

Reply via email to