Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
[SCSI] megaraid_sas: intercept cmd timeout and throttle io
[SCSI] fusion: Fix |/|| confusion
[SCSI] aic94xx: asd_clear_nexus should fail if the cleared task does not complete
[SCSI] aic7xxx: fix aicasm build failure with gcc-3.4.6
[SCSI] aacraid: apply commit config for reset_devices flag
[SCSI] sd: fix refcounting regression in suspend/resume routines
[SCSI] aacraid: fix panic on short Inquiry
[SCSI] aacraid: Correct sa platform support. (Was: [Bug 8469] Bad EIP value on pentium3 SMP kernel-2.6.21.1)
[SCSI] NCR53C9x: correct spelling mistake in deprecation notice
[SCSI] tgt: fix a rdma indirect transfer error bug
[SCSI] MegaRAID: Update MAINTAINERS email-id
[SCSI] stex: minor cleanup and version update
[SCSI] stex: fix reset recovery for console device
[SCSI] stex: extend hard reset wait time
[SCSI] stex: fix id mapping issue
[SCSI] ipr: Proper return codes for eh_dev_reset for SATA devices
[SCSI] zfcp: IO stall after deleting and path checker changes after reenabling zfcp devices
[SCSI] zfcp: avoid clutter in erp_dbf

+206 -106
+1 -1
Documentation/feature-removal-schedule.txt
··· 62 62 What: old NCR53C9x driver 63 63 When: October 2007 64 64 Why: Replaced by the much better esp_scsi driver. Actual low-level 65 - driver can ported over almost trivially. 65 + driver can be ported over almost trivially. 66 66 Who: David Miller <davem@davemloft.net> 67 67 Christoph Hellwig <hch@lst.de> 68 68
+1 -1
MAINTAINERS
··· 2334 2334 2335 2335 MEGARAID SCSI DRIVERS 2336 2336 P: Neela Syam Kolli 2337 - M: Neela.Kolli@engenio.com 2337 + M: megaraidlinux@lsi.com 2338 2338 S: linux-scsi@vger.kernel.org 2339 2339 W: http://megaraid.lsilogic.com 2340 2340 S: Maintained
+1 -1
drivers/message/fusion/mptbase.h
··· 436 436 typedef struct _mpt_ioctl_events { 437 437 u32 event; /* Specified by define above */ 438 438 u32 eventContext; /* Index or counter */ 439 - int data[2]; /* First 8 bytes of Event Data */ 439 + u32 data[2]; /* First 8 bytes of Event Data */ 440 440 } MPT_IOCTL_EVENTS; 441 441 442 442 /*
+4 -4
drivers/message/fusion/mptscsih.c
··· 2463 2463 ioc->events[idx].event = MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE; 2464 2464 ioc->events[idx].eventContext = ioc->eventContext; 2465 2465 2466 - ioc->events[idx].data[0] = (pReq->LUN[1] << 24) || 2467 - (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) || 2468 - (sc->device->channel << 8) || sc->device->id; 2466 + ioc->events[idx].data[0] = (pReq->LUN[1] << 24) | 2467 + (MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA << 16) | 2468 + (sc->device->channel << 8) | sc->device->id; 2469 2469 2470 - ioc->events[idx].data[1] = (sense_data[13] << 8) || sense_data[12]; 2470 + ioc->events[idx].data[1] = (sense_data[13] << 8) | sense_data[12]; 2471 2471 2472 2472 ioc->eventContext++; 2473 2473 if (hd->ioc->pcidev->vendor ==
+1
drivers/s390/scsi/zfcp_aux.c
··· 1127 1127 int retval = 0; 1128 1128 unsigned long flags; 1129 1129 1130 + zfcp_adapter_scsi_unregister(adapter); 1130 1131 device_unregister(&adapter->generic_services); 1131 1132 zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); 1132 1133 dev_set_drvdata(&adapter->ccw_device->dev, NULL);
+1 -4
drivers/s390/scsi/zfcp_ccw.c
··· 189 189 * @ccw_device: pointer to belonging ccw device 190 190 * 191 191 * This function gets called by the common i/o layer and sets an adapter 192 - * into state offline. Setting an fcp device offline means that it will be 193 - * unregistered from the SCSI stack and that the adapter will be shut down 194 - * asynchronously. 192 + * into state offline. 195 193 */ 196 194 static int 197 195 zfcp_ccw_set_offline(struct ccw_device *ccw_device) ··· 200 202 adapter = dev_get_drvdata(&ccw_device->dev); 201 203 zfcp_erp_adapter_shutdown(adapter, 0); 202 204 zfcp_erp_wait(adapter); 203 - zfcp_adapter_scsi_unregister(adapter); 204 205 zfcp_erp_thread_kill(adapter); 205 206 zfcp_adapter_debug_unregister(adapter); 206 207 up(&zfcp_data.config_sema);
+13 -27
drivers/s390/scsi/zfcp_fsf.c
··· 156 156 kfree(fsf_req); 157 157 } 158 158 159 - /** 160 - * zfcp_fsf_req_dismiss - dismiss a single fsf request 161 - */ 162 - static void zfcp_fsf_req_dismiss(struct zfcp_adapter *adapter, 163 - struct zfcp_fsf_req *fsf_req, 164 - unsigned int counter) 165 - { 166 - u64 dbg_tmp[2]; 167 - 168 - dbg_tmp[0] = (u64) atomic_read(&adapter->reqs_active); 169 - dbg_tmp[1] = (u64) counter; 170 - debug_event(adapter->erp_dbf, 4, (void *) dbg_tmp, 16); 171 - list_del(&fsf_req->list); 172 - fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; 173 - zfcp_fsf_req_complete(fsf_req); 174 - } 175 - 176 - /** 177 - * zfcp_fsf_req_dismiss_all - dismiss all remaining fsf requests 159 + /* 160 + * Never ever call this without shutting down the adapter first. 161 + * Otherwise the adapter would continue using and corrupting s390 storage. 162 + * Included BUG_ON() call to ensure this is done. 163 + * ERP is supposed to be the only user of this function. 178 164 */ 179 165 void zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) 180 166 { 181 - struct zfcp_fsf_req *request, *tmp; 167 + struct zfcp_fsf_req *fsf_req, *tmp; 182 168 unsigned long flags; 183 169 LIST_HEAD(remove_queue); 184 - unsigned int i, counter; 170 + unsigned int i; 185 171 172 + BUG_ON(atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)); 186 173 spin_lock_irqsave(&adapter->req_list_lock, flags); 187 174 atomic_set(&adapter->reqs_active, 0); 188 - for (i=0; i<REQUEST_LIST_SIZE; i++) 175 + for (i = 0; i < REQUEST_LIST_SIZE; i++) 189 176 list_splice_init(&adapter->req_list[i], &remove_queue); 190 - 191 177 spin_unlock_irqrestore(&adapter->req_list_lock, flags); 192 178 193 - counter = 0; 194 - list_for_each_entry_safe(request, tmp, &remove_queue, list) { 195 - zfcp_fsf_req_dismiss(adapter, request, counter); 196 - counter++; 179 + list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) { 180 + list_del(&fsf_req->list); 181 + fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; 182 + zfcp_fsf_req_complete(fsf_req); 197 183 } 198 184 } 199 185
+3
drivers/s390/scsi/zfcp_scsi.c
··· 569 569 int retval = 0; 570 570 static unsigned int unique_id = 0; 571 571 572 + if (adapter->scsi_host) 573 + goto out; 574 + 572 575 /* register adapter as SCSI host with mid layer of SCSI stack */ 573 576 adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template, 574 577 sizeof (struct zfcp_adapter *));
+9 -6
drivers/scsi/aacraid/aachba.c
··· 146 146 static int nondasd = -1; 147 147 static int dacmode = -1; 148 148 149 - static int commit = -1; 149 + int aac_commit = -1; 150 150 int startup_timeout = 180; 151 151 int aif_timeout = 120; 152 152 ··· 154 154 MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on"); 155 155 module_param(dacmode, int, S_IRUGO|S_IWUSR); 156 156 MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on"); 157 - module_param(commit, int, S_IRUGO|S_IWUSR); 157 + module_param_named(commit, aac_commit, int, S_IRUGO|S_IWUSR); 158 158 MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on"); 159 159 module_param(startup_timeout, int, S_IRUGO|S_IWUSR); 160 160 MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for adapter to have it's kernel up and\nrunning. This is typically adjusted for large systems that do not have a BIOS."); ··· 173 173 module_param(expose_physicals, int, S_IRUGO|S_IWUSR); 174 174 MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. -1=protect 0=off, 1=on"); 175 175 176 + int aac_reset_devices = 0; 177 + module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR); 178 + MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization."); 176 179 177 180 static inline int aac_valid_context(struct scsi_cmnd *scsicmd, 178 181 struct fib *fibptr) { ··· 249 246 aac_fib_complete(fibptr); 250 247 /* Send a CT_COMMIT_CONFIG to enable discovery of devices */ 251 248 if (status >= 0) { 252 - if ((commit == 1) || commit_flag) { 249 + if ((aac_commit == 1) || commit_flag) { 253 250 struct aac_commit_config * dinfo; 254 251 aac_fib_init(fibptr); 255 252 dinfo = (struct aac_commit_config *) fib_data(fibptr); ··· 264 261 1, 1, 265 262 NULL, NULL); 266 263 aac_fib_complete(fibptr); 267 - } else if (commit == 0) { 264 + } else if (aac_commit == 0) { 268 265 printk(KERN_WARNING 269 266 "aac_get_config_status: Foreign device configurations are being ignored\n"); 270 267 } ··· 343 340 static void aac_internal_transfer(struct scsi_cmnd *scsicmd, void *data, unsigned int offset, unsigned int len) 344 341 { 345 342 void *buf; 346 - unsigned int transfer_len; 343 + int transfer_len; 347 344 struct scatterlist *sg = scsicmd->request_buffer; 348 345 349 346 if (scsicmd->use_sg) { ··· 354 351 transfer_len = min(scsicmd->request_bufflen, len + offset); 355 352 } 356 353 transfer_len -= offset; 357 - if (buf && transfer_len) 354 + if (buf && transfer_len > 0) 358 355 memcpy(buf + offset, data, transfer_len); 359 356 360 357 if (scsicmd->use_sg)
+3
drivers/scsi/aacraid/aacraid.h
··· 1823 1823 int aac_probe_container(struct aac_dev *dev, int cid); 1824 1824 int _aac_rx_init(struct aac_dev *dev); 1825 1825 int aac_rx_select_comm(struct aac_dev *dev, int comm); 1826 + int aac_rx_deliver_producer(struct fib * fib); 1826 1827 extern int numacb; 1827 1828 extern int acbsize; 1828 1829 extern char aac_driver_version[]; 1829 1830 extern int startup_timeout; 1830 1831 extern int aif_timeout; 1831 1832 extern int expose_physicals; 1833 + extern int aac_reset_devices; 1834 + extern int aac_commit;
+6 -2
drivers/scsi/aacraid/rx.c
··· 378 378 * 379 379 * Will send a fib, returning 0 if successful. 380 380 */ 381 - static int aac_rx_deliver_producer(struct fib * fib) 381 + int aac_rx_deliver_producer(struct fib * fib) 382 382 { 383 383 struct aac_dev *dev = fib->dev; 384 384 struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; ··· 488 488 return -EINVAL; 489 489 if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) 490 490 return -ENODEV; 491 + if (startup_timeout < 300) 492 + startup_timeout = 300; 491 493 return 0; 492 494 } 493 495 ··· 544 542 dev->a_ops.adapter_sync_cmd = rx_sync_cmd; 545 543 dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt; 546 544 dev->OIMR = status = rx_readb (dev, MUnit.OIMR); 547 - if ((((status & 0x0c) != 0x0c) || reset_devices) && 545 + if ((((status & 0x0c) != 0x0c) || aac_reset_devices || reset_devices) && 548 546 !aac_rx_restart_adapter(dev, 0)) 549 547 ++restart; 550 548 /* ··· 596 594 } 597 595 msleep(1); 598 596 } 597 + if (restart) 598 + aac_commit = 1; 599 599 /* 600 600 * Fill in the common function dispatch table. 601 601 */
+8 -1
drivers/scsi/aacraid/sa.c
··· 5 5 * based on the old aacraid driver that is.. 6 6 * Adaptec aacraid device driver for Linux. 7 7 * 8 - * Copyright (c) 2000 Adaptec, Inc. (aacraid@adaptec.com) 8 + * Copyright (c) 2000-2007 Adaptec, Inc. (aacraid@adaptec.com) 9 9 * 10 10 * This program is free software; you can redistribute it and/or modify 11 11 * it under the terms of the GNU General Public License as published by ··· 257 257 NULL, NULL, NULL, NULL, NULL); 258 258 } 259 259 260 + static int aac_sa_restart_adapter(struct aac_dev *dev, int bled) 261 + { 262 + return -EINVAL; 263 + } 264 + 260 265 /** 261 266 * aac_sa_check_health 262 267 * @dev: device to check if healthy ··· 371 366 dev->a_ops.adapter_notify = aac_sa_notify_adapter; 372 367 dev->a_ops.adapter_sync_cmd = sa_sync_cmd; 373 368 dev->a_ops.adapter_check_health = aac_sa_check_health; 369 + dev->a_ops.adapter_restart = aac_sa_restart_adapter; 374 370 dev->a_ops.adapter_intr = aac_sa_intr; 371 + dev->a_ops.adapter_deliver = aac_rx_deliver_producer; 375 372 dev->a_ops.adapter_ioremap = aac_sa_ioremap; 376 373 377 374 /*
+1
drivers/scsi/aic7xxx/aicasm/aicasm_gram.y
··· 106 106 static void add_conditional(symbol_t *symbol); 107 107 static void add_version(const char *verstring); 108 108 static int is_download_const(expression_t *immed); 109 + void yyerror(const char *string); 109 110 110 111 #define SRAM_SYMNAME "SRAM_BASE" 111 112 #define SCB_SYMNAME "SCB_BASE"
+1
drivers/scsi/aic7xxx/aicasm/aicasm_macro_gram.y
··· 65 65 static symbol_t *macro_symbol; 66 66 67 67 static void add_macro_arg(const char *argtext, int position); 68 + void mmerror(const char *string); 68 69 69 70 %} 70 71
+10 -4
drivers/scsi/aic94xx/aic94xx_tmf.c
··· 290 290 static inline int asd_clear_nexus(struct sas_task *task) 291 291 { 292 292 int res = TMF_RESP_FUNC_FAILED; 293 + int leftover; 293 294 struct asd_ascb *tascb = task->lldd_task; 294 295 unsigned long flags; 295 296 ··· 299 298 res = asd_clear_nexus_tag(task); 300 299 else 301 300 res = asd_clear_nexus_index(task); 302 - wait_for_completion_timeout(&tascb->completion, 303 - AIC94XX_SCB_TIMEOUT); 301 + leftover = wait_for_completion_timeout(&tascb->completion, 302 + AIC94XX_SCB_TIMEOUT); 304 303 ASD_DPRINTK("came back from clear nexus\n"); 305 304 spin_lock_irqsave(&task->task_state_lock, flags); 305 + if (leftover < 1) 306 + res = TMF_RESP_FUNC_FAILED; 306 307 if (task->task_state_flags & SAS_TASK_STATE_DONE) 307 308 res = TMF_RESP_FUNC_COMPLETE; 308 309 spin_unlock_irqrestore(&task->task_state_lock, flags); ··· 353 350 unsigned long flags; 354 351 struct asd_ascb *ascb = NULL; 355 352 struct scb *scb; 353 + int leftover; 356 354 357 355 spin_lock_irqsave(&task->task_state_lock, flags); 358 356 if (task->task_state_flags & SAS_TASK_STATE_DONE) { ··· 459 455 break; 460 456 case TF_TMF_TASK_DONE + 0xFF00: /* done but not reported yet */ 461 457 res = TMF_RESP_FUNC_FAILED; 462 - wait_for_completion_timeout(&tascb->completion, 463 - AIC94XX_SCB_TIMEOUT); 458 + leftover = wait_for_completion_timeout(&tascb->completion, 459 + AIC94XX_SCB_TIMEOUT); 464 460 spin_lock_irqsave(&task->task_state_lock, flags); 461 + if (leftover < 1) 462 + res = TMF_RESP_FUNC_FAILED; 465 463 if (task->task_state_flags & SAS_TASK_STATE_DONE) 466 464 res = TMF_RESP_FUNC_COMPLETE; 467 465 spin_unlock_irqrestore(&task->task_state_lock, flags);
+7
drivers/scsi/ipr.c
··· 3954 3954 spin_unlock_irq(scsi_cmd->device->host->host_lock); 3955 3955 ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL); 3956 3956 spin_lock_irq(scsi_cmd->device->host->host_lock); 3957 + 3958 + list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { 3959 + if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) { 3960 + rc = -EIO; 3961 + break; 3962 + } 3963 + } 3957 3964 } else 3958 3965 rc = ipr_device_reset(ioa_cfg, res); 3959 3966 res->resetting_device = 0;
+1
drivers/scsi/libsrp.c
··· 254 254 255 255 sg_init_one(&dummy, md, id->table_desc.len); 256 256 sg_dma_address(&dummy) = token; 257 + sg_dma_len(&dummy) = id->table_desc.len; 257 258 err = rdma_io(sc, &dummy, 1, &id->table_desc, 1, DMA_TO_DEVICE, 258 259 id->table_desc.len); 259 260 if (err) {
+60 -7
drivers/scsi/megaraid/megaraid_sas.c
··· 10 10 * 2 of the License, or (at your option) any later version. 11 11 * 12 12 * FILE : megaraid_sas.c 13 - * Version : v00.00.03.10-rc1 13 + * Version : v00.00.03.10-rc5 14 14 * 15 15 * Authors: 16 16 * (email-id : megaraidlinux@lsi.com) ··· 886 886 goto out_return_cmd; 887 887 888 888 cmd->scmd = scmd; 889 + scmd->SCp.ptr = (char *)cmd; 889 890 890 891 /* 891 892 * Issue the command to the FW ··· 920 919 * The RAID firmware may require extended timeouts. 921 920 */ 922 921 if (sdev->channel >= MEGASAS_MAX_PD_CHANNELS) 923 - sdev->timeout = 90 * HZ; 922 + sdev->timeout = MEGASAS_DEFAULT_CMD_TIMEOUT * HZ; 924 923 return 0; 925 924 } 926 925 ··· 982 981 983 982 instance = (struct megasas_instance *)scmd->device->host->hostdata; 984 983 985 - scmd_printk(KERN_NOTICE, scmd, "megasas: RESET -%ld cmd=%x\n", 986 - scmd->serial_number, scmd->cmnd[0]); 984 + scmd_printk(KERN_NOTICE, scmd, "megasas: RESET -%ld cmd=%x retries=%x\n", 985 + scmd->serial_number, scmd->cmnd[0], scmd->retries); 987 986 988 987 if (instance->hw_crit_error) { 989 988 printk(KERN_ERR "megasas: cannot recover from previous reset " ··· 998 997 printk(KERN_ERR "megasas: failed to do reset\n"); 999 998 1000 999 return ret_val; 1000 + } 1001 + 1002 + /** 1003 + * megasas_reset_timer - quiesce the adapter if required 1004 + * @scmd: scsi cmnd 1005 + * 1006 + * Sets the FW busy flag and reduces the host->can_queue if the 1007 + * cmd has not been completed within the timeout period. 1008 + */ 1009 + static enum 1010 + scsi_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd) 1011 + { 1012 + struct megasas_cmd *cmd = (struct megasas_cmd *)scmd->SCp.ptr; 1013 + struct megasas_instance *instance; 1014 + unsigned long flags; 1015 + 1016 + if (time_after(jiffies, scmd->jiffies_at_alloc + 1017 + (MEGASAS_DEFAULT_CMD_TIMEOUT * 2) * HZ)) { 1018 + return EH_NOT_HANDLED; 1019 + } 1020 + 1021 + instance = cmd->instance; 1022 + if (!(instance->flag & MEGASAS_FW_BUSY)) { 1023 + /* FW is busy, throttle IO */ 1024 + spin_lock_irqsave(instance->host->host_lock, flags); 1025 + 1026 + instance->host->can_queue = 16; 1027 + instance->last_time = jiffies; 1028 + instance->flag |= MEGASAS_FW_BUSY; 1029 + 1030 + spin_unlock_irqrestore(instance->host->host_lock, flags); 1031 + } 1032 + return EH_RESET_TIMER; 1001 1033 } 1002 1034 1003 1035 /** ··· 1146 1112 .eh_device_reset_handler = megasas_reset_device, 1147 1113 .eh_bus_reset_handler = megasas_reset_bus_host, 1148 1114 .eh_host_reset_handler = megasas_reset_bus_host, 1115 + .eh_timed_out = megasas_reset_timer, 1149 1116 .bios_param = megasas_bios_param, 1150 1117 .use_clustering = ENABLE_CLUSTERING, 1151 1118 }; ··· 1250 1215 int exception = 0; 1251 1216 struct megasas_header *hdr = &cmd->frame->hdr; 1252 1217 1253 - if (cmd->scmd) { 1254 - cmd->scmd->SCp.ptr = (char *)0; 1255 - } 1218 + if (cmd->scmd) 1219 + cmd->scmd->SCp.ptr = NULL; 1256 1220 1257 1221 switch (hdr->cmd) { 1258 1222 ··· 1840 1806 u32 context; 1841 1807 struct megasas_cmd *cmd; 1842 1808 struct megasas_instance *instance = (struct megasas_instance *)instance_addr; 1809 + unsigned long flags; 1843 1810 1844 1811 /* If we have already declared adapter dead, donot complete cmds */ 1845 1812 if (instance->hw_crit_error) ··· 1863 1828 } 1864 1829 1865 1830 *instance->consumer = producer; 1831 + 1832 + /* 1833 + * Check if we can restore can_queue 1834 + */ 1835 + if (instance->flag & MEGASAS_FW_BUSY 1836 + && time_after(jiffies, instance->last_time + 5 * HZ) 1837 + && atomic_read(&instance->fw_outstanding) < 17) { 1838 + 1839 + spin_lock_irqsave(instance->host->host_lock, flags); 1840 + instance->flag &= ~MEGASAS_FW_BUSY; 1841 + instance->host->can_queue = 1842 + instance->max_fw_cmds - MEGASAS_INT_CMDS; 1843 + 1844 + spin_unlock_irqrestore(instance->host->host_lock, flags); 1845 + } 1846 + 1866 1847 } 1867 1848 1868 1849 /** ··· 2449 2398 instance->init_id = MEGASAS_DEFAULT_INIT_ID; 2450 2399 2451 2400 megasas_dbg_lvl = 0; 2401 + instance->flag = 0; 2402 + instance->last_time = 0; 2452 2403 2453 2404 /* 2454 2405 * Initialize MFI Firmware
+9 -5
drivers/scsi/megaraid/megaraid_sas.h
··· 18 18 /* 19 19 * MegaRAID SAS Driver meta data 20 20 */ 21 - #define MEGASAS_VERSION "00.00.03.10-rc1" 22 - #define MEGASAS_RELDATE "Feb 14, 2007" 23 - #define MEGASAS_EXT_VERSION "Wed Feb 14 10:14:25 PST 2007" 21 + #define MEGASAS_VERSION "00.00.03.10-rc5" 22 + #define MEGASAS_RELDATE "May 17, 2007" 23 + #define MEGASAS_EXT_VERSION "Thu May 17 10:09:32 PDT 2007" 24 24 25 25 /* 26 26 * Device IDs ··· 539 539 540 540 #define MEGASAS_DBG_LVL 1 541 541 542 + #define MEGASAS_FW_BUSY 1 543 + 542 544 /* 543 545 * When SCSI mid-layer calls driver's reset routine, driver waits for 544 546 * MEGASAS_RESET_WAIT_TIME seconds for all outstanding IO to complete. Note ··· 551 549 #define MEGASAS_RESET_WAIT_TIME 180 552 550 #define MEGASAS_INTERNAL_CMD_WAIT_TIME 180 553 551 #define MEGASAS_RESET_NOTICE_INTERVAL 5 554 - 555 552 #define MEGASAS_IOCTL_CMD 0 553 + #define MEGASAS_DEFAULT_CMD_TIMEOUT 90 556 554 557 555 /* 558 556 * FW reports the maximum of number of commands that it can accept (maximum ··· 1075 1073 struct megasas_register_set __iomem *reg_set; 1076 1074 1077 1075 s8 init_id; 1078 - u8 reserved[3]; 1079 1076 1080 1077 u16 max_num_sge; 1081 1078 u16 max_fw_cmds; ··· 1105 1104 1106 1105 struct megasas_instance_template *instancet; 1107 1106 struct tasklet_struct isr_tasklet; 1107 + 1108 + u8 flag; 1109 + unsigned long last_time; 1108 1110 }; 1109 1111 1110 1112 #define MEGASAS_IS_LOGICAL(scp) \
+1
drivers/scsi/scsi_devinfo.c
··· 209 209 {"PIONEER", "CD-ROM DRM-602X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 210 210 {"PIONEER", "CD-ROM DRM-604X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 211 211 {"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN}, 212 + {"Promise", "", NULL, BLIST_SPARSELUN}, 212 213 {"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN}, 213 214 {"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN}, 214 215 {"SEAGATE", "ST34555N", "0930", BLIST_NOTQ}, /* Chokes on tagged INQUIRY */
+11 -7
drivers/scsi/sd.c
··· 1789 1789 static int sd_suspend(struct device *dev, pm_message_t mesg) 1790 1790 { 1791 1791 struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); 1792 - int ret; 1792 + int ret = 0; 1793 1793 1794 1794 if (!sdkp) 1795 1795 return 0; /* this can happen */ ··· 1798 1798 sd_printk(KERN_NOTICE, sdkp, "Synchronizing SCSI cache\n"); 1799 1799 ret = sd_sync_cache(sdkp); 1800 1800 if (ret) 1801 - return ret; 1801 + goto done; 1802 1802 } 1803 1803 1804 1804 if (mesg.event == PM_EVENT_SUSPEND && 1805 1805 sdkp->device->manage_start_stop) { 1806 1806 sd_printk(KERN_NOTICE, sdkp, "Stopping disk\n"); 1807 1807 ret = sd_start_stop_device(sdkp, 0); 1808 - if (ret) 1809 - return ret; 1810 1808 } 1811 1809 1812 - return 0; 1810 + done: 1811 + scsi_disk_put(sdkp); 1812 + return ret; 1813 1813 } 1814 1814 1815 1815 static int sd_resume(struct device *dev) 1816 1816 { 1817 1817 struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); 1818 + int ret = 0; 1818 1819 1819 1820 if (!sdkp->device->manage_start_stop) 1820 - return 0; 1821 + goto done; 1821 1822 1822 1823 sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); 1824 + ret = sd_start_stop_device(sdkp, 1); 1823 1825 1824 - return sd_start_stop_device(sdkp, 1); 1826 + done: 1827 + scsi_disk_put(sdkp); 1828 + return ret; 1825 1829 } 1826 1830 1827 1831 /**
+54 -36
drivers/scsi/stex.c
··· 32 32 #include <scsi/scsi_cmnd.h> 33 33 #include <scsi/scsi_host.h> 34 34 #include <scsi/scsi_tcq.h> 35 + #include <scsi/scsi_dbg.h> 35 36 36 37 #define DRV_NAME "stex" 37 - #define ST_DRIVER_VERSION "3.1.0.1" 38 + #define ST_DRIVER_VERSION "3.6.0000.1" 38 39 #define ST_VER_MAJOR 3 39 - #define ST_VER_MINOR 1 40 + #define ST_VER_MINOR 6 40 41 #define ST_OEM 0 41 42 #define ST_BUILD_VER 1 42 43 ··· 113 112 SG_CF_EOT = 0x80, /* end of table */ 114 113 SG_CF_64B = 0x40, /* 64 bit item */ 115 114 SG_CF_HOST = 0x20, /* sg in host memory */ 116 - 117 - ST_MAX_ARRAY_SUPPORTED = 16, 118 - ST_MAX_TARGET_NUM = (ST_MAX_ARRAY_SUPPORTED+1), 119 - ST_MAX_LUN_PER_TARGET = 16, 120 115 121 116 st_shasta = 0, 122 117 st_vsc = 1, ··· 583 586 u16 tag; 584 587 host = cmd->device->host; 585 588 id = cmd->device->id; 586 - lun = cmd->device->channel; /* firmware lun issue work around */ 589 + lun = cmd->device->lun; 587 590 hba = (struct st_hba *) &host->hostdata[0]; 588 591 589 592 switch (cmd->cmnd[0]) { ··· 602 605 stex_invalid_field(cmd, done); 603 606 return 0; 604 607 } 608 + case REPORT_LUNS: 609 + /* 610 + * The shasta firmware does not report actual luns in the 611 + * target, so fail the command to force sequential lun scan. 612 + * Also, the console device does not support this command. 613 + */ 614 + if (hba->cardtype == st_shasta || id == host->max_id - 1) { 615 + stex_invalid_field(cmd, done); 616 + return 0; 617 + } 618 + break; 619 + case TEST_UNIT_READY: 620 + if (id == host->max_id - 1) { 621 + cmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8; 622 + done(cmd); 623 + return 0; 624 + } 625 + break; 605 626 case INQUIRY: 606 - if (id != ST_MAX_ARRAY_SUPPORTED) 627 + if (id != host->max_id - 1) 607 628 break; 608 629 if (lun == 0 && (cmd->cmnd[1] & INQUIRY_EVPD) == 0) { 609 630 stex_direct_copy(cmd, console_inq_page, ··· 639 624 ver.oem = ST_OEM; 640 625 ver.build = ST_BUILD_VER; 641 626 ver.signature[0] = PASSTHRU_SIGNATURE; 642 - ver.console_id = ST_MAX_ARRAY_SUPPORTED; 627 + ver.console_id = host->max_id - 1; 643 628 ver.host_no = hba->host->host_no; 644 629 cmd->result = stex_direct_copy(cmd, &ver, sizeof(ver)) ? 645 630 DID_OK << 16 | COMMAND_COMPLETE << 8 : ··· 660 645 661 646 req = stex_alloc_req(hba); 662 647 663 - if (hba->cardtype == st_yosemite) { 664 - req->lun = lun * (ST_MAX_TARGET_NUM - 1) + id; 665 - req->target = 0; 666 - } else { 667 - req->lun = lun; 668 - req->target = id; 669 - } 648 + req->lun = lun; 649 + req->target = id; 670 650 671 651 /* cdb */ 672 652 memcpy(req->cdb, cmd->cmnd, STEX_CDB_LENGTH); ··· 777 767 ccb->srb_status = SRB_STATUS_SELECTION_TIMEOUT; 778 768 else 779 769 ccb->srb_status = SRB_STATUS_SUCCESS; 780 - } else if (ccb->cmd->cmnd[0] == REPORT_LUNS) { 781 - u8 *report_lun_data = (u8 *)hba->copy_buffer; 782 - 783 - count = STEX_EXTRA_SIZE; 784 - stex_internal_copy(ccb->cmd, report_lun_data, 785 - &count, ccb->sg_count, ST_FROM_CMD); 786 - if (report_lun_data[2] || report_lun_data[3]) { 787 - report_lun_data[2] = 0x00; 788 - report_lun_data[3] = 0x08; 789 - stex_internal_copy(ccb->cmd, report_lun_data, 790 - &count, ccb->sg_count, ST_TO_CMD); 791 - } 792 770 } 793 771 } 794 772 ··· 993 995 u32 data; 994 996 int result = SUCCESS; 995 997 unsigned long flags; 998 + 999 + printk(KERN_INFO DRV_NAME 1000 + "(%s): aborting command\n", pci_name(hba->pdev)); 1001 + scsi_print_command(cmd); 1002 + 996 1003 base = hba->mmio_base; 997 1004 spin_lock_irqsave(host->host_lock, flags); 998 1005 if (tag < host->can_queue && hba->ccb[tag].cmd == cmd) ··· 1054 1051 pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &pci_bctl); 1055 1052 pci_bctl |= PCI_BRIDGE_CTL_BUS_RESET; 1056 1053 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl); 1057 - msleep(1); 1054 + 1055 + /* 1056 + * 1 ms may be enough for 8-port controllers. But 16-port controllers 1057 + * require more time to finish bus reset. Use 100 ms here for safety 1058 + */ 1059 + msleep(100); 1058 1060 pci_bctl &= ~PCI_BRIDGE_CTL_BUS_RESET; 1059 1061 pci_write_config_byte(bus->self, PCI_BRIDGE_CONTROL, pci_bctl); 1060 1062 ··· 1082 1074 unsigned long flags; 1083 1075 unsigned long before; 1084 1076 hba = (struct st_hba *) &cmd->device->host->hostdata[0]; 1077 + 1078 + printk(KERN_INFO DRV_NAME 1079 + "(%s): resetting host\n", pci_name(hba->pdev)); 1080 + scsi_print_command(cmd); 1085 1081 1086 1082 hba->mu_status = MU_STATE_RESETTING; 1087 1083 ··· 1206 1194 goto out_scsi_host_put; 1207 1195 } 1208 1196 1209 - hba->mmio_base = ioremap(pci_resource_start(pdev, 0), 1197 + hba->mmio_base = ioremap_nocache(pci_resource_start(pdev, 0), 1210 1198 pci_resource_len(pdev, 0)); 1211 1199 if ( !hba->mmio_base) { 1212 1200 printk(KERN_ERR DRV_NAME "(%s): memory map failed\n", ··· 1241 1229 hba->copy_buffer = hba->dma_mem + MU_BUFFER_SIZE; 1242 1230 hba->mu_status = MU_STATE_STARTING; 1243 1231 1244 - /* firmware uses id/lun pair for a logical drive, but lun would be 1245 - always 0 if CONFIG_SCSI_MULTI_LUN not configured, so we use 1246 - channel to map lun here */ 1247 - host->max_channel = ST_MAX_LUN_PER_TARGET - 1; 1248 - host->max_id = ST_MAX_TARGET_NUM; 1249 - host->max_lun = 1; 1232 + if (hba->cardtype == st_shasta) { 1233 + host->max_lun = 8; 1234 + host->max_id = 16 + 1; 1235 + } else if (hba->cardtype == st_yosemite) { 1236 + host->max_lun = 128; 1237 + host->max_id = 1 + 1; 1238 + } else { 1239 + /* st_vsc and st_vsc1 */ 1240 + host->max_lun = 1; 1241 + host->max_id = 128 + 1; 1242 + } 1243 + host->max_channel = 0; 1250 1244 host->unique_id = host->host_no; 1251 1245 host->max_cmd_len = STEX_CDB_LENGTH; 1252 1246