All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] omapdrm: dss: mark runtime PM functions __maybe_unused
@ 2021-12-05 13:15 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2021-12-05 13:15 UTC (permalink / raw)
  To: Tomi Valkeinen, David Airlie, Daniel Vetter, Cai Huoqing
  Cc: Arnd Bergmann, Laurent Pinchart, Neil Armstrong, Jyri Sarha,
	Sebastian Reichel, dri-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Using the SET_RUNTIME_PM_OPS() macro causes a warning about the
referenced functions when they are marked static but not __maybe_unused:

drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function]

Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/dss.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/venc.c  | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index b440147ae28b..ab259efe132b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -4842,7 +4842,7 @@ static int dispc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int dispc_runtime_suspend(struct device *dev)
+static __maybe_unused int dispc_runtime_suspend(struct device *dev)
 {
 	struct dispc_device *dispc = dev_get_drvdata(dev);
 
@@ -4857,7 +4857,7 @@ static int dispc_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int dispc_runtime_resume(struct device *dev)
+static __maybe_unused int dispc_runtime_resume(struct device *dev)
 {
 	struct dispc_device *dispc = dev_get_drvdata(dev);
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index d730bf67fed9..a6845856cbce 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -5058,7 +5058,7 @@ static int dsi_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int dsi_runtime_suspend(struct device *dev)
+static __maybe_unused int dsi_runtime_suspend(struct device *dev)
 {
 	struct dsi_data *dsi = dev_get_drvdata(dev);
 
@@ -5071,7 +5071,7 @@ static int dsi_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int dsi_runtime_resume(struct device *dev)
+static __maybe_unused int dsi_runtime_resume(struct device *dev)
 {
 	struct dsi_data *dsi = dev_get_drvdata(dev);
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 66db28bfe824..69b3e15b9356 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1569,7 +1569,7 @@ static void dss_shutdown(struct platform_device *pdev)
 	DSSDBG("shutdown\n");
 }
 
-static int dss_runtime_suspend(struct device *dev)
+static __maybe_unused int dss_runtime_suspend(struct device *dev)
 {
 	struct dss_device *dss = dev_get_drvdata(dev);
 
@@ -1581,7 +1581,7 @@ static int dss_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int dss_runtime_resume(struct device *dev)
+static __maybe_unused int dss_runtime_resume(struct device *dev)
 {
 	struct dss_device *dss = dev_get_drvdata(dev);
 	int r;
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index 508fddd376cf..4480b69ab5a7 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -879,7 +879,7 @@ static int venc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int venc_runtime_suspend(struct device *dev)
+static __maybe_unused int venc_runtime_suspend(struct device *dev)
 {
 	struct venc_device *venc = dev_get_drvdata(dev);
 
@@ -889,7 +889,7 @@ static int venc_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int venc_runtime_resume(struct device *dev)
+static __maybe_unused int venc_runtime_resume(struct device *dev)
 {
 	struct venc_device *venc = dev_get_drvdata(dev);
 
-- 
2.29.2


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

* [PATCH] omapdrm: dss: mark runtime PM functions __maybe_unused
@ 2021-12-05 13:15 ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2021-12-05 13:15 UTC (permalink / raw)
  To: Tomi Valkeinen, David Airlie, Daniel Vetter, Cai Huoqing
  Cc: Arnd Bergmann, Neil Armstrong, Sebastian Reichel, dri-devel,
	linux-kernel, Jyri Sarha, Laurent Pinchart

From: Arnd Bergmann <arnd@arndb.de>

Using the SET_RUNTIME_PM_OPS() macro causes a warning about the
referenced functions when they are marked static but not __maybe_unused:

drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function]
drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function]

Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 4 ++--
 drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/dss.c   | 4 ++--
 drivers/gpu/drm/omapdrm/dss/venc.c  | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index b440147ae28b..ab259efe132b 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -4842,7 +4842,7 @@ static int dispc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int dispc_runtime_suspend(struct device *dev)
+static __maybe_unused int dispc_runtime_suspend(struct device *dev)
 {
 	struct dispc_device *dispc = dev_get_drvdata(dev);
 
@@ -4857,7 +4857,7 @@ static int dispc_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int dispc_runtime_resume(struct device *dev)
+static __maybe_unused int dispc_runtime_resume(struct device *dev)
 {
 	struct dispc_device *dispc = dev_get_drvdata(dev);
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index d730bf67fed9..a6845856cbce 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -5058,7 +5058,7 @@ static int dsi_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int dsi_runtime_suspend(struct device *dev)
+static __maybe_unused int dsi_runtime_suspend(struct device *dev)
 {
 	struct dsi_data *dsi = dev_get_drvdata(dev);
 
@@ -5071,7 +5071,7 @@ static int dsi_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int dsi_runtime_resume(struct device *dev)
+static __maybe_unused int dsi_runtime_resume(struct device *dev)
 {
 	struct dsi_data *dsi = dev_get_drvdata(dev);
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 66db28bfe824..69b3e15b9356 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1569,7 +1569,7 @@ static void dss_shutdown(struct platform_device *pdev)
 	DSSDBG("shutdown\n");
 }
 
-static int dss_runtime_suspend(struct device *dev)
+static __maybe_unused int dss_runtime_suspend(struct device *dev)
 {
 	struct dss_device *dss = dev_get_drvdata(dev);
 
@@ -1581,7 +1581,7 @@ static int dss_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int dss_runtime_resume(struct device *dev)
+static __maybe_unused int dss_runtime_resume(struct device *dev)
 {
 	struct dss_device *dss = dev_get_drvdata(dev);
 	int r;
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index 508fddd376cf..4480b69ab5a7 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -879,7 +879,7 @@ static int venc_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int venc_runtime_suspend(struct device *dev)
+static __maybe_unused int venc_runtime_suspend(struct device *dev)
 {
 	struct venc_device *venc = dev_get_drvdata(dev);
 
@@ -889,7 +889,7 @@ static int venc_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int venc_runtime_resume(struct device *dev)
+static __maybe_unused int venc_runtime_resume(struct device *dev)
 {
 	struct venc_device *venc = dev_get_drvdata(dev);
 
-- 
2.29.2


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

* Re: [PATCH] omapdrm: dss: mark runtime PM functions __maybe_unused
  2021-12-05 13:15 ` Arnd Bergmann
@ 2021-12-06 11:14   ` Laurent Pinchart
  -1 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2021-12-06 11:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Tomi Valkeinen, David Airlie, Daniel Vetter, Cai Huoqing,
	Arnd Bergmann, Neil Armstrong, Jyri Sarha, Sebastian Reichel,
	dri-devel, linux-kernel

Hi Arnd,

Thank you for the patch.

On Sun, Dec 05, 2021 at 02:15:56PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Using the SET_RUNTIME_PM_OPS() macro causes a warning about the
> referenced functions when they are marked static but not __maybe_unused:
> 
> drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function]
> drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function]
> drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function]
> drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function]
> 
> Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()")

I wonder how well drivers are tested with !CONFIG_PM. We may be going
through hoops and loops to support this when it actually won't work in
most drivers. That's a separate issue though :-)

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Tomi, could you apply this ?

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 4 ++--
>  drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 ++--
>  drivers/gpu/drm/omapdrm/dss/dss.c   | 4 ++--
>  drivers/gpu/drm/omapdrm/dss/venc.c  | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index b440147ae28b..ab259efe132b 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -4842,7 +4842,7 @@ static int dispc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int dispc_runtime_suspend(struct device *dev)
> +static __maybe_unused int dispc_runtime_suspend(struct device *dev)
>  {
>  	struct dispc_device *dispc = dev_get_drvdata(dev);
>  
> @@ -4857,7 +4857,7 @@ static int dispc_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dispc_runtime_resume(struct device *dev)
> +static __maybe_unused int dispc_runtime_resume(struct device *dev)
>  {
>  	struct dispc_device *dispc = dev_get_drvdata(dev);
>  
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index d730bf67fed9..a6845856cbce 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -5058,7 +5058,7 @@ static int dsi_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int dsi_runtime_suspend(struct device *dev)
> +static __maybe_unused int dsi_runtime_suspend(struct device *dev)
>  {
>  	struct dsi_data *dsi = dev_get_drvdata(dev);
>  
> @@ -5071,7 +5071,7 @@ static int dsi_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dsi_runtime_resume(struct device *dev)
> +static __maybe_unused int dsi_runtime_resume(struct device *dev)
>  {
>  	struct dsi_data *dsi = dev_get_drvdata(dev);
>  
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
> index 66db28bfe824..69b3e15b9356 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
> @@ -1569,7 +1569,7 @@ static void dss_shutdown(struct platform_device *pdev)
>  	DSSDBG("shutdown\n");
>  }
>  
> -static int dss_runtime_suspend(struct device *dev)
> +static __maybe_unused int dss_runtime_suspend(struct device *dev)
>  {
>  	struct dss_device *dss = dev_get_drvdata(dev);
>  
> @@ -1581,7 +1581,7 @@ static int dss_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dss_runtime_resume(struct device *dev)
> +static __maybe_unused int dss_runtime_resume(struct device *dev)
>  {
>  	struct dss_device *dss = dev_get_drvdata(dev);
>  	int r;
> diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
> index 508fddd376cf..4480b69ab5a7 100644
> --- a/drivers/gpu/drm/omapdrm/dss/venc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/venc.c
> @@ -879,7 +879,7 @@ static int venc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int venc_runtime_suspend(struct device *dev)
> +static __maybe_unused int venc_runtime_suspend(struct device *dev)
>  {
>  	struct venc_device *venc = dev_get_drvdata(dev);
>  
> @@ -889,7 +889,7 @@ static int venc_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int venc_runtime_resume(struct device *dev)
> +static __maybe_unused int venc_runtime_resume(struct device *dev)
>  {
>  	struct venc_device *venc = dev_get_drvdata(dev);
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH] omapdrm: dss: mark runtime PM functions __maybe_unused
@ 2021-12-06 11:14   ` Laurent Pinchart
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Pinchart @ 2021-12-06 11:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Tomi Valkeinen, Arnd Bergmann, Neil Armstrong, David Airlie,
	Sebastian Reichel, Jyri Sarha, linux-kernel, Cai Huoqing,
	dri-devel

Hi Arnd,

Thank you for the patch.

On Sun, Dec 05, 2021 at 02:15:56PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Using the SET_RUNTIME_PM_OPS() macro causes a warning about the
> referenced functions when they are marked static but not __maybe_unused:
> 
> drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function]
> drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function]
> drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function]
> drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function]
> 
> Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()")

I wonder how well drivers are tested with !CONFIG_PM. We may be going
through hoops and loops to support this when it actually won't work in
most drivers. That's a separate issue though :-)

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Tomi, could you apply this ?

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 4 ++--
>  drivers/gpu/drm/omapdrm/dss/dsi.c   | 4 ++--
>  drivers/gpu/drm/omapdrm/dss/dss.c   | 4 ++--
>  drivers/gpu/drm/omapdrm/dss/venc.c  | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
> index b440147ae28b..ab259efe132b 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -4842,7 +4842,7 @@ static int dispc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int dispc_runtime_suspend(struct device *dev)
> +static __maybe_unused int dispc_runtime_suspend(struct device *dev)
>  {
>  	struct dispc_device *dispc = dev_get_drvdata(dev);
>  
> @@ -4857,7 +4857,7 @@ static int dispc_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dispc_runtime_resume(struct device *dev)
> +static __maybe_unused int dispc_runtime_resume(struct device *dev)
>  {
>  	struct dispc_device *dispc = dev_get_drvdata(dev);
>  
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index d730bf67fed9..a6845856cbce 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -5058,7 +5058,7 @@ static int dsi_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int dsi_runtime_suspend(struct device *dev)
> +static __maybe_unused int dsi_runtime_suspend(struct device *dev)
>  {
>  	struct dsi_data *dsi = dev_get_drvdata(dev);
>  
> @@ -5071,7 +5071,7 @@ static int dsi_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dsi_runtime_resume(struct device *dev)
> +static __maybe_unused int dsi_runtime_resume(struct device *dev)
>  {
>  	struct dsi_data *dsi = dev_get_drvdata(dev);
>  
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
> index 66db28bfe824..69b3e15b9356 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
> @@ -1569,7 +1569,7 @@ static void dss_shutdown(struct platform_device *pdev)
>  	DSSDBG("shutdown\n");
>  }
>  
> -static int dss_runtime_suspend(struct device *dev)
> +static __maybe_unused int dss_runtime_suspend(struct device *dev)
>  {
>  	struct dss_device *dss = dev_get_drvdata(dev);
>  
> @@ -1581,7 +1581,7 @@ static int dss_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int dss_runtime_resume(struct device *dev)
> +static __maybe_unused int dss_runtime_resume(struct device *dev)
>  {
>  	struct dss_device *dss = dev_get_drvdata(dev);
>  	int r;
> diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
> index 508fddd376cf..4480b69ab5a7 100644
> --- a/drivers/gpu/drm/omapdrm/dss/venc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/venc.c
> @@ -879,7 +879,7 @@ static int venc_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int venc_runtime_suspend(struct device *dev)
> +static __maybe_unused int venc_runtime_suspend(struct device *dev)
>  {
>  	struct venc_device *venc = dev_get_drvdata(dev);
>  
> @@ -889,7 +889,7 @@ static int venc_runtime_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int venc_runtime_resume(struct device *dev)
> +static __maybe_unused int venc_runtime_resume(struct device *dev)
>  {
>  	struct venc_device *venc = dev_get_drvdata(dev);
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH] omapdrm: dss: mark runtime PM functions __maybe_unused
  2021-12-06 11:14   ` Laurent Pinchart
@ 2021-12-08  8:08     ` Tomi Valkeinen
  -1 siblings, 0 replies; 6+ messages in thread
From: Tomi Valkeinen @ 2021-12-08  8:08 UTC (permalink / raw)
  To: Laurent Pinchart, Arnd Bergmann
  Cc: David Airlie, Daniel Vetter, Cai Huoqing, Arnd Bergmann,
	Neil Armstrong, Jyri Sarha, Sebastian Reichel, dri-devel,
	linux-kernel

On 06/12/2021 13:14, Laurent Pinchart wrote:
> Hi Arnd,
> 
> Thank you for the patch.
> 
> On Sun, Dec 05, 2021 at 02:15:56PM +0100, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Using the SET_RUNTIME_PM_OPS() macro causes a warning about the
>> referenced functions when they are marked static but not __maybe_unused:
>>
>> drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function]
>> drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function]
>> drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function]
>> drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function]
>>
>> Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()")
> 
> I wonder how well drivers are tested with !CONFIG_PM. We may be going
> through hoops and loops to support this when it actually won't work in
> most drivers. That's a separate issue though :-)

It won't work, but can be fixed. I did that for tidss, some years back. 
The problem is that the driver depends on runtime_suspend/resume to be 
called, and the fix is to call them manually when !CONFIG_PM.

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Tomi, could you apply this ?

Yes, I'll push to drm-misc-next. Thanks!

  Tomi

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

* Re: [PATCH] omapdrm: dss: mark runtime PM functions __maybe_unused
@ 2021-12-08  8:08     ` Tomi Valkeinen
  0 siblings, 0 replies; 6+ messages in thread
From: Tomi Valkeinen @ 2021-12-08  8:08 UTC (permalink / raw)
  To: Laurent Pinchart, Arnd Bergmann
  Cc: Arnd Bergmann, Neil Armstrong, David Airlie, Sebastian Reichel,
	Jyri Sarha, linux-kernel, Cai Huoqing, dri-devel

On 06/12/2021 13:14, Laurent Pinchart wrote:
> Hi Arnd,
> 
> Thank you for the patch.
> 
> On Sun, Dec 05, 2021 at 02:15:56PM +0100, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Using the SET_RUNTIME_PM_OPS() macro causes a warning about the
>> referenced functions when they are marked static but not __maybe_unused:
>>
>> drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function]
>> drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function]
>> drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function]
>> drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function]
>>
>> Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()")
> 
> I wonder how well drivers are tested with !CONFIG_PM. We may be going
> through hoops and loops to support this when it actually won't work in
> most drivers. That's a separate issue though :-)

It won't work, but can be fixed. I did that for tidss, some years back. 
The problem is that the driver depends on runtime_suspend/resume to be 
called, and the fix is to call them manually when !CONFIG_PM.

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> Tomi, could you apply this ?

Yes, I'll push to drm-misc-next. Thanks!

  Tomi

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

end of thread, other threads:[~2021-12-08  8:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-05 13:15 [PATCH] omapdrm: dss: mark runtime PM functions __maybe_unused Arnd Bergmann
2021-12-05 13:15 ` Arnd Bergmann
2021-12-06 11:14 ` Laurent Pinchart
2021-12-06 11:14   ` Laurent Pinchart
2021-12-08  8:08   ` Tomi Valkeinen
2021-12-08  8:08     ` Tomi Valkeinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.