Skip to contentSkip to conversation

drm/vc4: Unselect PM

PATCH In review Maxime Ripard 3 participants 3 messages Sep 24, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/vc4: Unselect PM

It turns out we can't select PM when allowing the compilation for COMPILE_TEST. Indeed, PM might not be defined at all, or come with extra requirements we can't meet.

This select was initially introduced since we need to call the vc4_hdmi_runtime_resume() at probe time to make sure our device is properly powered at bind time, no matter whether PM is there or not, and we needed to make sure we didn't have a defined but not used warning for vc4_hdmi_runtime_suspend().

This will still happen on platforms that don't define PM though, since SET_RUNTIME_PM_OPS will then be a nop. In order to fix both issues, let's remove the select, and add a __maybe_unused attribute to vc4_hdmi_runtime_resume().

---

I'm not sure how to merge this one, since this commit has been reverted in Linus tree, and un-reverted in linux-next. Should we wait a bit until the reworked version of the original commit has been merged again?

Maxime

Changes from v1:
- remove select
- add __maybe_unused to vc4_hdmi_runtime_resume
- reword the commit log

---
 drivers/gpu/drm/vc4/Kconfig    | 1 -
 drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/vc4/Kconfig +0 -1
index 52a1c309cb4a..345a5570a3da 100644
@@ -9,7 +9,6 @@ config DRM_VC4
 	select DRM_KMS_CMA_HELPER
 	select DRM_GEM_CMA_HELPER
 	select DRM_PANEL_BRIDGE
-	select PM
 	select SND_PCM
 	select SND_PCM_ELD
 	select SND_SOC_GENERIC_DMAENGINE_PCM
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -1
index 500cdd56b335..1f2690ed8542 100644
@@ -2122,7 +2122,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)
 	return 0;
 }
 
-static int vc4_hdmi_runtime_suspend(struct device *dev)
+static int __maybe_unused vc4_hdmi_runtime_suspend(struct device *dev)
 {
 	struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
 
Signature · 7 lines
2.31.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by Tested-by on v2 1/1
#1 lore raw
Quoted 10 lines · Maxime Ripard

It turns out we can't select PM when allowing the compilation for COMPILE_TEST. Indeed, PM might not be defined at all, or come with extra requirements we can't meet.

This select was initially introduced since we need to call the vc4_hdmi_runtime_resume() at probe time to make sure our device is properly powered at bind time, no matter whether PM is there or not, and we needed to make sure we didn't have a defined but not used warning for vc4_hdmi_runtime_suspend().

Quoted 7 lines

This will still happen on platforms that don't define PM though, since SET_RUNTIME_PM_OPS will then be a nop. In order to fix both issues, let's remove the select, and add a __maybe_unused attribute to vc4_hdmi_runtime_resume().

Quoted 45 lines

---

I'm not sure how to merge this one, since this commit has been reverted in Linus tree, and un-reverted in linux-next. Should we wait a bit until the reworked version of the original commit has been merged again?

Maxime

Changes from v1:
- remove select
- add __maybe_unused to vc4_hdmi_runtime_resume
- reword the commit log

---
 drivers/gpu/drm/vc4/Kconfig    | 1 -
 drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/vc4/Kconfig +0 -1
index 52a1c309cb4a..345a5570a3da 100644
@@ -9,7 +9,6 @@ config DRM_VC4
 	select DRM_KMS_CMA_HELPER
 	select DRM_GEM_CMA_HELPER
 	select DRM_PANEL_BRIDGE
-	select PM
 	select SND_PCM
 	select SND_PCM_ELD
 	select SND_SOC_GENERIC_DMAENGINE_PCM
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -1
index 500cdd56b335..1f2690ed8542 100644
@@ -2122,7 +2122,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)
 	return 0;
 }
 
-static int vc4_hdmi_runtime_suspend(struct device *dev)
+static int __maybe_unused vc4_hdmi_runtime_suspend(struct device *dev)
 {
 	struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
 
Signature · 1 line
2.31.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Acked-by on v2 1/1
#2 lore raw
In reply to Maxime Ripard
Quoted 10 lines · Maxime Ripard

It turns out we can't select PM when allowing the compilation for COMPILE_TEST. Indeed, PM might not be defined at all, or come with extra requirements we can't meet.

This select was initially introduced since we need to call the vc4_hdmi_runtime_resume() at probe time to make sure our device is properly powered at bind time, no matter whether PM is there or not, and we needed to make sure we didn't have a defined but not used warning for vc4_hdmi_runtime_suspend().

Quoted 8 lines

This will still happen on platforms that don't define PM though, since SET_RUNTIME_PM_OPS will then be a nop. In order to fix both issues, let's remove the select, and add a __maybe_unused attribute to vc4_hdmi_runtime_resume().

LGTM. Thanks.

Quoted 43 lines

---

I'm not sure how to merge this one, since this commit has been reverted in Linus tree, and un-reverted in linux-next. Should we wait a bit until the reworked version of the original commit has been merged again?

Maxime

Changes from v1:
- remove select
- add __maybe_unused to vc4_hdmi_runtime_resume
- reword the commit log

---
  drivers/gpu/drm/vc4/Kconfig    | 1 -
  drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
  2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/vc4/Kconfig +0 -1
index 52a1c309cb4a..345a5570a3da 100644
@@ -9,7 +9,6 @@ config DRM_VC4
  	select DRM_KMS_CMA_HELPER
  	select DRM_GEM_CMA_HELPER
  	select DRM_PANEL_BRIDGE
-	select PM
  	select SND_PCM
  	select SND_PCM_ELD
  	select SND_SOC_GENERIC_DMAENGINE_PCM
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -1
index 500cdd56b335..1f2690ed8542 100644
@@ -2122,7 +2122,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi)
  	return 0;
  }
 
-static int vc4_hdmi_runtime_suspend(struct device *dev)
+static int __maybe_unused vc4_hdmi_runtime_suspend(struct device *dev)
  {
  	struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev);
 
Signature · 6 lines
~Randy

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel