diff options
author | James Bottomley <jejb@titanic> | 2005-04-18 13:45:00 -0500 |
---|---|---|
committer | James Bottomley <jejb@titanic> | 2005-04-18 13:45:00 -0500 |
commit | c46f2ffb9e7fce7208c2639790e1ade42e00b146 (patch) | |
tree | 284912295d46a861930d0619788a650f56c2a29b | |
parent | c2a9331c62216e222a08de8dd58559367fef0af6 (diff) | |
parent | f59114b7b5dc677bbd7cc7e26a5fcb3572a3445c (diff) | |
download | linux-c46f2ffb9e7fce7208c2639790e1ade42e00b146.tar.gz linux-c46f2ffb9e7fce7208c2639790e1ade42e00b146.tar.bz2 linux-c46f2ffb9e7fce7208c2639790e1ade42e00b146.zip |
merge by hand (scsi_device.h)
39 files changed, 203 insertions, 330 deletions
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c index 689527a89de7..681871ca5d60 100644 --- a/drivers/block/scsi_ioctl.c +++ b/drivers/block/scsi_ioctl.c @@ -328,11 +328,6 @@ static int sg_io(struct file *file, request_queue_t *q, return 0; } -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) -#define START_STOP_TIMEOUT (60 * HZ) -#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) -#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) #define OMAX_SB_LEN 16 /* For backward compatibility */ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 5fc5004ea07a..1fb5cdf67f8f 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c @@ -54,6 +54,9 @@ extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); +static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, + unsigned long arg); + static spinlock_t i2o_config_lock; #define MODINC(x,y) ((x) = ((x) + 1) % (y)) @@ -538,8 +541,7 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp) } #ifdef CONFIG_COMPAT -static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg, - struct file *file) +static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long arg) { struct i2o_cmd_passthru32 __user *cmd; struct i2o_controller *c; @@ -752,7 +754,26 @@ static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg, return rcode; } -#else +static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) +{ + int ret; + lock_kernel(); + switch (cmd) { + case I2OGETIOPS: + ret = i2o_cfg_ioctl(NULL, file, cmd, arg); + break; + case I2OPASSTHRU32: + ret = i2o_cfg_passthru32(file, cmd, arg); + break; + default: + ret = -ENOIOCTLCMD; + break; + } + unlock_kernel(); + return ret; +} + +#endif static int i2o_cfg_passthru(unsigned long arg) { @@ -958,7 +979,6 @@ static int i2o_cfg_passthru(unsigned long arg) kfree(reply); return rcode; } -#endif /* * IOCTL Handler @@ -1013,11 +1033,9 @@ static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, ret = i2o_cfg_evt_get(arg, fp); break; -#ifndef CONFIG_COMPAT case I2OPASSTHRU: ret = i2o_cfg_passthru(arg); break; -#endif default: osm_debug("unknown ioctl called!\n"); @@ -1105,6 +1123,9 @@ static struct file_operations config_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = i2o_cfg_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = i2o_cfg_compat_ioctl, +#endif .open = cfg_open, .release = cfg_release, .fasync = cfg_fasync, @@ -1134,19 +1155,11 @@ static int __init i2o_config_init(void) misc_deregister(&i2o_miscdev); return -EBUSY; } -#ifdef CONFIG_COMPAT - register_ioctl32_conversion(I2OPASSTHRU32, i2o_cfg_passthru32); - register_ioctl32_conversion(I2OGETIOPS, (void *)sys_ioctl); -#endif return 0; } static void i2o_config_exit(void) { -#ifdef CONFIG_COMPAT - unregister_ioctl32_conversion(I2OPASSTHRU32); - unregister_ioctl32_conversion(I2OGETIOPS); -#endif misc_deregister(&i2o_miscdev); i2o_driver_unregister(&i2o_config_driver); } diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index ce398aa9e019..1f9aeb4accc6 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -88,10 +88,10 @@ MODULE_DESCRIPTION ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries"); MODULE_LICENSE("GPL"); -module_param(device, charp, 0); +module_param(device, charp, 0400); MODULE_PARM_DESC(device, "specify initial device"); -module_param(loglevel, uint, 0); +module_param(loglevel, uint, 0400); MODULE_PARM_DESC(loglevel, "log levels, 8 nibbles: " "FC ERP QDIO CIO Config FSF SCSI Other, " diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 53fcccbb424c..0afa1c4696ca 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -70,7 +70,7 @@ /********************* GENERAL DEFINES *********************************/ /* zfcp version number, it consists of major, minor, and patch-level number */ -#define ZFCP_VERSION "4.2.0" +#define ZFCP_VERSION "4.3.0" /** * zfcp_sg_to_address - determine kernel address from struct scatterlist @@ -851,6 +851,9 @@ struct zfcp_adapter { wwn_t wwnn; /* WWNN */ wwn_t wwpn; /* WWPN */ fc_id_t s_id; /* N_Port ID */ + wwn_t peer_wwnn; /* P2P peer WWNN */ + wwn_t peer_wwpn; /* P2P peer WWPN */ + fc_id_t peer_d_id; /* P2P peer D_ID */ struct ccw_device *ccw_device; /* S/390 ccw device */ u8 fc_service_class; u32 fc_topology; /* FC topology */ diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index cfc0d8c588df..53ebc1cdfe2d 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -2568,6 +2568,23 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING: + if (adapter->fc_topology == FSF_TOPO_P2P) { + if (port->wwpn != adapter->peer_wwpn) { + ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " + "on adapter %s.\nPeer WWPN " + "0x%016Lx does not match\n", + port->wwpn, + zfcp_get_busid_by_adapter(adapter), + adapter->peer_wwpn); + zfcp_erp_port_failed(port); + retval = ZFCP_ERP_FAILED; + break; + } + port->d_id = adapter->peer_d_id; + atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status); + retval = zfcp_erp_port_strategy_open_port(erp_action); + break; + } if (!(adapter->nameserver_port)) { retval = zfcp_nameserver_enqueue(adapter); if (retval != 0) { @@ -3516,8 +3533,9 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter) debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); debug_event(adapter->erp_dbf, 3, &adapter->name, 8); - zfcp_erp_port_access_changed(adapter->nameserver_port); read_lock_irqsave(&zfcp_data.config_lock, flags); + if (adapter->nameserver_port) + zfcp_erp_port_access_changed(adapter->nameserver_port); list_for_each_entry(port, &adapter->port_list_head, list) if (port != adapter->nameserver_port) zfcp_erp_port_access_changed(port); diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 578b9fbe5206..148b11c822bf 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -2107,6 +2107,9 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) bottom->low_qtcb_version, bottom->high_qtcb_version); adapter->fsf_lic_version = bottom->lic_version; adapter->supported_features = bottom->supported_features; + adapter->peer_wwpn = 0; + adapter->peer_wwnn = 0; + adapter->peer_d_id = 0; if (xchg_ok) { adapter->wwnn = bottom->nport_serv_param.wwnn; @@ -2124,13 +2127,19 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) adapter->hydra_version = 0; } + if (adapter->fc_topology == FSF_TOPO_P2P) { + adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; + adapter->peer_wwpn = bottom->plogi_payload.wwpn; + adapter->peer_wwnn = bottom->plogi_payload.wwnn; + } + if(adapter->supported_features & FSF_FEATURE_HBAAPI_MANAGEMENT){ adapter->hardware_version = bottom->hardware_version; memcpy(adapter->serial_number, bottom->serial_number, 17); EBCASC(adapter->serial_number, sizeof(adapter->serial_number)); } - ZFCP_LOG_INFO("The adapter %s reported the following characteristics:\n" + ZFCP_LOG_NORMAL("The adapter %s reported the following characteristics:\n" "WWNN 0x%016Lx, " "WWPN 0x%016Lx, " "S_ID 0x%08x,\n" @@ -2194,14 +2203,18 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) switch (adapter->fc_topology) { case FSF_TOPO_P2P: ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n"); - ZFCP_LOG_NORMAL("error: Point-to-point fibrechannel " - "configuration detected at adapter %s " - "unsupported, shutting down adapter\n", - zfcp_get_busid_by_adapter(adapter)); + ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " + "configuration detected at adapter %s\n" + "Peer WWNN 0x%016llx, " + "peer WWPN 0x%016llx, " + "peer d_id 0x%06x\n", + zfcp_get_busid_by_adapter(adapter), + adapter->peer_wwnn, + adapter->peer_wwpn, + adapter->peer_d_id); debug_text_event(fsf_req->adapter->erp_dbf, 0, "top-p-to-p"); - zfcp_erp_adapter_shutdown(adapter, 0); - return -EIO; + break; case FSF_TOPO_AL: ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n"); ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " @@ -2226,6 +2239,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) "of a type known to the zfcp " "driver, shutting down adapter\n", zfcp_get_busid_by_adapter(adapter)); + adapter->fc_topology = FSF_TOPO_ERROR; debug_text_exception(fsf_req->adapter->erp_dbf, 0, "unknown-topo"); zfcp_erp_adapter_shutdown(adapter, 0); @@ -4281,6 +4295,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE); zfcp_cmd_dbf_event_fsf("undeffcp", fsf_req, NULL, 0); set_host_byte(&scpnt->result, DID_ERROR); + goto skip_fsfstatus; } } @@ -4334,7 +4349,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) scpnt->resid = fcp_rsp_iu->fcp_resid; if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) - scpnt->result |= DID_ERROR << 16; + set_host_byte(&scpnt->result, DID_ERROR); } skip_fsfstatus: @@ -4607,6 +4622,13 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { switch (header->fsf_status_qual.word[0]) { + case FSF_SQ_CFDC_HARDENED_ON_SE: + ZFCP_LOG_NORMAL( + "CFDC on the adapter %s has being " + "hardened on primary and secondary SE\n", + zfcp_get_busid_by_adapter(adapter)); + break; + case FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE: ZFCP_LOG_NORMAL( "CFDC of the adapter %s could not " diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h index 5889956bbf08..07140dfda2a7 100644 --- a/drivers/s390/scsi/zfcp_fsf.h +++ b/drivers/s390/scsi/zfcp_fsf.h @@ -129,6 +129,7 @@ #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 /* FSF status qualifier for CFDC commands */ +#define FSF_SQ_CFDC_HARDENED_ON_SE 0x00000000 #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE 0x00000001 #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2 0x00000002 /* CFDC subtable codes */ @@ -357,7 +358,6 @@ struct fsf_nport_serv_param { u8 class3_serv_param[16]; u8 class4_serv_param[16]; u8 vendor_version_level[16]; - u8 res1[16]; } __attribute__ ((packed)); struct fsf_plogi { @@ -415,11 +415,13 @@ struct fsf_qtcb_bottom_config { u8 res2[12]; u32 s_id; struct fsf_nport_serv_param nport_serv_param; + u8 reserved_nport_serv_param[16]; u8 res3[8]; u32 adapter_ports; u32 hardware_version; u8 serial_number[32]; - u8 res4[272]; + struct fsf_nport_serv_param plogi_payload; + u8 res4[160]; } __attribute__ ((packed)); struct fsf_qtcb_bottom_port { diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index ff28ade1dfc7..23e2dca55bb8 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c @@ -65,6 +65,9 @@ ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status)); ZFCP_DEFINE_ADAPTER_ATTR(wwnn, "0x%016llx\n", adapter->wwnn); ZFCP_DEFINE_ADAPTER_ATTR(wwpn, "0x%016llx\n", adapter->wwpn); ZFCP_DEFINE_ADAPTER_ATTR(s_id, "0x%06x\n", adapter->s_id); +ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn); +ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn); +ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id); ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); ZFCP_DEFINE_ADAPTER_ATTR(fc_link_speed, "%d Gb/s\n", adapter->fc_link_speed); @@ -255,6 +258,9 @@ static struct attribute *zfcp_adapter_attrs[] = { &dev_attr_wwnn.attr, &dev_attr_wwpn.attr, &dev_attr_s_id.attr, + &dev_attr_peer_wwnn.attr, + &dev_attr_peer_wwpn.attr, + &dev_attr_peer_d_id.attr, &dev_attr_card_version.attr, &dev_attr_lic_version.attr, &dev_attr_fc_link_speed.attr, diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c index 8ead55f75d02..2341d27ceed7 100644 --- a/drivers/scsi/53c7xx.c +++ b/drivers/scsi/53c7xx.c @@ -280,6 +280,7 @@ #endif #include "scsi.h" +#include <scsi/scsi_dbg.h> #include <scsi/scsi_host.h> #include "53c7xx.h" #include <linux/stat.h> @@ -1721,9 +1722,9 @@ NCR53c7xx_run_tests (struct Scsi_Host *host) { printk ("scsi%d : test 2 INQUIRY to target %d, lun 0 : %s\n", host->host_no, i, data + 8); printk ("scsi%d : status ", host->host_no); - print_status (status); + scsi_print_status (status); printk ("\nscsi%d : message ", host->host_no); - print_msg (&msg); + scsi_print_msg (&msg); printk ("\n"); } else if (hostdata->test_completed == 3) { printk("scsi%d : test 2 no connection with target %d\n", @@ -2312,7 +2313,7 @@ NCR53c7x0_dstat_sir_intr (struct Scsi_Host *host, struct printk ("scsi%d : received message", host->host_no); if (c) printk (" from target %d lun %d ", c->device->id, c->device->lun); - print_msg ((unsigned char *) hostdata->msg_buf); + scsi_print_msg ((unsigned char *) hostdata->msg_buf); printk("\n"); } @@ -3204,7 +3205,7 @@ create_cmd (Scsi_Cmnd *cmd) { case WRITE_10: #if 0 printk("scsi%d : command is ", host->host_no); - print_command(cmd->cmnd); + __scsi_print_command(cmd->cmnd); #endif #if 0 printk ("scsi%d : %d scatter/gather segments\n", host->host_no, @@ -3232,7 +3233,7 @@ create_cmd (Scsi_Cmnd *cmd) { */ default: printk("scsi%d : datain+dataout for command ", host->host_no); - print_command(cmd->cmnd); + __scsi_print_command(cmd->cmnd); datain = dataout = 2 * (cmd->use_sg ? cmd->use_sg : 1) + 3; } @@ -3938,7 +3939,7 @@ intr_scsi (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) { if (cmd) { printk("scsi%d : target %d, lun %d, command ", host->host_no, cmd->cmd->device->id, cmd->cmd->device->lun); - print_command (cmd->cmd->cmnd); + __scsi_print_command (cmd->cmd->cmnd); printk("scsi%d : dsp = 0x%x (virt 0x%p)\n", host->host_no, NCR53c7x0_read32(DSP_REG), bus_to_virt(NCR53c7x0_read32(DSP_REG))); @@ -4208,7 +4209,7 @@ restart: if (hostdata->options & OPTION_DEBUG_INTR) { printk ("scsi%d : command complete : pid %lu, id %d,lun %d result 0x%x ", host->host_no, tmp->pid, tmp->device->id, tmp->device->lun, tmp->result); - print_command (tmp->cmnd); + __scsi_print_command (tmp->cmnd); } tmp->scsi_done(tmp); @@ -4297,7 +4298,7 @@ NCR53c7x0_intr (int irq, void *dev_id, struct pt_regs * regs) printk("scsi%d : interrupt for pid %lu, id %d, lun %d ", host->host_no, cmd->cmd->pid, (int) cmd->cmd->device->id, (int) cmd->cmd->device->lun); - print_command (cmd->cmd->cmnd); + __scsi_print_command (cmd->cmd->cmnd); } else { printk("scsi%d : no active command\n", host->host_no); } @@ -5539,7 +5540,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) { i > 0 && !check_address ((unsigned long) ptr, 1); ptr += len, i -= len) { printk(" "); - len = print_msg (ptr); + len = scsi_print_msg (ptr); printk("\n"); if (!len) break; @@ -5554,7 +5555,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) { if (cmd) { printk(" result = 0x%x, target = %d, lun = %d, cmd = ", cmd->result, cmd->device->id, cmd->device->lun); - print_command(cmd->cmnd); + __scsi_print_command(cmd->cmnd); } else printk("\n"); printk(" + %d : dsa_next = 0x%x\n", hostdata->dsa_next, @@ -6028,7 +6029,7 @@ dump_events (struct Scsi_Host *host, int count) { virt_to_bus(event.dsa), event.dsa); if (event.pid != -1) { printk (" event for pid %ld ", event.pid); - print_command (event.cmnd); + __scsi_print_command (event.cmnd); } } } diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 41b5197ce4e6..15e4b122d56e 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -2958,13 +2958,6 @@ static int BusLogic_AbortCommand(struct scsi_cmnd *Command) struct BusLogic_CCB *CCB; BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested); /* - If this Command has already completed, then no Abort is necessary. - */ - if (Command->serial_number != Command->serial_number_at_timeout) { - BusLogic_Warning("Unable to Abort Command to Target %d - " "Already Completed\n", HostAdapter, TargetID); - return SUCCESS; - } - /* Attempt to find an Active CCB for this Command. If no Active CCB for this Command is found, then no Abort is necessary. */ diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 5e71a0beafca..770fa841e389 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -86,6 +86,7 @@ * 5. Test linked command handling code after Eric is ready with * the high level code. */ +#include <scsi/scsi_dbg.h> #if (NDEBUG & NDEBUG_LISTS) #define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); } @@ -2371,7 +2372,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2418,7 +2419,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { default: if (!tmp) { printk("scsi%d: rejecting message ", instance->host_no); - print_msg(extended_msg); + scsi_print_msg(extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->device->id, cmd->device->lun); @@ -2552,7 +2553,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) { if (!(msg[0] & 0x80)) { printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no); - print_msg(msg); + scsi_print_msg(msg); abort = 1; } else { /* Accept message by clearing ACK */ @@ -2677,7 +2678,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { Scsi_Cmnd *tmp, **prev; printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no); - print_Scsi_Cmnd(cmd); + scsi_print_command(cmd); NCR5380_print_status(instance); diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 9962c51dc2a7..04cb5c405a2d 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -9198,16 +9198,13 @@ asc_prt_scsi_cmnd(struct scsi_cmnd *s) s->use_sg, s->sglist_len, s->abort_reason); printk( -" serial_number 0x%x, serial_number_at_timeout 0x%x, retries %d, allowed %d\n", - (unsigned) s->serial_number, (unsigned) s->serial_number_at_timeout, - s->retries, s->allowed); +" serial_number 0x%x, retries %d, allowed %d\n", + (unsigned) s->serial_number, s->retries, s->allowed); printk( " timeout_per_command %d, timeout_total %d, timeout %d\n", s->timeout_per_command, s->timeout_total, s->timeout); - printk(" internal_timeout %u\n", s->internal_timeout); - printk( " scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", (ulong) s->scsi_done, (ulong) s->done, diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index d7b8efe86401..88d119f4b970 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -257,6 +257,7 @@ #include <scsi/scsicam.h> #include "scsi.h" +#include <scsi/scsi_dbg.h> #include <scsi/scsi_host.h> #include "aha152x.h" @@ -986,7 +987,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p if (HOSTDATA(shpnt)->debug & debug_queue) { printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=", CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); } #endif @@ -1560,7 +1561,7 @@ static void busfree_run(struct Scsi_Host *shpnt) #if 0 if(HOSTDATA(shpnt)->debug & debug_eh) { printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC)); - print_sense("bh", DONE_SC); + scsi_print_sense("bh", DONE_SC); } #endif @@ -1846,7 +1847,7 @@ static void msgi_run(struct Scsi_Host *shpnt) #if defined(AHA152X_DEBUG) if (HOSTDATA(shpnt)->debug & debug_msgi) { printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0)); - print_msg(&MSGI(0)); + scsi_print_msg(&MSGI(0)); printk("\n"); } #endif @@ -1934,7 +1935,7 @@ static void msgi_run(struct Scsi_Host *shpnt) break; printk(INFO_LEAD, CMDINFO(CURRENT_SC)); - print_msg(&MSGI(0)); + scsi_print_msg(&MSGI(0)); printk("\n"); ticks = (MSGI(3) * 4 + 49) / 50; @@ -2032,7 +2033,7 @@ static void msgo_init(struct Scsi_Host *shpnt) int i; printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC)); - for (i=0; i<MSGOLEN; i+=print_msg(&MSGO(i)), printk(" ")) + for (i=0; i<MSGOLEN; i+=scsi_print_msg(&MSGO(i)), printk(" ")) ; printk(")\n"); } @@ -2104,7 +2105,7 @@ static void cmd_init(struct Scsi_Host *shpnt) #if defined(AHA152X_DEBUG) if (HOSTDATA(shpnt)->debug & debug_cmd) { printk(DEBUG_LEAD "cmd_init: ", CMDINFO(CURRENT_SC)); - print_command(CURRENT_SC->cmnd); + __scsi_print_command(CURRENT_SC->cmnd); } #endif @@ -2158,7 +2159,7 @@ static void status_run(struct Scsi_Host *shpnt) #if defined(AHA152X_DEBUG) if (HOSTDATA(shpnt)->debug & debug_status) { printk(DEBUG_LEAD "inbound status %02x ", CMDINFO(CURRENT_SC), CURRENT_SC->SCp.Status); - print_status(CURRENT_SC->SCp.Status); + scsi_print_status(CURRENT_SC->SCp.Status); printk("\n"); } #endif @@ -2925,7 +2926,7 @@ static void show_command(Scsi_Cmnd *ptr) printk(KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(", (unsigned int) ptr, ptr->device->id, ptr->device->lun); - print_command(ptr->cmnd); + __scsi_print_command(ptr->cmnd); printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |", ptr->request_bufflen, ptr->resid); diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index 24dd0b890dd2..be2caecbbdd9 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c @@ -150,6 +150,7 @@ #include <asm/ecard.h> #include "../scsi.h" +#include <scsi/scsi_dbg.h> #include <scsi/scsi_host.h> #include "acornscsi.h" #include "msgqueue.h" @@ -866,7 +867,7 @@ void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result) default: printk(KERN_ERR "scsi%d.H: incomplete data transfer detected: result=%08X command=", host->host->host_no, SCpnt->result); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); acornscsi_dumpdma(host, "done"); acornscsi_dumplog(host, SCpnt->device->id); SCpnt->result &= 0xffff; @@ -1369,7 +1370,7 @@ void acornscsi_sendmessage(AS_Host *host) host->scsi.last_message = msg->msg[0]; #if (DEBUG & DEBUG_MESSAGES) - print_msg(msg->msg); + scsi_print_msg(msg->msg); #endif break; @@ -1391,7 +1392,7 @@ void acornscsi_sendmessage(AS_Host *host) while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) { unsigned int i; #if (DEBUG & DEBUG_MESSAGES) - print_msg(msg); + scsi_print_msg(msg); #endif i = 0; if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000)) @@ -1487,7 +1488,7 @@ void acornscsi_message(AS_Host *host) #if (DEBUG & DEBUG_MESSAGES) printk("scsi%d.%c: message in: ", host->host->host_no, acornscsi_target(host)); - print_msg(message); + scsi_print_msg(message); printk("\n"); #endif diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index 5411e850c833..0a172c1e9f7e 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c @@ -52,6 +52,7 @@ #include <asm/ecard.h> #include "../scsi.h" +#include <scsi/scsi_dbg.h> #include <scsi/scsi_host.h> #include "fas216.h" #include "scsi.h" @@ -309,7 +310,7 @@ fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, .. va_end(args); printk(" CDB: "); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); } static void @@ -2081,7 +2082,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) info->host->host_no, '0' + SCpnt->device->id, SCpnt->result, info->scsi.SCp.ptr, info->scsi.SCp.this_residual); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); SCpnt->result &= ~(255 << 16); SCpnt->result |= DID_BAD_TARGET << 16; goto request_sense; @@ -2170,7 +2171,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result) info->host->host_no, '0' + SCpnt->device->id, info->scsi.SCp.ptr, info->scsi.SCp.this_residual); info->scsi.SCp.ptr = NULL; - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); } /* @@ -2426,7 +2427,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt) info->stats.aborts += 1; printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no); - print_command(SCpnt->data_cmnd); + __scsi_print_command(SCpnt->data_cmnd); print_debug_list(); fas216_dumpstate(info); diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h index 2f1b3f4bf954..48e1c4d9738b 100644 --- a/drivers/scsi/arm/scsi.h +++ b/drivers/scsi/arm/scsi.h @@ -108,7 +108,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt) #if 0 //def BELT_AND_BRACES printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for " "command ", SCpnt->host->host_no, '0' + SCpnt->target); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); #endif SCpnt->SCp.ptr = NULL; } diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 5d1e78ebed83..2c12be72c4c6 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c @@ -73,6 +73,7 @@ * 1. Test linked command handling code after Eric is ready with * the high level code. */ +#include <scsi/scsi_dbg.h> #if (NDEBUG & NDEBUG_LISTS) #define LIST(x,y) \ @@ -2354,7 +2355,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2407,7 +2408,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) default: if (!tmp) { printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); - print_msg (extended_msg); + scsi_print_msg (extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk(KERN_DEBUG "scsi%d: rejecting unknown " @@ -2540,7 +2541,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); - print_msg(msg); + scsi_print_msg(msg); do_abort(instance); return; } @@ -2646,7 +2647,7 @@ int NCR5380_abort (Scsi_Cmnd *cmd) unsigned long flags; printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); - print_Scsi_Cmnd (cmd); + scsi_print_command(cmd); NCR5380_print_status (instance); diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index d625fdebe052..ec161733a82b 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c @@ -372,7 +372,7 @@ static void scsi_print_cdb(unsigned char *cdb, int cdb_len, int start_of_line) /** * - * print_status - print scsi status description + * scsi_print_status - print scsi status description * @scsi_status: scsi status value * * If the status is recognized, the description is printed. diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index e46096da8db2..47c263e5cd39 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -833,13 +833,6 @@ ips_eh_abort(Scsi_Cmnd * SC) if (!ha->active) return (FAILED); - if (SC->serial_number != SC->serial_number_at_timeout) { - /* HMM, looks like a bogus command */ - DEBUG(1, "Abort called with bogus scsi command"); - - return (FAILED); - } - /* See if the command is on the copp queue */ item = ha->copp_waitlist.head; while ((item) && (item->scsi_cmd != SC)) diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 7ae13236788e..2a0e42ec27d3 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -7486,24 +7486,14 @@ static int ncr53c8xx_abort(struct scsi_cmnd *cmd) struct scsi_cmnd *done_list; #if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS - printk("ncr53c8xx_abort: pid=%lu serial_number=%ld serial_number_at_timeout=%ld\n", - cmd->pid, cmd->serial_number, cmd->serial_number_at_timeout); + printk("ncr53c8xx_abort: pid=%lu serial_number=%ld\n", + cmd->pid, cmd->serial_number); #else printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid); #endif NCR_LOCK_NCB(np, flags); -#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS - /* - * We have to just ignore abort requests in some situations. - */ - if (cmd->serial_number != cmd->serial_number_at_timeout) { - sts = SCSI_ABORT_NOT_RUNNING; - goto out; - } -#endif - sts = ncr_abort_command(np, cmd); out: done_list = np->done_list; diff --git a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c index 60ce1cce9497..d58f303127f5 100644 --- a/drivers/scsi/pci2000.c +++ b/drivers/scsi/pci2000.c @@ -438,8 +438,8 @@ int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) if ( bus ) { DEB (if(*cdb) printk ("\nCDB: %X- %X %X %X %X %X %X %X %X %X %X ", SCpnt->cmd_len, cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], cdb[6], cdb[7], cdb[8], cdb[9])); - DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d, internal_timout: %d", SCpnt->timeout_per_command, - SCpnt->timeout_total, SCpnt->timeout, SCpnt->internal_timeout)); + DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d", SCpnt->timeout_per_command, + SCpnt->timeout_total, SCpnt->timeout)); outl (SCpnt->timeout_per_command, padapter->mb1); outb_p (CMD_SCSI_TIMEOUT, padapter->cmd); if ( WaitReady (padapter) ) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index dcc33daa5913..0e8ebbc56e81 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -1050,10 +1050,8 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) for (i = 0; i < cmd->cmd_len; i++) { printk("0x%02x ", cmd->cmnd[i]); } - printk("\n seg_cnt=%d, allowed=%d, retries=%d, " - "serial_number_at_timeout=0x%lx\n", - cmd->use_sg, cmd->allowed, cmd->retries, - cmd->serial_number_at_timeout); + printk("\n seg_cnt=%d, allowed=%d, retries=%d\n", + cmd->use_sg, cmd->allowed, cmd->retries); printk(" request buffer=0x%p, request buffer len=0x%x\n", cmd->request_buffer, cmd->request_bufflen); printk(" tag=%d, transfersize=0x%x\n", diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 2e7ab3ab0993..05d2bd075fd4 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -489,7 +489,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) scsi_print_command(cmd); if (status_byte(cmd->result) & CHECK_CONDITION) { /* - * XXX The print_sense formatting/prefix + * XXX The scsi_print_sense formatting/prefix * doesn't match this function. */ scsi_print_sense("", cmd); @@ -686,7 +686,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq) cmd->request = sreq->sr_request; memcpy(cmd->data_cmnd, sreq->sr_cmnd, sizeof(cmd->data_cmnd)); cmd->serial_number = 0; - cmd->serial_number_at_timeout = 0; cmd->bufflen = sreq->sr_bufflen; cmd->buffer = sreq->sr_buffer; cmd->retries = 0; @@ -716,7 +715,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq) /* * Start the timer ticking. */ - cmd->internal_timeout = NORMAL_TIMEOUT; cmd->abort_reason = 0; cmd->result = 0; @@ -766,7 +764,6 @@ void __scsi_done(struct scsi_cmnd *cmd) * Set the serial numbers back to zero */ cmd->serial_number = 0; - cmd->serial_number_at_timeout = 0; cmd->state = SCSI_STATE_BHQUEUE; cmd->owner = SCSI_OWNER_BH_HANDLER; diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h index cb6b5fbb7e14..e2360c26ef01 100644 --- a/drivers/scsi/scsi.h +++ b/drivers/scsi/scsi.h @@ -23,7 +23,6 @@ #include <linux/config.h> /* for CONFIG_SCSI_LOGGING */ #include <scsi/scsi_cmnd.h> -#include <scsi/scsi_dbg.h> #include <scsi/scsi_device.h> #include <scsi/scsi_eh.h> #include <scsi/scsi_request.h> @@ -61,48 +60,6 @@ struct scatterlist; #define scsi_to_pci_dma_dir(scsi_dir) ((int)(scsi_dir)) #define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir)) -/* - * Old names for debug prettyprinting functions. - */ -static inline void print_Scsi_Cmnd(struct scsi_cmnd *cmd) -{ - return scsi_print_command(cmd); -} -static inline void print_command(unsigned char *cdb) -{ - return __scsi_print_command(cdb); -} -static inline void print_sense(const char *devclass, struct scsi_cmnd *cmd) -{ - return scsi_print_sense(devclass, cmd); -} -static inline void print_req_sense(const char *devclass, struct scsi_request *req) -{ - return scsi_print_req_sense(devclass, req); -} -static inline void print_driverbyte(int scsiresult) -{ - return scsi_print_driverbyte(scsiresult); -} -static inline void print_hostbyte(int scsiresult) -{ - return scsi_print_hostbyte(scsiresult); -} -static inline void print_status(unsigned char status) -{ - return scsi_print_status(status); -} -static inline int print_msg(const unsigned char *msg) -{ - return scsi_print_msg(msg); -} - -/* - * This is the crap from the old error handling code. We have it in a special - * place so that we can more easily delete it later on. - */ -#include "scsi_obsolete.h" - /* obsolete typedef junk. */ #include "scsi_typedefs.h" diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 9bc597bd13ba..1a135f38e78d 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -79,11 +79,6 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag) */ scmd->owner = SCSI_OWNER_ERROR_HANDLER; scmd->state = SCSI_STATE_FAILED; - /* - * Set the serial_number_at_timeout to the current - * serial_number - */ - scmd->serial_number_at_timeout = scmd->serial_number; list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); set_bit(SHOST_RECOVERY, &shost->shost_state); shost->host_failed++; @@ -481,7 +476,8 @@ static void scsi_eh_done(struct scsi_cmnd *scmd) **/ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) { - struct Scsi_Host *host = scmd->device->host; + struct scsi_device *sdev = scmd->device; + struct Scsi_Host *shost = sdev->host; DECLARE_MUTEX_LOCKED(sem); unsigned long flags; int rtn = SUCCESS; @@ -492,27 +488,27 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) */ scmd->owner = SCSI_OWNER_LOWLEVEL; - if (scmd->device->scsi_level <= SCSI_2) + if (sdev->scsi_level <= SCSI_2) scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | - (scmd->device->lun << 5 & 0xe0); + (sdev->lun << 5 & 0xe0); scsi_add_timer(scmd, timeout, scsi_eh_times_out); /* * set up the semaphore so we wait for the command to complete. */ - scmd->device->host->eh_action = &sem; + shost->eh_action = &sem; scmd->request->rq_status = RQ_SCSI_BUSY; - spin_lock_irqsave(scmd->device->host->host_lock, flags); + spin_lock_irqsave(shost->host_lock, flags); scsi_log_send(scmd); - host->hostt->queuecommand(scmd, scsi_eh_done); - spin_unlock_irqrestore(scmd->device->host->host_lock, flags); + shost->hostt->queuecommand(scmd, scsi_eh_done); + spin_unlock_irqrestore(shost->host_lock, flags); down(&sem); scsi_log_completion(scmd, SUCCESS); - scmd->device->host->eh_action = NULL; + shost->eh_action = NULL; /* * see if timeout. if so, tell the host to forget about it. @@ -532,10 +528,10 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) * abort a timed out command or not. not sure how * we should treat them differently anyways. */ - spin_lock_irqsave(scmd->device->host->host_lock, flags); - if (scmd->device->host->hostt->eh_abort_handler) - scmd->device->host->hostt->eh_abort_handler(scmd); - spin_unlock_irqrestore(scmd->device->host->host_lock, flags); + spin_lock_irqsave(shost->host_lock, flags); + if (shost->hostt->eh_abort_handler) + shost->hostt->eh_abort_handler(scmd); + spin_unlock_irqrestore(shost->host_lock, flags); scmd->request->rq_status = RQ_SCSI_DONE; scmd->owner = SCSI_OWNER_ERROR_HANDLER; @@ -1061,7 +1057,6 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd) SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", __FUNCTION__)); scmd->owner = SCSI_OWNER_LOWLEVEL; - scmd->serial_number_at_timeout = scmd->serial_number; if (!scmd->device->host->hostt->eh_bus_reset_handler) return FAILED; @@ -1093,7 +1088,6 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd) SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", __FUNCTION__)); scmd->owner = SCSI_OWNER_LOWLEVEL; - scmd->serial_number_at_timeout = scmd->serial_number; if (!scmd->device->host->hostt->eh_host_reset_handler) return FAILED; @@ -1313,6 +1307,9 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) case DID_IMM_RETRY: return NEEDS_RETRY; + case DID_REQUEUE: + return ADD_TO_MLQUEUE; + case DID_ERROR: if (msg_byte(scmd->result) == COMMAND_COMPLETE && status_byte(scmd->result) == RESERVATION_CONFLICT) @@ -1839,7 +1836,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag) scmd->bufflen = 0; scmd->request_buffer = NULL; scmd->request_bufflen = 0; - scmd->internal_timeout = NORMAL_TIMEOUT; scmd->abort_reason = DID_ABORT; scmd->cmd_len = 0; diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 68c9728dfbbb..7a6b530115ac 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -27,11 +27,6 @@ #define NORMAL_RETRIES 5 #define IOCTL_NORMAL_TIMEOUT (10 * HZ) -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) -#define START_STOP_TIMEOUT (60 * HZ) -#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) -#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) /* ZIP-250 on parallel port takes as long! */ #define MAX_BUF PAGE_SIZE diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index d230c699c728..d18da21c9c57 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -298,7 +298,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) { cmd->owner = SCSI_OWNER_MIDLEVEL; cmd->serial_number = 0; - cmd->serial_number_at_timeout = 0; cmd->abort_reason = 0; memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); @@ -320,7 +319,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd)); cmd->buffer = cmd->request_buffer; cmd->bufflen = cmd->request_bufflen; - cmd->internal_timeout = NORMAL_TIMEOUT; cmd->abort_reason = 0; return 1; diff --git a/drivers/scsi/scsi_obsolete.h b/drivers/scsi/scsi_obsolete.h deleted file mode 100644 index abeacb996ea0..000000000000 --- a/drivers/scsi/scsi_obsolete.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * scsi_obsolete.h Copyright (C) 1997 Eric Youngdale - * - */ - -#ifndef _SCSI_OBSOLETE_H -#define _SCSI_OBSOLETE_H - -/* - * These are the return codes for the abort and reset functions. The mid-level - * code uses these to decide what to do next. Each of the low level abort - * and reset functions must correctly indicate what it has done. - * The descriptions are written from the point of view of the mid-level code, - * so that the return code is telling the mid-level drivers exactly what - * the low level driver has already done, and what remains to be done. - */ - -/* We did not do anything. - * Wait some more for this command to complete, and if this does not work, - * try something more serious. */ -#define SCSI_ABORT_SNOOZE 0 - -/* This means that we were able to abort the command. We have already - * called the mid-level done function, and do not expect an interrupt that - * will lead to another call to the mid-level done function for this command */ -#define SCSI_ABORT_SUCCESS 1 - -/* We called for an abort of this command, and we should get an interrupt - * when this succeeds. Thus we should not restore the timer for this - * command in the mid-level abort function. */ -#define SCSI_ABORT_PENDING 2 - -/* Unable to abort - command is currently on the bus. Grin and bear it. */ -#define SCSI_ABORT_BUSY 3 - -/* The command is not active in the low level code. Command probably - * finished. */ -#define SCSI_ABORT_NOT_RUNNING 4 - -/* Something went wrong. The low level driver will indicate the correct - * error condition when it calls scsi_done, so the mid-level abort function - * can simply wait until this comes through */ -#define SCSI_ABORT_ERROR 5 - -/* We do not know how to reset the bus, or we do not want to. Bummer. - * Anyway, just wait a little more for the command in question, and hope that - * it eventually finishes. If it never finishes, the SCSI device could - * hang, so use this with caution. */ -#define SCSI_RESET_SNOOZE 0 - -/* We do not know how to reset the bus, or we do not want to. Bummer. - * We have given up on this ever completing. The mid-level code will - * request sense information to decide how to proceed from here. */ -#define SCSI_RESET_PUNT 1 - -/* This means that we were able to reset the bus. We have restarted all of - * the commands that should be restarted, and we should be able to continue - * on normally from here. We do not expect any interrupts that will return - * DID_RESET to any of the other commands in the host_queue, and the mid-level - * code does not need to do anything special to keep the commands alive. - * If a hard reset was performed then all outstanding commands on the - * bus have been restarted. */ -#define SCSI_RESET_SUCCESS 2 - -/* We called for a reset of this bus, and we should get an interrupt - * when this succeeds. Each command should get its own status - * passed up to scsi_done, but this has not happened yet. - * If a hard reset was performed, then we expect an interrupt - * for *each* of the outstanding commands that will have the - * effect of restarting the commands. - */ -#define SCSI_RESET_PENDING 3 - -/* We did a reset, but do not expect an interrupt to signal DID_RESET. - * This tells the upper level code to request the sense info, and this - * should keep the command alive. */ -#define SCSI_RESET_WAKEUP 4 - -/* The command is not active in the low level code. Command probably - finished. */ -#define SCSI_RESET_NOT_RUNNING 5 - -/* Something went wrong, and we do not know how to fix it. */ -#define SCSI_RESET_ERROR 6 - -#define SCSI_RESET_SYNCHRONOUS 0x01 -#define SCSI_RESET_ASYNCHRONOUS 0x02 -#define SCSI_RESET_SUGGEST_BUS_RESET 0x04 -#define SCSI_RESET_SUGGEST_HOST_RESET 0x08 -/* - * This is a bitmask that is ored with one of the above codes. - * It tells the mid-level code that we did a hard reset. - */ -#define SCSI_RESET_BUS_RESET 0x100 -/* - * This is a bitmask that is ored with one of the above codes. - * It tells the mid-level code that we did a host adapter reset. - */ -#define SCSI_RESET_HOST_RESET 0x200 -/* - * Used to mask off bits and to obtain the basic action that was - * performed. - */ -#define SCSI_RESET_ACTION 0xff - -#endif /* SCSI_OBSOLETE_H */ diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index aca3b39fe710..c01580df4476 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -30,11 +30,6 @@ struct Scsi_Host; #define SCSI_REQ_MAGIC 0x75F6D354 /* - * Flag bit for the internal_timeout array - */ -#define NORMAL_TIMEOUT 0 - -/* * Scsi Error Handler Flags */ #define scsi_eh_eflags_chk(scp, flags) \ diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c index b362ff2811da..4c95abb54057 100644 --- a/drivers/scsi/seagate.c +++ b/drivers/scsi/seagate.c @@ -103,6 +103,7 @@ #include <asm/uaccess.h> #include "scsi.h" +#include <scsi/scsi_dbg.h> #include <scsi/scsi_host.h> #include "seagate.h" @@ -746,7 +747,7 @@ static int internal_command (unsigned char target, unsigned char lun, #if (DEBUG & PRINT_COMMAND) printk("scsi%d : target = %d, command = ", hostno, target); - print_command((unsigned char *) cmnd); + __scsi_print_command((unsigned char *) cmnd); #endif #if (DEBUG & PHASE_RESELECT) @@ -1553,7 +1554,7 @@ connect_loop: printk("\n"); #endif printk("scsi%d : status = ", hostno); - print_status(status); + scsi_print_status(status); printk(" message = %02x\n", message); #endif diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 32de9aabcb99..ce8332297dfa 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -51,6 +51,7 @@ static int sg_version_num = 30533; /* 2 digits for each component */ #include <linux/delay.h> #include "scsi.h" +#include <scsi/scsi_dbg.h> #include <scsi/scsi_host.h> #include <scsi/scsi_driver.h> #include <scsi/scsi_ioctl.h> @@ -1368,7 +1369,7 @@ sg_cmd_done(Scsi_Cmnd * SCpnt) if ((sdp->sgdebug > 0) && ((CHECK_CONDITION == srp->header.masked_status) || (COMMAND_TERMINATED == srp->header.masked_status))) - print_req_sense("sg_cmd_done", SRpnt); + scsi_print_req_sense("sg_cmd_done", SRpnt); /* Following if statement is a patch supplied by Eric Youngdale */ if (driver_byte(SRpnt->sr_result) != 0 diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 90811390a37d..7e19589e71a0 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c @@ -69,6 +69,7 @@ * finally replaced that by the *_PRINTK() macros. * */ +#include <scsi/scsi_dbg.h> /* * Further development / testing that should be done : @@ -2377,7 +2378,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2430,7 +2431,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) default: if (!tmp) { printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); - print_msg (extended_msg); + scsi_print_msg (extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk(KERN_DEBUG "scsi%d: rejecting unknown " @@ -2565,7 +2566,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); - print_msg(msg); + scsi_print_msg(msg); do_abort(instance); return; } @@ -2691,7 +2692,7 @@ static int NCR5380_abort (Scsi_Cmnd *cmd) unsigned long flags; printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); - print_Scsi_Cmnd (cmd); + scsi_print_command(cmd); NCR5380_print_status (instance); diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index a1dff6d437bc..5ff83d214f12 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c @@ -799,12 +799,6 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd) dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname); -#if 0 - /* This one should be the result of some race, thus to ignore */ - if (cmd->serial_number != cmd->serial_number_at_timeout) - goto prepare; -#endif - /* This one is queued in some place -> to wait for completion */ FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 7484916fe2aa..a00095cc74c6 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -945,7 +945,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt) config.mscp[mscp_index].SCint, SCpnt); #endif if (config.mscp[mscp_index].SCint == 0) - return SCSI_ABORT_NOT_RUNNING; + return FAILURE; if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort"); config.mscp[mscp_index].SCint = NULL; @@ -1020,7 +1020,7 @@ static int ultrastor_host_reset(Scsi_Cmnd * SCpnt) #endif spin_unlock_irqrestore(host->host_lock, flags); - return SCSI_RESET_SUCCESS; + return SUCCESS; } diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index de0d32f6618d..cab89a970c7f 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c @@ -335,7 +335,7 @@ static int mts_scsi_abort (Scsi_Cmnd *srb) mts_urb_abort(desc); - return SCSI_ABORT_PENDING; + return FAILURE; } static int mts_scsi_host_reset (Scsi_Cmnd *srb) diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 1d54c063ae52..659ecf48fb4a 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h @@ -295,6 +295,8 @@ struct scsi_lun { #define DID_PASSTHROUGH 0x0a /* Force command past mid-layer */ #define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */ #define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ +#define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also + * without decrementing the retry count */ #define DRIVER_OK 0x00 /* Driver status */ /* @@ -360,6 +362,15 @@ struct scsi_lun { #define sense_error(sense) ((sense) & 0xf) #define sense_valid(sense) ((sense) & 0x80); +/* + * default timeouts +*/ +#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define START_STOP_TIMEOUT (60 * HZ) +#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) +#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) + #define IDENTIFY_BASE 0x80 #define IDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\ diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 9d9871c28abd..07f5c699eaa7 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -43,21 +43,17 @@ struct scsi_cmnd { void (*done) (struct scsi_cmnd *); /* Mid-level done function */ /* - * A SCSI Command is assigned a nonzero serial_number when internal_cmnd - * passes it to the driver's queue command function. The serial_number - * is cleared when scsi_done is entered indicating that the command has - * been completed. If a timeout occurs, the serial number at the moment - * of timeout is copied into serial_number_at_timeout. By subsequently - * comparing the serial_number and serial_number_at_timeout fields - * during abort or reset processing, we can detect whether the command - * has already completed. This also detects cases where the command has - * completed and the SCSI Command structure has already being reused - * for another command, so that we can avoid incorrectly aborting or - * resetting the new command. - * The serial number is only unique per host. + * A SCSI Command is assigned a nonzero serial_number before passed + * to the driver's queue command function. The serial_number is + * cleared when scsi_done is entered indicating that the command + * has been completed. It currently doesn't have much use other + * than printk's. Some lldd's use this number for other purposes. + * It's almost certain that such usages are either incorrect or + * meaningless. Please kill all usages other than printk's. Also, + * as this number is always identical to ->pid, please convert + * printk's to use ->pid, so that we can kill this field. */ unsigned long serial_number; - unsigned long serial_number_at_timeout; int retries; int allowed; @@ -65,12 +61,6 @@ struct scsi_cmnd { int timeout_total; int timeout; - /* - * We handle the timeout differently if it happens when a reset, - * abort, etc are in process. - */ - unsigned volatile char internal_timeout; - unsigned char cmd_len; unsigned char old_cmd_len; enum dma_data_direction sc_data_direction; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index fe9571d2e306..c018020d9160 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -44,7 +44,8 @@ struct scsi_device { struct list_head same_target_siblings; /* just the devices sharing same target id */ /* this is now protected by the request_queue->queue_lock */ - volatile unsigned short device_busy; /* commands actually active on low-level */ + unsigned int device_busy; /* commands actually active on + * low-level. protected by queue_lock. */ spinlock_t list_lock; struct list_head cmd_list; /* queue of in use SCSI Command structures */ struct list_head starved_entry; diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 27f2c4e8943a..1cee1e100943 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -448,8 +448,14 @@ struct Scsi_Host { wait_queue_head_t host_wait; struct scsi_host_template *hostt; struct scsi_transport_template *transportt; - volatile unsigned short host_busy; /* commands actually active on low-level */ - volatile unsigned short host_failed; /* commands that failed. */ + + /* + * The following two fields are protected with host_lock; + * however, eh routines can safely access during eh processing + * without acquiring the lock. + */ + unsigned int host_busy; /* commands actually active on low-level */ + unsigned int host_failed; /* commands that failed. */ unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ int resetting; /* if set, it means that last_reset is a valid value */ |