aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_ata.c
Commit message (Collapse)AuthorAgeFilesLines
* more driver stuff from 3.2.72Wolfgang Wiedmeyer2015-10-231-7/+7
|
* [SCSI] libsas: Add option for SATA soft resetDave Jiang2011-05-261-1/+39
| | | | | | | | | | | This allows a libsas driver to optionally provide a soft reset handler for libata to drive. The isci driver allows software to control the assertion/deassertion of SRST. [jejb: checkpatch.pl fixes] Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
* [SCSI] libsas: fix SATA NCQ errorXiangliang Yu2011-05-241-2/+18
| | | | | | | | Current version of libsas can not handle SATA NCQ error. This patch handle SATA NCQ error as AHCI do. Signed-off-by: Xiangliang Yu <yuxiangl@marvell.com> Signed-off-by: James Bottomley <jbottomley@parallels.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2011-03-171-58/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (170 commits) [SCSI] scsi_dh_rdac: Add MD36xxf into device list [SCSI] scsi_debug: add consecutive medium errors [SCSI] libsas: fix ata list corruption issue [SCSI] hpsa: export resettable host attribute [SCSI] hpsa: move device attributes to avoid forward declarations [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26) [SCSI] sd: Logical Block Provisioning update [SCSI] Include protection operation in SCSI command trace [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try) [SCSI] target: Fix volume size misreporting for volumes > 2TB [SCSI] bnx2fc: Broadcom FCoE offload driver [SCSI] fcoe: fix broken fcoe interface reset [SCSI] fcoe: precedence bug in fcoe_filter_frames() [SCSI] libfcoe: Remove stale fcoe-netdev entries [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h [SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out" [SCSI] libfc: Fixing a memory leak when destroying an interface [SCSI] megaraid_sas: Version and Changelog update ... Fix up trivial conflicts due to whitespace differences in drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}
| * [SCSI] libsas: fix ata list corruption issueJames Bottomley2011-03-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think this stems from a misunderstanding of how the ata error handler works. ata_scsi_cmd_error_handler() gets called with a passed in list of commands to handle. However, that list may still not be empty when it exits. The command ata_scsi_port_error_handler() must be called (which takes no list) before the list will be completely emptied. This bites the sas error handler because the two are called from different functions and the original list has gone out of scope before ata_scsi_port_error_handler() is called. leading to some commands dangling on bare stack, which is a potential memory corruption issue. Fix this by manually deleting all outstanding commands from the on-stack list before it goes out of scope. Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] libsas: convert to libata new error handlerJames Bottomley2011-02-131-6/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conversion is quite complex given that the libata new error handler has to be hooked into the current libsas timeout and error handling. The way this is done is to process all the failed commands via libsas first, but if they have no underlying sas task (and they're on a sata device) assume they are destined for the libata error handler and send them accordingly. Finally, activate the port recovery of the libata error handler for each port known to the host. This is somewhat suboptimal, since that port may not need recovering, but given the current architecture of the libata error handler, it's the only way; and the spurious activation is harmless. Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] libsas: remove spurious sata control register read/writeJames Bottomley2011-01-241-51/+0
| | | | | | | | | | | | | | | | | | Originally, libata required the illusion that it could access the sata control register. Now, however, it can run perfectly well without them, so remove the dummy routines from libsas which tried to emulate them (but only ended up causing confusion). Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| * [SCSI] libsas: fix ATAPI check condition terminationJames Bottomley2011-01-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | ATAPI check condition needs to be treated the same as a success or protocol return. The register returns from the PACKET command are all correctly positioned in the device to host register FIS and so we should collect them properly. Right at the moment this doesn't matter because libata sends a request sense always for ATAPI errors, but if it ever checked the registers, we should have the correct contents just in case. Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* | libata: remove ATA_FLAG_NO_LEGACYSergei Shtylyov2011-03-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | All checks of ATA_FLAG_NO_LEGACY have been removed by the commits c791c30670ea61f19eec390124128bf278e854fe ([libata] minor PCI IDE probe fixes and cleanups) and f0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (libata: update libata core layer to use devres), so I think it's time to finally get rid of this flag... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* | libata: remove ATA_FLAG_MMIOSergei Shtylyov2011-03-021-2/+2
| | | | | | | | | | | | | | | | | | Commit 0d5ff566779f894ca9937231a181eb31e4adff0e (libata: convert to iomap) removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself. Do it now, at last... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* | libata: remove ATA_FLAG_{SRST|SATA_RESET}Sergei Shtylyov2011-03-021-2/+2
| | | | | | | | | | | | | | | | | | These flags are marked as obsolete and the checks for them have been removed by commit 294440887b32c58d220fb54b73b7a58079b78f20 (libata-sff: kill unused ata_bus_reset()), so I think it's time to finally get rid of them... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* | ipr/sas_ata: use mode mask macros from <linux/ata.h>Sergei Shtylyov2011-03-021-2/+2
| | | | | | | | | | | | | | | | | | Commit 14bdef982caeda19afe34010482867c18217c641 ([libata] convert drivers to use ata.h mode mask defines) didn't convert these two libata driver outside drivers/ata/... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* | libsas: convert to libata new error handlerJames Bottomley2011-03-021-6/+81
|/ | | | | | | | | | | | | | | | | | The conversion is quite complex given that the libata new error handler has to be hooked into the current libsas timeout and error handling. The way this is done is to process all the failed commands via libsas first, but if they have no underlying sas task (and they're on a sata device) assume they are destined for the libata error handler and send them accordingly. Finally, activate the port recovery of the libata error handler for each port known to the host. This is somewhat suboptimal, since that port may not need recovering, but given the current architecture of the libata error handler, it's the only way; and the spurious activation is harmless. Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* [SCSI] libsas: Don't issue commands to devices that have been hot-removedDarrick J. Wong2010-10-081-0/+4
| | | | | | | | | | | | | | | sd will get hung up issuing commands to flush write cache if a SAS device behind the expander is unplugged without warning. Change libsas to reject commands to domain devices that have already gone away. [maciej.trela@intel.com: removed setting ->gone in sas_deform_port() to permit sync cache commands at module removal] Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Tested-by: Haipao Fan <haipao.fan@intel.com> Signed-off-by: Maciej Trela <maciej.trela@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] libsas: fix NCQ mixing with non-NCQDavid Milburn2010-10-071-0/+1
| | | | | | | | | | | Some cards (like mvsas) have issue troubles if non-NCQ commands are mixed with NCQ ones. Fix this by using the libata default NCQ check routine which waits until all NCQ commands are complete before issuing a non-NCQ one. The impact to cards (like aic94xx) which don't need this logic should be minimal Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] Unify SAM_ and SAM_STAT_ macrosJames Bottomley2010-07-281-6/+6
| | | | | | | | | | | We have two separate definitions for identical constants with nearly the same name. One comes from the generic headers in scsi.h; the other is an enum in libsas.h ... it's causing confusion about which one is correct (fortunately they both are). Fix this by eliminating the libsas.h duplicate Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] libsas: fix deref before check in commit 70b25f890ceJames Bottomley2010-05-161-2/+3
| | | | | | | | | | | | | | | | commit 70b25f890ce9f0520c64075ce9225a5b020a513e Author: Tejun Heo <tj@kernel.org> Date: Thu Apr 15 09:00:08 2010 +0900 [SCSI] fix locking around blk_abort_request() Introduced a reference before check problem, fix this by moving the lock shorthand code to be right at the point of actual use. Reported-by: Dan Carpenter <error27@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* [SCSI] fix locking around blk_abort_request()Tejun Heo2010-05-011-0/+4
| | | | | | | | | | | | blk_abort_request() expects queue lock to be held by the caller. Grab it before calling the function. Lack of this synchronization led to infinite loop on corrupt q->timeout_list. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: stable@kernel.org Signed-off-by: James Bottomley <James.Bottomley@suse.de>
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* Merge branch 'for-2.6.28' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds2008-10-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block: (132 commits) doc/cdrom: Trvial documentation error, file not present block_dev: fix kernel-doc in new functions block: add some comments around the bio read-write flags block: mark bio_split_pool static block: Find bio sector offset given idx and offset block: gendisk integrity wrapper block: Switch blk_integrity_compare from bdev to gendisk block: Fix double put in blk_integrity_unregister block: Introduce integrity data ownership flag block: revert part of d7533ad0e132f92e75c1b2eb7c26387b25a583c1 bio.h: Remove unused conditional code block: remove end_{queued|dequeued}_request() block: change elevator to use __blk_end_request() gdrom: change to use __blk_end_request() memstick: change to use __blk_end_request() virtio_blk: change to use __blk_end_request() blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure block: add lld busy state exporting interface block: Fix blk_start_queueing() to not kick a stopped queue include blktrace_api.h in headers_install ...
| * block: unify request timeout handlingJens Axboe2008-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Right now SCSI and others do their own command timeout handling. Move those bits to the block layer. Instead of having a timer per command, we try to be a bit more clever and simply have one per-queue. This avoids the overhead of having to tear down and setup a timer for each command, so it will result in a lot less timer fiddling. Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* | libata: make SCR access ops per-linkTejun Heo2008-09-291-4/+4
|/ | | | | | | | | | | | | Logically, SCR access ops should take @link; however, there was no compelling reason to convert all SCR access ops when adding @link abstraction as there's one-to-one mapping between a port and a non-PMP link. However, that assumption won't hold anymore with the scheduled addition of slave link. Make SCR access ops per-link. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* [SCSI] replace __FUNCTION__ with __func__Harvey Harrison2008-07-271-8/+8
| | | | | | | | | | | | [jejb: fixed up a ton of missed conversions. All of you are on notice this has happened, driver trees will now need to be rebased] Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Cc: SCSI List <linux-scsi@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2008-04-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (137 commits) [SCSI] iscsi: bidi support for iscsi_tcp [SCSI] iscsi: bidi support at the generic libiscsi level [SCSI] iscsi: extended cdb support [SCSI] zfcp: Fix error handling for blocked unit for send FCP command [SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock [SCSI] zfcp: fix 31 bit compile warnings [SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands [SCSI] bsg: remove minor in struct bsg_device [SCSI] bsg: use better helper list functions [SCSI] bsg: replace kobject_get with blk_get_queue [SCSI] bsg: takes a ref to struct device in fops->open [SCSI] qla1280: remove version check [SCSI] libsas: fix endianness bug in sas_ata [SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next) [SCSI] aacraid: Do not describe check_reset parameter with its value [SCSI] aacraid: Fix down_interruptible() to check the return value [SCSI] sun3_scsi_vme: add MODULE_LICENSE [SCSI] st: rename flush_write_buffer() [SCSI] tgt: use KMEM_CACHE macro [SCSI] initio: fix big endian problems for auto request sense ...
| * [SCSI] libsas: fix endianness bug in sas_ataAl Viro2008-04-171-1/+1
| | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* | libata: kill ata_noop_dev_select()Tejun Heo2008-04-171-1/+0
| | | | | | | | | | | | | | | | | | Now that SFF assumptions are separated out from non-SFF reset sequence, port_ops->sff_dev_select() is no longer necessary for non-SFF controllers. Kill ata_noop_dev_select() and ->sff_dev_select initialization from base and other non-SFF port_ops. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | libata: remove check_status from non-SFF driversTejun Heo2008-04-171-8/+0
| | | | | | | | | | | | | | | | Now that all SFF stuff is separated out of core layer, core layer doesn't call ops->[alt_]check_status(). In fact, no one calls them for non-SFF drivers anymore. Kill them. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | libata: replace tf_read with qc_fill_rtf for non-SFF driversTejun Heo2008-04-171-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all SFF stuff is separated out of core layer, core layer doesn't call ops->tf_read directly. It gets called only via ops->qc_fill_rtf() for non-SFF drivers. This patch directly implements private ops->qc_fill_rtf() for non-SFF controllers and kill ops->tf_read(). This is much cleaner for non-SFF controllers as some of them have to cache SFF register values in private data structure and report the cached values via ops->tf_read(). Also, ops->tf_read() gets nasty for controllers which don't have clear notion of TF registers when operation is not in progress. As this change makes default ops->qc_fill_rtf unnecessary, move ata_sff_qc_fill_rtf() form ata_base_port_ops to ata_sff_port_ops where it belongs. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | libata: add qc_fill_rtf port operationTejun Heo2008-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On command completion, ata_qc_complete() directly called ops->tf_read to fill qc->result_tf. This patch adds ops->qc_fill_rtf to replace hardcoded ops->tf_read usage. ata_sff_qc_fill_rtf() which uses ops->tf_read to fill result_tf is implemented and set in ata_base_port_ops and other ops tables which don't inherit from ata_base_port_ops, so this patch doesn't introduce any behavior change. ops->qc_fill_rtf() is similar to ops->sff_tf_read() but can only be called when a command finishes. As some non-SFF controllers don't have TF registers defined unless they're associated with in-flight commands, this limited operation makes life easier for those drivers and help lifting SFF assumptions from libata core layer. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | libata: rename SFF port opsTejun Heo2008-04-171-4/+4
|/ | | | | | | | | | Add sff_ prefix to SFF specific port ops. This rename is in preparation of separating SFF support out of libata core layer. This patch strictly renames ops and doesn't introduce any behavior difference. Signed-off-by: Tejun Heo <htejun@gmail.com>
* [SCSI] libsas: use the supplied address for SATA devices rather than changing itJames Bottomley2008-02-231-37/+2
| | | | | | | | | | | | | | | 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>
* libata: eliminate the home grown dma padding in favour ofJames Bottomley2008-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that provided by the block layer ATA requires that all DMA transfers begin and end on word boundaries. Because of this, a large amount of machinery grew up in ide to adjust scatterlists on this basis. However, as of 2.5, the block layer has a dma_alignment variable which ensures both the beginning and length of a DMA transfer are aligned on the dma_alignment boundary. Although the block layer does adjust the beginning of the transfer to ensure this happens, it doesn't actually adjust the length, it merely makes sure that space is allocated for transfers beyond the declared length. The upshot of this is that scatterlists may be padded to any size between the actual length and the length adjusted to the dma_alignment safely knowing that memory is allocated in this region. Right at the moment, SCSI takes the default dma_aligment which is on a 512 byte boundary. Note that this aligment only applies to transfers coming in from user space. However, since all kernel allocations are automatically aligned on a minimum of 32 byte boundaries, it is safe to adjust them in this manner as well. tj: * Adjusting sg after padding is done in block layer. Make libata set queue alignment correctly for ATAPI devices and drop broken sg mangling from ata_sg_setup(). * Use request->raw_data_len for ATAPI transfer chunk size. * Killed qc->raw_nbytes. * Separated out killing qc->n_iter. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2008-01-251-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits) [SCSI] usbstorage: use last_sector_bug flag universally [SCSI] libsas: abstract STP task status into a function [SCSI] ultrastor: clean up inline asm warnings [SCSI] aic7xxx: fix firmware build [SCSI] aacraid: fib context lock for management ioctls [SCSI] ch: remove forward declarations [SCSI] ch: fix device minor number management bug [SCSI] ch: handle class_device_create failure properly [SCSI] NCR5380: fix section mismatch [SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices [SCSI] IB/iSER: add logical unit reset support [SCSI] don't use __GFP_DMA for sense buffers if not required [SCSI] use dynamically allocated sense buffer [SCSI] scsi.h: add macro for enclosure bit of inquiry data [SCSI] sd: add fix for devices with last sector access problems [SCSI] fix pcmcia compile problem [SCSI] aacraid: add Voodoo Lite class of cards. [SCSI] aacraid: add new driver features flags [SCSI] qla2xxx: Update version number to 8.02.00-k7. [SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command. ...
| * [SCSI] libsas: don't use made up error codesJames Bottomley2008-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is bad for two reasons: 1. If they're returned to outside applications, no-one knows what they mean. 2. Eventually they'll clash with the ever expanding standard error codes. The problem error code in question is ETASK. I've replaced this by ECOMM (communications error on send) a network error code that seems to most closely relay what ETASK meant. Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* | libata: convert to chained sgTejun Heo2008-01-231-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libata used private sg iterator to handle padding sg. Now that sg can be chained, padding can be handled using standard sg ops. Convert to chained sg. * s/qc->__sg/qc->sg/ * s/qc->pad_sgent/qc->extra_sg[]/. Because chaining consumes one sg entry. There need to be two extra sg entries. The renaming is also for future addition of other extra sg entries. * Padding setup is moved into ata_sg_setup_extra() which is organized in a way that future addition of other extra sg entries is easy. * qc->orig_n_elem is unused and removed. * qc->n_elem now contains the number of sg entries that LLDs should map. qc->mapped_n_elem is added to carry the original number of mapped sgs for unmapping. * The last sg of the original sg list is used to chain to extra sg list. The original last sg is pointed to by qc->last_sg and the content is stored in qc->saved_last_sg. It's restored during ata_sg_clean(). * All sg walking code has been updated. Unnecessary assertions and checks for conditions the core layer already guarantees are removed. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | libata: rename ATA_PROT_ATAPI_* to ATAPI_PROT_*Tejun Heo2008-01-231-1/+1
| | | | | | | | | | | | | | | | | | ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and ATA_PROT_ATAPI_* are inconsistent causing confusion. Rename them to ATAPI_PROT_* and make them consistent with ATA counterpart. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* | libata: implement protocol testsTejun Heo2008-01-231-1/+1
|/ | | | | | | | | Implement protocol tests - ata_is_atapi(), ata_is_nodata(), ata_is_pio(), ata_is_dma(), ata_is_ncq() and ata_is_data() and use them to replace is_atapi_taskfile() and hard coded protocol tests. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [libata] Remove ->port_disable() hookJeff Garzik2007-10-121-1/+0
| | | | | | | | It was always set to ata_port_disable(). Removed the hook, and replaced the very few ap->ops->port_disable() callsites with direct calls to ata_port_disable(). Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata-link: introduce ata_linkTejun Heo2007-10-121-5/+5
| | | | | | | | | | | | | | | | | | | Introduce ata_link. It abstracts PHY and sits between ata_port and ata_device. This new level of abstraction is necessary to support SATA Port Multiplier, which basically adds a bunch of links (PHYs) to a ATA host port. Fields related to command execution, spd_limit and EH are per-link and thus moved to ata_link. This patch only defines the host link. Multiple link handling will be added later. Also, a lot of ap->link derefences are added but many of them will be removed as each part is converted to deal directly with ata_link instead of ata_port. This patch introduces no behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [SCSI] libsas: Remove PCI dependenciesJeff Garzik2007-07-261-15/+15
| | | | | | | | Eliminate unnecessary PCI dependencies in libsas. It should use generic DMA and struct device like other subsystems. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] libsas: make ATA functions selectable by a config optionJames Bottomley2007-07-221-0/+397
| | | | | | | | Not everyone wants libsas automatically to pull in libata. This patch makes the behaviour configurable, so you can build libsas with or without ATA support. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] libsas: fix scr_read/write users and update the libata documentationJames Bottomley2007-07-201-8/+16
| | | | | | | | This fixes up the usage in libsas (which are easy to miss, since they're only in the scsi-misc tree) ... and also corrects the documentation on the point of what these two function pointers actually return. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] sas_ata: Implement sas_task_abort for ATA devicesDarrick J. Wong2007-07-181-3/+44
| | | | | | | | | | ATA devices need special handling for sas_task_abort. If the ATA command came from SCSI, then we merely need to tell SCSI to abort the scsi_cmnd. However, internal commands require a bit more work--we need to fill the qc with the appropriate error status and complete the command, and eventually post_internal will issue the actual ABORT TASK. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] sas_ata: Assign sas_task to scsi_cmnd to enable EH for ATA devicesDarrick J. Wong2007-07-181-0/+7
| | | | | | | | | | The SATL should connect the scsi_cmnd to the sas_task (despite the presence of libata) so that requests to abort scsi_cmnds headed to the ATA device can be processed by the EH and aborted correctly. The abort status should still be propagated from sas -> ata -> scsi. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] libsas: Unknown STP devices should be reported to libata as unknown.Darrick J. Wong2007-07-181-1/+1
| | | | | | | | | When libsas encounters a STP device whose protocol isn't recognized (i.e. not ATA or ATAPI), we should set the ata_device's class to ATA_DEV_UNKNOWN instead of ATA_DEV_ATA. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] libsas: Accept SAM_GOOD for ATAPI devices in sas_ata_task_doneDarrick J. Wong2007-07-181-1/+1
| | | | | | | | | A sas_task sent to an ATAPI devices returns SAM_GOOD if successful. Therefore, we should treat this the same way we treat ATA commands that succeed. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] sas_ata: Don't copy aic94xx's sactive to ata_portDarrick J. Wong2007-07-181-1/+0
| | | | | | | | | | | | | Since the aic94xx sequencer assigns its own NCQ tags to ATA commands, it no longer makes any sense to copy the sactive field in the STP response to ata_port->sactive, as that will confuse libata. Also, libata seems to be capable of managing sactive on its own. The attached patch gets rid of one of the causes of the BUG messages in ata_qc_new, and seems to work without problems on an IBM x206m. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] sas_ata: ata_post_internal should abort the sas_taskDarrick J. Wong2007-07-181-3/+27
| | | | | | | | | | | | | | | | | This patch adds a new field, lldd_task, to ata_queued_cmd so that libata users such as libsas can associate some data with a qc. The particular ambition with this patch is to associate a sas_task with a qc; that way, if libata decides to timeout a command, we can come back (in sas_ata_post_internal) and abort the sas task. One question remains: Is it necessary to reset the phy on error, or will the libata error handler take care of it? (Assuming that one is written, of course.) This patch, as it is today, works well enough to clean things up when an ATA device probe attempt fails halfway through the probe, though I'm not sure this is always the right thing to do. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] sas_ata: sas_ata_qc_issue should return AC_ERR_*Darrick J. Wong2007-07-181-6/+4
| | | | | | | | | | | | | | The sas_ata_qc_issue function was incorrectly written to return error codes such as -ENOMEM. Since libata OR's qc->err_mask with the return value, It is necessary to make my code return one of the AC_ERR_ codes instead. For now, use AC_ERR_SYSTEM because an error here means that the OS couldn't send the command to the controller. If anybody has a suggestion for a better AC_ERR_ code to use, please suggest it. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* [SCSI] sas_ata: Satisfy libata qc function locking requirementsDarrick J. Wong2007-07-181-0/+4
| | | | | | | | | | | | | | ata_qc_complete and ata_sas_queuecmd require that the port lock be held when they are called. sas_ata doesn't do this, leading to BUG messages about qc tags newly allocated qc tags already being in use. This patch fixes the locking, which should clean up the rest of those messages. So far I've tested this against an IBM x206m with two SATA disks with no BUG messages and no other signs of things going wrong, and the machine finally passed the pounder stress test. Signed-off-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>