PCI: Restore detection of read-only BARs
[pandora-kernel.git] / drivers / target / target_core_transport.c
index 34d114a..be1218f 100644 (file)
@@ -1445,6 +1445,7 @@ static inline void transport_generic_prepare_cdb(
        case VERIFY_16: /* SBC - VRProtect */
        case WRITE_VERIFY: /* SBC - VRProtect */
        case WRITE_VERIFY_12: /* SBC - VRProtect */
+       case MAINTENANCE_IN: /* SPC - Parameter Data Format for SA RTPG */
                break;
        default:
                cdb[1] &= 0x1f; /* clear logical unit number */
@@ -2683,7 +2684,7 @@ static int transport_generic_cmd_sequencer(
                        /*
                         * Check for emulated MI_REPORT_TARGET_PGS.
                         */
-                       if (cdb[1] == MI_REPORT_TARGET_PGS &&
+                       if ((cdb[1] & 0x1f) == MI_REPORT_TARGET_PGS &&
                            su_dev->t10_alua.alua_type == SPC3_ALUA_EMULATED) {
                                cmd->execute_task =
                                        target_emulate_report_target_port_groups;
@@ -3146,8 +3147,7 @@ static void transport_complete_qf(struct se_cmd *cmd)
 
        if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE) {
                ret = cmd->se_tfo->queue_status(cmd);
-               if (ret)
-                       goto out;
+               goto out;
        }
 
        switch (cmd->data_direction) {
@@ -4539,7 +4539,7 @@ int transport_send_check_condition_and_sense(
                /* ILLEGAL REQUEST */
                buffer[offset+SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
                /* LOGICAL UNIT COMMUNICATION FAILURE */
-               buffer[offset+SPC_ASC_KEY_OFFSET] = 0x80;
+               buffer[offset+SPC_ASC_KEY_OFFSET] = 0x08;
                break;
        }
        /*