]> git.baikalelectronics.ru Git - kernel.git/commitdiff
intel_th: msu: Fix the unexpected state warning
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 17 Mar 2020 06:22:13 +0000 (08:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 10:32:56 +0000 (11:32 +0100)
The unexpected state warning should only warn on illegal state
transitions. Fix that.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: bc1e2f8643d62 ("intel_th: msu: Introduce buffer interface")
Cc: stable@vger.kernel.org # v5.4+
Link: https://lore.kernel.org/r/20200317062215.15598-5-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/intel_th/msu.c

index 8e48c7458aa35cbbf3963462d969d2b22614ce49..43e70507c9499bc1ec29ab0f59c5d37a5c03ece8 100644 (file)
@@ -718,9 +718,6 @@ static int msc_win_set_lockout(struct msc_window *win,
 
        if (old != expect) {
                ret = -EINVAL;
-               dev_warn_ratelimited(msc_dev(win->msc),
-                                    "expected lockout state %d, got %d\n",
-                                    expect, old);
                goto unlock;
        }
 
@@ -741,6 +738,10 @@ unlock:
                /* from intel_th_msc_window_unlock(), don't warn if not locked */
                if (expect == WIN_LOCKED && old == new)
                        return 0;
+
+               dev_warn_ratelimited(msc_dev(win->msc),
+                                    "expected lockout state %d, got %d\n",
+                                    expect, old);
        }
 
        return ret;