Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:

Pre-existing issues:
- [High] The use of pm_sleep_ptr() discards runtime PM callbacks when CONFIG_PM 
is enabled but CONFIG_PM_SLEEP is disabled, leading to a kernel oops on probe.
--

--- Patch [2]: [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning ---
commit 92fb37945f1af608d237fde0454ddaa90bee5644
Author: Jiri Slaby (SUSE) <[email protected]>

drm/imx: include dc-drv.h to avoid sparse warning

This commit adds an include of dc-drv.h in dc-ic.c to fix a sparse warning.
The warning indicated that dc_ic_driver was not declared.

> diff --git a/drivers/gpu/drm/imx/dc/dc-ic.c b/drivers/gpu/drm/imx/dc/dc-ic.c
> index d8aa46ee6a7a0..0f2fc7aecf31f 100644
> --- a/drivers/gpu/drm/imx/dc/dc-ic.c
> +++ b/drivers/gpu/drm/imx/dc/dc-ic.c
> @@ -14,6 +14,8 @@
>  #include <linux/pm_runtime.h>
>  #include <linux/regmap.h>
>  
> +#include "dc-drv.h"
> +
>  #define USERINTERRUPTMASK(n) (0x8 + 4 * (n))
>  #define INTERRUPTENABLE(n)   (0x10 + 4 * (n))

[ ... ]

drivers/gpu/drm/imx/dc/dc-ic.c:dc_ic_driver {
        .probe = dc_ic_probe,
        .remove = dc_ic_remove,
        .driver = {
                .name = "imx8-dc-intc",
                .suppress_bind_attrs = true,
                .of_match_table = dc_ic_dt_ids,
                .pm = pm_sleep_ptr(&dc_ic_pm_ops),
        },
};

[Severity: High]
This isn't a bug introduced by this patch, but can using pm_sleep_ptr() here
cause a kernel oops on probe?

If the kernel is configured with CONFIG_PM=y but CONFIG_PM_SLEEP=n,
pm_sleep_ptr() evaluates to NULL, dropping the entire PM operations
structure including the runtime PM callbacks set by RUNTIME_PM_OPS().

During device probe, pm_runtime_resume_and_get() would execute successfully
since the device lacks PM callbacks. As a result, dc_ic_runtime_resume()
is skipped and the AXI clock (clk_axi) is never enabled.

The probe function then calls regmap_write() to mask and clear interrupts.
Does accessing memory-mapped registers over an unclocked AXI bus trigger a
synchronous external bus abort? Should this use pm_ptr() instead?

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

Reply via email to