qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <Laurent.Vivier@bull.net>
To: theburner1@yahoo.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] LSI53C895A, IDE HDD detection under SCO OpenServer 5.0.5
Date: Fri, 14 Nov 2008 23:13:42 +0100	[thread overview]
Message-ID: <1226700822.3965.21.camel@frecb07144> (raw)
In-Reply-To: <254233.81731.qm@web51112.mail.re2.yahoo.com>

Le vendredi 14 novembre 2008 à 12:50 -0800, Justin Chevrier a écrit :
> 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:

Could you explain this part ?

> ...
> 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 <-- ****
> ...

In fact the log is wrong, this is the status key.

> 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.  */

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
-- 
------------------ Laurent.Vivier@bull.net  ------------------
"Tout ce qui est impossible reste à accomplir"    Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard

  reply	other threads:[~2008-11-14 22:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 20:50 [Qemu-devel] LSI53C895A, IDE HDD detection under SCO OpenServer 5.0.5 Justin Chevrier
2008-11-14 22:13 ` Laurent Vivier [this message]
2008-11-17  0:44   ` Justin Chevrier
  -- strict thread matches above, loose matches on Subject: below --
2008-11-04 13:30 Justin Chevrier
2008-11-06 12:51 ` Craig Ringer
2008-11-06 13:36   ` Justin Chevrier
2008-11-07  9:26     ` Craig Ringer
2008-11-07 11:46       ` Craig Ringer
2008-11-10 15:04       ` Justin Chevrier
2008-11-04 12:58 Justin Chevrier
2008-11-05  3:02 ` Craig Ringer
2008-11-04  3:21 Justin Chevrier
2008-11-04  3:41 ` Craig Ringer
2008-11-04  7:57   ` Craig Ringer
2008-11-10  1:31 ` andrzej zaborowski
2008-11-10  6:19   ` Craig Ringer
2008-10-29 19:39 Justin Chevrier
2008-10-29 18:16 Justin Chevrier
2008-10-29  9:25 Craig Ringer
2008-10-29 15:38 ` Craig Ringer

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=1226700822.3965.21.camel@frecb07144 \
    --to=laurent.vivier@bull.net \
    --cc=qemu-devel@nongnu.org \
    --cc=theburner1@yahoo.com \
    /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).