From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
To: alistair@alistair23.me, crosthwaite.peter@gmail.com,
peter.maydell@linaro.org, edgar.iglesias@gmail.com,
frasse.iglesias@gmail.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v2 1/1] xilinx_spips: send dummy cycles only if cmd requires it
Date: Wed, 18 Apr 2018 13:11:38 +0530 [thread overview]
Message-ID: <1524037298-23401-2-git-send-email-saipava@xilinx.com> (raw)
In-Reply-To: <1524037298-23401-1-git-send-email-saipava@xilinx.com>
For all the commands, which do not have an entry in
xilinx_spips_num_dummies, present logic sends dummy cycles when ever we
are in SNOOP_NONE state, fix it to only send dummy cycles if the cmd
requires them.
SNOOP_NONE state handle is moved above (previously its part of default else
case), as its same as SNOOP_STRIPPING during data cycles.
Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com>
---
TODO: Maybe we could delete the SNOOP_NONE state as it seems to be
same as SNOOP_STRIPPING
hw/ssi/xilinx_spips.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
index 426f971..4f6760d 100644
--- a/hw/ssi/xilinx_spips.c
+++ b/hw/ssi/xilinx_spips.c
@@ -616,7 +616,8 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)
if (fifo8_is_empty(&s->tx_fifo)) {
xilinx_spips_update_ixr(s);
return;
- } else if (s->snoop_state == SNOOP_STRIPING) {
+ } else if (s->snoop_state == SNOOP_STRIPING ||
+ s->snoop_state == SNOOP_NONE) {
for (i = 0; i < num_effective_busses(s); ++i) {
tx_rx[i] = fifo8_pop(&s->tx_fifo);
}
@@ -626,11 +627,12 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)
for (i = 0; i < num_effective_busses(s); ++i) {
tx_rx[i] = tx;
}
- } else {
+ } else if (s->cmd_dummies > 0) {
/* Extract a dummy byte and generate dummy cycles according to the
* link state */
tx = fifo8_pop(&s->tx_fifo);
dummy_cycles = 8 / s->link_state;
+ s->cmd_dummies--;
}
for (i = 0; i < num_effective_busses(s); ++i) {
--
2.7.4
next prev parent reply other threads:[~2018-04-18 7:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-18 7:41 [Qemu-devel] [PATCH v2 0/1] xilinx_spips dummy bytes fix Sai Pavan Boddu
2018-04-18 7:41 ` Sai Pavan Boddu [this message]
2018-04-18 22:08 ` [Qemu-devel] [PATCH v2 1/1] xilinx_spips: send dummy cycles only if cmd requires it francisco iglesias
2018-04-19 5:57 ` Sai Pavan Boddu
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=1524037298-23401-2-git-send-email-saipava@xilinx.com \
--to=sai.pavan.boddu@xilinx.com \
--cc=alistair@alistair23.me \
--cc=crosthwaite.peter@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=frasse.iglesias@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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).