From f66264d41db4442ad3b7e64c30d5b30b2bd0537b Mon Sep 17 00:00:00 2001
From: Douglas Anderson <dianders@chromium.org>
Date: Mon, 4 Mar 2024 12:52:59 -0800
Subject: [PATCH 4/6] PM: runtime: Pass RPM_NOWAIT through to our parent if
 recursing

If we're resuming with the "RPM_NOWAIT" flag then we need to make sure
our parent also doesn't wait. This is necessary so that
pm_runtime_try_get_sync() introduced in the next patch really doesn't
block.

Change-Id: I87ff5dd527e4014dd5cbbd8dbeb2f6bd284c9b5d
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
 drivers/base/power/runtime.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 6bd54d3ae12f..9395b3fbd23f 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -886,8 +886,9 @@ static int rpm_resume(struct device *dev, int rpmflags)
 		 */
 		if (!parent->power.disable_depth
 		    && !parent->power.ignore_children) {
-			rpm_resume(parent, 0);
-			if (parent->power.runtime_status != RPM_ACTIVE)
+			retval = rpm_resume(parent, rpmflags & RPM_NOWAIT);
+			if (retval != -EINPROGRESS &&
+			    parent->power.runtime_status != RPM_ACTIVE)
 				retval = -EBUSY;
 		}
 		spin_unlock(&parent->power.lock);
-- 
2.44.0.rc1.240.g4c46232300-goog

