Commit 36b83ded authored by Nick Cheng's avatar Nick Cheng Committed by James Bottomley

[SCSI] arcmsr: Support HW reset for EH and polling scheme for scsi device

1. To support instantaneous report for SCSI device existing by periodic
   polling
2. In arcmsr_iop_xfer(), inform AP of F/W's deadlock state to prevent
   endless waiting
3. To block the coming SCSI command while the driver is handling bus reset
4. To support HW reset in bus reset error handler
Signed-off-by: default avatarNick Cheng <nick.cheng@areca.com.tw>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 7873ca4e
...@@ -48,7 +48,7 @@ struct device_attribute; ...@@ -48,7 +48,7 @@ struct device_attribute;
/*The limit of outstanding scsi command that firmware can handle*/ /*The limit of outstanding scsi command that firmware can handle*/
#define ARCMSR_MAX_OUTSTANDING_CMD 256 #define ARCMSR_MAX_OUTSTANDING_CMD 256
#define ARCMSR_MAX_FREECCB_NUM 320 #define ARCMSR_MAX_FREECCB_NUM 320
#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2008/02/27" #define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.15 2008/11/03"
#define ARCMSR_SCSI_INITIATOR_ID 255 #define ARCMSR_SCSI_INITIATOR_ID 255
#define ARCMSR_MAX_XFER_SECTORS 512 #define ARCMSR_MAX_XFER_SECTORS 512
#define ARCMSR_MAX_XFER_SECTORS_B 4096 #define ARCMSR_MAX_XFER_SECTORS_B 4096
...@@ -110,6 +110,8 @@ struct CMD_MESSAGE_FIELD ...@@ -110,6 +110,8 @@ struct CMD_MESSAGE_FIELD
#define FUNCTION_SAY_HELLO 0x0807 #define FUNCTION_SAY_HELLO 0x0807
#define FUNCTION_SAY_GOODBYE 0x0808 #define FUNCTION_SAY_GOODBYE 0x0808
#define FUNCTION_FLUSH_ADAPTER_CACHE 0x0809 #define FUNCTION_FLUSH_ADAPTER_CACHE 0x0809
#define FUNCTION_GET_FIRMWARE_STATUS 0x080A
#define FUNCTION_HARDWARE_RESET 0x080B
/* ARECA IO CONTROL CODE*/ /* ARECA IO CONTROL CODE*/
#define ARCMSR_MESSAGE_READ_RQBUFFER \ #define ARCMSR_MESSAGE_READ_RQBUFFER \
ARECA_SATA_RAID | FUNCTION_READ_RQBUFFER ARECA_SATA_RAID | FUNCTION_READ_RQBUFFER
...@@ -133,6 +135,7 @@ struct CMD_MESSAGE_FIELD ...@@ -133,6 +135,7 @@ struct CMD_MESSAGE_FIELD
#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 #define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001
#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 #define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006
#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F #define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F
#define ARCMSR_MESSAGE_RETURNCODE_BUS_HANG_ON 0x00000088
/* /*
************************************************************* *************************************************************
** structure for holding DMA address data ** structure for holding DMA address data
...@@ -341,13 +344,13 @@ struct MessageUnit_B ...@@ -341,13 +344,13 @@ struct MessageUnit_B
uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE];
uint32_t postq_index; uint32_t postq_index;
uint32_t doneq_index; uint32_t doneq_index;
void __iomem *drv2iop_doorbell_reg; uint32_t __iomem *drv2iop_doorbell_reg;
void __iomem *drv2iop_doorbell_mask_reg; uint32_t __iomem *drv2iop_doorbell_mask_reg;
void __iomem *iop2drv_doorbell_reg; uint32_t __iomem *iop2drv_doorbell_reg;
void __iomem *iop2drv_doorbell_mask_reg; uint32_t __iomem *iop2drv_doorbell_mask_reg;
void __iomem *msgcode_rwbuffer_reg; uint32_t __iomem *msgcode_rwbuffer_reg;
void __iomem *ioctl_wbuffer_reg; uint32_t __iomem *ioctl_wbuffer_reg;
void __iomem *ioctl_rbuffer_reg; uint32_t __iomem *ioctl_rbuffer_reg;
}; };
/* /*
...@@ -375,6 +378,7 @@ struct AdapterControlBlock ...@@ -375,6 +378,7 @@ struct AdapterControlBlock
/* message unit ATU inbound base address0 */ /* message unit ATU inbound base address0 */
uint32_t acb_flags; uint32_t acb_flags;
uint8_t adapter_index;
#define ACB_F_SCSISTOPADAPTER 0x0001 #define ACB_F_SCSISTOPADAPTER 0x0001
#define ACB_F_MSG_STOP_BGRB 0x0002 #define ACB_F_MSG_STOP_BGRB 0x0002
/* stop RAID background rebuild */ /* stop RAID background rebuild */
...@@ -390,7 +394,7 @@ struct AdapterControlBlock ...@@ -390,7 +394,7 @@ struct AdapterControlBlock
#define ACB_F_BUS_RESET 0x0080 #define ACB_F_BUS_RESET 0x0080
#define ACB_F_IOP_INITED 0x0100 #define ACB_F_IOP_INITED 0x0100
/* iop init */ /* iop init */
#define ACB_F_FIRMWARE_TRAP 0x0400
struct CommandControlBlock * pccb_pool[ARCMSR_MAX_FREECCB_NUM]; struct CommandControlBlock * pccb_pool[ARCMSR_MAX_FREECCB_NUM];
/* used for memory free */ /* used for memory free */
struct list_head ccb_free_list; struct list_head ccb_free_list;
...@@ -423,12 +427,19 @@ struct AdapterControlBlock ...@@ -423,12 +427,19 @@ struct AdapterControlBlock
#define ARECA_RAID_GOOD 0xaa #define ARECA_RAID_GOOD 0xaa
uint32_t num_resets; uint32_t num_resets;
uint32_t num_aborts; uint32_t num_aborts;
uint32_t signature;
uint32_t firm_request_len; uint32_t firm_request_len;
uint32_t firm_numbers_queue; uint32_t firm_numbers_queue;
uint32_t firm_sdram_size; uint32_t firm_sdram_size;
uint32_t firm_hd_channels; uint32_t firm_hd_channels;
char firm_model[12]; char firm_model[12];
char firm_version[20]; char firm_version[20];
char device_map[20]; /*21,84-99*/
struct work_struct arcmsr_do_message_isr_bh;
struct timer_list eternal_timer;
unsigned short fw_state;
atomic_t rq_map_token;
int ante_token_value;
};/* HW_DEVICE_EXTENSION */ };/* HW_DEVICE_EXTENSION */
/* /*
******************************************************************************* *******************************************************************************
......
...@@ -192,6 +192,7 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = { ...@@ -192,6 +192,7 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = {
.attr = { .attr = {
.name = "mu_read", .name = "mu_read",
.mode = S_IRUSR , .mode = S_IRUSR ,
.owner = THIS_MODULE,
}, },
.size = 1032, .size = 1032,
.read = arcmsr_sysfs_iop_message_read, .read = arcmsr_sysfs_iop_message_read,
...@@ -201,6 +202,7 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = { ...@@ -201,6 +202,7 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = {
.attr = { .attr = {
.name = "mu_write", .name = "mu_write",
.mode = S_IWUSR, .mode = S_IWUSR,
.owner = THIS_MODULE,
}, },
.size = 1032, .size = 1032,
.write = arcmsr_sysfs_iop_message_write, .write = arcmsr_sysfs_iop_message_write,
...@@ -210,6 +212,7 @@ static struct bin_attribute arcmsr_sysfs_message_clear_attr = { ...@@ -210,6 +212,7 @@ static struct bin_attribute arcmsr_sysfs_message_clear_attr = {
.attr = { .attr = {
.name = "mu_clear", .name = "mu_clear",
.mode = S_IWUSR, .mode = S_IWUSR,
.owner = THIS_MODULE,
}, },
.size = 1, .size = 1,
.write = arcmsr_sysfs_iop_message_clear, .write = arcmsr_sysfs_iop_message_clear,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment