Commit 8397990b authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-scsi.bkbits.net/scsi-for-linus-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents f1e706d0 8808b074
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#undef A_NCR53c7xx_msg_abort
#undef A_NCR53c7xx_msg_reject
#undef A_NCR53c7xx_sink
#undef A_NCR53c7xx_zero
#undef A_NOP_insn
#undef A_addr_reconnect_dsa_head
#undef A_addr_scratch
#undef A_addr_temp
#undef A_dmode_memory_to_memory
#undef A_dmode_memory_to_ncr
#undef A_dmode_ncr_to_memory
#undef A_dsa_check_reselect
#undef A_dsa_cmdout
#undef A_dsa_cmnd
#undef A_dsa_datain
#undef A_dsa_dataout
#undef A_dsa_end
#undef A_dsa_fields_start
#undef A_dsa_msgin
#undef A_dsa_msgout
#undef A_dsa_msgout_other
#undef A_dsa_next
#undef A_dsa_restore_pointers
#undef A_dsa_save_data_pointer
#undef A_dsa_select
#undef A_dsa_status
#undef A_dsa_temp_addr_array_value
#undef A_dsa_temp_addr_dsa_value
#undef A_dsa_temp_addr_new_value
#undef A_dsa_temp_addr_next
#undef A_dsa_temp_addr_residual
#undef A_dsa_temp_addr_saved_pointer
#undef A_dsa_temp_addr_saved_residual
#undef A_dsa_temp_lun
#undef A_dsa_temp_next
#undef A_dsa_temp_sync
#undef A_dsa_temp_target
#undef A_int_debug_break
#undef A_int_debug_panic
#undef A_int_err_check_condition
#undef A_int_err_no_phase
#undef A_int_err_selected
#undef A_int_err_unexpected_phase
#undef A_int_err_unexpected_reselect
#undef A_int_msg_1
#undef A_int_msg_sdtr
#undef A_int_msg_wdtr
#undef A_int_norm_aborted
#undef A_int_norm_command_complete
#undef A_int_norm_disconnected
#undef A_int_norm_reselect_complete
#undef A_int_norm_reset
#undef A_int_norm_select_complete
#undef A_int_test_1
#undef A_int_test_2
#undef A_int_test_3
#undef A_msg_buf
#undef A_reconnect_dsa_head
#undef A_reselected_identify
#undef A_reselected_tag
#undef A_schedule
#undef A_test_dest
#undef A_test_src
#undef Ent_accept_message
#undef Ent_cmdout_cmdout
#undef Ent_command_complete
#undef Ent_command_complete_msgin
#undef Ent_data_transfer
#undef Ent_datain_to_jump
#undef Ent_debug_break
#undef Ent_dsa_code_begin
#undef Ent_dsa_code_check_reselect
#undef Ent_dsa_code_fix_jump
#undef Ent_dsa_code_restore_pointers
#undef Ent_dsa_code_save_data_pointer
#undef Ent_dsa_code_template
#undef Ent_dsa_code_template_end
#undef Ent_dsa_schedule
#undef Ent_dsa_zero
#undef Ent_end_data_transfer
#undef Ent_initiator_abort
#undef Ent_msg_in
#undef Ent_msg_in_restart
#undef Ent_other_in
#undef Ent_other_out
#undef Ent_other_transfer
#undef Ent_reject_message
#undef Ent_reselected_check_next
#undef Ent_reselected_ok
#undef Ent_respond_message
#undef Ent_select
#undef Ent_select_msgout
#undef Ent_target_abort
#undef Ent_test_1
#undef Ent_test_2
#undef Ent_test_2_msgout
#undef Ent_wait_reselect
......@@ -1379,24 +1379,16 @@ config SCSI_SEAGATE
# definitely looks note 64bit safe:
config SCSI_SIM710
tristate "Simple 53c710 SCSI support (Compaq, NCR machines)"
depends on (ISA || MCA && !X86_64) && SCSI
depends on (EISA || MCA && !X86_64) && SCSI
---help---
This is a simple driver for NCR53c710 based SCSI host adapters.
This driver for NCR53c710 based SCSI host adapters.
More complex drivers for this chip are available ("NCR53c7,8xx SCSI
support", above), but they require that the scsi chip be able to do
DMA block moves between memory and on-chip registers, which can
cause problems under certain conditions. This driver is designed to
avoid these problems and is intended to work with any Intel machines
using 53c710 chips, including various Compaq and NCR machines.
It currently supports Compaq EISA cards and NCR MCA cards
Please read the comments at the top of the file
<file:drivers/scsi/sim710.c> for more information.
If you want to compile this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read <file:Documentation/modules.txt>. The module
will be called sim710.o.
config 53C700_IO_MAPPED
bool
depends on SCSI_SIM710
default y
config SCSI_SYM53C416
tristate "Symbios 53c416 SCSI support"
......
......@@ -43,7 +43,7 @@ obj-$(CONFIG_SCSI_MAC_ESP) += mac_esp.o NCR53C9x.o
obj-$(CONFIG_SUN3_SCSI) += sun3_scsi.o sun3_scsi_vme.o
obj-$(CONFIG_MVME16x_SCSI) += mvme16x.o 53c7xx.o
obj-$(CONFIG_BVME6000_SCSI) += bvme6000.o 53c7xx.o
obj-$(CONFIG_SCSI_SIM710) += sim710.o
obj-$(CONFIG_SCSI_SIM710) += sim710.o 53c700.o
obj-$(CONFIG_SCSI_ADVANSYS) += advansys.o
obj-$(CONFIG_SCSI_PCI2000) += pci2000.o
obj-$(CONFIG_SCSI_PCI2220I) += pci2220i.o
......@@ -78,7 +78,6 @@ obj-$(CONFIG_SCSI_FD_8xx) += seagate.o
obj-$(CONFIG_SCSI_T128) += t128.o
obj-$(CONFIG_SCSI_DMX3191D) += dmx3191d.o
obj-$(CONFIG_SCSI_DTC3280) += dtc.o
obj-$(CONFIG_SCSI_NCR53C7xx) += 53c7,8xx.o
obj-$(CONFIG_SCSI_SYM53C8XX_2) += sym53c8xx_2/
obj-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
obj-$(CONFIG_SCSI_NCR53C8XX) += ncr53c8xx.o
......@@ -139,12 +138,10 @@ cpqfc-objs := cpqfcTSinit.o cpqfcTScontrol.o cpqfcTSi2c.o \
cpqfcTSworker.o cpqfcTStrigger.o
# Files generated that shall be removed upon make clean
clean-files := 53c8xx_d.h 53c7xx_d.h sim710_d.h 53c700_d.h \
53c8xx_u.h 53c7xx_u.h sim710_u.h 53c700_u.h
clean-files := 53c7xx_d.h 53c700_d.h \
53c7xx_u.h 53c700_u.h
$(obj)/53c7,8xx.o: $(obj)/53c8xx_d.h $(obj)/53c8xx_u.h
$(obj)/53c7xx.o: $(obj)/53c7xx_d.h $(obj)/53c7xx_u.h
$(obj)/sim710.o: $(obj)/sim710_d.h
$(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h
# If you want to play with the firmware, uncomment
......@@ -152,21 +149,11 @@ $(obj)/53c700.o $(MODVERDIR)/$(obj)/53c700.ver: $(obj)/53c700_d.h
ifdef GENERATE_FIRMWARE
$(obj)/53c8xx_d.h: $(src)/53c7,8xx.scr $(src)/script_asm.pl
$(CPP) -traditional -DCHIP=810 - < $< | grep -v '^#' | $(PERL) $(src)/script_asm.pl $@ $(@:_d.h=_u.h)
$(obj)/53c8xx_u.h: $(obj)/53c8xx_d.h
$(obj)/53c7xx_d.h: $(src)/53c7xx.scr $(src)/script_asm.pl
$(CPP) -traditional -DCHIP=710 - < $< | grep -v '^#' | $(PERL) -s $(src)/script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h)
$(obj)/53c7xx_u.h: $(obj)/53c7xx_d.h
$(obj)/sim710_d.h: $(src)/sim710.scr $(src)/script_asm.pl
$(CPP) -traditional -DCHIP=710 - < $< | grep -v '^#' | $(PERL) -s $(src)/script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h)
$(obj)/sim710_u.h: $(obj)/sim710_d.h
$(obj)/53c700_d.h: $(src)/53c700.scr $(src)/script_asm.pl
$(PERL) -s $(src)/script_asm.pl -ncr7x0_family $@ $(@:_d.h=_u.h) < $<
......
......@@ -2510,13 +2510,16 @@ static void adpt_fail_posted_scbs(adpt_hba* pHba)
Scsi_Device* d = NULL;
list_for_each_entry(d, &pHba->host->my_devices, siblings) {
for(cmd = d->device_queue; cmd ; cmd = cmd->next){
unsigned long flags;
spin_lock_irqsave(&d->list_lock, flags);
list_for_each_entry(cmd, &d->cmd_list, list) {
if(cmd->serial_number == 0){
continue;
}
cmd->result = (DID_OK << 16) | (QUEUE_FULL <<1);
cmd->scsi_done(cmd);
}
spin_unlock_irqrestore(&d->list_lock, flags);
}
}
......
......@@ -205,13 +205,15 @@ static int scsi_check_device_busy(struct scsi_device *sdev)
{
struct Scsi_Host *shost = sdev->host;
struct scsi_cmnd *scmd;
unsigned long flags;
/*
* Loop over all of the commands associated with the
* device. If any of them are busy, then set the state
* back to inactive and bail.
*/
for (scmd = sdev->device_queue; scmd; scmd = scmd->next) {
spin_lock_irqsave(&sdev->list_lock, flags);
list_for_each_entry(scmd, &sdev->cmd_list, list) {
if (scmd->request && scmd->request->rq_status != RQ_INACTIVE)
goto active;
......@@ -223,6 +225,7 @@ static int scsi_check_device_busy(struct scsi_device *sdev)
if (scmd->request)
scmd->request->rq_status = RQ_SCSI_DISCONNECTING;
}
spin_unlock_irqrestore(&sdev->list_lock, flags);
return 0;
......@@ -233,12 +236,13 @@ static int scsi_check_device_busy(struct scsi_device *sdev)
scmd->pid, scmd->state, scmd->owner);
list_for_each_entry(sdev, &shost->my_devices, siblings) {
for (scmd = sdev->device_queue; scmd; scmd = scmd->next) {
list_for_each_entry(scmd, &sdev->cmd_list, list) {
if (scmd->request->rq_status == RQ_SCSI_DISCONNECTING)
scmd->request->rq_status = RQ_INACTIVE;
}
}
spin_unlock_irqrestore(&sdev->list_lock, flags);
printk(KERN_ERR "Device busy???\n");
return 1;
}
......
......@@ -403,12 +403,17 @@ struct scsi_cmnd *scsi_get_command(struct scsi_device *dev, int gfp_mask)
struct scsi_cmnd *cmd = __scsi_get_command(dev->host, gfp_mask);
if (likely(cmd != NULL)) {
unsigned long flags;
memset(cmd, 0, sizeof(*cmd));
cmd->device = dev;
cmd->state = SCSI_STATE_UNUSED;
cmd->owner = SCSI_OWNER_NOBODY;
init_timer(&cmd->eh_timeout);
INIT_LIST_HEAD(&cmd->list);
spin_lock_irqsave(&dev->list_lock, flags);
list_add_tail(&cmd->list, &dev->cmd_list);
spin_unlock_irqrestore(&dev->list_lock, flags);
}
return cmd;
......@@ -430,7 +435,13 @@ void scsi_put_command(struct scsi_cmnd *cmd)
struct Scsi_Host *shost = cmd->device->host;
unsigned long flags;
spin_lock_irqsave(&shost->free_list_lock, flags);
/* serious error if the command hasn't come from a device list */
spin_lock_irqsave(&cmd->device->list_lock, flags);
BUG_ON(list_empty(&cmd->list));
list_del_init(&cmd->list);
spin_unlock(&cmd->device->list_lock);
/* changing locks here, don't need to restore the irq state */
spin_lock(&shost->free_list_lock);
if (unlikely(list_empty(&shost->free_list))) {
list_add(&cmd->list, &shost->free_list);
cmd = NULL;
......
......@@ -571,9 +571,8 @@ struct scsi_device {
struct Scsi_Host *host;
request_queue_t *request_queue;
volatile unsigned short device_busy; /* commands actually active on low-level */
struct list_head free_cmnds; /* list of available Scsi_Cmnd structs */
struct list_head busy_cmnds; /* list of Scsi_Cmnd structs in use */
Scsi_Cmnd *device_queue; /* queue of SCSI Command structures */
spinlock_t list_lock;
struct list_head cmd_list; /* queue of in use SCSI Command structures */
Scsi_Cmnd *current_cmnd; /* currently active command */
unsigned short queue_depth; /* How deep of a queue we want */
unsigned short last_queue_full_depth; /* These two are used by */
......@@ -724,7 +723,6 @@ struct scsi_cmnd {
unsigned short state;
unsigned short owner;
Scsi_Request *sc_request;
struct scsi_cmnd *next;
struct scsi_cmnd *reset_chain;
struct list_head list; /* scsi_cmnd participates in queue lists */
......
......@@ -233,7 +233,10 @@ static void scsi_eh_get_failed(Scsi_Cmnd **sc_list, struct Scsi_Host *shost)
found = 0;
list_for_each_entry(sdev, &shost->my_devices, siblings) {
for (scmd = sdev->device_queue; scmd; scmd = scmd->next) {
unsigned long flags;
spin_lock_irqsave(&sdev->list_lock, flags);
list_for_each_entry(scmd, &sdev->cmd_list, list) {
if (scsi_eh_eflags_chk(scmd, SCSI_EH_CMD_ERR)) {
scmd->bh_next = *sc_list;
*sc_list = scmd;
......@@ -266,6 +269,7 @@ static void scsi_eh_get_failed(Scsi_Cmnd **sc_list, struct Scsi_Host *shost)
}
}
}
spin_unlock_irqrestore(&sdev->list_lock, flags);
}
SCSI_LOG_ERROR_RECOVERY(1, scsi_eh_prt_fail_stats(*sc_list, shost));
......@@ -1739,25 +1743,13 @@ scsi_reset_provider_done_command(Scsi_Cmnd *SCpnt)
int
scsi_reset_provider(Scsi_Device *dev, int flag)
{
struct scsi_cmnd SC, *SCpnt = &SC;
struct scsi_cmnd *SCpnt = scsi_get_command(dev, GFP_KERNEL);
struct request req;
int rtn;
SCpnt->request = &req;
memset(&SCpnt->eh_timeout, 0, sizeof(SCpnt->eh_timeout));
SCpnt->device = dev;
SCpnt->request->rq_status = RQ_SCSI_BUSY;
SCpnt->request->waiting = NULL;
SCpnt->use_sg = 0;
SCpnt->old_use_sg = 0;
SCpnt->old_cmd_len = 0;
SCpnt->underflow = 0;
SCpnt->transfersize = 0;
SCpnt->resid = 0;
SCpnt->serial_number = 0;
SCpnt->serial_number_at_timeout = 0;
SCpnt->host_scribble = NULL;
SCpnt->next = NULL;
SCpnt->state = SCSI_STATE_INITIALIZING;
SCpnt->owner = SCSI_OWNER_MIDLEVEL;
......@@ -1790,5 +1782,6 @@ scsi_reset_provider(Scsi_Device *dev, int flag)
rtn = scsi_new_reset(SCpnt, flag);
scsi_delete_timer(SCpnt);
scsi_put_command(SCpnt);
return rtn;
}
......@@ -359,7 +359,10 @@ static void scsi_dump_status(int level)
printk(KERN_INFO "h:c:t:l (dev sect nsect cnumsec sg) "
"(ret all flg) (to/cmd to ito) cmd snse result\n");
list_for_each_entry(SDpnt, &shpnt->my_devices, siblings) {
for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCpnt->next) {
unsigned long flags;
spin_lock_irqsave(&SDpnt->list_lock, flags);
list_for_each_entry(SCpnt, &SDpnt->cmd_list, list) {
/* (0) h:c:t:l (dev sect nsect cnumsec sg) (ret all flg) (to/cmd to ito) cmd snse result %d %x */
printk(KERN_INFO "(%3d) %2d:%1d:%2d:%2d (%6s %4llu %4ld %4ld %4x %1d) (%1d %1d 0x%2x) (%4d %4d %4d) 0x%2.2x 0x%2.2x 0x%8.8x\n",
i++,
......@@ -389,6 +392,7 @@ static void scsi_dump_status(int level)
SCpnt->sense_buffer[2],
SCpnt->result);
}
spin_unlock_irqrestore(&SDpnt->list_lock, flags);
}
}
}
......
......@@ -449,6 +449,8 @@ static struct scsi_device *scsi_alloc_sdev(struct Scsi_Host *shost,
sdev->online = TRUE;
INIT_LIST_HEAD(&sdev->siblings);
INIT_LIST_HEAD(&sdev->same_target_siblings);
INIT_LIST_HEAD(&sdev->cmd_list);
spin_lock_init(&sdev->list_lock);
/*
* Some low level driver could use device->type
*/
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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