From: Todd Poynor Date: Tue, 17 Jul 2018 20:56:50 +0000 (-0700) Subject: staging: gasket: fix gasket_wait_with_reschedule timeout return code X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=24dfee40e6c4b558437db1bdb3c4927cec1bda51;p=openwrt%2Fstaging%2Fblogic.git staging: gasket: fix gasket_wait_with_reschedule timeout return code Return -ETIMEDOUT, not -EINVAL, on timeout, including callers. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c index a31937dfff83..3a83c3d4d556 100644 --- a/drivers/staging/gasket/apex_driver.c +++ b/drivers/staging/gasket/apex_driver.c @@ -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) { diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index 248d717e1df6..803566229bfc 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -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; }