Project

General

Profile

Actions

Bug #11901

open

mptsas_smp_start may return the wrong error code & should log IOCLogInfo

Added by Jason King about 4 years ago. Updated about 4 years ago.

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

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

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.

Actions

Also available in: Atom PDF