Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear()
@ 2026-07-08  9:56 Jiri Slaby (SUSE)
  2026-07-08  9:56 ` [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning Jiri Slaby (SUSE)
  2026-07-09  6:32 ` [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear() Liu Ying
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Slaby (SUSE) @ 2026-07-08  9:56 UTC (permalink / raw)
  To: victor.liu
  Cc: linux-kernel, Jiri Slaby (SUSE), Thomas Gleixner,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, dri-devel, imx, linux-arm-kernel

irq_domain_add_linear() is going away as being obsolete now. Switch to
the preferred irq_domain_create_linear(). That differs in the first
parameter: It takes more generic struct fwnode_handle instead of struct
device_node. Therefore, of_fwnode_handle() is added around the
parameter.

Note some of the users can likely use dev->fwnode directly instead of
indirect of_fwnode_handle(dev->of_node). But dev->fwnode is not
guaranteed to be set for all, so this has to be investigated on case to
case basis (by people who can actually test with the HW).

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Thomas Gleixner <tglx@kernel.org>
Cc: Liu Ying <victor.liu@nxp.com>
---
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/imx/dc/dc-ic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/dc/dc-ic.c b/drivers/gpu/drm/imx/dc/dc-ic.c
index a270ae4030cd..d8aa46ee6a7a 100644
--- a/drivers/gpu/drm/imx/dc/dc-ic.c
+++ b/drivers/gpu/drm/imx/dc/dc-ic.c
@@ -174,7 +174,7 @@ static int dc_ic_probe(struct platform_device *pdev)
 		regmap_write(data->regs, USERINTERRUPTMASK(i), 0xffffffff);
 	}
 
