Skip to contentSkip to conversation

Miscellaneous runtime PM fixes for Nouveau

PATCH Superseded Lyude Paul 1 participant 3 messages May 26, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lyude Paul

author maintainer
#0 lore raw

cover Miscellaneous runtime PM fixes for Nouveau

Noticed these minor issues while trying to investigate

https://bugzilla.redhat.com/show_bug.cgi?id=2086470

While unfortunately I've been unable to confirm whether these patches fix the specific problem in question, they're likely fixes we want to pull in regardless.

Lyude Paul (2):
drm/nouveau/acpi: Don't print error when we get -EINPROGRESS from
pm_runtime
drm/nouveau: Don't pm_runtime_put_sync(), only
pm_runtime_put_autosuspend()

 drivers/gpu/drm/nouveau/nouveau_display.c | 4 ++--
 drivers/gpu/drm/nouveau/nouveau_fbcon.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.35.3
author maintainer
#1 lore raw

PATCH 1/2 drm/nouveau/acpi: Don't print error when we get -EINPROGRESS from pm_runtime

Since this isn't actually a failure.

---
 drivers/gpu/drm/nouveau/nouveau_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_display.c +1 -1
index 2cd0932b3d68..9f5a45f24e5b 100644
@@ -537,7 +537,7 @@ nouveau_display_acpi_ntfy(struct notifier_block *nb, unsigned long val,
 				 * it's own hotplug events.
 				 */
 				pm_runtime_put_autosuspend(drm->dev->dev);
-			} else if (ret == 0) {
+			} else if (ret == 0 || ret == -EINPROGRESS) {
 				/* We've started resuming the GPU already, so
 				 * it will handle scheduling a full reprobe
 				 * itself
Signature · 1 line
2.35.3
author maintainer
#2 lore raw

PATCH 2/2 drm/nouveau: Don't pm_runtime_put_sync(), only pm_runtime_put_autosuspend()

In reply to Lyude Paul

While trying to fix another issue, it occurred to me that I don't actually think there is any situation where we want pm_runtime_put() in nouveau to be synchronous. In fact, this kind of just seems like it would cause issues where we may unexpectedly block a thread we don't expect to be blocked.

So, let's only use pm_runtime_put_autosuspend().

---
 drivers/gpu/drm/nouveau/nouveau_display.c | 2 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/nouveau/nouveau_display.c +1 -1
index 9f5a45f24e5b..103bfb11acb9 100644
@@ -515,7 +515,7 @@ nouveau_display_hpd_work(struct work_struct *work)
 
 	pm_runtime_mark_last_busy(drm->dev->dev);
 noop:
-	pm_runtime_put_sync(drm->dev->dev);
+	pm_runtime_put(drm->dev->dev);
 }
 
 #ifdef CONFIG_ACPI
drivers/gpu/drm/nouveau/nouveau_fbcon.c +1 -1
index 4f9b3aa5deda..20ac1ce2c0f1 100644
@@ -466,7 +466,7 @@ nouveau_fbcon_set_suspend_work(struct work_struct *work)
 	if (state == FBINFO_STATE_RUNNING) {
 		nouveau_fbcon_hotplug_resume(drm->fbcon);
 		pm_runtime_mark_last_busy(drm->dev->dev);
-		pm_runtime_put_sync(drm->dev->dev);
+		pm_runtime_put_autosuspend(drm->dev->dev);
 	}
 }
 
Signature · 1 line
2.35.3