[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH] Fix sparc booting with no CD in drive
From: |
Paul Brook |
Subject: |
[Qemu-devel] Re: [PATCH] Fix sparc booting with no CD in drive |
Date: |
Tue, 15 Aug 2006 18:45:23 +0100 |
User-agent: |
KMail/1.9.3 |
On Tuesday 15 August 2006 16:45, Blue Swirl wrote:
> >Why are we getting reads when no data is available? The command should
> >already
> >have completed.
>
> I don't know. Should all SCSI commands return something with the transfer
> mechanism? Or is it a bug in OpenBIOS, should it get the SCSI error status
> somehow without transferring data?
The scsi_read_data and scsi_write_data routines correspond directly to the
SCSI DATA IN and DATA OUT phases.
It's up to the HBA (ie. esp) emulation to keep track of the SCSI phase based
on the return value of scsi_send_command and whether the command completion
routine has been called.
It's also up to the HBA to implement the SCSI STATUS phase based on the sense
code passed to the completion routine. Calling completion routine with
SCSI_REASON_DONE indicates that the command has finished (success is
determined by the sense code) and the disk is ready for the next command.
Commands can fail at any time, including before any data has been transferred.
On LSI HBA this causes an invalid phase exception to be raised when data
transfer is attempted. I don't remember offhand how the ESP controller
handles this. There are also some commands that complete successfully without
transfering any data.
> The background here is that OpenBIOS probes for SCSI devices, but when
> probing of capacity for nonexistent CDROM, the command fails.
The read capacity command deliberately fails when there is no media present.
Paul