1*4882a593Smuzhiyun************************************************************************** 2*4882a593Smuzhiyun** History 3*4882a593Smuzhiyun** 4*4882a593Smuzhiyun** REV# DATE NAME DESCRIPTION 5*4882a593Smuzhiyun** 1.00.00.00 3/31/2004 Erich Chen First release 6*4882a593Smuzhiyun** 1.10.00.04 7/28/2004 Erich Chen modify for ioctl 7*4882a593Smuzhiyun** 1.10.00.06 8/28/2004 Erich Chen modify for 2.6.x 8*4882a593Smuzhiyun** 1.10.00.08 9/28/2004 Erich Chen modify for x86_64 9*4882a593Smuzhiyun** 1.10.00.10 10/10/2004 Erich Chen bug fix for SMP & ioctl 10*4882a593Smuzhiyun** 1.20.00.00 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error 11*4882a593Smuzhiyun** 1.20.00.02 12/09/2004 Erich Chen bug fix with over 2T bytes RAID Volume 12*4882a593Smuzhiyun** 1.20.00.04 1/09/2005 Erich Chen fits for Debian linux kernel version 2.2.xx 13*4882a593Smuzhiyun** 1.20.00.05 2/20/2005 Erich Chen cleanly as look like a Linux driver at 2.6.x 14*4882a593Smuzhiyun** thanks for peoples kindness comment 15*4882a593Smuzhiyun** Kornel Wieliczek 16*4882a593Smuzhiyun** Christoph Hellwig 17*4882a593Smuzhiyun** Adrian Bunk 18*4882a593Smuzhiyun** Andrew Morton 19*4882a593Smuzhiyun** Christoph Hellwig 20*4882a593Smuzhiyun** James Bottomley 21*4882a593Smuzhiyun** Arjan van de Ven 22*4882a593Smuzhiyun** 1.20.00.06 3/12/2005 Erich Chen fix with arcmsr_pci_unmap_dma "unsigned long" cast, 23*4882a593Smuzhiyun** modify PCCB POOL allocated by "dma_alloc_coherent" 24*4882a593Smuzhiyun** (Kornel Wieliczek's comment) 25*4882a593Smuzhiyun** 1.20.00.07 3/23/2005 Erich Chen bug fix with arcmsr_scsi_host_template_init 26*4882a593Smuzhiyun** occur segmentation fault, 27*4882a593Smuzhiyun** if RAID adapter does not on PCI slot 28*4882a593Smuzhiyun** and modprobe/rmmod this driver twice. 29*4882a593Smuzhiyun** bug fix enormous stack usage (Adrian Bunk's comment) 30*4882a593Smuzhiyun** 1.20.00.08 6/23/2005 Erich Chen bug fix with abort command, 31*4882a593Smuzhiyun** in case of heavy loading when sata cable 32*4882a593Smuzhiyun** working on low quality connection 33*4882a593Smuzhiyun** 1.20.00.09 9/12/2005 Erich Chen bug fix with abort command handling, firmware version check 34*4882a593Smuzhiyun** and firmware update notify for hardware bug fix 35*4882a593Smuzhiyun** 1.20.00.10 9/23/2005 Erich Chen enhance sysfs function for change driver's max tag Q number. 36*4882a593Smuzhiyun** add DMA_64BIT_MASK for backward compatible with all 2.6.x 37*4882a593Smuzhiyun** add some useful message for abort command 38*4882a593Smuzhiyun** add ioctl code 'ARCMSR_IOCTL_FLUSH_ADAPTER_CACHE' 39*4882a593Smuzhiyun** customer can send this command for sync raid volume data 40*4882a593Smuzhiyun** 1.20.00.11 9/29/2005 Erich Chen by comment of Arjan van de Ven fix incorrect msleep redefine 41*4882a593Smuzhiyun** cast off sizeof(dma_addr_t) condition for 64bit pci_set_dma_mask 42*4882a593Smuzhiyun** 1.20.00.12 9/30/2005 Erich Chen bug fix with 64bit platform's ccbs using if over 4G system memory 43*4882a593Smuzhiyun** change 64bit pci_set_consistent_dma_mask into 32bit 44*4882a593Smuzhiyun** increcct adapter count if adapter initialize fail. 45*4882a593Smuzhiyun** miss edit at arcmsr_build_ccb.... 46*4882a593Smuzhiyun** psge += sizeof(struct _SG64ENTRY *) => 47*4882a593Smuzhiyun** psge += sizeof(struct _SG64ENTRY) 48*4882a593Smuzhiyun** 64 bits sg entry would be incorrectly calculated 49*4882a593Smuzhiyun** thanks Kornel Wieliczek give me kindly notify 50*4882a593Smuzhiyun** and detail description 51*4882a593Smuzhiyun** 1.20.00.13 11/15/2005 Erich Chen scheduling pending ccb with FIFO 52*4882a593Smuzhiyun** change the architecture of arcmsr command queue list 53*4882a593Smuzhiyun** for linux standard list 54*4882a593Smuzhiyun** enable usage of pci message signal interrupt 55*4882a593Smuzhiyun** follow Randy.Danlup kindness suggestion cleanup this code 56*4882a593Smuzhiyun** 1.20.00.14 05/02/2007 Erich Chen & Nick Cheng 57*4882a593Smuzhiyun** 1.implement PCI-Express error recovery function and AER capability 58*4882a593Smuzhiyun** 2.implement the selection of ARCMSR_MAX_XFER_SECTORS_B=4096 59*4882a593Smuzhiyun** if firmware version is newer than 1.42 60*4882a593Smuzhiyun** 3.modify arcmsr_iop_reset to improve the ability 61*4882a593Smuzhiyun** 4.modify the ISR, arcmsr_interrupt routine,to prevent the 62*4882a593Smuzhiyun** inconsistency with sg_mod driver if application directly calls 63*4882a593Smuzhiyun** the arcmsr driver w/o passing through scsi mid layer 64*4882a593Smuzhiyun** specially thanks to Yanmin Zhang's openhanded help about AER 65*4882a593Smuzhiyun** 1.20.00.15 08/30/2007 Erich Chen & Nick Cheng 66*4882a593Smuzhiyun** 1. support ARC1200/1201/1202 SATA RAID adapter, which is named 67*4882a593Smuzhiyun** ACB_ADAPTER_TYPE_B 68*4882a593Smuzhiyun** 2. modify the arcmsr_pci_slot_reset function 69*4882a593Smuzhiyun** 3. modify the arcmsr_pci_ers_disconnect_forepart function 70*4882a593Smuzhiyun** 4. modify the arcmsr_pci_ers_need_reset_forepart function 71*4882a593Smuzhiyun** 1.20.00.15 09/27/2007 Erich Chen & Nick Cheng 72*4882a593Smuzhiyun** 1. add arcmsr_enable_eoi_mode() on adapter Type B 73*4882a593Smuzhiyun** 2. add readl(reg->iop2drv_doorbell_reg) in arcmsr_handle_hbb_isr() 74*4882a593Smuzhiyun** in case of the doorbell interrupt clearance is cached 75*4882a593Smuzhiyun** 1.20.00.15 10/01/2007 Erich Chen & Nick Cheng 76*4882a593Smuzhiyun** 1. modify acb->devstate[i][j] 77*4882a593Smuzhiyun** as ARECA_RAID_GOOD instead of 78*4882a593Smuzhiyun** ARECA_RAID_GONE in arcmsr_alloc_ccb_pool 79*4882a593Smuzhiyun** 1.20.00.15 11/06/2007 Erich Chen & Nick Cheng 80*4882a593Smuzhiyun** 1. add conditional declaration for 81*4882a593Smuzhiyun** arcmsr_pci_error_detected() and 82*4882a593Smuzhiyun** arcmsr_pci_slot_reset 83*4882a593Smuzhiyun** 1.20.00.15 11/23/2007 Erich Chen & Nick Cheng 84*4882a593Smuzhiyun** 1.check if the sg list member number 85*4882a593Smuzhiyun** exceeds arcmsr default limit in arcmsr_build_ccb() 86*4882a593Smuzhiyun** 2.change the returned value type of arcmsr_build_ccb() 87*4882a593Smuzhiyun** from "void" to "int" 88*4882a593Smuzhiyun** 3.add the conditional check if arcmsr_build_ccb() 89*4882a593Smuzhiyun** returns FAILED 90*4882a593Smuzhiyun** 1.20.00.15 12/04/2007 Erich Chen & Nick Cheng 91*4882a593Smuzhiyun** 1. modify arcmsr_drain_donequeue() to ignore unknown 92*4882a593Smuzhiyun** command and let kernel process command timeout. 93*4882a593Smuzhiyun** This could handle IO request violating max. segments 94*4882a593Smuzhiyun** while Linux XFS over DM-CRYPT. 95*4882a593Smuzhiyun** Thanks to Milan Broz's comments <mbroz@redhat.com> 96*4882a593Smuzhiyun** 1.20.00.15 12/24/2007 Erich Chen & Nick Cheng 97*4882a593Smuzhiyun** 1.fix the portability problems 98*4882a593Smuzhiyun** 2.fix type B where we should _not_ iounmap() acb->pmu; 99*4882a593Smuzhiyun** it's not ioremapped. 100*4882a593Smuzhiyun** 3.add return -ENOMEM if ioremap() fails 101*4882a593Smuzhiyun** 4.transfer IS_SG64_ADDR w/ cpu_to_le32() 102*4882a593Smuzhiyun** in arcmsr_build_ccb 103*4882a593Smuzhiyun** 5. modify acb->devstate[i][j] as ARECA_RAID_GONE instead of 104*4882a593Smuzhiyun** ARECA_RAID_GOOD in arcmsr_alloc_ccb_pool() 105*4882a593Smuzhiyun** 6.fix arcmsr_cdb->Context as (unsigned long)arcmsr_cdb 106*4882a593Smuzhiyun** 7.add the checking state of 107*4882a593Smuzhiyun** (outbound_intstatus & ARCMSR_MU_OUTBOUND_HANDLE_INT) == 0 108*4882a593Smuzhiyun** in arcmsr_handle_hba_isr 109*4882a593Smuzhiyun** 8.replace pci_alloc_consistent()/pci_free_consistent() with kmalloc()/kfree() in arcmsr_iop_message_xfer() 110*4882a593Smuzhiyun** 9. fix the release of dma memory for type B in arcmsr_free_ccb_pool() 111*4882a593Smuzhiyun** 10.fix the arcmsr_polling_hbb_ccbdone() 112*4882a593Smuzhiyun** 1.20.00.15 02/27/2008 Erich Chen & Nick Cheng 113*4882a593Smuzhiyun** 1.arcmsr_iop_message_xfer() is called from atomic context under the 114*4882a593Smuzhiyun** queuecommand scsi_host_template handler. James Bottomley pointed out 115*4882a593Smuzhiyun** that the current GFP_KERNEL|GFP_DMA flags are wrong: firstly we are in 116*4882a593Smuzhiyun** atomic context, secondly this memory is not used for DMA. 117*4882a593Smuzhiyun** Also removed some unneeded casts. Thanks to Daniel Drake <dsd@gentoo.org> 118*4882a593Smuzhiyun************************************************************************** 119