-	data->domain = irq_domain_add_linear(dev->of_node, IRQ_COUNT,
+	data->domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), IRQ_COUNT,
 					     &irq_generic_chip_ops, data);
 	if (!data->domain) {
 		dev_err(dev, "failed to create IRQ domain\n");
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning
  2026-07-08  9:56 [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear() Jiri Slaby (SUSE)
@ 2026-07-08  9:56 ` Jiri Slaby (SUSE)
  2026-07-08 10:05   ` sashiko-bot
  2026-07-09  6:34   ` Liu Ying
  2026-07-09  6:32 ` [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear() Liu Ying
  1 sibling, 2 replies; 5+ messages in thread
From: Jiri Slaby (SUSE) @ 2026-07-08  9:56 UTC (permalink / raw)
  To: victor.liu
  Cc: linux-kernel, Jiri Slaby (SUSE), Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, dri-devel,
	imx, linux-arm-kernel

sparse (build with C=1) warns:
drivers/gpu/drm/imx/dc/dc-ic.c:273:24: warning: symbol 'dc_ic_driver' was not declared. Should it be static?

And it is right. Include dc-drv.h which declares the struct. This
ensures the types of both match.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Liu Ying <victor.liu@nxp.com>
---
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/imx/dc/dc-ic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/imx/dc/dc-ic.c b/drivers/gpu/drm/imx/dc/dc-ic.c
index d8aa46ee6a7a..0f2fc7aecf31 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))
 #define INTERRUPTPRESET(n)	(0x18 + 4 * (n))
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning
  2026-07-08  9:56 ` [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning Jiri Slaby (SUSE)
@ 2026-07-08 10:05   ` sashiko-bot
  2026-07-09  6:34   ` Liu Ying
  1 sibling, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-07-08 10:05 UTC (permalink / raw)
  To: Jiri Slaby (SUSE); +Cc: imx, dri-devel, Frank.Li

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) <jirislaby@kernel.org>

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/20260708095645.385291-1-jirislaby@kernel.org?part=2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear()
  2026-07-08  9:56 [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear() Jiri Slaby (SUSE)
  2026-07-08  9:56 ` [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning Jiri Slaby (SUSE)
@ 2026-07-09  6:32 ` Liu Ying
  1 sibling, 0 replies; 5+ messages in thread
From: Liu Ying @ 2026-07-09  6:32 UTC (permalink / raw)
  To: Jiri Slaby (SUSE)
  Cc: linux-kernel, Thomas Gleixner, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, dri-devel,
	imx, linux-arm-kernel

On Wed, Jul 08, 2026 at 11:56:44AM +0200, Jiri Slaby (SUSE) wrote:
> irq_domain_add_linear() is going away as being obsolete now. Switch to
> the preferred irq_domain_create_linear(). That differs in the first
> parameter: It takes more generic struct fwnode_handle instead of struct
> device_node. Therefore, of_fwnode_handle() is added around the
> parameter.
> 
> Note some of the users can likely use dev->fwnode directly instead of
> indirect of_fwnode_handle(dev->of_node). But dev->fwnode is not
> guaranteed to be set for all, so this has to be investigated on case to
> case basis (by people who can actually test with the HW).
> 
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> Cc: Thomas Gleixner <tglx@kernel.org>
> Cc: Liu Ying <victor.liu@nxp.com>
> ---
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Frank Li <Frank.Li@nxp.com>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  drivers/gpu/drm/imx/dc/dc-ic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imx/dc/dc-ic.c b/drivers/gpu/drm/imx/dc/dc-ic.c
> index a270ae4030cd..d8aa46ee6a7a 100644
> --- a/drivers/gpu/drm/imx/dc/dc-ic.c
> +++ b/drivers/gpu/drm/imx/dc/dc-ic.c
> @@ -174,7 +174,7 @@ static int dc_ic_probe(struct platform_device *pdev)
>  		regmap_write(data->regs, USERINTERRUPTMASK(i), 0xffffffff);
>  	}
>  
> -	data->domain = irq_domain_add_linear(dev->of_node, IRQ_COUNT,
> +	data->domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), IRQ_COUNT,
>  					     &irq_generic_chip_ops, data);

'./scripts/checkpatch.pl --strict' complaints:
CHECK: Alignment should match open parenthesis
#34: FILE: drivers/gpu/drm/imx/dc/dc-ic.c:178:
+	data->domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), IRQ_COUNT,
 					     &irq_generic_chip_ops, data);

Acked-by: Liu Ying <victor.liu@nxp.com>

>  	if (!data->domain) {
>  		dev_err(dev, "failed to create IRQ domain\n");
> -- 
> 2.55.0
> 

-- 
Regards,
Liu Ying

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning
  2026-07-08  9:56 ` [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning Jiri Slaby (SUSE)
  2026-07-08 10:05   ` sashiko-bot
@ 2026-07-09  6:34   ` Liu Ying
  1 sibling, 0 replies; 5+ messages in thread
From: Liu Ying @ 2026-07-09  6:34 UTC (permalink / raw)
  To: Jiri Slaby (SUSE)
  Cc: linux-kernel, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, dri-devel, imx,
	linux-arm-kernel

On Wed, Jul 08, 2026 at 11:56:45AM +0200, Jiri Slaby (SUSE) wrote:
> sparse (build with C=1) warns:
> drivers/gpu/drm/imx/dc/dc-ic.c:273:24: warning: symbol 'dc_ic_driver' was not declared. Should it be static?
> 
> And it is right. Include dc-drv.h which declares the struct. This
> ensures the types of both match.
> 
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> Cc: Liu Ying <victor.liu@nxp.com>
> ---
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Frank Li <Frank.Li@nxp.com>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
>  drivers/gpu/drm/imx/dc/dc-ic.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Liu Ying <victor.liu@nxp.com>

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-09  6:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  9:56 [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear() Jiri Slaby (SUSE)
2026-07-08  9:56 ` [PATCH 2/2] drm/imx: include dc-drv.h to avoid sparse warning Jiri Slaby (SUSE)
2026-07-08 10:05   ` sashiko-bot
2026-07-09  6:34   ` Liu Ying
2026-07-09  6:32 ` [PATCH 1/2] drm/imx: Switch to irq_domain_create_linear() Liu Ying

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox