From: "Mehta, Sanju" <Sanju.Mehta@amd.com>
To: "S-k, Shyam-sundar" <Shyam-sundar.S-k@amd.com>,
"jdmason@kudzu.us" <jdmason@kudzu.us>,
"dave.jiang@intel.com" <dave.jiang@intel.com>,
"allenbh@gmail.com" <allenbh@gmail.com>
Cc: "linux-ntb@googlegroups.com" <linux-ntb@googlegroups.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Mehta, Sanju" <Sanju.Mehta@amd.com>
Subject: [PATCH 3/4] NTB: ntb_perf: Clear stale values in doorbell and command SPAD register
Date: Fri, 15 Feb 2019 09:21:19 +0000 [thread overview]
Message-ID: <1550222458-29752-1-git-send-email-Sanju.Mehta@amd.com> (raw)
From: Sanjay R Mehta <sanju.mehta@amd.com>
when ntb_perf is unloaded, the command scratchpad register still
retains the last initialized value of PERF_CMD_INVAL. When ntb_perf
is re-loaded and reads peer command scratchpad register and it mis
interprets the peer state as initialized.
To avoid this, clearing the local side command scratchpad register
in perf_disable_service
Signed-off-by: Sanjay R Mehta <sanju.mehta@amd.com>
---
drivers/ntb/test/ntb_perf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 4a3fba4..c7d1a48 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -754,6 +754,14 @@ static void perf_disable_service(struct perf_ctx *perf)
for (pidx = 0; pidx < perf->pcnt; pidx++)
flush_work(&perf->peers[pidx].service);
+ for (pidx = 0; pidx < perf->pcnt; pidx++) {
+ struct perf_peer *peer = &perf->peers[pidx];
+
+ ntb_spad_write(perf->ntb, PERF_SPAD_CMD(peer->gidx), 0);
+ }
+
+ ntb_db_clear(perf->ntb, PERF_SPAD_NOTIFY(perf->gidx));
+
ntb_link_disable(perf->ntb);
}
--
2.7.4
reply other threads:[~2019-02-15 9:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1550222458-29752-1-git-send-email-Sanju.Mehta@amd.com \
--to=sanju.mehta@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=allenbh@gmail.com \
--cc=dave.jiang@intel.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.com \
/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
all inboxes | Powered by JetHome®