* [PATCH] drm/xe: fix build warning with CONFIG_PM=n
@ 2024-09-09 20:25 Arnd Bergmann
2024-09-09 20:47 ` Rodrigo Vivi
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-09-09 20:25 UTC (permalink / raw)
To: Lucas De Marchi, Thomas Hellström, Rodrigo Vivi
Cc: Arnd Bergmann, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Anshuman Gupta,
Matthew Auld, Matthew Brost, Riana Tauro, Jonathan Cavitt,
intel-xe, dri-devel, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
The 'runtime_status' field is an implementation detail of the
power management code, so a device driver should not normally
touch this:
drivers/gpu/drm/xe/xe_pm.c: In function 'xe_pm_suspending_or_resuming':
drivers/gpu/drm/xe/xe_pm.c:606:26: error: 'struct dev_pm_info' has no member named 'runtime_status'
606 | return dev->power.runtime_status == RPM_SUSPENDING ||
| ^
drivers/gpu/drm/xe/xe_pm.c:607:27: error: 'struct dev_pm_info' has no member named 'runtime_status'
607 | dev->power.runtime_status == RPM_RESUMING;
| ^
drivers/gpu/drm/xe/xe_pm.c:608:1: error: control reaches end of non-void function [-Werror=return-type]
Add an #ifdef check to avoid the build regression.
Fixes: cb85e39dc5d1 ("drm/xe: Suppress missing outer rpm protection warning")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/xe/xe_pm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 9c59a30d7646..a3d1509066f7 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -601,10 +601,14 @@ bool xe_pm_runtime_get_if_in_use(struct xe_device *xe)
*/
static bool xe_pm_suspending_or_resuming(struct xe_device *xe)
{
+#ifdef CONFIG_PM
struct device *dev = xe->drm.dev;
return dev->power.runtime_status == RPM_SUSPENDING ||
dev->power.runtime_status == RPM_RESUMING;
+#else
+ return false;
+#endif
}
/**
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/xe: fix build warning with CONFIG_PM=n
2024-09-09 20:25 [PATCH] drm/xe: fix build warning with CONFIG_PM=n Arnd Bergmann
@ 2024-09-09 20:47 ` Rodrigo Vivi
0 siblings, 0 replies; 2+ messages in thread
From: Rodrigo Vivi @ 2024-09-09 20:47 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Lucas De Marchi, Thomas Hellström, Arnd Bergmann,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Anshuman Gupta, Matthew Auld, Matthew Brost,
Riana Tauro, Jonathan Cavitt, intel-xe, dri-devel, linux-kernel
On Mon, Sep 09, 2024 at 08:25:08PM +0000, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The 'runtime_status' field is an implementation detail of the
> power management code, so a device driver should not normally
> touch this:
>
> drivers/gpu/drm/xe/xe_pm.c: In function 'xe_pm_suspending_or_resuming':
> drivers/gpu/drm/xe/xe_pm.c:606:26: error: 'struct dev_pm_info' has no member named 'runtime_status'
> 606 | return dev->power.runtime_status == RPM_SUSPENDING ||
> | ^
> drivers/gpu/drm/xe/xe_pm.c:607:27: error: 'struct dev_pm_info' has no member named 'runtime_status'
> 607 | dev->power.runtime_status == RPM_RESUMING;
> | ^
> drivers/gpu/drm/xe/xe_pm.c:608:1: error: control reaches end of non-void function [-Werror=return-type]
>
> Add an #ifdef check to avoid the build regression.
>
Thank you
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
pushing now...
> Fixes: cb85e39dc5d1 ("drm/xe: Suppress missing outer rpm protection warning")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/gpu/drm/xe/xe_pm.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index 9c59a30d7646..a3d1509066f7 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -601,10 +601,14 @@ bool xe_pm_runtime_get_if_in_use(struct xe_device *xe)
> */
> static bool xe_pm_suspending_or_resuming(struct xe_device *xe)
> {
> +#ifdef CONFIG_PM
> struct device *dev = xe->drm.dev;
>
> return dev->power.runtime_status == RPM_SUSPENDING ||
> dev->power.runtime_status == RPM_RESUMING;
> +#else
> + return false;
> +#endif
> }
>
> /**
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-09 20:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-09 20:25 [PATCH] drm/xe: fix build warning with CONFIG_PM=n Arnd Bergmann
2024-09-09 20:47 ` Rodrigo Vivi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox