Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7XZ4-0007lQ-SN for qemu-devel@nongnu.org; Tue, 02 Dec 2008 10:53:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7XZ3-0007kU-8A for qemu-devel@nongnu.org; Tue, 02 Dec 2008 10:53:30 -0500 Received: from [199.232.76.173] (port=35190 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7XZ3-0007kO-0Y for qemu-devel@nongnu.org; Tue, 02 Dec 2008 10:53:29 -0500 Received: from web51105.mail.re2.yahoo.com ([206.190.38.147]:41189) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L7XZ2-0006BB-Hr for qemu-devel@nongnu.org; Tue, 02 Dec 2008 10:53:28 -0500 Date: Tue, 2 Dec 2008 07:53:27 -0800 (PST) From: Justin Chevrier MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-107216255-1228233207=:18887" Message-ID: <555360.18887.qm@web51105.mail.re2.yahoo.com> Subject: [Qemu-devel] [PATCH 2/2] LSI53C895A: Handle empty SCRIPTS opcode Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0-107216255-1228233207=:18887 Content-Type: text/plain; charset=us-ascii Well I've finally sorted out what Openserver is doing. Basically after each DMA transfer the Openserver driver would issue an empty (0) SCRIPTS opcode. As the opcode is essentially a NOP it has no second DWORD and therefore the DSP should only be incremented by 4 bytes instead of the 8 bytes we currently do. Here's a snippet of the log: lsi_scsi: Data ready tag=0x100d9 len=16384 ... lsi_scsi: SCRIPTS dsp=068c5e50 opcode 01000400 arg 07a09000 lsi_scsi: DMA addr=0x07a09000 len=1024 lsi_scsi: SCRIPTS dsp=068c5e58 opcode 00000000 arg 01000400 lsi_scsi: Wrong phase got 1 expected 0 Note the 2nd DWORD after the empty opcode; the next opcode in the DMA transfer sequence. As can be expected the address after that has the next DMA address to use. After the attached patch the DMA transfer is able to complete successfully: lsi_scsi: SCRIPTS dsp=068c5e50 opcode 01000400 arg 07a0d000 lsi_scsi: DMA addr=0x07a0d000 len=1024 lsi_scsi: SCRIPTS dsp=068c5e5c opcode 01000400 arg 07a0d400 lsi_scsi: DMA addr=0x07a0d400 len=1024 ... Tested againsted Openserver 5.0.5 and Debian ARM. Changelog: Handle empty SCRIPTS opcode Signed-off-by: Justin Chevrier --0-107216255-1228233207=:18887 Content-Type: text/plain; name="empty_opcode.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="empty_opcode.diff" SW5kZXg6IGh3L2xzaTUzYzg5NWEuYwo9PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 Ci0tLSBody9sc2k1M2M4OTVhLmMJKHJldmlzaW9uIDU4NTIpCisrKyBody9s c2k1M2M4OTVhLmMJKHdvcmtpbmcgY29weSkKQEAgLTg2Nyw2ICs4NjcsMTIg QEAKIGFnYWluOgogICAgIGluc25fcHJvY2Vzc2VkKys7CiAgICAgaW5zbiA9 IHJlYWRfZHdvcmQocywgcy0+ZHNwKTsKKyAgICBpZighaW5zbikgeworICAg ICAgICAvKiBJZiB3ZSByZWNlaXZlIGFuIGVtcHR5IG9wY29kZSBpbmNyZW1l bnQgdGhlIERTUCBieSA0IGJ5dGVzCisgICAgICAgICAgIGluc3RlYWQgb2Yg OCBhbmQgZXhlY3V0ZSB0aGUgbmV4dCBvcGNvZGUgYXQgdGhhdCBsb2NhdGlv biAqLworICAgICAgICBzLT5kc3AgKz0gNDsKKyAgICAgICAgZ290byBhZ2Fp bjsKKyAgICB9ICAgIAogICAgIGFkZHIgPSByZWFkX2R3b3JkKHMsIHMtPmRz cCArIDQpOwogICAgIGFkZHJfaGlnaCA9IDA7CiAgICAgRFBSSU5URigiU0NS SVBUUyBkc3A9JTA4eCBvcGNvZGUgJTA4eCBhcmcgJTA4eFxuIiwgcy0+ZHNw LCBpbnNuLCBhZGRyKTsK --0-107216255-1228233207=:18887--