Refresh vendor driver version which fixes command queue

full issue with ARC-1214 and ARC-1224.

Many thanks to Areca for continuing to support FreeBSD.

Submitted by:	黃清隆 <ching2048 areca com tw>
MFC after:	1 day
This commit is contained in:
Xin LI 2013-07-06 01:46:58 +00:00
parent bb6d7d0ef5
commit abfdbca922
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=252857
2 changed files with 62 additions and 45 deletions

View File

@ -35,44 +35,45 @@
********************************************************************************
** History
**
** REV# DATE NAME DESCRIPTION
** 1.00.00.00 03/31/2004 Erich Chen First release
** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error
** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support
** clean unused function
** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling,
** firmware version check
** and firmware update notify for hardware bug fix
** handling if none zero high part physical address
** of srb resource
** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy
** add iop message xfer
** with scsi pass-through command
** add new device id of sas raid adapters
** code fit for SPARC64 & PPC
** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report
** and cause g_vfs_done() read write error
** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x
** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x
** bus_dmamem_alloc() with BUS_DMA_ZERO
** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880
** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed,
** prevent cam_periph_error removing all LUN devices of one Target id
** for any one LUN device failed
** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step"
** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B
** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0
** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function
** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout
** 02/14/2011 Ching Huang Modified pktRequestCount
** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it
** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic
** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start
** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed
** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command
** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition
** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter
** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224
** REV# DATE NAME DESCRIPTION
** 1.00.00.00 03/31/2004 Erich Chen First release
** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error
** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support
** clean unused function
** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling,
** firmware version check
** and firmware update notify for hardware bug fix
** handling if none zero high part physical address
** of srb resource
** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy
** add iop message xfer
** with scsi pass-through command
** add new device id of sas raid adapters
** code fit for SPARC64 & PPC
** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report
** and cause g_vfs_done() read write error
** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x
** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x
** bus_dmamem_alloc() with BUS_DMA_ZERO
** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880
** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed,
** prevent cam_periph_error removing all LUN devices of one Target id
** for any one LUN device failed
** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step"
** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B
** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0
** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function
** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout
** 02/14/2011 Ching Huang Modified pktRequestCount
** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it
** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic
** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start
** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed
** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command
** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition
** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter
** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284
** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4
******************************************************************************************
*/
@ -144,7 +145,7 @@ __FBSDID("$FreeBSD$");
#define arcmsr_callout_init(a) callout_init(a);
#endif
#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2013-01-08"
#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.27 2013-05-06"
#include <dev/arcmsr/arcmsr.h>
/*
**************************************************************************
@ -753,7 +754,7 @@ static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag)
if(stand_flag == 1) {
atomic_subtract_int(&acb->srboutstandingcount, 1);
if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && (
acb->srboutstandingcount < (acb->firm_numbers_queue -10))) {
acb->srboutstandingcount < (acb->maxOutstanding -10))) {
acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN;
pccb->ccb_h.status |= CAM_RELEASE_SIMQ;
}
@ -1599,8 +1600,7 @@ static void arcmsr_rescan_lun(struct AdapterControlBlock *acb, int target, int l
if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL)
return;
if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun)
!= CAM_REQ_CMP)
if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP)
{
xpt_free_ccb(ccb);
return;
@ -1940,11 +1940,11 @@ static void arcmsr_hbc_postqueue_isr(struct AdapterControlBlock *acb)
/* check if command done with no error*/
error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE;
arcmsr_drain_donequeue(acb, flag_srb, error);
throttling++;
if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) {
CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING);
break;
throttling = 0;
}
throttling++;
} /*drain reply FIFO*/
}
/*
@ -2687,7 +2687,7 @@ static void arcmsr_execute_srb(void *arg, bus_dma_segment_t *dm_segs, int nseg,
arcmsr_srb_complete(srb, 0);
return;
}
if(acb->srboutstandingcount >= acb->firm_numbers_queue) {
if(acb->srboutstandingcount >= acb->maxOutstanding) {
if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) == 0)
{
xpt_freeze_simq(acb->psim, 1);
@ -3431,6 +3431,10 @@ static void arcmsr_get_hba_config(struct AdapterControlBlock *acb)
acb->firm_sdram_size = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/
acb->firm_ide_channels = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/
acb->firm_cfg_version = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */
if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD)
acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1;
else
acb->maxOutstanding = acb->firm_numbers_queue - 1;
}
/*
**********************************************************************
@ -3477,6 +3481,10 @@ static void arcmsr_get_hbb_config(struct AdapterControlBlock *acb)
acb->firm_sdram_size = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/
acb->firm_ide_channels = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/
acb->firm_cfg_version = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */
if(acb->firm_numbers_queue > ARCMSR_MAX_HBB_POSTQUEUE)
acb->maxOutstanding = ARCMSR_MAX_HBB_POSTQUEUE - 1;
else
acb->maxOutstanding = acb->firm_numbers_queue - 1;
}
/*
**********************************************************************
@ -3524,6 +3532,10 @@ static void arcmsr_get_hbc_config(struct AdapterControlBlock *acb)
acb->firm_sdram_size = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/
acb->firm_ide_channels = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/
acb->firm_cfg_version = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */
if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD)
acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1;
else
acb->maxOutstanding = acb->firm_numbers_queue - 1;
}
/*
**********************************************************************
@ -3572,6 +3584,10 @@ static void arcmsr_get_hbd_config(struct AdapterControlBlock *acb)
acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/
acb->firm_ide_channels = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[5]); /*firm_ide_channels, 4, 16-19*/
acb->firm_cfg_version = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */
if(acb->firm_numbers_queue > ARCMSR_MAX_HBD_POSTQUEUE)
acb->maxOutstanding = ARCMSR_MAX_HBD_POSTQUEUE - 1;
else
acb->maxOutstanding = acb->firm_numbers_queue - 1;
}
/*
**********************************************************************

View File

@ -1182,6 +1182,7 @@ struct AdapterControlBlock {
u_int32_t pktReturnCount;
u_int32_t vendor_device_id;
u_int32_t adapter_bus_speed;
u_int32_t maxOutstanding;
};/* HW_DEVICE_EXTENSION */
/* acb_flags */
#define ACB_F_SCSISTOPADAPTER 0x0001