diff -uprN a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h --- a/drivers/scsi/arcmsr/arcmsr.h 2012-11-17 02:02:18.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr.h 2013-05-07 01:49:08.000000000 +0800 @@ -51,7 +51,7 @@ struct device_attribute; #else #define ARCMSR_MAX_FREECCB_NUM 320 #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2012/09/30" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2013/05/06" #define ARCMSR_SCSI_INITIATOR_ID 255 #define ARCMSR_MAX_XFER_SECTORS 512 #define ARCMSR_MAX_XFER_SECTORS_B 4096 @@ -705,6 +705,7 @@ struct AdapterControlBlock #define FW_DEADLOCK 0x0010 atomic_t rq_map_token; atomic_t ante_token_value; + uint32_t maxOutstanding; };/* HW_DEVICE_EXTENSION */ /* ******************************************************************************* diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2012-12-19 02:02:36.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2013-05-07 19:12:12.000000000 +0800 @@ -2,7 +2,7 @@ ******************************************************************************* ** O.S : Linux ** FILE NAME : arcmsr_hba.c -** BY : Nick Cheng +** BY : Nick Cheng, C.L. Huang ** Description: SCSI RAID Device Driver for ** ARECA RAID Host adapter ******************************************************************************* @@ -71,7 +71,7 @@ #include #include "arcmsr.h" MODULE_AUTHOR("Nick Cheng "); -MODULE_DESCRIPTION("Areca SAS RAID Controller Driver"); +MODULE_DESCRIPTION("Areca SAS,SATA RAID Controller Driver"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_VERSION(ARCMSR_DRIVER_VERSION); @@ -1329,7 +1329,8 @@ arcmsr_report_sense_info(struct CommandC struct scsi_cmnd *pcmd = ccb->pcmd; struct SENSE_DATA *sensebuffer = (struct SENSE_DATA *)pcmd->sense_buffer; - pcmd->result = DID_OK << 16; + pcmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1) + | (DRIVER_SENSE << 24); if (sensebuffer) { int sense_data_length = sizeof(struct SENSE_DATA) < SCSI_SENSE_BUFFERSIZE @@ -3313,7 +3314,7 @@ arcmsr_queue_command_lck(struct scsi_cmn return 0; } if (atomic_read(&acb->ccboutstandingcount) >= - ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding) return SCSI_MLQUEUE_HOST_BUSY; ccb = arcmsr_get_freeccb(acb); if (!ccb) @@ -3710,6 +3711,10 @@ arcmsr_get_firmware_spec(struct AdapterC default: break; } + if(acb->firm_numbers_queue > ARCMSR_MAX_FREECCB_NUM) + acb->maxOutstanding = ARCMSR_MAX_FREECCB_NUM-1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; return rtn; } @@ -4882,6 +4887,7 @@ static const char case PCI_DEVICE_ID_ARECA_1160: case PCI_DEVICE_ID_ARECA_1170: case PCI_DEVICE_ID_ARECA_1201: + case PCI_DEVICE_ID_ARECA_1214: case PCI_DEVICE_ID_ARECA_1220: case PCI_DEVICE_ID_ARECA_1230: case PCI_DEVICE_ID_ARECA_1260: @@ -4889,7 +4895,6 @@ static const char case PCI_DEVICE_ID_ARECA_1280: type = "SATA"; break; - case PCI_DEVICE_ID_ARECA_1214: case PCI_DEVICE_ID_ARECA_1680: case PCI_DEVICE_ID_ARECA_1681: case PCI_DEVICE_ID_ARECA_1880: