From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L16vn-0001I5-V6 for qemu-devel@nongnu.org; Fri, 14 Nov 2008 17:14:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L16vm-0001G9-Ex for qemu-devel@nongnu.org; Fri, 14 Nov 2008 17:14:23 -0500 Received: from [199.232.76.173] (port=48288 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L16vm-0001Fy-8c for qemu-devel@nongnu.org; Fri, 14 Nov 2008 17:14:22 -0500 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:42938) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L16vl-00013Q-Td for qemu-devel@nongnu.org; Fri, 14 Nov 2008 17:14:22 -0500 Subject: Re: [Qemu-devel] LSI53C895A, IDE HDD detection under SCO OpenServer 5.0.5 From: Laurent Vivier In-Reply-To: <254233.81731.qm@web51112.mail.re2.yahoo.com> References: <254233.81731.qm@web51112.mail.re2.yahoo.com> Content-Type: text/plain; charset=utf-8 Date: Fri, 14 Nov 2008 23:13:42 +0100 Message-Id: <1226700822.3965.21.camel@frecb07144> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: theburner1@yahoo.com, qemu-devel@nongnu.org Le vendredi 14 novembre 2008 =C3=A0 12:50 -0800, Justin Chevrier a =C3=A9= crit : > Hey guys, >=20 > Well I've continued to work on the: >=20 > ... > WARNING: A_DeviceReset interrupt on ha=3D0 id=3D0 lun=3D5 tag=3DA6 > ... >=20 > errors (in the emulated OS) when installing Openserver. >=20 > 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 t= he SCSI disk. The disk then returns: >=20 > 0x02 - STATUS_CHECK_CONDITION > 0x05 - SENSE_ILLEGAL_REQUEST >=20 > 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 contr= oller is using the status value (STATUS_CHECK_CONDITION) as the sense val= ue. So it thinks we've recieved a sense return of 'SENSE_NOT_READY' and t= hen it keeps probing the drive until it finally gives up, and we get the = above error. See the log below: Could you explain this part ? > ... > lsi_scsi: SCRIPTS dsp=3Df20021a4 opcode 1a000000 arg1 00000018 arg2 810= b0000 > lsi_scsi: Send command len=3D6 > scsi-disk: Command: lun=3D1 tag=3D0x100c1 data=3D0x00 0x20 0x00 0x00 0x= 00 0x00 > scsi-disk: Unimplemented LUN 1 > scsi-disk: Command complete tag=3D0x100c1 status=3D2 sense=3D5 <--**** > lsi_scsi: Command reason: 0 > lsi_scsi: Command complete sense=3D2 <-- **** > ... In fact the log is wrong, this is the status key. > The patch below changes 'scsi_command_complete' (in scsi-disk.c) to pas= s a sense value along to the callbak instead of status. >=20 > I'm not sure this is where we want to go however as this basically reve= rses part of rev 5455 (which made a point of specifically changing this l= ine). >=20 > Do we need to update the LSI emulation to make use of status as well? >=20 > 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. >=20 > Alas this does not fix Openserver's install problem (not too surprised)= . Onto the next bug... >=20 > Justin >=20 > --- hw/scsi-disk.c (revision 5722) > +++ hw/scsi-disk.c (working copy) > @@ -135,7 +135,7 @@ > s->sense =3D sense; > tag =3D r->tag; > scsi_remove_request(r); > - s->completion(s->opaque, SCSI_REASON_DONE, tag, status); > + s->completion(s->opaque, SCSI_REASON_DONE, tag, sense); > } >=20 > /* Cancel a pending data transfer. */ The sense value is retrieve using REQUEST SENSE. If you send the sense value instead of the status key, there is no way for the upper levels to know the status key. Regards, Laurent --=20 ------------------ Laurent.Vivier@bull.net ------------------ "Tout ce qui est impossible reste =C3=A0 accomplir" Jules Verne "Things are only impossible until they're not" Jean-Luc Picard