Loading drivers/scsi/aha152x.c +52 −33 Original line number Diff line number Diff line Loading @@ -1260,16 +1260,15 @@ static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs) * Reset the bus * */ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) static int aha152x_bus_reset_host(struct Scsi_Host *shpnt) { struct Scsi_Host *shpnt = SCpnt->device->host; unsigned long flags; DO_LOCK(flags); #if defined(AHA152X_DEBUG) if(HOSTDATA(shpnt)->debug & debug_eh) { printk(DEBUG_LEAD "aha152x_bus_reset(%p)", CMDINFO(SCpnt), SCpnt); printk(KERN_DEBUG "scsi%d: bus reset", shpnt->host_no); show_queues(shpnt); } #endif Loading @@ -1277,14 +1276,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) free_hard_reset_SCs(shpnt, &ISSUE_SC); free_hard_reset_SCs(shpnt, &DISCONNECTED_SC); DPRINTK(debug_eh, DEBUG_LEAD "resetting bus\n", CMDINFO(SCpnt)); DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no); SETPORT(SCSISEQ, SCSIRSTO); mdelay(256); SETPORT(SCSISEQ, 0); mdelay(DELAY); DPRINTK(debug_eh, DEBUG_LEAD "bus resetted\n", CMDINFO(SCpnt)); DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no); setup_expected_interrupts(shpnt); if(HOSTDATA(shpnt)->commands==0) Loading @@ -1295,6 +1294,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) return SUCCESS; } /* * Reset the bus * */ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) { return aha152x_bus_reset_host(SCpnt->device->host); } /* * Restore default values to the AIC-6260 registers and reset the fifos Loading Loading @@ -1337,22 +1344,27 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ int aha152x_host_reset(Scsi_Cmnd * SCpnt) int aha152x_host_reset_host(struct Scsi_Host *shpnt) { #if defined(AHA152X_DEBUG) struct Scsi_Host *shpnt = SCpnt->device->host; #endif DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no); DPRINTK(debug_eh, DEBUG_LEAD "aha152x_host_reset(%p)\n", CMDINFO(SCpnt), SCpnt); aha152x_bus_reset_host(shpnt); aha152x_bus_reset(SCpnt); DPRINTK(debug_eh, DEBUG_LEAD "resetting ports\n", CMDINFO(SCpnt)); reset_ports(SCpnt->device->host); DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", shpnt->host_no); reset_ports(shpnt); return SUCCESS; } /* * Reset the host (bus and controller) * */ static int aha152x_host_reset(Scsi_Cmnd *SCpnt) { return aha152x_host_reset_host(SCpnt->device->host); } /* * Return the "logical geometry" * Loading Loading @@ -1431,22 +1443,18 @@ static void run(void) { int i; for (i = 0; i<ARRAY_SIZE(aha152x_host); i++) { struct Scsi_Host *shpnt = aha152x_host[i]; if (shpnt && HOSTDATA(shpnt)->service) { HOSTDATA(shpnt)->service=0; is_complete(shpnt); } is_complete(aha152x_host[i]); } } /* * Interrupts handler * Interrupt handler * */ static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *shpnt = lookup_irq(irqno); unsigned long flags; unsigned char rev, dmacntrl0; if (!shpnt) { Loading @@ -1472,23 +1480,23 @@ static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) if ((rev == 0xFF) && (dmacntrl0 == 0xFF)) return IRQ_NONE; if( TESTLO(DMASTAT, INTSTAT) ) return IRQ_NONE; /* no more interrupts from the controller, while we're busy. INTEN is restored by the BH handler */ CLRBITS(DMACNTRL0, INTEN); #if 0 /* check if there is already something to be serviced; should not happen */ if(HOSTDATA(shpnt)->service) { printk(KERN_ERR "aha152x%d: lost interrupt (%d)\n", HOSTNO, HOSTDATA(shpnt)->service); show_queues(shpnt); } #endif DO_LOCK(flags); if( HOSTDATA(shpnt)->service==0 ) { HOSTDATA(shpnt)->service=1; /* Poke the BH handler */ HOSTDATA(shpnt)->service++; INIT_WORK(&aha152x_tq, (void *) run, NULL); schedule_work(&aha152x_tq); } DO_UNLOCK(flags); return IRQ_HANDLED; } Loading Loading @@ -2527,7 +2535,18 @@ static void is_complete(struct Scsi_Host *shpnt) unsigned long flags; int pending; if(!shpnt) return; DO_LOCK(flags); if( HOSTDATA(shpnt)->service==0 ) { DO_UNLOCK(flags); return; } HOSTDATA(shpnt)->service = 0; if(HOSTDATA(shpnt)->in_intr) { DO_UNLOCK(flags); /* aha152x_error never returns.. */ Loading drivers/scsi/aha152x.h +1 −1 Original line number Diff line number Diff line Loading @@ -332,6 +332,6 @@ struct aha152x_setup { struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); void aha152x_release(struct Scsi_Host *); int aha152x_host_reset(Scsi_Cmnd *); int aha152x_host_reset_host(struct Scsi_Host *); #endif /* _AHA152X_H */ drivers/scsi/jazz_esp.c +0 −21 Original line number Diff line number Diff line Loading @@ -65,27 +65,6 @@ static int jazz_esp_release(struct Scsi_Host *shost) return 0; } static struct scsi_host_template driver_template = { .proc_name = "jazz_esp", .proc_info = &esp_proc_info, .name = "ESP 100/100a/200", .detect = jazz_esp_detect, .slave_alloc = esp_slave_alloc, .slave_destroy = esp_slave_destroy, .release = jazz_esp_release, .info = esp_info, .queuecommand = esp_queue, .eh_abort_handler = esp_abort, .eh_bus_reset_handler = esp_reset, .can_queue = 7, .this_id = 7, .sg_tablesize = SG_ALL, .cmd_per_lun = 1, .use_clustering = DISABLE_CLUSTERING, }; #include "scsi_module.c" /***************************************************************** Detection */ static int jazz_esp_detect(struct scsi_host_template *tpnt) { Loading drivers/scsi/megaraid/megaraid_sas.c +15 −14 Original line number Diff line number Diff line Loading @@ -793,6 +793,20 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) return 0; } static int megasas_slave_configure(struct scsi_device *sdev) { /* * Don't export physical disk devices to the disk driver. * * FIXME: Currently we don't export them to the midlayer at all. * That will be fixed once LSI engineers have audited the * firmware for possible issues. */ if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK) return -ENXIO; return 0; } /** * megasas_wait_for_outstanding - Wait for all outstanding cmds * @instance: Adapter soft state Loading Loading @@ -943,6 +957,7 @@ static struct scsi_host_template megasas_template = { .module = THIS_MODULE, .name = "LSI Logic SAS based MegaRAID driver", .proc_name = "megaraid_sas", .slave_configure = megasas_slave_configure, .queuecommand = megasas_queue_command, .eh_device_reset_handler = megasas_reset_device, .eh_bus_reset_handler = megasas_reset_bus_host, Loading Loading @@ -1071,20 +1086,6 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, break; } /* * Don't export physical disk devices to mid-layer. */ if (!MEGASAS_IS_LOGICAL(cmd->scmd) && (hdr->cmd_status == MFI_STAT_OK) && (cmd->scmd->cmnd[0] == INQUIRY)) { if (((*(u8 *) cmd->scmd->request_buffer) & 0x1F) == TYPE_DISK) { cmd->scmd->result = DID_BAD_TARGET << 16; exception = 1; } } case MFI_CMD_LD_READ: case MFI_CMD_LD_WRITE: Loading drivers/scsi/pcmcia/aha152x_stub.c +1 −3 Original line number Diff line number Diff line Loading @@ -275,10 +275,8 @@ static int aha152x_resume(struct pcmcia_device *dev) link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { Scsi_Cmnd tmp; pcmcia_request_configuration(link->handle, &link->conf); tmp.device->host = info->host; aha152x_host_reset(&tmp); aha152x_host_reset_host(info->host); } return 0; Loading Loading
drivers/scsi/aha152x.c +52 −33 Original line number Diff line number Diff line Loading @@ -1260,16 +1260,15 @@ static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs) * Reset the bus * */ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) static int aha152x_bus_reset_host(struct Scsi_Host *shpnt) { struct Scsi_Host *shpnt = SCpnt->device->host; unsigned long flags; DO_LOCK(flags); #if defined(AHA152X_DEBUG) if(HOSTDATA(shpnt)->debug & debug_eh) { printk(DEBUG_LEAD "aha152x_bus_reset(%p)", CMDINFO(SCpnt), SCpnt); printk(KERN_DEBUG "scsi%d: bus reset", shpnt->host_no); show_queues(shpnt); } #endif Loading @@ -1277,14 +1276,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) free_hard_reset_SCs(shpnt, &ISSUE_SC); free_hard_reset_SCs(shpnt, &DISCONNECTED_SC); DPRINTK(debug_eh, DEBUG_LEAD "resetting bus\n", CMDINFO(SCpnt)); DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no); SETPORT(SCSISEQ, SCSIRSTO); mdelay(256); SETPORT(SCSISEQ, 0); mdelay(DELAY); DPRINTK(debug_eh, DEBUG_LEAD "bus resetted\n", CMDINFO(SCpnt)); DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no); setup_expected_interrupts(shpnt); if(HOSTDATA(shpnt)->commands==0) Loading @@ -1295,6 +1294,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) return SUCCESS; } /* * Reset the bus * */ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) { return aha152x_bus_reset_host(SCpnt->device->host); } /* * Restore default values to the AIC-6260 registers and reset the fifos Loading Loading @@ -1337,22 +1344,27 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ int aha152x_host_reset(Scsi_Cmnd * SCpnt) int aha152x_host_reset_host(struct Scsi_Host *shpnt) { #if defined(AHA152X_DEBUG) struct Scsi_Host *shpnt = SCpnt->device->host; #endif DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no); DPRINTK(debug_eh, DEBUG_LEAD "aha152x_host_reset(%p)\n", CMDINFO(SCpnt), SCpnt); aha152x_bus_reset_host(shpnt); aha152x_bus_reset(SCpnt); DPRINTK(debug_eh, DEBUG_LEAD "resetting ports\n", CMDINFO(SCpnt)); reset_ports(SCpnt->device->host); DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", shpnt->host_no); reset_ports(shpnt); return SUCCESS; } /* * Reset the host (bus and controller) * */ static int aha152x_host_reset(Scsi_Cmnd *SCpnt) { return aha152x_host_reset_host(SCpnt->device->host); } /* * Return the "logical geometry" * Loading Loading @@ -1431,22 +1443,18 @@ static void run(void) { int i; for (i = 0; i<ARRAY_SIZE(aha152x_host); i++) { struct Scsi_Host *shpnt = aha152x_host[i]; if (shpnt && HOSTDATA(shpnt)->service) { HOSTDATA(shpnt)->service=0; is_complete(shpnt); } is_complete(aha152x_host[i]); } } /* * Interrupts handler * Interrupt handler * */ static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *shpnt = lookup_irq(irqno); unsigned long flags; unsigned char rev, dmacntrl0; if (!shpnt) { Loading @@ -1472,23 +1480,23 @@ static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) if ((rev == 0xFF) && (dmacntrl0 == 0xFF)) return IRQ_NONE; if( TESTLO(DMASTAT, INTSTAT) ) return IRQ_NONE; /* no more interrupts from the controller, while we're busy. INTEN is restored by the BH handler */ CLRBITS(DMACNTRL0, INTEN); #if 0 /* check if there is already something to be serviced; should not happen */ if(HOSTDATA(shpnt)->service) { printk(KERN_ERR "aha152x%d: lost interrupt (%d)\n", HOSTNO, HOSTDATA(shpnt)->service); show_queues(shpnt); } #endif DO_LOCK(flags); if( HOSTDATA(shpnt)->service==0 ) { HOSTDATA(shpnt)->service=1; /* Poke the BH handler */ HOSTDATA(shpnt)->service++; INIT_WORK(&aha152x_tq, (void *) run, NULL); schedule_work(&aha152x_tq); } DO_UNLOCK(flags); return IRQ_HANDLED; } Loading Loading @@ -2527,7 +2535,18 @@ static void is_complete(struct Scsi_Host *shpnt) unsigned long flags; int pending; if(!shpnt) return; DO_LOCK(flags); if( HOSTDATA(shpnt)->service==0 ) { DO_UNLOCK(flags); return; } HOSTDATA(shpnt)->service = 0; if(HOSTDATA(shpnt)->in_intr) { DO_UNLOCK(flags); /* aha152x_error never returns.. */ Loading
drivers/scsi/aha152x.h +1 −1 Original line number Diff line number Diff line Loading @@ -332,6 +332,6 @@ struct aha152x_setup { struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); void aha152x_release(struct Scsi_Host *); int aha152x_host_reset(Scsi_Cmnd *); int aha152x_host_reset_host(struct Scsi_Host *); #endif /* _AHA152X_H */
drivers/scsi/jazz_esp.c +0 −21 Original line number Diff line number Diff line Loading @@ -65,27 +65,6 @@ static int jazz_esp_release(struct Scsi_Host *shost) return 0; } static struct scsi_host_template driver_template = { .proc_name = "jazz_esp", .proc_info = &esp_proc_info, .name = "ESP 100/100a/200", .detect = jazz_esp_detect, .slave_alloc = esp_slave_alloc, .slave_destroy = esp_slave_destroy, .release = jazz_esp_release, .info = esp_info, .queuecommand = esp_queue, .eh_abort_handler = esp_abort, .eh_bus_reset_handler = esp_reset, .can_queue = 7, .this_id = 7, .sg_tablesize = SG_ALL, .cmd_per_lun = 1, .use_clustering = DISABLE_CLUSTERING, }; #include "scsi_module.c" /***************************************************************** Detection */ static int jazz_esp_detect(struct scsi_host_template *tpnt) { Loading
drivers/scsi/megaraid/megaraid_sas.c +15 −14 Original line number Diff line number Diff line Loading @@ -793,6 +793,20 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) return 0; } static int megasas_slave_configure(struct scsi_device *sdev) { /* * Don't export physical disk devices to the disk driver. * * FIXME: Currently we don't export them to the midlayer at all. * That will be fixed once LSI engineers have audited the * firmware for possible issues. */ if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK) return -ENXIO; return 0; } /** * megasas_wait_for_outstanding - Wait for all outstanding cmds * @instance: Adapter soft state Loading Loading @@ -943,6 +957,7 @@ static struct scsi_host_template megasas_template = { .module = THIS_MODULE, .name = "LSI Logic SAS based MegaRAID driver", .proc_name = "megaraid_sas", .slave_configure = megasas_slave_configure, .queuecommand = megasas_queue_command, .eh_device_reset_handler = megasas_reset_device, .eh_bus_reset_handler = megasas_reset_bus_host, Loading Loading @@ -1071,20 +1086,6 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, break; } /* * Don't export physical disk devices to mid-layer. */ if (!MEGASAS_IS_LOGICAL(cmd->scmd) && (hdr->cmd_status == MFI_STAT_OK) && (cmd->scmd->cmnd[0] == INQUIRY)) { if (((*(u8 *) cmd->scmd->request_buffer) & 0x1F) == TYPE_DISK) { cmd->scmd->result = DID_BAD_TARGET << 16; exception = 1; } } case MFI_CMD_LD_READ: case MFI_CMD_LD_WRITE: Loading
drivers/scsi/pcmcia/aha152x_stub.c +1 −3 Original line number Diff line number Diff line Loading @@ -275,10 +275,8 @@ static int aha152x_resume(struct pcmcia_device *dev) link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { Scsi_Cmnd tmp; pcmcia_request_configuration(link->handle, &link->conf); tmp.device->host = info->host; aha152x_host_reset(&tmp); aha152x_host_reset_host(info->host); } return 0; Loading