From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L4qyV-0001rk-Kr for qemu-devel@nongnu.org; Tue, 25 Nov 2008 01:00:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L4qyT-0001rT-Tw for qemu-devel@nongnu.org; Tue, 25 Nov 2008 01:00:39 -0500 Received: from [199.232.76.173] (port=58922 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L4qyT-0001rQ-Ph for qemu-devel@nongnu.org; Tue, 25 Nov 2008 01:00:37 -0500 Received: from web51107.mail.re2.yahoo.com ([206.190.38.149]:47390) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L4qyT-0007ki-H0 for qemu-devel@nongnu.org; Tue, 25 Nov 2008 01:00:37 -0500 Date: Mon, 24 Nov 2008 22:00:35 -0800 (PST) From: Justin Chevrier Subject: Re: [Qemu-devel] [5706] Implement LSI53C895A quirks exposed by OpenServer (Justin Chevrier). MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <299566.51371.qm@web51107.mail.re2.yahoo.com> Reply-To: theburner1@yahoo.com, 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 andrzej zaborowski wrote: >He noticed that the patch uncovered an endiannes issue somewhere in >lsi53c895a.c due to which the comparison that we added doesn't work on >some target/host pairs. This is the issue that should be fixed next. I've done some more testing. I believe the line in question is wrong and wasn't the right way to fix the original problem I was seeing with Openserver. The original problem I observered in Openserver was that it was sending an Inquiry with an allocation length of 40 to the scsi drive but only got a reponse of length 36 (hardcoded in scsi-disk.c). This caused it to panic. The patch below reverses this line and modifies scsi-disk.c to handle different length Inquiry commands. Tested in Openserver and in debian ARM from: (http://people.debian.org/~aurel32/qemu/armel). Give it a shot, hopefully it doesn't break anything. Justin --- hw/scsi-disk.c (revision 5793) +++ hw/scsi-disk.c (working copy) @@ -492,7 +492,7 @@ "is less than 36 (TODO: only 5 required)\n", len); } } - memset(outbuf, 0, 36); + memset(outbuf, 0, len); if (lun || buf[1] >> 5) { outbuf[0] = 0x7f; /* LUN not supported */ @@ -510,10 +510,10 @@ Some later commands are also implemented. */ outbuf[2] = 3; outbuf[3] = 2; /* Format 2 */ - outbuf[4] = 31; + outbuf[4] = len - 5; /* Len(n - 4) */ /* Sync data transfer and TCQ. */ outbuf[7] = 0x10 | (s->tcq ? 0x02 : 0); - r->buf_len = 36; + r->buf_len = len; break; case 0x16: DPRINTF("Reserve(6)\n"); --- hw/lsi53c895a.c (revision 5793) +++ hw/lsi53c895a.c (working copy) @@ -920,7 +920,6 @@ break; case PHASE_DI: s->waiting = 2; - s->current_dma_len = s->dbc; lsi_do_dma(s, 0); if (s->waiting) s->waiting = 3;