OSDN Git Service

staging: gasket: fix gasket_wait_with_reschedule timeout return code
authorTodd Poynor <toddpoynor@google.com>
Tue, 17 Jul 2018 20:56:50 +0000 (13:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jul 2018 09:39:47 +0000 (11:39 +0200)
Return -ETIMEDOUT, not -EINVAL, on timeout, including callers.

Reported-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Zhongze Hu <frankhu@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gasket/apex_driver.c
drivers/staging/gasket/gasket_core.c

index a31937d..3a83c3d 100644 (file)
@@ -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) {
index 248d717..8035662 100644 (file)
@@ -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;
 }