From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L15dq-0003Fl-1a for qemu-devel@nongnu.org; Fri, 14 Nov 2008 15:51:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L15do-0003FA-E1 for qemu-devel@nongnu.org; Fri, 14 Nov 2008 15:51:45 -0500 Received: from [199.232.76.173] (port=54349 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L15do-0003F3-9z for qemu-devel@nongnu.org; Fri, 14 Nov 2008 15:51:44 -0500 Received: from web51112.mail.re2.yahoo.com ([206.190.39.89]:24869) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1L15dn-0003uh-VP for qemu-devel@nongnu.org; Fri, 14 Nov 2008 15:51:44 -0500 Date: Fri, 14 Nov 2008 12:50:55 -0800 (PST) From: Justin Chevrier Subject: Re: [Qemu-devel] LSI53C895A, IDE HDD detection under SCO OpenServer 5.0.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <254233.81731.qm@web51112.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 Hey guys, Well I've continued to work on the: ... WARNING: A_DeviceReset interrupt on ha=0 id=0 lun=5 tag=A6 ... errors (in the emulated OS) when installing Openserver. I believe I have narrowed down the problem. Openserver does an INQUIRY on various LUNs above 0 (which we don't support). We return 0x7f (nothing here, move along). Openserver then proceeds to send another command to the SCSI disk. The disk then returns: 0x02 - STATUS_CHECK_CONDITION 0x05 - SENSE_ILLEGAL_REQUEST which is as expected. The problem comes along when the controller goes into Status Phase and compares the resulting sense returned by the drive to see what the status of the drive is. What I've found is that the controller is using the status value (STATUS_CHECK_CONDITION) as the sense value. So it thinks we've recieved a sense return of 'SENSE_NOT_READY' and then it keeps probing the drive until it finally gives up, and we get the above error. See the log below: ... lsi_scsi: SCRIPTS dsp=f20021a4 opcode 1a000000 arg1 00000018 arg2 810b0000 lsi_scsi: Send command len=6 scsi-disk: Command: lun=1 tag=0x100c1 data=0x00 0x20 0x00 0x00 0x00 0x00 scsi-disk: Unimplemented LUN 1 scsi-disk: Command complete tag=0x100c1 status=2 sense=5 <--**** lsi_scsi: Command reason: 0 lsi_scsi: Command complete sense=2 <-- **** ... The patch below changes 'scsi_command_complete' (in scsi-disk.c) to pass a sense value along to the callbak instead of status. I'm not sure this is where we want to go however as this basically reverses part of rev 5455 (which made a point of specifically changing this line). Do we need to update the LSI emulation to make use of status as well? Either way, at least we know the cause of these errors and this can be a hack at least if it's not the direction we want to take. Alas this does not fix Openserver's install problem (not too surprised). Onto the next bug... Justin --- hw/scsi-disk.c (revision 5722) +++ hw/scsi-disk.c (working copy) @@ -135,7 +135,7 @@ s->sense = sense; tag = r->tag; scsi_remove_request(r); - s->completion(s->opaque, SCSI_REASON_DONE, tag, status); + s->completion(s->opaque, SCSI_REASON_DONE, tag, sense); } /* Cancel a pending data transfer. */