Commit e2e2400b authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6:
  [SCSI] fix race in scsi_target_reap
  [SCSI] aacraid: Eliminate use after free
  [SCSI] arcmsr: Support HW reset for EH and polling scheme for scsi device
  [SCSI] bfa: fix system crash when reading sysfs fc_host statistics
  [SCSI] iscsi_tcp: remove sk_sleep check
  [SCSI] ipr: improve interrupt service routine performance
  [SCSI] ipr: set the data list length in the request control block
  [SCSI] ipr: fix a register read to use the correct address for 64 bit adapters
  [SCSI] ipr: include the resource path in the IOA status area structure
  [SCSI] ipr: implement fixes for 64 bit adapter support
  [SCSI] be2iscsi: correct return value in mgmt_invalidate_icds()
parents e4ce30f3 f9e8894a
...@@ -655,9 +655,9 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg) ...@@ -655,9 +655,9 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
/* Does this really need to be GFP_DMA? */ /* Does this really need to be GFP_DMA? */
p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA); p = kmalloc(usg->sg[i].count,GFP_KERNEL|__GFP_DMA);
if(!p) { if(!p) {
kfree (usg); dprintk((KERN_DEBUG "aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
dprintk((KERN_DEBUG"aacraid: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
usg->sg[i].count,i,usg->count)); usg->sg[i].count,i,usg->count));
kfree(usg);
rcode = -ENOMEM; rcode = -ENOMEM;
goto cleanup; goto cleanup;
} }
......
...@@ -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.
...@@ -167,10 +167,9 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba, ...@@ -167,10 +167,9 @@ unsigned char mgmt_invalidate_icds(struct beiscsi_hba *phba,
&nonemb_cmd.dma); &nonemb_cmd.dma);
if (nonemb_cmd.va == NULL) { if (nonemb_cmd.va == NULL) {
SE_DEBUG(DBG_LVL_1, SE_DEBUG(DBG_LVL_1,
"Failed to allocate memory for" "Failed to allocate memory for mgmt_invalidate_icds\n");
"mgmt_invalidate_icds \n");
spin_unlock(&ctrl->mbox_lock); spin_unlock(&ctrl->mbox_lock);
return -1; return 0;
} }
nonemb_cmd.size = sizeof(struct invalidate_commands_params_in); nonemb_cmd.size = sizeof(struct invalidate_commands_params_in);
req = nonemb_cmd.va; req = nonemb_cmd.va;
......
...@@ -84,11 +84,32 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo) ...@@ -84,11 +84,32 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo)
for (i = 0; hal_mods[i]; i++) for (i = 0; hal_mods[i]; i++)
hal_mods[i]->meminfo(cfg, &km_len, &dm_len); hal_mods[i]->meminfo(cfg, &km_len, &dm_len);
dm_len += bfa_port_meminfo();
meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_len = km_len; meminfo->meminfo[BFA_MEM_TYPE_KVA - 1].mem_len = km_len;
meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_len = dm_len; meminfo->meminfo[BFA_MEM_TYPE_DMA - 1].mem_len = dm_len;
} }
static void
bfa_com_port_attach(struct bfa_s *bfa, struct bfa_meminfo_s *mi)
{
struct bfa_port_s *port = &bfa->modules.port;
uint32_t dm_len;
uint8_t *dm_kva;
uint64_t dm_pa;
dm_len = bfa_port_meminfo();
dm_kva = bfa_meminfo_dma_virt(mi);
dm_pa = bfa_meminfo_dma_phys(mi);
memset(port, 0, sizeof(struct bfa_port_s));
bfa_port_attach(port, &bfa->ioc, bfa, bfa->trcmod, bfa->logm);
bfa_port_mem_claim(port, dm_kva, dm_pa);
bfa_meminfo_dma_virt(mi) = dm_kva + dm_len;
bfa_meminfo_dma_phys(mi) = dm_pa + dm_len;
}
/** /**
* Use this function to do attach the driver instance with the BFA * Use this function to do attach the driver instance with the BFA
* library. This function will not trigger any HW initialization * library. This function will not trigger any HW initialization
...@@ -140,6 +161,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, ...@@ -140,6 +161,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
for (i = 0; hal_mods[i]; i++) for (i = 0; hal_mods[i]; i++)
hal_mods[i]->attach(bfa, bfad, cfg, meminfo, pcidev); hal_mods[i]->attach(bfa, bfad, cfg, meminfo, pcidev);
bfa_com_port_attach(bfa, meminfo);
} }
/** /**
......
This diff is collapsed.
...@@ -244,6 +244,7 @@ ...@@ -244,6 +244,7 @@
#define IPR_RUNTIME_RESET 0x40000000 #define IPR_RUNTIME_RESET 0x40000000
#define IPR_IPL_INIT_MIN_STAGE_TIME 5 #define IPR_IPL_INIT_MIN_STAGE_TIME 5
#define IPR_IPL_INIT_DEFAULT_STAGE_TIME 15
#define IPR_IPL_INIT_STAGE_UNKNOWN 0x0 #define IPR_IPL_INIT_STAGE_UNKNOWN 0x0
#define IPR_IPL_INIT_STAGE_TRANSOP 0xB0000000 #define IPR_IPL_INIT_STAGE_TRANSOP 0xB0000000
#define IPR_IPL_INIT_STAGE_MASK 0xff000000 #define IPR_IPL_INIT_STAGE_MASK 0xff000000
...@@ -613,7 +614,7 @@ struct ipr_auto_sense { ...@@ -613,7 +614,7 @@ struct ipr_auto_sense {
__be32 data[SCSI_SENSE_BUFFERSIZE/sizeof(__be32)]; __be32 data[SCSI_SENSE_BUFFERSIZE/sizeof(__be32)];
}; };
struct ipr_ioasa { struct ipr_ioasa_hdr {
__be32 ioasc; __be32 ioasc;
#define IPR_IOASC_SENSE_KEY(ioasc) ((ioasc) >> 24) #define IPR_IOASC_SENSE_KEY(ioasc) ((ioasc) >> 24)
#define IPR_IOASC_SENSE_CODE(ioasc) (((ioasc) & 0x00ff0000) >> 16) #define IPR_IOASC_SENSE_CODE(ioasc) (((ioasc) & 0x00ff0000) >> 16)
...@@ -645,6 +646,25 @@ struct ipr_ioasa { ...@@ -645,6 +646,25 @@ struct ipr_ioasa {
#define IPR_FIELD_POINTER_VALID (0x80000000 >> 8) #define IPR_FIELD_POINTER_VALID (0x80000000 >> 8)
#define IPR_FIELD_POINTER_MASK 0x0000ffff #define IPR_FIELD_POINTER_MASK 0x0000ffff
}__attribute__((packed, aligned (4)));
struct ipr_ioasa {
struct ipr_ioasa_hdr hdr;
union {
struct ipr_ioasa_vset vset;
struct ipr_ioasa_af_dasd dasd;
struct ipr_ioasa_gpdd gpdd;
struct ipr_ioasa_gata gata;
} u;
struct ipr_auto_sense auto_sense;
}__attribute__((packed, aligned (4)));
struct ipr_ioasa64 {
struct ipr_ioasa_hdr hdr;
u8 fd_res_path[8];
union { union {
struct ipr_ioasa_vset vset; struct ipr_ioasa_vset vset;
struct ipr_ioasa_af_dasd dasd; struct ipr_ioasa_af_dasd dasd;
...@@ -804,7 +824,7 @@ struct ipr_hostrcb_array_data_entry_enhanced { ...@@ -804,7 +824,7 @@ struct ipr_hostrcb_array_data_entry_enhanced {
}__attribute__((packed, aligned (4))); }__attribute__((packed, aligned (4)));
struct ipr_hostrcb_type_ff_error { struct ipr_hostrcb_type_ff_error {
__be32 ioa_data[502]; __be32 ioa_data[758];
}__attribute__((packed, aligned (4))); }__attribute__((packed, aligned (4)));
struct ipr_hostrcb_type_01_error { struct ipr_hostrcb_type_01_error {
...@@ -1181,7 +1201,7 @@ struct ipr_resource_entry { ...@@ -1181,7 +1201,7 @@ struct ipr_resource_entry {
u8 flags; u8 flags;
__be16 res_flags; __be16 res_flags;
__be32 type; u8 type;
u8 qmodel; u8 qmodel;
struct ipr_std_inq_data std_inq_data; struct ipr_std_inq_data std_inq_data;
...@@ -1464,7 +1484,10 @@ struct ipr_cmnd { ...@@ -1464,7 +1484,10 @@ struct ipr_cmnd {
struct ipr_ioadl64_desc ioadl64[IPR_NUM_IOADL_ENTRIES]; struct ipr_ioadl64_desc ioadl64[IPR_NUM_IOADL_ENTRIES];
struct ipr_ata64_ioadl ata_ioadl; struct ipr_ata64_ioadl ata_ioadl;
} i; } i;
union {
struct ipr_ioasa ioasa; struct ipr_ioasa ioasa;
struct ipr_ioasa64 ioasa64;
} s;
struct list_head queue; struct list_head queue;
struct scsi_cmnd *scsi_cmd; struct scsi_cmnd *scsi_cmd;
struct ata_queued_cmd *qc; struct ata_queued_cmd *qc;
......
...@@ -601,10 +601,8 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag) ...@@ -601,10 +601,8 @@ static void iscsi_sw_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx);
write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock); write_unlock_bh(&tcp_sw_conn->sock->sk->sk_callback_lock);
if (sk_sleep(sock->sk)) {
sock->sk->sk_err = EIO; sock->sk->sk_err = EIO;
wake_up_interruptible(sk_sleep(sock->sk)); wake_up_interruptible(sk_sleep(sock->sk));
}
iscsi_conn_stop(cls_conn, flag); iscsi_conn_stop(cls_conn, flag);
iscsi_sw_tcp_release_conn(conn); iscsi_sw_tcp_release_conn(conn);
......
...@@ -492,19 +492,20 @@ void scsi_target_reap(struct scsi_target *starget) ...@@ -492,19 +492,20 @@ void scsi_target_reap(struct scsi_target *starget)
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
unsigned long flags; unsigned long flags;
enum scsi_target_state state; enum scsi_target_state state;
int empty; int empty = 0;
spin_lock_irqsave(shost->host_lock, flags); spin_lock_irqsave(shost->host_lock, flags);
state = starget->state; state = starget->state;
empty = --starget->reap_ref == 0 && if (--starget->reap_ref == 0 && list_empty(&starget->devices)) {
list_empty(&starget->devices) ? 1 : 0; empty = 1;
starget->state = STARGET_DEL;
}
spin_unlock_irqrestore(shost->host_lock, flags); spin_unlock_irqrestore(shost->host_lock, flags);
if (!empty) if (!empty)
return; return;
BUG_ON(state == STARGET_DEL); BUG_ON(state == STARGET_DEL);
starget->state = STARGET_DEL;
if (state == STARGET_CREATED) if (state == STARGET_CREATED)
scsi_target_destroy(starget); scsi_target_destroy(starget);
else else
......
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