From: Ryan Harper <ryanh@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Ryan Harper <ryanh@us.ibm.com>, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH 4/4] LSI53C895A: Don't reset scratch C-R on soft reset
Date: Mon, 8 Dec 2008 12:07:50 -0600 [thread overview]
Message-ID: <1228759670-31113-5-git-send-email-ryanh@us.ibm.com> (raw)
In-Reply-To: <1228759670-31113-1-git-send-email-ryanh@us.ibm.com>
Debugging 64-bit Linux using the sym53c8xx_2/sym53c8xx.ko driver with
SYM_CONF_DMA_ADDRESSING_MODE=2 which uses 64-bit Table Indirect moves, I
encountered a situation where the initial probing of the scsi device succeded,
but after checking other LUNs besides LUN0, the device would fail to work. This
was tracked down to the fact that the Linux driver programs one of the scratch
registers to contain the upper 32-bits of the target DMA address and since our
emulation doesn't support more than LUN0, it resets the scsi device which
results in clearing out the scratch registers. The Linux driver was written
against real hardware which I think we can assume does not reset the scratch
registers, otherwise this driver would fail on real hardware as well. As such,
avoiding resetting scratch registers C-R (ones that can be used for Table
Indirect 64-bit mode) fixes the issue for Linux.
Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index b36c08c..542d5a0 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -276,7 +276,11 @@ static void lsi_soft_reset(LSIState *s)
s->dnad = 0;
s->dbc = 0;
s->temp = 0;
- memset(s->scratch, 0, sizeof(s->scratch));
+ /* The Linux driver (sym53c8xx) when in 64-bit mode relies on scratch regs
+ * C-R to not be touched. The Tech manual doesn't dictate that scratch
+ * registers be cleared. */
+ s->scratch[0] = 0; /* reset scratchA */
+ s->scratch[1] = 0; /* reset scratchB */
s->istat0 = 0;
s->istat1 = 0;
s->dcmd = 0;
prev parent reply other threads:[~2008-12-08 18:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-08 18:07 [Qemu-devel] [PATCH 0/4] LSI53C895A: Implemented 64-bit Block Moves Ryan Harper
2008-12-08 18:07 ` [Qemu-devel] [PATCH 1/4] LSI53C895A: Rename dmbs register to dbms Ryan Harper
2008-12-10 15:39 ` [Qemu-devel] " Anthony Liguori
2008-12-08 18:07 ` [Qemu-devel] [PATCH 2/4] Add 64-bit Block Move support (Direct & Table Indirect) Ryan Harper
2008-12-10 15:39 ` [Qemu-devel] " Anthony Liguori
2008-12-08 18:07 ` [Qemu-devel] [PATCH 3/4] LSI53C895A: Implement TARGET RESET message Ryan Harper
2008-12-08 18:38 ` Paul Brook
2008-12-08 18:41 ` Ryan Harper
2008-12-08 18:58 ` Ryan Harper
2008-12-08 23:36 ` Paul Brook
2008-12-08 23:49 ` Ryan Harper
2008-12-08 18:07 ` Ryan Harper [this message]
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=1228759670-31113-5-git-send-email-ryanh@us.ibm.com \
--to=ryanh@us.ibm.com \
--cc=kvm@vger.kernel.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).