Commit 24dfee40 authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman
Browse files

staging: gasket: fix gasket_wait_with_reschedule timeout return code



Return -ETIMEDOUT, not -EINVAL, on timeout, including callers.

Reported-by: default avatarDmitry Torokhov <dtor@chromium.org>
Signed-off-by: default avatarZhongze Hu <frankhu@chromium.org>
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e24fbaf7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ static int apex_enter_reset(struct gasket_dev *gasket_dev, uint type)
		gasket_log_error(gasket_dev,
				 "DMAs did not quiesce within timeout (%d ms)",
				 APEX_RESET_RETRY * APEX_RESET_DELAY);
		return -EINVAL;
		return -ETIMEDOUT;
	}

	/*  - Enable GCB reset (0x1 to rg_rst_gcb) */
@@ -513,7 +513,7 @@ static int apex_enter_reset(struct gasket_dev *gasket_dev, uint type)
			gasket_dev,
			"RAM did not shut down within timeout (%d ms)",
			APEX_RESET_RETRY * APEX_RESET_DELAY);
		return -EINVAL;
		return -ETIMEDOUT;
	}

	return 0;
@@ -562,7 +562,7 @@ static int apex_quit_reset(struct gasket_dev *gasket_dev, uint type)
			gasket_dev,
			"RAM did not enable within timeout (%d ms)",
			APEX_RESET_RETRY * APEX_RESET_DELAY);
		return -EINVAL;
		return -ETIMEDOUT;
	}

	/*    - Wait for Reset complete. */
@@ -574,7 +574,7 @@ static int apex_quit_reset(struct gasket_dev *gasket_dev, uint type)
			gasket_dev,
			"GCB did not leave reset within timeout (%d ms)",
			APEX_RESET_RETRY * APEX_RESET_DELAY);
		return -EINVAL;
		return -ETIMEDOUT;
	}

	if (!allow_hw_clock_gating) {
+1 −1
Original line number Diff line number Diff line
@@ -2106,7 +2106,7 @@ int gasket_wait_with_reschedule(
			"%s timeout: reg %llx timeout (%llu ms)",
			__func__,
			offset, max_retries * delay_ms);
		return -EINVAL;
		return -ETIMEDOUT;
	}
	return 0;
}