From b6651129cc27d56a9cbefcb5f713cea7706fd6b7 Mon Sep 17 00:00:00 2001 From: Date: Sun, 3 Apr 2005 14:52:44 -0500 Subject: [PATCH] consolidate timeout defintions in scsi.h Adapted from a patch in SuSE's kernel SRPM. Signed-off-by: James Bottomley --- drivers/scsi/scsi_ioctl.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/scsi') 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 -- cgit v1.2.2 From db9dff366ba78085d0323364fadbf09bec0e77ee Mon Sep 17 00:00:00 2001 From: Date: Sun, 3 Apr 2005 14:53:59 -0500 Subject: [PATCH] remove outdated print_* functions We have the scsi_print_* functions in the proper namespace for a long time now and there weren't a lot users left. Signed-off-by: James Bottomley --- drivers/scsi/53c7xx.c | 23 ++++++++++++----------- drivers/scsi/NCR5380.c | 9 +++++---- drivers/scsi/aha152x.c | 17 +++++++++-------- drivers/scsi/arm/acornscsi.c | 9 +++++---- drivers/scsi/arm/fas216.c | 9 +++++---- drivers/scsi/arm/scsi.h | 2 +- drivers/scsi/atari_NCR5380.c | 9 +++++---- drivers/scsi/constants.c | 2 +- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi.h | 37 ------------------------------------- drivers/scsi/seagate.c | 5 +++-- drivers/scsi/sg.c | 3 ++- drivers/scsi/sun3_NCR5380.c | 9 +++++---- 13 files changed, 54 insertions(+), 82 deletions(-) (limited to 'drivers/scsi') 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 #include #include "53c7xx.h" #include @@ -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/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 #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/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 #include "scsi.h" +#include #include #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; idebug & 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 #include "../scsi.h" +#include #include #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 #include "../scsi.h" +#include #include #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 #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/scsi.c b/drivers/scsi/scsi.c index 2e7ab3ab0993..5dc84669616d 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); diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h index cb6b5fbb7e14..6e7bb068220f 100644 --- a/drivers/scsi/scsi.h +++ b/drivers/scsi/scsi.h @@ -23,7 +23,6 @@ #include /* for CONFIG_SCSI_LOGGING */ #include -#include #include #include #include @@ -61,42 +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. 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 #include "scsi.h" +#include #include #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 fd72d73bb244..cf6b1f0fb124 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -51,6 +51,7 @@ static int sg_version_num = 30532; /* 2 digits for each component */ #include #include "scsi.h" +#include #include #include #include @@ -1311,7 +1312,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 /* * 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); -- cgit v1.2.2 From d3a933dc9851e74581f9f4c8e703e77901ae8d01 Mon Sep 17 00:00:00 2001 From: Date: Sun, 3 Apr 2005 14:55:06 -0500 Subject: [PATCH] scsi: remove unused scsi_cmnd->internal_timeout field scsi_cmnd->internal_timeout field doesn't have any meaning anymore. Kill the field. Signed-off-by: Tejun Heo Signed-off-by: James Bottomley --- drivers/scsi/advansys.c | 2 -- drivers/scsi/pci2000.c | 4 ++-- drivers/scsi/scsi.c | 1 - drivers/scsi/scsi_error.c | 1 - drivers/scsi/scsi_lib.c | 1 - drivers/scsi/scsi_priv.h | 5 ----- 6 files changed, 2 insertions(+), 12 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 9962c51dc2a7..edeb333d8161 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -9206,8 +9206,6 @@ asc_prt_scsi_cmnd(struct scsi_cmnd *s) " 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/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/scsi.c b/drivers/scsi/scsi.c index 5dc84669616d..95de4d0f4fd1 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -716,7 +716,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; diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 9bc597bd13ba..173abb88e3e8 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1839,7 +1839,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_lib.c b/drivers/scsi/scsi_lib.c index 7cbc4127fb5a..19dd911d9f7a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -320,7 +320,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_priv.h b/drivers/scsi/scsi_priv.h index aca3b39fe710..c01580df4476 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -29,11 +29,6 @@ struct Scsi_Host; #define SCSI_CMND_MAGIC 0xE25C23A5 #define SCSI_REQ_MAGIC 0x75F6D354 -/* - * Flag bit for the internal_timeout array - */ -#define NORMAL_TIMEOUT 0 - /* * Scsi Error Handler Flags */ -- cgit v1.2.2 From c6295cdf656de63d6d1123def71daba6cd91939c Mon Sep 17 00:00:00 2001 From: Date: Sun, 3 Apr 2005 14:59:11 -0500 Subject: [PATCH] scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field scsi_cmnd->serial_number_at_timeout doesn't serve any purpose anymore. All serial_number == serial_number_at_timeout tests are always true in abort callbacks. Kill the field. Also, as ->pid always equals ->serial_number and ->serial_number doesn't have any special meaning anymore, update comments above ->serial_number accordingly. Once we remove all uses of this field from all lldd's, this field should go. Signed-off-by: Tejun Heo Signed-off-by: James Bottomley --- drivers/scsi/BusLogic.c | 7 ------- drivers/scsi/advansys.c | 5 ++--- drivers/scsi/ips.c | 7 ------- drivers/scsi/ncr53c8xx.c | 14 ++------------ drivers/scsi/qla2xxx/qla_dbg.c | 6 ++---- drivers/scsi/scsi.c | 2 -- drivers/scsi/scsi_error.c | 7 ------- drivers/scsi/scsi_lib.c | 1 - drivers/scsi/sym53c8xx_2/sym_glue.c | 6 ------ 9 files changed, 6 insertions(+), 49 deletions(-) (limited to 'drivers/scsi') 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 @@ -2957,13 +2957,6 @@ static int BusLogic_AbortCommand(struct scsi_cmnd *Command) int TargetID = Command->device->id; 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/advansys.c b/drivers/scsi/advansys.c index edeb333d8161..04cb5c405a2d 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -9198,9 +9198,8 @@ 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", 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/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 95de4d0f4fd1..05d2bd075fd4 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -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; @@ -765,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_error.c b/drivers/scsi/scsi_error.c index 173abb88e3e8..13bac93fc397 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++; @@ -1061,7 +1056,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 +1087,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; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 19dd911d9f7a..619d3fb7a2f0 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); 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); -- cgit v1.2.2 From 2bc474c3646efba67bdc83b7fc7d8ee7562e0106 Mon Sep 17 00:00:00 2001 From: Date: Sun, 10 Apr 2005 22:19:25 -0500 Subject: [PATCH] kill old EH constants Fix up two drivers that incorrectly were using the old return values for their new-style EH methods and kill off scsi_obsolete.h that defined the constants. The initio driver has all these constansts defined locally and uses them internally, I'll fix that up some time later. Signed-off-by: James Bottomley --- drivers/scsi/scsi.h | 6 --- drivers/scsi/scsi_obsolete.h | 106 ------------------------------------------- drivers/scsi/ultrastor.c | 4 +- 3 files changed, 2 insertions(+), 114 deletions(-) delete mode 100644 drivers/scsi/scsi_obsolete.h (limited to 'drivers/scsi') diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h index 6e7bb068220f..e2360c26ef01 100644 --- a/drivers/scsi/scsi.h +++ b/drivers/scsi/scsi.h @@ -60,12 +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)) -/* - * 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_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/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; } -- cgit v1.2.2 From bf341919dbc1fbcbb565fb3224c840760ebd9f85 Mon Sep 17 00:00:00 2001 From: Date: Tue, 12 Apr 2005 17:49:09 -0500 Subject: scsi: add DID_REQUEUE to the error handling We have a DID_IMM_RETRY to require a retry at once, but we could do with a DID_REQUEUE to instruct the mid-layer to treat this command in the same manner as QUEUE_FULL or BUSY (i.e. halt the submission until another command returns ... or the queue pressure builds if there are no outstanding commands). Signed-off-by: James Bottomley --- drivers/scsi/scsi_error.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/scsi') diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 13bac93fc397..203a0812508a 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1306,6 +1306,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) -- cgit v1.2.2 From f59114b7b5dc677bbd7cc7e26a5fcb3572a3445c Mon Sep 17 00:00:00 2001 From: Date: Sun, 17 Apr 2005 15:00:23 -0500 Subject: [PATCH] scsi: scsi_send_eh_cmnd() cleanup This patch makes scsi_send_eh_cmnd() use sdev and shost instead of referencing them through scmd-> everytime. Signed-off-by: Tejun Heo Signed-off-by: James Bottomley --- drivers/scsi/scsi_error.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 203a0812508a..1a135f38e78d 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -476,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; @@ -487,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. @@ -527,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; -- cgit v1.2.2