Skip to contentSkip to conversation

LSI53C895A, IDE HDD detection under SCO OpenServer 5.0.5

Qemu-devel Justin Chevrier 2 participants 3 messages Nov 14, 2008 – Nov 17, 2008

lore
Share & tools
lore
#0 lore raw

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

scsi-disk.c (working copy) renamed from scsi-disk.c (revision 5722) +1 -1
@@ -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.  */
#1 lore raw
Quoted 8 lines · Justin Chevrier

Hey guys,

Well I've continued to work on the:

...
WARNING: A_DeviceReset interrupt on ha=0 id=0 lun=5 tag=A6
...

Quoted 8 lines

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 ?

Quoted 9 lines

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

Quoted 15 lines

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

scsi-disk.c (working copy) line 141

Quoted 8 lines
scsi-disk.c (working copy) renamed from scsi-disk.c (revision 5722) +1 -1
@@ -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

Signature · 3 lines
------------------ [email protected]  ------------------
"Tout ce qui est impossible reste à accomplir"    Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard
#2 lore raw
Quoted 6 lines · Laurent Vivier

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.

You're right of course. The naming in lsi53c895a.c threw me. My assumptions were based on the naming and therefore are wrong. Back to the drawing board. Thanks for replying!

Justin