The handling of REQUEST SENSE is incorrect in sbd_scsi.c . There are certain 
BIOSes which are very particular about how request sense is handled. I saw some 
failures recently in booting and upon investigating, discovered this issue. In 
response to the command, the LU is suppose to return sense data in a data-in 
phase (even if there is no additional sense information). So basically this is 
how this code should look like (inside sbd_new_task() ):

        if (cdb0 == SCMD_REQUEST_SENSE) {
                if ((cdb1 & ~1) || task->task_cdb[2] || task->task_cdb[3] ||
                    task->task_cdb[5]) {
                        stmf_scsilib_send_status(task, STATUS_CHECK,
                            STMF_SAA_INVALID_FIELD_IN_CDB);
                } else {
                        sbd_handle_request_sense(task, initial_dbuf);
                }
                return;
        }

And the sbd_handle_request_sense should look like this:

static uint8_t sbd_request_sense_payload[] = {
        /* Fixed format payload to say no additional sense */
    0x70, 0, 0, 0, 0, 0, 0, 10,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

void
sbd_handle_request_sense(struct scsi_task *task,
    struct stmf_data_buf *initial_dbuf)
{
        uint8_t *cdbp = (uint8_t *)&task->task_cdb[0];
        uint32_t cmd_size;
        uint32_t xfer_size = sizeof (scd_request_sense_payload);

        cmd_size = cdbp[4];
        if (cmd_size == 0) {
                task->task_cmd_xfer_length = 0;
                if (task->task_additional_flags &
                    TASK_AF_NO_EXPECTED_XFER_LENGTH) {
                        task->task_expected_xfer_length = 0;
                }
                stmf_scsilib_send_status(task, STATUS_GOOD, 0);
                return;
        }

        sbd_handle_short_read_transfers(task, initial_dbuf,
            sbd_request_sense_payload, cmd_size, min(cmd_size, xfer_size));
}



Sumit
-- 
This message posted from opensolaris.org
_______________________________________________
storage-discuss mailing list
storage-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/storage-discuss

Reply via email to