summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [SCSI] advansys: Sort out irq number messMatthew Wilcox2007-10-121-198/+189
| | | | | | | | | | | | | | | | | | | The interrupt number was being stored in 4-5 different places, each with its own type, rules and usage. Fix this by keeping an unsigned int in the struct asc_board, and filling it in from the bus probe functions (since it's different for each of the four bus types). In order to do this, we have to allocate the Scsi_Host in the bus probe functions too. Then we can return an error from advansys_board_found, which requires a little rearranging of code (and removing of the err_code variable). Move the Wide Board flag setting into the PCI bus probe function. Split the AscGetChipIRQ function into three functions (one for each bus type that needs it) and add some commentary to explain what's going on. Also get rid of the AscSetChipIRQ function as we only ever set the interrupt number to the same value it already had. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] advansys: Remove ASC_WIDE_BOARD predicateMatthew Wilcox2007-10-121-3/+2
| | | | | | | Replace it with !ASC_NARROW_BOARD Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] advansys: Remove ASC_SELECT_QUEUE_DEPTHSMatthew Wilcox2007-10-121-2/+0
| | | | | | | It was only ever set; never tested, nor cleared. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] advansys: Improve reset handlerMatthew Wilcox2007-10-121-61/+22
| | | | | | | | | | - Don't need to set ASC_HOST_IN_RESET any more - Don't need to test scp->device->host for NULL -- if it's NULL, we couldn't've been called. - Use scmd_printk instead of ASC_PRINT Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] advansys: Fix simultaneous calls to ->queuecommandMatthew Wilcox2007-10-121-49/+39
| | | | | | | | | | | | | The narrow board used two global structures to set up a command; unfortunately they weren't locked, so with two boards in the machine, one call to queuecommand could corrupt the data being used by the other call to queuecommand. Fix this by allocating asc_scsi_q on the stack (64 bytes) and using kmalloc for the asc_sg_head (2k) Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] advansys: Restructure asc_execute_scsi_cmnd()Matthew Wilcox2007-10-121-92/+39
| | | | | | | | | | The wide and narrow boards share identical handling of the return value, except for some trivial error messages. Move the handling to the common end of the function. Also move variable declarations to the arms of the `if' that they're used in and delete some pointless comments. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] advansys: Remove array of scsi targetsMatthew Wilcox2007-10-121-10/+0
| | | | | | | | The driver was saving a scsi_device for each target, but wasn't doing anything useful with them. Just delete the array. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] advansys: Eliminate prototypesMatthew Wilcox2007-10-121-6230/+6043
| | | | | | | | Rearrange a lot of the functions in the file to get rid of all the forward declarations. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] Get rid of scsi_cmnd->doneMatthew Wilcox2007-10-129-58/+43
| | | | | | | | | | | | | | | The ULD ->done callback moves into the scsi_driver. By moving the call to scsi_io_completion() from scsi_blk_pc_done() to scsi_finish_command(), we can eliminate the latter entirely. By returning 'good_bytes' from the ->done callback (rather than invoking scsi_io_completion()), we can stop exporting scsi_io_completion(). Also move the prototypes from sd.h to sd.c as they're all internal anyway. Rename sd_rw_intr to sd_done and rw_intr to sr_done. Inspired-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] gdth: Stop abusing ->done for internal commandsMatthew Wilcox2007-10-122-10/+13
| | | | | | | | | | The ->done member was being used to mark commands as being internal. I decided to put a magic number in ->underflow instead. I believe this to be safe as no current user of ->underflow has any of the bottom 9 bits set. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qlogicpti: Add a slave_configure methodMatthew Wilcox2007-10-122-147/+27
| | | | | | | | | | | By configuring targets in slave_configure, we can eliminate a shadow queuecommand, a shadow scsi_done, a write to the host template, abuse of SCp->Message and SCp->Status, a use of kmap_atomic() and sniffing the results of INQUIRY. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] Update Documentation/scsi/00-INDEXRob Landley2007-10-121-3/+31
| | | | | | | Update Documentation/scsi/00-INDEX to match current files. Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] aic94xx: fix SSP IU status print-outJeff Garzik2007-10-121-1/+1
| | | | | | | | | | | | The SSP response DPRINTK in asd_get_response_tasklet() was printing a hardcoded status result, rather than the status from the SSP response IU. Arguably, this should not be a DPRINTK either, since the admin might want to know about this. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] mptctl : shutup uninitialized variable warningsEric Moore2007-10-121-5/+3
| | | | | | | | | | | | | | | | drivers/message/fusion/mptctl.c: In function ‘mptctl_mpt_command’: drivers/message/fusion/mptctl.c:1764: warning: ‘bufIn.len’ may be used uninitialized in this function drivers/message/fusion/mptctl.c:1765: warning: ‘bufOut.len’ may be used uninitialized in this function come because gcc gets confused by some "goto" statements in above function. The warnings have been verified to be bogus, however, the function does initialize these later (after the offending goto's) in the function anyway. So let's move those initializations to top of function, thereby also shutting up these warnings. Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: Satyam Sharma <satyam@infradead.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] mptlan: bug fix, only half the message frame is dma'd resulting in ↵Eric Moore2007-10-121-0/+2
| | | | | | | | | | | | | | | | | | corruption NB = number of blocks. This represents the number of blocks to transfer. The block size is based on the message frame size provided in the ioc_facts. A value of zero indicates the entire message frame should be copied. This is two bit value. So by setting this to non-zero vaule, you increase performance by reducing amount of data needing to be dma'd. The value that is stored in ioc->ReqeustNB is sometimes a non-zero vaule, which creates a bug in mptlan, where not the entire message frame is getting transfer to firware, resulting in corruption. This fix sets the default to zero, thus entire message frame is copied. Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] mpt fusion: fix up fusion prints using the sdev_printk, dev_printk, ↵Eric Moore2007-10-124-18/+20
| | | | | | | | | | | | and shost_printk API Cleaning up prints that use the xxx_printk API, in that the fusion preamble "mptbase: iocX" follows the info provided by the print API. The way its currently coded, the [H:C:T] print in sdev_printk will be inbetween "mptbase" and "iocX", instead of before. Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] mpt fusion: lock down ScsiLookupEric Moore2007-10-125-87/+149
| | | | | | | | | | | | ScsiLookup is an array of pending scmd pointers that the scsi lld maintains. This array is touched from queuecommand, eh threads, and interrupt context. This array should put under locks, hence this patch to synchronize its access. I've added some nice little function wrappers for this, and moved the ScsiLookup array over to MPT_ADAPTER struct. Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] mpt fusion: Fix sparse warningsEric Moore2007-10-123-22/+28
| | | | | | | | | | | | | | | | | List below is output from C=2 sparse compilation, which are fixed with this patch. 1) mptspi: pg0 is defined in x86 version of include/asm/pgtable.h 2) mptsas: context imbalance in 'mptsas_probe' different lock contexts for basic block 3) mptbase: from mpt_attach - cast adds address space to expression 4) mptbase: from mpt_do_upload - request[] is bad constant expression Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] mpt fusion: add use of shost_priv and remove all the typecastingEric Moore2007-10-125-76/+62
| | | | | | | | The driver is currently typecasting to obtain the shost hostdata. The driver is updated to use the shost_priv macro. Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] Fix mistaken uses of ->doneMatthew Wilcox2007-10-124-9/+9
| | | | | | | All these drivers meant to call ->scsi_done() but got confused. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] pluto: Don't abuse ->done for internal commandsMatthew Wilcox2007-10-121-2/+1
| | | | | | | We can simply call the internal done function directly Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] Fix device not ready printkJames Bottomley2007-10-123-5/+21
| | | | | | | | | | | | | | | | Because scsi_print_sense_hdr prefixes with KERN_INFO, the output from scsi_io_completion looks like: sd 0:0:0:0: [sdb] Device not ready: <6>: Sense Key : 0x2 [current] : ASC=0x4 ASCQ=0x3 By using scsi_show_sense_hdr, we can get the much more appealing output: sd 0:0:0:0: [sdb] Device not ready: Sense Key : 0x2 [current] sd 0:0:0:0: [sdb] Device not ready: ASC=0x4 ASCQ=0x3 Acked-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] Remove ->pid field from scsi_cmndMatthew Wilcox2007-10-1213-171/+153
| | | | | | | | | The pid field is a duplicate of the serial_number field and has been scheduled for removal for a long time. A few drivers were still using it, so just change them to use serial_number instead. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] fix scsi_is_sdev_device() after switch to default sdev attributesKay Sievers2007-10-121-1/+1
| | | | | Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] ips: Update version informationBernhard Walle2007-10-122-7/+8
| | | | | | | | | | | | This patch just makes the version number in ips.c and ips.h consistent. It seems that this has been forgotten in a60768e2d43eb30a1adb8a119aeac35dc0d03ef6. It also removes code duplication, each number is now only once in the code to avoid similar errors in the future. Signed-off-by: Bernhard Walle <bwalle@suse.de> Acked-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] ips: Close narrow race in releaseMatthew Wilcox2007-10-121-1/+2
| | | | | | | | | We were releasing the IRQ before removing the host, so commands could still be coming in which would never be seen by the interrupt handler. Just remove the host before releasing the IRQ to close this race. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] aic94xx: Free scsi host on errorMatthew Wilcox2007-10-121-8/+9
| | | | | | | | | If an error occurred during initialisation, we would sometimes fail to call scsi_host_put() and thus end up with a leaked scsi_host. It was also possible to miss calling scsi_remove_host(). Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] simscsi: Free scsi host on errorMatthew Wilcox2007-10-121-2/+7
| | | | | | | | If scsi_add_host returned an error, the host would never be freed. We need to call scsi_host_put() if an error happens. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qlogicfas: Close narrow race in releaseMatthew Wilcox2007-10-121-1/+1
| | | | | | | | | We were releasing the IRQ before removing the host, so commands could still be coming in which would never be seen by the interrupt handler. Just remove the host before releasing the IRQ to close this race. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] aha152x: Close narrow race in releaseMatthew Wilcox2007-10-121-2/+2
| | | | | | | | | We were releasing the IRQ before removing the host, so commands could still be coming in which would never be seen by the interrupt handler. Just remove the host before releasing the IRQ to close this race. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] ncr53c8xx: Call scsi_host_put in releaseMatthew Wilcox2007-10-122-8/+5
| | | | | | | | | | | | | | Since ncr53c8xx_attach() calls scsi_host_put(), make ncr53c8xx_release() call scsi_host_put() too, for symmetry. Both callers already expect it to put the host for them, so that works out nicely. While the zalon driver does 'use' the host pointer afterwards, it only compares it for equality and doesn't dereference it, so that's safe. While I'm at it, get rid of pointless checks for NULL, use shost_priv() and change ncr53c8xx_release to return void. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] ide-scsi: Close narrow race in releaseMatthew Wilcox2007-10-121-1/+1
| | | | | | | | | We were releasing the block devices before removing the host, so commands could still be coming in which would cause a panic. Just remove the host before releasing the block devices to close this race. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] ibmmca: Stop leaking scsi_hosts on exitMatthew Wilcox2007-10-121-0/+1
| | | | | | | | There was a missing call to scsi_host_put() causing us to leak a scsi host every time this module was unloaded. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] scsi_scan: Cope with kthread_run failingMatthew Wilcox2007-10-121-1/+4
| | | | | | | | | If kthread_run failed, we would fail to scan the host, and leak the allocated async_scan_data. Since using a separate thread is just an optimisation, do the scan synchronously if we fail to spawn a thread. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] Improve error message when offlining a deviceMatthew Wilcox2007-10-121-3/+2
| | | | | | | | | | | | | The current code prints: scsi 13:0:4:0: scsi: Device offlined - not ready after error recovery which is repetitively redundant. This patch changes that message to: scsi 6:0:6:0: Device offlined - not ready after error recovery Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] sg: use idr to replace static arraysJames Bottomley2007-10-121-141/+112
| | | | | | | | | | | | sg uses a scheme to reallocate a single contiguous array of all its pointers for lookup and management. This didn't matter too much when sg could only attach 256 nodes, but now the maximum has been bumped up to 32k we're starting to push the limits of the maximum allocatable contiguous memory. The solution to this is to eliminate the static array and do everything via idr, which this patch does. Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] osst: Use mutex instead of semaphoreMatthias Kaehlcke2007-10-122-9/+10
| | | | | | | | | | | The OnStream SCSI Tape driver uses a semaphore as mutex. Use the mutex API instead of the (binary) semaphore. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Reviewed-by: Satyam Sharma <satyam@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Willem Riede <wrlk@riede.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] arcmsr: irq handler fixes, cleanups, micro-optsJeff Garzik2007-10-121-1/+1
| | | | | | | | | | | | | | | | | | * Remove IRQF_DISABLED, it is clearly wrong for this driver. * Remove wasteful spin_lock_irqsave() in interrupt handler. The lighter-weight spin_lock() is all that's needed. * Annotate with FIXME where arcmsr_interrupt() is called without any spinlock being acquired. * Eliminate pointless cast from void pointer in arcmsr_do_interrupt() [jejb: conflict resolution] Signed-off-by: Jeff Garzik <jeff@garzik.org> Acked-by: Nick Cheng <nick.cheng@areca.com.tw> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] arcmsr: Fix hardware wait loopsJeff Garzik2007-10-121-0/+2
| | | | | | | | | | | | | | | | Remove _interruptible, since receiving a signal while waiting on a hardware condition will simply cause the driver to busy-wait. Using msleep_interruptible() is rarely the right thing to do, when waiting on a hardware condition to change. Also, replace msleep with ssleep while doing this, where appropriate. [jejb: fix up merge conflict] Signed-off-by: Jeff Garzik <jeff@garzik.org> Acked-by: Nick Cheng <nick.cheng@areca.com.tw> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Update version number to 8.02.00-k4.Andrew Vasquez2007-10-121-1/+1
| | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Limit iIDMA speed adjustments.Andrew Vasquez2007-10-121-8/+2
| | | | | | | | Do not adjust the iIDMA speed on ports which have a faster link-speed than the HBA itself. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Rework MSI-X handlers.Andrew Vasquez2007-10-121-5/+2
| | | | | | | | | | | | | | Since MSI-X vectors do not require a clearing "handshake" from the system perspective, and the registered handler will not be called more than once for one occurrence of receipt of a vector, there is no requirement to flush the risc register write clearing the interrupt condition in the risc. Also, since the msi-x registered handlers are optimised for a particular vector, it is preferable to handle the one vector received per invocation of the handler. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Clear options-flags while staging firmware-execution.Andrew Vasquez2007-10-121-1/+2
| | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Sparse cleanups in qla_mid.cAndrew Vasquez2007-10-121-32/+2
| | | | | | | | | | | Make several needlessly global functions static: - qla2x00_mark_vp_devices_dead() - qla24xx_configure_vp() Remove unused function qla24xx_modify_vport(). Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Cleanup several 'sparse' warnings.Andrew Vasquez2007-10-121-2/+2
| | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Use shost_priv().Andrew Vasquez2007-10-125-60/+58
| | | | | | | Drop usage of legacy to_qla_host() macro. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Remove unused member (list) from srb_t structure.Andrew Vasquez2007-10-121-2/+0
| | | | | | | | This change reduces by as much as 16% the memory footprint for each allocated sbr_t structure requested from the mempool. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Retrieve max-NPIV support capabilities from FW.Seokmann Ju2007-10-125-13/+22
| | | | | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Use the correct pointer-address during NVRAM writes.Andrew Vasquez2007-10-121-1/+1
| | | | | | | | Original code, incorrectly passed the address-of a pointer rather than the pointer value itself. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] qla2xxx: Set correct attribute count during FDMI RPA.Andrew Vasquez2007-10-122-3/+5
| | | | | | | | Also remove legacy '/proc' name during OS_DEVICE_NAME registration. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>