linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	stable@vger.kernel.org
Subject: [GIT PULL 4/6] intel_th: msu: Fix the unexpected state warning
Date: Tue, 17 Mar 2020 08:22:13 +0200	[thread overview]
Message-ID: <20200317062215.15598-5-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <20200317062215.15598-1-alexander.shishkin@linux.intel.com>

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: 615c164da0eb4 ("intel_th: msu: Introduce buffer interface")
Cc: stable@vger.kernel.org # v5.4+
---
 drivers/hwtracing/intel_th/msu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 45916b48bcf0..7ac7dd4d3b1c 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -722,9 +722,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;
 	}
 
@@ -745,6 +742,10 @@ static int msc_win_set_lockout(struct msc_window *win,
 		/* 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;
-- 
2.25.1


  parent reply	other threads:[~2020-03-17  6:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17  6:22 [GIT PULL 0/6] intel_th/stm class: Updates for v5.7 Alexander Shishkin
2020-03-17  6:22 ` [GIT PULL 1/6] intel_th: Disallow multi mode on devices where it's broken Alexander Shishkin
2020-03-17  6:22 ` [GIT PULL 2/6] stm class: sys-t: Fix the use of time_after() Alexander Shishkin
2020-03-18 10:28   ` Greg Kroah-Hartman
2020-03-17  6:22 ` [GIT PULL 3/6] intel_th: msu: Make stopping the trace optional Alexander Shishkin
2020-03-18 10:30   ` Greg Kroah-Hartman
2020-03-17  6:22 ` Alexander Shishkin [this message]
2020-03-18 10:30   ` [GIT PULL 4/6] intel_th: msu: Fix the unexpected state warning Greg Kroah-Hartman
2020-03-17  6:22 ` [GIT PULL 5/6] intel_th: Fix user-visible error codes Alexander Shishkin
2020-03-18 10:31   ` Greg Kroah-Hartman
2020-03-17  6:22 ` [GIT PULL 6/6] intel_th: pci: Add Elkhart Lake CPU support Alexander Shishkin
2020-03-17 22:30   ` Sasha Levin
2020-03-18 10:31   ` Greg Kroah-Hartman
2020-03-18 10:26 ` [GIT PULL 0/6] intel_th/stm class: Updates for v5.7 Greg Kroah-Hartman
2020-03-19  8:51   ` [PATCH v1] intel_th: msu: Make stopping the trace optional Alexander Shishkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200317062215.15598-5-alexander.shishkin@linux.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).