Project

General

Profile

Bug #11901

mptsas_smp_start may return the wrong error code & should log IOCLogInfo

Added by Jason King 4 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

Description

In mptsas_smp_start, if the request is successfully submitted, but the request itself fails, currently the code does the following:

        /* do passthrough success, check the smp status */
    if (LE_16(rep.IOCStatus) != MPI2_IOCSTATUS_SUCCESS) {
        switch (LE_16(rep.IOCStatus)) {
        case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE:
            smp_pkt->smp_pkt_reason = ENODEV;
            break;
        case MPI2_IOCSTATUS_SAS_SMP_DATA_OVERRUN:
            smp_pkt->smp_pkt_reason = EOVERFLOW;
            break;
        case MPI2_IOCSTATUS_SAS_SMP_REQUEST_FAILED:
            smp_pkt->smp_pkt_reason = EIO;
            break;
        default:
            mptsas_log(mpt, CE_NOTE, "smp_start: get unknown ioc" 
                "status:%x", LE_16(rep.IOCStatus));
            smp_pkt->smp_pkt_reason = EIO;
            break;
        }
        return (DDI_FAILURE);
    }

However, IOCStatus is a 15-bit field. The switch should mask off bit 15 (MPI2_IOCSTATUS_MASK) when setting smp_pkt_reason. If bit 15 is set, it indicates that there is a code in IOCLogInfo that should also be logged.

History

Also available in: Atom PDF