aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2008-03-03[SCSI] tgt: fix build errors when dprintk is definedFUJITA Tomonori
drivers/scsi/ibmvscsi/ibmvstgt.c: In function 'ibmvstgt_cmd_done': drivers/scsi/ibmvscsi/ibmvstgt.c:292: error: 'cmd' undeclared (first use in this function) drivers/scsi/ibmvscsi/ibmvstgt.c:292: error: (Each undeclared identifier is reported only once drivers/scsi/ibmvscsi/ibmvstgt.c:292: error: for each function it appears in.) Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] tgt: set the data length properlyFUJITA Tomonori
scsi_tgt uses REQ_TYPE_BLOCK_PC so scsi_init_io doesn't set the length for us. scsi_tgt needs to do it by itself. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] tgt: stop zero'ing scsi_cmndFUJITA Tomonori
The scsi midlayer allocates scsi_cmnd->sense_buffer dynamically so we can't initialize scsi_cmnd (the midlyaer does for us). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] ibmvstgt: set up scsi_host properly before __scsi_alloc_queueFUJITA Tomonori
Before calling __scsi_alloc_queue, scsi_host->shost_gendev.parent must be initialized properly. This patch moves __scsi_alloc_queue after scsi_add_host (like initiator drivers do). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] docbook: fix fusion source filesRandy Dunlap
Fix docbook problems in fusion source files. These cause the generated docbook to be incorrect. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] docbook: fix scsi source fileRandy Dunlap
Fix docbook problem in SCSI source files. These cause the generated docbook to be incorrect. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] qla2xxx: Update version number to 8.02.00-k9.Andrew Vasquez
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] qla2xxx: Correct usage of inconsistent timeout values while issuing ↵Andrew Vasquez
ELS commands. The original code would incorrectly hardcode ELS timeout values rather than using the traditional '2 * r_a_tov' value. In some cases, the hardcoded values would be larger than the mailbox-command-timeout and result in a needless BIG_HAMMER (ISP reset), the typical recovery mechanism employed in such cases. The second defect in the original code was in the assignment of the default 'ha->r_a_tov' to twice the traditional value. Correct this by setting the value to 10 seconds. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] qla2xxx: Correct discrepancies during OVERRUN handling on ↵Andrew Vasquez
FWI2-capable cards. For recent ISPs, software must detect OVERRUN conditions by checking the SS_RESIDUAL_OVER bit during CS_COMPLETE handling. Update the driver to perform this check, which is consistent with what earlier firmwares did by explicitly cracking open the FCP_RSP statuses and returning an CS_DATA_OVERRUN. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] qla2xxx: Correct needless clean-up resets during shutdown.Andrew Vasquez
There's no point in hitting the RISC with what will most assuredly be an unsucessful reset of the RISC hardware if the initial stop-firmware mailbox command fails with a time-out status. Instead, to avoid what could amount to a lengthy stop-firmware/detect-failure/reset-risc loop, continue with driver unloading and discard the stop-firmware requirement. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] arcmsr: update version and changelogNick Cheng
The fix up from Daniel Drake for replacing GFP_DMA with something more sensible has gone in here: commit 69e562c234440fb7410877b5b24f4b29ef8521d1 Author: Daniel Drake <dsd@gentoo.org> Date: Wed Feb 20 13:29:05 2008 +0000 [SCSI] arcmsr: fix message allocation add a change log and update the version for this. Signed-off-by: Nick Cheng <nick.cheng@areca.com.tw> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] ps3rom: disable clusteringFUJITA Tomonori
ps3rom does: scsi_for_each_sg(cmd, sgpnt, scsi_sg_count(cmd), k) { kaddr = kmap_atomic(sg_page(sgpnt), KM_IRQ0); We cannot do something like that with the clustering enabled (or we can use scsi_kmap_atomic_sg). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-03-03[SCSI] ps3rom: fix wrong resid calculation bugFUJITA Tomonori
sg driver rounds up the length in struct scatterlist to be a multiple of 512 in some conditions. So LLDs can't use the data length in a sg list to calculate residual. Instead, the length in struct scsi_cmnd should be used. [Geert: the variable buflen already contains scsi_bufflen(cmd)] Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-29[SCSI] mvsas: fix phy sas addressKe Wei
The phy sas address is showing wrongly (wrong endianness). Fix up the endian transforms to make this correct. Signed-off-by: Ke Wei <kewei@marvell.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-27[SCSI] gdth: fix to internal commands executionBoaz Harrosh
The recent patch named: [SCSI] gdth: !use_sg cleanup and use of scsi accessors has done a bad job in handling internal commands issued by gdth_execute(). Internal commands are issued with device gdth_cmd_str ready made directly to the card, without any mapping or translations of scsi commands. So here I added a gdth_cmd_str pointer to the gdth_cmndinfo private structure which is then copied directly to host. following this patch is a cleanup that removes the home cooked accessors and reverts them to regular scsi_cmnd accessors. Since they are not used anymore. After review maybe the 2 patches should be squashed together. FIXME: There is still a problem with gdth_get_info(). as reported there is a WARN_ON trigerd in dma_free_coherent() when doing: $ cat /proc/sys/gdth/0 Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Tested-by: Joerg Dorchain: <joerg@dorchain.net> Tested-by: Stefan Priebe <s.priebe@allied-internet.ag> Tested-by: Jon Chelton <jchelton@ffpglobal.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-27[SCSI] gdth: bugfix for the at-exit problemsBoaz Harrosh
gdth_exit would first remove all cards then stop the timer and would not sync with the timer function. This caused a crash in gdth_timer() when module was unloaded. So del_timer_sync the timer before we delete the cards. also the reboot notifier function would crash. So clean that up and fix the crashes. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Tested-by: Joerg Dorchain: <joerg@dorchain.net> Tested-by: Stefan Priebe <s.priebe@allied-internet.ag> Tested-by: Jon Chelton <jchelton@ffpglobal.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-27[SCSI] iscsi regression: check for zero max session cmdsMike Christie
The old tools did not set max session cmds. This is a regression. I removed the check when merging the power of 2 patch. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-24[SCSI] aic94xx: fix TMF ascb handling to prevent sequencer panicJames Bottomley
This is a particularly nasty bug. The problem is that if any internal ascb times out, currently we free it even though it's pending at the sequencer. This results in the sequencer getting terminally confused and the error message: BUG:sequencer:dl:no ascb Being returned when it comes back. The way to fix this is to manage freeing the ascb from the tasklet completion routine, so that we only free it when the sequencer actually returns it. The code is also altered to use on stack completions and transfer variables. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23[SCSI] libsas: misc fixes to the eh pathJames Bottomley
- Correct one use after free of the sas task - update the reset required path to move straight to LUN reset - make the bigger hammer actually reset something instead of just trying to clear all the tasks. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23[SCSI] libsas: use the supplied address for SATA devices rather than changing itJames Bottomley
Once the phy reset is plumbed in properly, SATA error handling fails nastily because we change the port attached_sas_address using the WWN field of the IDENTIFY message. This is a nice thing to do in theory, but it really destroys hotplug because any event on the port causes an automatic mismatch between the sas_address the phy just picked up and the one we propagate into the port. However ugly they are, we have to stick with the sas addresses made up by the phys and expanders. Also does a few cosmetic changes to the way port printing is done to make it clearer how a port is formed. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23[SCSI] aic94xx: plumb in I_T_nexus_reset task management functionJames Bottomley
Currently aic94xx has no exported I_T_nexus_reset function. This is a bit of a huge problem, since sas_ata relies on this function to perform an ATA phy reset and also it means that if abort fails, we really have no bigger hammer to hit everything with. Plumb in the I_T_nexus_reset by quiescing the sequencer, sending the correct phy reset (link for ATA and hard for SAS) and then carefully resuming the sequencer again. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23[SCSI] libsas: export sas_find_local_phy functionJames Bottomley
This is needed by the to be added I_T reset function in aic94xx. It needs to know the local phy so it can send a link or hard reset along the path. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23[SCSI] mvsas: remove execute permission from fileJames Bottomley
mvsas.c picked up execute permissions. Move it back to being a plane old file. James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23mvsas: fix build warning, clean prototypesJeff Garzik
- Fix build 'make randconfig' build warning spotted by Toralf Foerster: drivers/scsi/mvsas.c: In function 'mvs_hexdump': drivers/scsi/mvsas.c:715: error: implicit declaration of function 'isalnum' - Remove unneeded prototypes (spotted by hch) Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23dmi: prevent linked list corruptionJean Delvare
Adding the same item to a given linked list more than once is guaranteed to break and corrupt the list. This is however what we do in dmi_scan since commit 79da4721117fcf188b4b007b775738a530f574da ("x86: fix DMI out of memory problems"). Given that there is absolutely no interest in saving empty OEM strings anyway, I propose the simple and efficient fix below: we discard the empty OEM strings altogether. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Parag Warudkar <parag.warudkar@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23drivers/video/uvesafb.c: fix section mismatch warning in param_set_scroll()Sergio Luis
Fix following warnings: WARNING: drivers/video/built-in.o(.text+0x7c64a): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/video/built-in.o(.text+0x7c65d): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/video/built-in.o(.text+0x7c679): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/video/built-in.o(.text+0x7c699): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/video/built-in.o(.text+0x7c69f): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/built-in.o(.text+0xa3676): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/built-in.o(.text+0xa3689): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/built-in.o(.text+0xa36a5): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/built-in.o(.text+0xa36c5): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: drivers/built-in.o(.text+0xa36cb): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: vmlinux.o(.text+0x4a079a): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: vmlinux.o(.text+0x4a07ad): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: vmlinux.o(.text+0x4a07c9): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: vmlinux.o(.text+0x4a07e9): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan WARNING: vmlinux.o(.text+0x4a07ef): Section mismatch in reference from the function param_set_scroll() to the variable .devinit.data:ypan Remove __devinitdata annotation from the variable ypan. Signed-off-by: Sergio Luis <sergio@larces.uece.br> Cc: Michal Januszewski <spock@gentoo.org> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23NBD: make nbd default to deadline I/O schedulerPaul Clements
NBD doesn't work well with CFQ (or AS) schedulers, so let's default to something else. The two problems I have experienced with nbd and cfq are: 1) nbd hangs with cfq on RHEL 5 (2.6.18) -- this may well have been fixed There's a similar debian bug that has been filed as well: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447638 There have been posts to nbd-general mailing list about problems with cfq and nbd also. 2) nbd performs about 10% better (the last time I tested) with deadline vs. cfq (the overhead of cfq doesn't provide much advantage to nbd [not being a real disk], and you end up going through the I/O scheduler on the nbd server anyway, so it makes sense that deadline is better with nbd) Signed-off-by: Paul Clements <paul.clements@steeleye.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23dmi: don't save the same device twiceJean Delvare
Now that we gather on-board devices from both DMI types 10 and 41, there is a possibility that we list the same device twice. In order to not confuse drivers, and also to save memory, make sure that we do not add duplicate devices to the dmi_devices list. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23rtc-cmos: display HPET emulation modeDavid Brownell
For the "cmos" RTC, have /proc/driver/rtc say whether HPET based IRQ emulation is in effect. Given the problems we've had with this particular hardware maldesign (and the fact that most BIOS code seems not to provide the IRQ routing needed to use the saner HPET modes), this should help troubleshooting. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23spi: pxa2xx_spi clock polarity fixNed Forrester
Fixes a sequencing bug in spi driver pxa2xx_spi.c in which the chip select for a transfer may be asserted before the clock polarity is set on the interface. As a result of this bug, the clock signal may have the wrong polarity at transfer start, so it may need to make an extra half transition before the intended clock/data signals begin. (This probably means all transfers are one bit out of sequence.) This only occurs on the first transfer following a change in clock polarity in systems using more than one more than one such polarity. The fix assures that the clock mode is properly set before asserting chip select. This bug was introduced in a patch merged on 2006/12/10, kernel 2.6.20. The patch defines an additional bit in: include/asm-arm/arch-pxa/regs-ssp.h for 2.6.25 and newer kernels but this addition must be made in: include/asm-arm/arch-pxa/pxa-regs.h for kernels between 2.6.20 and 2.6.24, inclusive Signed-off-by: Ned Forrester <nforrester@whoi.edu> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23atmel_spi: fix clock polarityAtsushi Nemoto
The atmel_spi driver does not initialize clock polarity correctly (except for at91rm9200 CS0 channel) in some case. The atmel_spi driver uses gpio-controlled chipselect. OTOH spi clock signal is controlled by CSRn.CPOL bit, but this register controls clock signal correctly only in 'real transfer' duration. At the time of cs_activate() call, CSRn.CPOL will be initialized correctly, but the controller do not know which channel is to be used next, so clock signal will stay at the inactive state of last transfer. If clock polarity of new transfer and last transfer was differ, new transfer will start with wrong clock signal state. For example, if you started SPI MODE 2 or 3 transfer after SPI MODE 0 or 1 transfer, the clock signal state at the assertion of chipselect will be low. Of course this will violates SPI transfer. This patch is short term solution for this problem. It makes all CSRn.CPOL match for the transfer before activating chipselect. For longer term, the best fix might be to let NPCS0 stay selected permanently in MR and overwrite CSR0 with to the new slave's settings before asserting CS. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23atmel_serial: fix interrupt handler return valueHaavard Skinnemoen
We should only return IRQ_HANDLED when we actually found something to handle. This is important since the USART interrupt handler may be shared with the timer interrupt on some chips. Pointed-out-by: michael <trimarchi@gandalf.sssup.it> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23copyright owner and author clean up for intel iommu and related filesmark gross
The following is a clean up and correction of the copyright holding entities for the files associated with the intel iommu code. Signed-off-by: <mgross@linux.intel.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (25 commits) [SCSI] qlogicpt: section fixes [SCSI] mvsas: convert from rough draft to working driver [SCSI] mvsas: Add Marvell 6440 SAS/SATA driver [SCSI] libsas: correctly flush the LU queue on error recovery [SCSI] aic94xx: fix sequencer hang on error recovery [SCSI] st: compile fix when DEBUG set to one [SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccb [SCSI] stex: stex_direct_copy shouldn't call dma_map_sg [SCSI] lpfc: Balance locking [SCSI] qla4xxx: fix up residual handling [SCSI] libsas: fix error handling [SCSI] arcmsr: fix message allocation [SCSI] mptbase: fix use-after-free's [SCSI] iscsi transport: make 2 functions static [SCSI] lpfc: make lpfc_disable_node() static [SCSI] ips: fix data buffer accessors conversion bug [SCSI] gdth: don't call pci_free_consistent under spinlock [SCSI] qla2xxx: fix compile warning for printk format [SCSI] aic7xx: mitigate HOST_MSG_LOOP invalid SCB ff panic [SCSI] scsi_debug: disable clustering ...
2008-02-23PM: Introduce PM_EVENT_HIBERNATE callback stateRafael J. Wysocki
During the last step of hibernation in the "platform" mode (with the help of ACPI) we use the suspend code, including the devices' ->suspend() methods, to prepare the system for entering the ACPI S4 system sleep state. But at least for some devices the operations performed by the ->suspend() callback in that case must be different from its operations during regular suspend. For this reason, introduce the new PM event type PM_EVENT_HIBERNATE and pass it to the device drivers' ->suspend() methods during the last phase of hibernation, so that they can distinguish this case and handle it as appropriate. Modify the drivers that handle PM_EVENT_SUSPEND in a special way and need to handle PM_EVENT_HIBERNATE in the same way. These changes are necessary to fix a hibernation regression related to the i915 driver (ref. http://lkml.org/lkml/2008/2/22/488). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Tested-by: Jeff Chua <jeff.chua.linux@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-23[SCSI] qlogicpt: section fixesAdrian Bunk
In current mainline, __devinit qpti_sbus_probe() still is calling __init qpti_chain_add(). Change occurrences of __init to __devinit to fix. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23[SCSI] mvsas: convert from rough draft to working driverKe Wei
Convert rough draft Marvell 6440 driver to a working driver. Added support for SAS and SATA devices, hotplug, wide port, and expanders. Signed-off-by: Ke Wei <kewei@marvell.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-23[SCSI] mvsas: Add Marvell 6440 SAS/SATA driverJeff Garzik
Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22i915: fix AR register restore.Jesse Barnes
Make sure the restoration correctly restores the AR registers by flipping the ARX register into index mode before doing anything. Without this, some people have had the text mode restore all green. Signed-off-by: Jesse Barnes <jesse.barnes@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-22[SCSI] libsas: correctly flush the LU queue on error recoveryJames Bottomley
The current sas_scsi_clear_queue_lu() is wrongly checking for commands which match the pointer to the one passed in. It should be checking for commands which are on the same logical unit as the one passed in. Fix this by checking target pointer and LUN for equality. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] aic94xx: fix sequencer hang on error recoveryJames Bottomley
The clear nexus I_T and clear nexus I_T_L functions in the aic94xx specify the SUSPEND_TX flag which causes the sequencer to be suspended until it receives a RESUME_TX. Unfortunately, nothing ever sends the resume, so the sequencer on the link is stopped forever, leading to eventual timeouts and I/O errors. Since clear nexus commands are only executed as part of error recovery, it's perfectly fine to keep the sequencer running on the link ... as soon as the recovery function is completed, we'll send it the commands to retry. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] st: compile fix when DEBUG set to oneKai Makisara
Remove the now useless counting of adjacent pages from the debugging code in to make it compile when DEBUG is set non-zero. Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] stex: stex_internal_copy should be called with sg_count in struct st_ccbFUJITA Tomonori
stex_internal_copy copies an in-kernel buffer to a sg list by using scsi_kmap_atomic_sg. Some functions calls stex_internal_copy with sg_count in struct st_ccb, which is the value that dma_map_sg returned. However it might be shorter than the actual number of sg entries (if the IOMMU merged the sg entries). scsi_kmap_atomic_sg doesn't see sg->dma_length so stex_internal_copy should be called with the actual number of sg entries (i.e. scsi_sg_count), because if the sg entries were merged, stex_direct_copy wrongly think that the data length in the sg list is shorter than the actual length. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] stex: stex_direct_copy shouldn't call dma_map_sgFUJITA Tomonori
stex_direct_copy copies an in-kernel buffer to a sg list in order to spoof some SCSI commands. stex_direct_copy calls dma_map_sg and then stex_internal_copy with the value that dma_map_sg returned. It calls scsi_kmap_atomic_sg to copy data. scsi_kmap_atomic_sg doesn't see sg->dma_length so if dma_map_sg merges sg entries, stex_internal_copy gets the smaller number of sg entries than the acutual number, which means it wrongly think that the data length in the sg list is shorter than the actual length. stex_direct_copy shouldn't call dma_map_sg and it doesn't need since this code path doesn't involve dma transfers. This patch removes stex_direct_copy and simply calls stex_internal_copy with the actual number of sg entries. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Ed Lin <ed.lin@promise.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] lpfc: Balance lockingMatthew Wilcox
Commit 3163f725a5d071eea1830bbbfab78cfe3fc9baaf introduced locking in lpfc_sli_hbqbuf_fill_hbqs, but missed unlocking on one exit. Reported-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] qla4xxx: fix up residual handlingDavid Somayajulu
the check in the residual case has an incorrect test of scsi_status (the logic is reversed, it should be scsi_status != 0 instead of !scsi_status. Since we checked a few lines above that scsi_status was non-zero, just eliminate this test Signed-off-by: David C Somayajulu <david.somayajulu@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] libsas: fix error handlingJames Bottomley
The libsas error handler has two fairly fatal bugs 1. scsi_sas_task_done calls scsi_eh_finish_cmd() too early. This happens if the task completes after it has been aborted but before the error handler starts up. Because scsi_eh_finish_cmd() decrements host_failed and adds the task to the done list, the error handler start check (host_failed == host_busy) never passes and the eh never starts. 2. The multiple task completion paths sas_scsi_clear_queue_... all simply delete the task from the error queue. This causes it to disappear into the ether, since a command must be placed on the done queue to be finished off by the error handler. This behaviour causes the HBA to hang on pending commands. Fix 1. by moving the SAS_TASK_STATE_ABORTED check to an exit clause at the top of the routine and calling ->scsi_done() unconditionally (it is a nop if the timer has fired). This keeps the task in the error handling queue until the eh starts. Fix 2. by making sure every task goes through task complete followed by scsi_eh_finish_cmd(). Tested this by firing resets across a disk running a hammer test (now it actually survives without hanging the system) Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] arcmsr: fix message allocationDaniel Drake
arcmsr_iop_message_xfer() is called from atomic context under the queuecommand scsi_host_template handler. James Bottomley pointed out that the current GFP_KERNEL|GFP_DMA flags are wrong: firstly we are in atomic context, secondly this memory is not used for DMA. Also removed some unneeded casts. Signed-off-by: Daniel Drake <dsd@gentoo.org> Cc: Nick Cheng <nick.cheng@areca.com.tw> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] mptbase: fix use-after-free'sAdrian Bunk
ioc->name is used in the printk's after ioc has been freed. Free after prinks to fix this. This patch fixes two use-after-free's introduced by commit e78d5b8f1e73ab82f3fd041d05824cfee7d83a2c and spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-02-22[SCSI] iscsi transport: make 2 functions staticAdrian Bunk
This patch makes the following needlessly global functions static: - __iscsi_unblock_session() - iscsi_session_state_name() Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>