Commit 12c023d7 authored by Sanjay R Mehta's avatar Sanjay R Mehta Committed by Jon Mason

NTB: ntb_perf: Clear stale values in doorbell and command SPAD register

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: default avatarSanjay R Mehta <sanju.mehta@amd.com>
Acked-by: default avatarAllen Hubbe <allenbh@gmail.com>
Acked-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Acked-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
parent b1ee5998
......@@ -751,6 +751,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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment