History log of /drivers/scsi/libsas/sas_scsi_host.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
26a2e68f816ebd736a0484ca293457b280af4ef1 31-Jan-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: don't recover end devices attached to disabled phys

If userspace has decided to disable a phy the kernel should honor that
and not inadvertantly re-enable the phy via error recovery. This is
more straightforward in the sata case where link recovery (via
libata-eh) is separate from sas_task cancelling in libsas-eh. Teach
libsas to accept -ENODEV as a successful response from I_T_nexus_reset
('successful' in terms of not escalating further).

This is a more comprehensive fix then "libsas: don't recover 'gone'
devices in sas_ata_hard_reset()", as it is no longer sata-specific.

aic94xx does check the return value from sas_phy_reset() so if the phy
is disabled we proceed with clearing the I_T_nexus.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
840234745edaa82d514420dc1086e63536493a51 21-Jan-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: fix lifetime of SAS_HA_FROZEN

Until all sas_tasks are known to no longer be in-flight this flag gates late
completions from colliding with error handling. However, it must be cleared
prior to the submission of scsi_send_eh_cmnd() requests, otherwise those
commands will never be completed correctly.

This was spotted by slub debug:
=============================================================================
BUG sas_task: Objects remaining on kmem_cache_close()
-----------------------------------------------------------------------------

INFO: Slab 0xffffea001f0eba00 objects=34 used=1 fp=0xffff8807c3aecb00 flags=0x8000000000004080
Pid: 22919, comm: modprobe Not tainted 3.2.0-isci+ #2
Call Trace:
[<ffffffff810fcdcd>] slab_err+0xb0/0xd2
[<ffffffff810e1c50>] ? free_percpu+0x31/0x117
[<ffffffff81100122>] ? kzalloc+0x14/0x16
[<ffffffff81100122>] ? kzalloc+0x14/0x16
[<ffffffff81100486>] kmem_cache_destroy+0x11d/0x270
[<ffffffffa0112bdc>] sas_class_exit+0x10/0x12 [libsas]
[<ffffffff81078fba>] sys_delete_module+0x1c4/0x23c
[<ffffffff814797ba>] ? sysret_check+0x2e/0x69
[<ffffffff8126479e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff81479782>] system_call_fastpath+0x16/0x1b
INFO: Object 0xffff8807c3aed280 @offset=21120
INFO: Allocated in sas_alloc_task+0x22/0x90 [libsas] age=4615311 cpu=2 pid=12966
__slab_alloc.clone.3+0x1d1/0x234
kmem_cache_alloc+0x52/0x10d
sas_alloc_task+0x22/0x90 [libsas]
sas_queuecommand+0x20e/0x230 [libsas]
scsi_send_eh_cmnd+0xd1/0x30c
scsi_eh_try_stu+0x4f/0x6b
scsi_eh_ready_devs+0xba/0x6ef
sas_scsi_recover_host+0xa35/0xab1 [libsas]
scsi_error_handler+0x14b/0x5fa
kthread+0x9d/0xa5
kernel_thread_helper+0x4/0x10

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
9508a66f898d46e726a318469312b45e0b1d078b 19-Jan-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: async ata scanning

libsas ata error handling is already async but this does not help the
scan case. Move initial link recovery out from under host->scan_mutex,
and delay synchronization with eh until after all port probe/recovery
work has been queued.

Device ordering is maintained with scan order by still calling
sas_rphy_add() in order of domain discovery.

Since we now scan the domain list when invoking libata-eh we need to be
careful to check for fully initialized ata ports.

Acked-by: Jack Wang <jack_wang@usish.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
d230ce691c7712c4f56ba3378d6d2f44628a49f1 11-Jan-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: fix mixed topology recovery

If we have a domain with sas and sata devices there may still be sas
recovery actions to take after peeling off the commands to send to
libata.

Reported-by: Andrzej Jakowski <andrzej.jakowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
8abda4d28a55ecb91e39ceb5e3ee264c5a3cd1af 11-Jan-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: close scsi_remove_target() vs libata-eh race

ata_port lifetime in libata follows the host. In libsas it follows the
scsi_target. Once scsi_remove_device() has caused all commands to be
completed it allows scsi_remove_target() to immediately proceed to
freeing the ata_port causing bug reports like:

[ 848.393333] BUG: spinlock bad magic on CPU#4, kworker/u:2/5107
[ 848.400262] general protection fault: 0000 [#1] SMP
[ 848.406244] CPU 4
[ 848.408310] Modules linked in: nls_utf8 ipv6 uinput i2c_i801 i2c_core iTCO_wdt iTCO_vendor_support ioatdma dca sg sd_mod sr_mod cdrom ahci libahci isci libsas libata scsi_transport_sas [last unloaded: scsi_wait_scan]
[ 848.432060]
[ 848.434137] Pid: 5107, comm: kworker/u:2 Not tainted 3.2.0-isci+ #8 Intel Corporation S2600CP/S2600CP
[ 848.445310] RIP: 0010:[<ffffffff8126a68c>] [<ffffffff8126a68c>] spin_dump+0x5e/0x8c
[ 848.454787] RSP: 0018:ffff8807f868dca0 EFLAGS: 00010002
[ 848.461137] RAX: 0000000000000048 RBX: ffff8807fe86a630 RCX: ffffffff817d0be0
[ 848.469520] RDX: 0000000000000000 RSI: ffffffff814af1cf RDI: 0000000000000002
[ 848.477959] RBP: ffff8807f868dcb0 R08: 00000000ffffffff R09: 000000006b6b6b6b
[ 848.486327] R10: 000000000003fb8c R11: ffffffff81a19448 R12: 6b6b6b6b6b6b6b6b
[ 848.494699] R13: ffff8808027dc520 R14: 0000000000000000 R15: 000000000000001e
[ 848.503067] FS: 0000000000000000(0000) GS:ffff88083fd00000(0000) knlGS:0000000000000000
[ 848.512899] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 848.519710] CR2: 00007ff77d001000 CR3: 00000007f7a5d000 CR4: 00000000000406e0
[ 848.528072] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 848.536446] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 848.544831] Process kworker/u:2 (pid: 5107, threadinfo ffff8807f868c000, task ffff8807ff348000)
[ 848.555327] Stack:
[ 848.557959] ffff8807fe86a630 ffff8807fe86a630 ffff8807f868dcd0 ffffffff8126a6e0
[ 848.567072] ffffffff817c142f ffff8807fe86a630 ffff8807f868dcf0 ffffffff8126a703
[ 848.576190] ffff8808027dc520 0000000000000286 ffff8807f868dd10 ffffffff814af1bb
[ 848.585281] Call Trace:
[ 848.588409] [<ffffffff8126a6e0>] spin_bug+0x26/0x28
[ 848.594357] [<ffffffff8126a703>] do_raw_spin_unlock+0x21/0x88
[ 848.601283] [<ffffffff814af1bb>] _raw_spin_unlock_irqrestore+0x2c/0x65
[ 848.609089] [<ffffffffa001c103>] ata_scsi_port_error_handler+0x548/0x557 [libata]
[ 848.618331] [<ffffffff81061813>] ? async_schedule+0x17/0x17
[ 848.625060] [<ffffffffa004f30f>] async_sas_ata_eh+0x45/0x69 [libsas]
[ 848.632655] [<ffffffff810618aa>] async_run_entry_fn+0x97/0x125
[ 848.639670] [<ffffffff81057439>] process_one_work+0x207/0x38d
[ 848.646577] [<ffffffff8105738c>] ? process_one_work+0x15a/0x38d
[ 848.653681] [<ffffffff810576f7>] worker_thread+0x138/0x21c
[ 848.660305] [<ffffffff810575bf>] ? process_one_work+0x38d/0x38d
[ 848.667493] [<ffffffff8105b098>] kthread+0x9d/0xa5
[ 848.673382] [<ffffffff8106e1bd>] ? trace_hardirqs_on_caller+0x12f/0x166
[ 848.681304] [<ffffffff814b7704>] kernel_thread_helper+0x4/0x10
[ 848.688324] [<ffffffff814af534>] ? retint_restore_args+0x13/0x13
[ 848.695530] [<ffffffff8105affb>] ? __init_kthread_worker+0x5b/0x5b
[ 848.702929] [<ffffffff814b7700>] ? gs_change+0x13/0x13
[ 848.709155] Code: 00 00 48 8d 88 38 04 00 00 44 8b 80 84 02 00 00 31 c0 e8 cf 1b 24 00 41 83 c8 ff 44 8b 4b 08 48 c7 c1 e0 0b 7d 81 4d 85 e4 74 10 <45> 8b 84 24 84 02 00 00 49 8d 8c 24 38 04 00 00 8b 53 04 48 89
[ 848.732467] RIP [<ffffffff8126a68c>] spin_dump+0x5e/0x8c
[ 848.738905] RSP <ffff8807f868dca0>
[ 848.743743] ---[ end trace 143161646eee8caa ]---

...so arrange for the ata_port to have the same end of life as the domain
device.

Reported-by: Marcin Tomczak <marcin.tomczak@intel.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
45c73b65194173e77030d5b95abe5b63a402d268 09-Jan-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: pre-clean commands that won the eh vs completion race

When scrolling forward through the eh list (in a clear_q scenario) it is
possible to encounter commands that won the completion vs eh race. Rather
than sprinkle more "if (!task)" throughout the handler just make a pass
through the list and delete the race winners before handling the rest.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
f41a0c441c3fe43e79ebeb75584dbb5bfa83e5cd 22-Dec-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: fix sas_find_local_phy(), take phy references

In the direct-attached case this routine returns the phy on which this
device was first discovered. Which is broken if we want to support
wide-targets, as this phy reference can become stale even though the
port is still active.

In the expander-attached case this routine tries to lookup the phy by
scanning the attached sas addresses of the parent expander, and BUG_ONs
if it can't find it. However since eh and the libsas workqueue run
independently we can still be attempting device recovery via eh after
libsas has recorded the device as detached. This is even easier to hit
now that eh is blocked while device domain rediscovery takes place, and
that libata is fed more timed out commands increasing the chances that
it will try to recover the ata device.

Arrange for dev->phy to always point to a last known good phy, it may be
stale after the port is torn down, but it will catch up for wide port
reconfigurations, and never be NULL.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
2a559f4ba443265b4c58925b48296f1cf81b49f9 04-Dec-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: sas_phy_enable via transport_sas_phy_reset

Execute the link-reset triggered by sas_phy_enable via
transport_sas_phy_reset so that it can be managed by libata.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
3a2cdf391b62919d3d2862cdce3d70b9a7a99673 29-Nov-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: defer SAS_TASK_NEED_DEV_RESET commands to libata

lldds use the SAS_TASK_NEED_DEV_RESET interface to request that eh
perform a reset. In the sata device case defer the commands that
triggered the reset to libata-eh context so it can perform its pre and
post reset management.

In the sas_ata_post_internal() case the reset request is falling on deaf
ears as the sas_task is immediately destroyed without any reset action.
Since it is currently a nop, and likely superfluous given the conversion
to new-style libata-eh, just drop the request.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
3944f50995f947558c35fb16ae0288354756762c 29-Nov-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: let libata handle command timeouts

libsas-eh if it successfully aborts an ata command will hide the timeout
condition (AC_ERR_TIMEOUT) from libata. The command likely completes
with the all-zero task->task_status it started with. Instead, interpret
a TMF_RESP_FUNC_COMPLETE as the end of the sas_task but keep the scmd
around for libata-eh to handle.

Tested-by: Andrzej Jakowski <andrzej.jakowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
9095a64a9aead653df320e3a6fc70835c15d46e4 28-Nov-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: fix timeout vs completion race

Until we have told the lldd to forget a task a timed out operation can
return from the hardware at any time. Since completion frees the task
we need to make sure that no tasks run their normal completion handler
once eh has decided to manage the task. Similar to
ata_scsi_cmd_error_handler() freeze completions to let eh judge the
outcome of the race.

Task collector mode is problematic because it presents a situation where
a task can be timed out and aborted before the lldd has even seen it.
For this case we need to guarantee that a task that an lldd has been
told to forget does not get queued after the lldd says "never seen it".
With sas_scsi_timed_out we achieve this with the ->task_queue_flush
mutex, rather than adding more time.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
a3a142524aa4b1539a64a55087bf12ffa4b1f94e 07-Dec-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: prevent double completion of scmds from eh

We invoke task->task_done() to free the task in the eh case, but at this
point we are prepared for scsi_eh_flush_done_q() to finish off the scmd.

Introduce sas_end_task() to capture the final response status from the
lldd and free the task.

Also take the opportunity to kill this warning.
drivers/scsi/libsas/sas_scsi_host.c: In function ‘sas_end_task’:
drivers/scsi/libsas/sas_scsi_host.c:102:3: warning: case value ‘2’ not in enumerated type ‘enum exec_status’ [-Wswitch]

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
3dff5721e4f67e6231dfc419d30aaa7563bfffd4 28-Nov-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: close error handling vs sas_ata_task_done() race

Since sas_ata does not implement ->freeze(), completions for scmds and
internal commands can still arrive concurrent with
ata_scsi_cmd_error_handler() and sas_ata_post_internal() respectively.
By the time either of those is called libata has committed to completing
the qc, and the ATA_PFLAG_FROZEN flag tells sas_ata_task_done() it has
lost the race.

In the sas_ata_post_internal() case we take on the additional
responsibility of freeing the sas_task to close the race with
sas_ata_task_done() freeing the the task while sas_ata_post_internal()
is in the process of invoking ->lldd_abort_task().

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
e139942d77a6e3ac83bc322e826668054a8601d6 07-Jan-2012 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: convert dev->gone to flags

In preparation for adding tracking of another device state "destroy".

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
312d3e56119a4bc5c36a96818f87f650c069ddc2 18-Nov-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: remove ata_port.lock management duties from lldds

Each libsas driver (mvsas, pm8001, and isci) has invented a different
method for managing the ap->lock. The lock is held by the ata
->queuecommand() path. mvsas drops it prior to acquiring any internal
locks which allows it to hold its internal lock across calls to
task->task_done(). This capability is important as it is the only way
the driver can flush task->task_done() instances to guarantee that it no
longer has any in-flight references to a domain_device at
->lldd_dev_gone() time.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
735f7d2fedf57380214221be7bed7f62d729e262 18-Nov-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: fix domain_device leak

Arrange for the deallocation of a struct domain_device object when it no
longer has:
1/ any children
2/ references by any scsi_targets
3/ references by a lldd

The comment about domain_device lifetime in
Documentation/scsi/libsas.txt is stale as it appears mainline never had
a version of a struct domain_device that was registered as a kobject.
We now manage domain_device reference counts on behalf of external
agents.

Reviewed-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
6f4e75a49fd07d707995865493b9f452302ae36b 18-Nov-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: kill sas_slave_destroy

Per commit 3e4ec344 "libata: kill ATA_FLAG_DISABLED" needing to set
ATA_DEV_NONE is a holdover from before libsas converted to the
"new-style" ata-eh.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
09703660edf83b8b6d175440bf745f30580d85ab 27-May-2011 Paul Gortmaker <paul.gortmaker@windriver.com> scsi: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required

For the basic SCSI infrastructure files that are exporting symbols
but not modules themselves, add in the basic export.h header file
to allow the exports.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
/drivers/scsi/libsas/sas_scsi_host.c
b50102d3e9a43a75379407c2080f696f61cb286b 01-Oct-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] isci: atapi support

Based on original implementation from Jiangbi Liu and Maciej Trela.

ATAPI transfers happen in two-to-three stages. The two stage atapi
commands are those that include a dma data transfer. The data transfer
portion of these operations is handled by the hardware packet-dma
acceleration. The three-stage commands do not have a data transfer and
are handled without hardware assistance in raw frame mode.

stage1: transmit host-to-device fis to notify the device of an incoming
atapi cdb. Upon reception of the pio-setup-fis repost the task_context
to perform the dma transfer of the cdb+data (go to stage3), or repost
the task_context to transmit the cdb as a raw frame (go to stage 2).

stage2: wait for hardware notification of the cdb transmission and then
go to stage 3.

stage3: wait for the arrival of the terminating device-to-host fis and
terminate the command.

To keep the implementation simple we only support ATAPI packet-dma
protocol (for commands with data) to avoid needing to handle the data
transfer manually (like we do for SATA-PIO). This may affect
compatibility for a small number of devices (see
ATA_HORKAGE_ATAPI_MOD16_DMA).

If the data-transfer underruns, or encounters an error the
device-to-host fis is expected to arrive in the unsolicited frame queue
to pass to libata for disposition. However, in the DONE_UNEXP_FIS (data
underrun) case it appears we need to craft a response. In the
DONE_REG_ERR case we do receive the UF and propagate it to libsas.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
97a1420d127ca1db2fd665707bf4e9501758147c 21-Sep-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: dynamic queue depth

The queue-depth for libsas-attached devices initializes to 32 and can
only be increased manually via sysfs to a max of 64, while mpt2sas
attached devices initialize to 254 and dynamically float via the
midlayer ->change_queue_depth interface.

No performance regression was observed with this change on the isci
driver.

Tested-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>
/drivers/scsi/libsas/sas_scsi_host.c
f6e67035a9edd79b8b202c159d5bec560bb9c358 21-Sep-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas,libata: fix ->change_queue_{depth|type} for sata devices

Pass queue_depth change requests to libata, and prevent queue_type
changes for ATA devices.

Otherwise:
1/ we do not honor the libata specific restrictions on the queue depth
2/ libsas drivers that do not set sdev->tagged_supported are unable to
change the queue_depth of ata devices via sysfs

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
ac81c6a832a8769d1cc7ffda361aa3dc3d8f06dc 16-Jul-2011 Christoph Hellwig <hch@infradead.org> [SCSI] libsas: fix sas_queuecommand return values

->queuecommand must return either 0, or one of the SCSI_MLQUEUE_* return
values. Non-transient errors are indicated by setting cmd->result before
calling ->scsi_done and returning 0. Fix libsas to adhere to this calling
convention. Note that the DID_ERROR for returns from the low-level driver
might not be correct for all cases, but it's the best we can do with
the current layering in libsas. I also suspect that the pre-existing
handling of -SAS_QUEUE_FULL should really be SCSI_MLQUEUE_HOST_BUSY, but
I'll leave that for a separate change.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
a923f756be07aae690ec3dd2e4a25967658cf893 11-Jul-2011 Christoph Hellwig <hch@infradead.org> [SCSI] libsas: reindent sas_queuecommand

Switch sas_queuecommand to a normal indentation and goto based error handling.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
92bd401ba7248946a4215d65ae9b1993ae66db2c 11-Jul-2011 Christoph Hellwig <hch@infradead.org> [SCSI] libsas: sas_queuecommand doesnt need host_lock

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
3673f4bf6a277f4f2944ad153ceb167b340f9ffc 24-May-2011 Dan Williams <dan.j.williams@intel.com> [SCSI] libsas: check dev->gone before submitting sata i/o

Head off doomed-to-fail i/o in sas_queuecommand before sending it down
the ata path.

Before:
sd 7:0:0:0: [sdd] Synchronizing SCSI cache
ata8: no sense translation for status: 0x00
ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
ata8.00: device reported invalid CHS sector 0
ata8: status=0x00 { }
ata8: no sense translation for status: 0x00
ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
ata8.00: device reported invalid CHS sector 0
ata8: status=0x00 { }
ata8: no sense translation for status: 0x00
ata8: translated ATA stat/err 0x00/00 to SCSI SK/ASC/ASCQ 0xb/00/00
ata8.00: device reported invalid CHS sector 0
ata8: status=0x00 { }
sd 7:0:0:0: [sdd] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 7:0:0:0: [sdd] Sense Key : Aborted Command [current] [descriptor]
sd 7:0:0:0: [sdd] Add. Sense: No additional sense information
sd 7:0:0:0: [sdd] Stopping disk

After:
sd 9:0:0:0: [sdd] Synchronizing SCSI cache
sd 9:0:0:0: [sdd] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
sd 9:0:0:0: [sdd] Stopping disk
sd 9:0:0:0: [sdd] START_STOP FAILED
sd 9:0:0:0: [sdd] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK

This is a cosmetic change as sata i/o can still leak to a gone device,
but this addresses the nominal hotplug case when releasing the target.

Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
/drivers/scsi/libsas/sas_scsi_host.c
c55d267de274d308927b60c3e740c1a826832317 18-Mar-2011 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* 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}
00dd4998a60599d98b4d6635820a1fbeafa5b021 23-Jan-2011 James Bottomley <James.Bottomley@suse.de> libsas: convert to libata new error handler

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>
/drivers/scsi/libsas/sas_scsi_host.c
c299190b9398d4edfbf80a749875d5bac199bfdc 23-Jan-2011 James Bottomley <James.Bottomley@suse.de> [SCSI] libsas: convert to libata new error handler

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>
/drivers/scsi/libsas/sas_scsi_host.c
9ee91f7fb550a4c82f82d9818e42493484c754af 21-Jan-2011 James Bottomley <James.Bottomley@suse.de> [SCSI] libsas: fix runaway error handler problem

libsas makes use of scsi_schedule_eh() but forgets to clear the
host_eh_scheduled flag in its error handling routine. Because of this,
the error handler thread never gets to sleep; it's constantly awake and
trying to run the error routine leading to console spew and inability to
run anything else (at least on a UP system). The fix is to clear the
flag as we splice the work queue.

Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/libsas/sas_scsi_host.c
b27dcfb0670ea7352a67137f4ff7947c2a9f6892 18-Nov-2010 Jeff Garzik <jeff@garzik.org> [libata] avoid needlessly passing around ptr to SCSI completion func

It's stored in struct scsi_cmnd->scsi_done, making several 'done'
parameters to functions redundant.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/libsas/sas_scsi_host.c
f281233d3eba15fb225d21ae2e228fd4553d824a 16-Nov-2010 Jeff Garzik <jeff@garzik.org> SCSI host lock push-down

Move the mid-layer's ->queuecommand() invocation from being locked
with the host lock to being unlocked to facilitate speeding up the
critical path for drivers who don't need this lock taken anyway.

The patch below presents a simple SCSI host lock push-down as an
equivalent transformation. No locking or other behavior should change
with this patch. All existing bugs and locking orders are preserved.

Additionally, add one parameter to queuecommand,
struct Scsi_Host *
and remove one parameter from queuecommand,
void (*done)(struct scsi_cmnd *)

Scsi_Host* is a convenient pointer that most host drivers need anyway,
and 'done' is redundant to struct scsi_cmnd->scsi_done.

Minimal code disturbance was attempted with this change. Most drivers
needed only two one-line modifications for their host lock push-down.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/scsi/libsas/sas_scsi_host.c
c70b5296e775cde46cfcb2d860ba160108a5ec7a 23-Oct-2010 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (84 commits)
[SCSI] be2iscsi: SGE Len == 64K
[SCSI] be2iscsi: Remove premature free of cid
[SCSI] be2iscsi: More time for FW
[SCSI] libsas: fix bug for vacant phy
[SCSI] sd: Fix overflow with big physical blocks
[SCSI] st: add MTWEOFI to write filemarks without flushing drive buffer
[SCSI] libsas: Don't issue commands to devices that have been hot-removed
[SCSI] megaraid_sas: Add Online Controller Reset to MegaRAID SAS drive
[SCSI] lpfc 8.3.17: Update lpfc driver version to 8.3.17
[SCSI] lpfc 8.3.17: Replace function reset methodology
[SCSI] lpfc 8.3.17: SCSI fixes
[SCSI] lpfc 8.3.17: BSG fixes
[SCSI] lpfc 8.3.17: SLI Additions and Fixes
[SCSI] lpfc 8.3.17: Code Cleanup and Locking fixes
[SCSI] zfcp: Remove scsi_cmnd->serial_number from debug traces
[SCSI] ipr: fix array error logging
[SCSI] aha152x: enable PCMCIA on 64bit
[SCSI] scsi_dh_alua: Handle all states correctly
[SCSI] cxgb4i: connection and ddp setting update
[SCSI] cxgb3i: fixed connection over vlan
...
56dd2c0691a5a387b7b05835fe547dc6fade9407 01-Oct-2010 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Don't issue commands to devices that have been hot-removed

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>
/drivers/scsi/libsas/sas_scsi_host.c
9cbbdca44ae1a6f512ea1e2be11ced8bbb9d430a 03-Sep-2010 Tejun Heo <tj@kernel.org> block: remove spurious uses of REQ_HARDBARRIER

REQ_HARDBARRIER is deprecated. Remove spurious uses in the following
users. Please note that other than osdblk, all other uses were
already spurious before deprecation.

* osdblk: osdblk_rq_fn() won't receive any request with
REQ_HARDBARRIER set. Remove the test for it.

* pktcdvd: use of REQ_HARDBARRIER in pkt_generic_packet() doesn't mean
anything. Removed.

* aic7xxx_old: Setting MSG_ORDERED_Q_TAG on REQ_HARDBARRIER is
spurious. Removed.

* sas_scsi_host: Setting TASK_ATTR_ORDERED on REQ_HARDBARRIER is
spurious. Removed.

* scsi_tcq: The ordered tag path wasn't being used anyway. Removed.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Boaz Harrosh <bharrosh@panasas.com>
Cc: James Bottomley <James.Bottomley@suse.de>
Cc: Peter Osterlund <petero2@telia.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
/drivers/scsi/libsas/sas_scsi_host.c
df64d3caab8db6ae17dacd229a03d7689a10c432 27-Jul-2010 James Bottomley <James.Bottomley@suse.de> [SCSI] Unify SAM_ and SAM_STAT_ macros

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>
/drivers/scsi/libsas/sas_scsi_host.c
33cf23b0a535475aead57707cb9f4fe135a93544 21-May-2010 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (182 commits)
[SCSI] aacraid: add an ifdef'd device delete case instead of taking the device offline
[SCSI] aacraid: prohibit access to array container space
[SCSI] aacraid: add support for handling ATA pass-through commands.
[SCSI] aacraid: expose physical devices for models with newer firmware
[SCSI] aacraid: respond automatically to volumes added by config tool
[SCSI] fcoe: fix fcoe module ref counting
[SCSI] libfcoe: FIP Keep-Alive messages for VPorts are sent with incorrect port_id and wwn
[SCSI] libfcoe: Fix incorrect MAC address clearing
[SCSI] fcoe: fix a circular locking issue with rtnl and sysfs mutex
[SCSI] libfc: Move the port_id into lport
[SCSI] fcoe: move link speed checking into its own routine
[SCSI] libfc: Remove extra pointer check
[SCSI] libfc: Remove unused fc_get_host_port_type
[SCSI] fcoe: fixes wrong error exit in fcoe_create
[SCSI] libfc: set seq_id for incoming sequence
[SCSI] qla2xxx: Updates to ISP82xx support.
[SCSI] qla2xxx: Optionally disable target reset.
[SCSI] qla2xxx: ensure flash operation and host reset via sg_reset are mutually exclusive
[SCSI] qla2xxx: Silence bogus warning by gcc for wrap and did.
[SCSI] qla2xxx: T10 DIF support added.
...
3e4ec3443f70fbe144799ccf0b1c3797f78d1715 10-May-2010 Tejun Heo <tj@kernel.org> libata: kill ATA_FLAG_DISABLED

ATA_FLAG_DISABLED is only used by drivers which don't use
->error_handler framework and is largely broken. Its only meaningful
function is to make irq handlers skip processing if the flag is set,
which is largely useless and even harmful as it makes those ports more
likely to cause IRQ storms.

Kill ATA_FLAG_DISABLED and makes the callers disable attached devices
instead. ata_port_probe() and ata_port_disable() which manipulate the
flag are also killed.

This simplifies condition check in IRQ handlers. While updating IRQ
handlers, remove ap NULL check as libata guarantees consecutive port
allocation (unoccupied ports are initialized with dummies) and
long-obsolete ATA_QCFLAG_ACTIVE check (checked by ata_qc_from_tag()).

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/libsas/sas_scsi_host.c
1b4d0d8ea7b3cbd107f345ab766416f9b38ce66a 13-May-2010 James Bottomley <James.Bottomley@suse.de> [SCSI] libsas: fix deref before check in commit 70b25f890ce

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>
/drivers/scsi/libsas/sas_scsi_host.c
70b25f890ce9f0520c64075ce9225a5b020a513e 15-Apr-2010 Tejun Heo <tj@kernel.org> [SCSI] fix locking around blk_abort_request()

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>
/drivers/scsi/libsas/sas_scsi_host.c
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking 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>
/drivers/scsi/libsas/sas_scsi_host.c
e881a172dac4d9ea3b2a1540041d872963c269bd 16-Oct-2009 Mike Christie <michaelc@cs.wisc.edu> [SCSI] modify change_queue_depth to take in reason why it is being called

This patch modifies scsi_host_template->change_queue_depth so that
it takes an argument indicating why it is being called. This will be
used so that if a LLD needs to do some extra processing when
handling queue fulls or later ramp ups, it can do so.

This is a simple port of the drivers setting a change_queue_depth
callback. In the patch I just have these LLDs adjust the queue depth
if the user was requesting it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>

[Vasu.Dev: v2
Also converted pmcraid_change_queue_depth and then verified
all modules compile using "make allmodconfig" for any new build
warnings on X86_64.

Updated original description after combing two original
patches from Mike to make this patch git bisectable.]
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
[jejb: fixed up 53c700]
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
/drivers/scsi/libsas/sas_scsi_host.c
94be9a58d7e683ac3c1df1858a17f09ebade8da0 16-Jan-2009 Jeff Garzik <jeff@garzik.org> [libata] get-identity ioctl: Fix use of invalid memory pointer
for SAS drivers.

Caught by Ke Wei (and team?) at Marvell.

Also, move the ata_scsi_ioctl export to libata-scsi.c, as that seems to be the
general trend.

Acked-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
/drivers/scsi/libsas/sas_scsi_host.c
242f9dcb8ba6f68fcd217a119a7648a4f69290e9 14-Sep-2008 Jens Axboe <jens.axboe@oracle.com> block: unify request timeout handling

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>
/drivers/scsi/libsas/sas_scsi_host.c
cadbd4a5e36dde7e6c49b587b2c419103c0b7218 04-Jul-2008 Harvey Harrison <harvey.harrison@gmail.com> [SCSI] replace __FUNCTION__ with __func__

[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>
/drivers/scsi/libsas/sas_scsi_host.c
45e6cdf41437c72ed79cee64dc69e7f740511e50 19-Feb-2008 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Provide a transport-level facility to request SAS addrs

Provide a facility to use the request_firmware() interface to get a SAS
address from userspace. This can be used by SAS LLDDs that cannot
obtain the address from the host adapter.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/libsas/sas_scsi_host.c
8de3ef25a1fcd28d270b69417a41b424826d4f89 24-Feb-2008 James Bottomley <James.Bottomley@HansenPartnership.com> [SCSI] libsas: misc fixes to the eh path

- 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>
/drivers/scsi/libsas/sas_scsi_host.c
5319578ca38a8b90b6d0270c194c65d1dd8f7725 24-Feb-2008 James Bottomley <James.Bottomley@HansenPartnership.com> [SCSI] libsas: export sas_find_local_phy function

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>
/drivers/scsi/libsas/sas_scsi_host.c
63e4563b9cf77875286312758f61a20f912afbbb 23-Feb-2008 James Bottomley <James.Bottomley@HansenPartnership.com> [SCSI] libsas: correctly flush the LU queue on error recovery

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>
/drivers/scsi/libsas/sas_scsi_host.c
a8e14fec164cc01d8dfb18760ee9bddd91e127c2 20-Feb-2008 James Bottomley <James.Bottomley@HansenPartnership.com> [SCSI] libsas: fix error handling

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>
/drivers/scsi/libsas/sas_scsi_host.c
9b73e76f3cf63379dcf45fcd4f112f5812418d0a 26-Jan-2008 Linus Torvalds <torvalds@linux-foundation.org> Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* 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.
...
af5ca3f4ec5cc4432a42a73b050dd8898ce8fd00 20-Dec-2007 Kay Sievers <kay.sievers@vrfy.org> Driver core: change sysdev classes to use dynamic kobject names

All kobjects require a dynamically allocated name now. We no longer
need to keep track if the name is statically assigned, we can just
unconditionally free() all kobject names on cleanup.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/drivers/scsi/libsas/sas_scsi_host.c
94aa5e5f6251ca0e1d77e083f8c2f9f40ee548c5 13-Jan-2008 FUJITA Tomonori <tomof@acm.org> [SCSI] aic7xxx_old, eata_pio, ips, libsas: don't zero out sense_buffer in queuecommand

LLDs don't need to zero out scsi_cmnd::sense_buffer in queuecommand
since scsi-ml does. This is a preparation of the future changes to
allocate the sense_buffer only when necessary.

Many LLDs zero out the sense_buffer before touching it on the error
case. This patch lets them alone for now because new APIs for them
would be added later on.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: "Salyzyn, Mark" <Mark_Salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/libsas/sas_scsi_host.c
cc75e8ab6f262a3ea60e8d8268f48da5365f2823 12-Jan-2008 FUJITA Tomonori <tomof@acm.org> [SCSI] libsas: fix sense_buffer overrun

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/libsas/sas_scsi_host.c
8ee24023ef43c77cdaea1add00e1e45cc4fc3261 05-Nov-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Fix various sparse complaints

Annotate sas_queuecommand with locking details, and clean up a few
more sparse warnings about static/non-static declarations.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
/drivers/scsi/libsas/sas_scsi_host.c
3a2755af37b317d47fdc3dd15178adaf5d47263e 30-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] sas_ata: Implement sas_task_abort for ATA devices

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>
/drivers/scsi/libsas/sas_scsi_host.c
3eb7a51a3ae0ed0227e051ecf75199fccbb4cc73 30-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] sas_ata: Satisfy libata qc function locking requirements

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>
/drivers/scsi/libsas/sas_scsi_host.c
338ec57003ff9d7bc1471677e61872455977a5de 18-Oct-2006 Darrick J. Wong <djwong@us.ibm.com> [SCSI] Migrate libsas ATA code into a separate file

This is a respin of my earlier patch that migrates the ATA support code
into a separate file. For now, the controversial linking bits have
been removed per James Bottomley's request for a patch that contains
only the migration diffs, which means that libsas continues to require
libata. I intend to address that problem in a separate patch.

This patch is against the aic94xx-sas-2.6 git tree, and it has been
sanity tested on my x206m with Seagate SATA and SAS disks without
uncovering any new problems.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
0281e02c5671f50701924465744edd3e2feb5d6f 16-Oct-2006 James Bottomley <James.Bottomley@steeleye.com> [SCSI] libsas: fixup NCQ for SATA disks

We actually had two problems: the one with the tag (which is fixed by
zeroing the tag before sending the taskfile to the sequencer) but the
other with the fact that we sent our first NCQ command to the device
before the sequencer had been informed of the NCQ tagging
capabilities. I fixed the latter by moving the rphy_add() to the
correct point in the code after the NCQ capabilities are set up.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
27e92471b5d8b3e70646dfaf9369d96773972efd 16-Oct-2006 James Bottomley <James.Bottomley@steeleye.com> [SCSI] aic94xx: add SATAPI support

It turns out this is fairly easy to plumb in by recognising the three
command types and copying the CDB. The protocol response path needs to
be amended to cope with SAS_PROTO_RESPONSE.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
bdab4e877819cc8b682797901c8b37567fec3c5e 14-Oct-2006 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: support NCQ for SATA disks

This patch adds SATAII NCQ support to libsas. Both the use_ncq and the
dma_xfer flags in ata_task must be set for NCQ to work correctly on the
Adaptec SAS controller. The rest of the patch adds ATA_FLAG_NCQ to
sata_port_info and sets up ap->scsi_host so that ata_setup_ncq doesn't
crash. Please note that this patch is against the aic94xx-sas git tree,
not scsi-misc. Thanks also to James Bottomley for providing an earlier
version of this patch from which to work.

I've tested this patch on a x206m with a ST380819AS SATA2 disk plugged
into the Adaptec SAS controller. The drive came up with a queue depth
of 31, and I successfully ran an I/O flood test to coerce libata into
sending multiple commands simultaneously. A kernel probe recorded the
maximum tag number that had been seen before and after the flood test;
before the test it was 2 and after it was 30, as I expected.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
fa1c1e8f1ece48c7baa3ba529bfd0d10a0bdf4eb 11-Aug-2006 Darrick J. Wong <djwong@us.ibm.com> [SCSI] Add SATA support to libsas

Hook the scsi_host_template functions in libsas to delegate
functionality to libata when appropriate.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>

Misc code changes and merge fixes and update for libata->drivers/ata
move

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
831441862956fffa17b9801db37e6ea1650b0f69 17-Jul-2007 Rafael J. Wysocki <rjw@sisk.pl> Freezer: make kernel threads nonfreezable by default

Currently, the freezer treats all tasks as freezable, except for the kernel
threads that explicitly set the PF_NOFREEZE flag for themselves. This
approach is problematic, since it requires every kernel thread to either
set PF_NOFREEZE explicitly, or call try_to_freeze(), even if it doesn't
care for the freezing of tasks at all.

It seems better to only require the kernel threads that want to or need to
be frozen to use some freezer-related code and to remove any
freezer-related code from the other (nonfreezable) kernel threads, which is
done in this patch.

The patch causes all kernel threads to be nonfreezable by default (ie. to
have PF_NOFREEZE set by default) and introduces the set_freezable()
function that should be called by the freezable kernel threads in order to
unset PF_NOFREEZE. It also makes all of the currently freezable kernel
threads call set_freezable(), so it shouldn't cause any (intentional)
change of behaviour to appear. Additionally, it updates documentation to
describe the freezing of tasks more accurately.

[akpm@linux-foundation.org: build fixes]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/drivers/scsi/libsas/sas_scsi_host.c
c13e5566471d90ff2858f5cacaf27021d158e037 25-May-2007 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> [SCSI] libsas: convert to use the data buffer accessors

- convert to use the new accessors for the sg lists and the
parameters.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
d7a54e30d324b6f3b29a6cf2ff24c95b135013f5 26-Apr-2007 Christoph Hellwig <hch@infradead.org> [SCSI] sas_scsi_host: Convert to use the kthread API

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
a9344e68ac0a656475006737dbc258d69fe4f7b0 30-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Add an LU reset mechanism to the error handler

After discussion with andmike and dougg, it seems that the purpose of
eh_device_reset_handler is to issue LU resets, and that
eh_bus_reset_handler would be a more appropriate place for a phy reset.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
63bb1bf0400414c0bc51cf276daa0fb5168d1e61 27-Jan-2007 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> [SCSI] libsas: fix task attribute

Why TASK_ATTR_HOQ?

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
f27708fc7523a87e3e69cae5628015961f0d3061 26-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Enable automatic spin-up of SAS disks

Set allow_restart=1 for all SAS disks so that they are spun up when needed.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
ad689233bee854dced741c91aff12a8771a22f6f 26-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Handle SCSI commands that complete with failure codes

This patch moves the code that handles SAS failures out of the main EH
function and into a separate function. It also detects commands that have
no sas_task (i.e. they completed, but with error data) and sends them into
scsi_error for processing. This allows us to handle SCSI errors (and
enables auto-spinup as a side effect) instead of dropping them on the
floor and falling into an infinite loop. It also requires the
implementation of a device reset function, which the SAS failure code has
been modified to employ for REQ_DEVICE_RESET.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
02cd743bb3a37f27681c487608fb819493fa4010 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Start I_T recovery if ABORT TASK fails

The EH should fall into I_T recovery (and potentially stronger
remedies) if ABORT TASK fails.

Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
980fa2f9d64b9be96107c89e165953ace311af54 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: phy port lock needs irq spinlocks

Convert the phy port locks to use irq spinlocks.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
396819fba821ad56f1b90090d256f0ab726c89c5 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Delay issuing ABORT TASK TMF until the error handler

sas_task_abort() should simply abort the upper-level SCSI command and wait
until the error handler to send the actual ABORT TASK command. By
deferring things to the EH we simplify the concurrency coordination and
eliminate some race conditions. Note that sas_task_abort has a few hooks
to handle libsas internal commands properly too.

Also rename do_sas_task_abort to __sas_task_abort just in case we really
want to abort the task *right now* and we don't have a scsi_cmnd attached
to the command. This is a hook for libata internal commands to abort.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
3ebf6922b0833807e54c73f4794c74baf9945fc8 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Enable the EH strategy handler to reset a phy after a command

When a SAS LLDD needs to request a device port reset, it needs to have all
commands aborted before it can reset the port. Since commands are put on
the EH's list in the order that they were queued, the LLDD can set a "need
reset" flag in the last task to be aborted so that the EH can reset the
port after all commands are aborted.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
37958fb040cf6f88b354b9fa7e846014ffbd3b73 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Remove SAS_TASK_INITIATOR_ABORTED flag

This flag is no longer necessary because we push tasks to be aborted into
the EH as soon as we possibly can, and let the SCSI EH code take care of
the coordination for which this flag was used.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
6d4dcd4dae25c48e8932326aaedfe560d7f2c7bb 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Reset timer on taskless scsi_cmnds in sas_scsi_timed_out

Every so often, a scsi_cmnd will time out, and the libsas timeout handler
will discover that the scsi_cmnd does not have a sas_task attached to it.
This can happen in two cases: (1) the scsi_cmnd actually made it through
libsas to the HBA and is now going through scsi_done, or (2) the
scsi_cmnd has been held up (host lock, slab alloc, etc) and libsas has
not yet attached a sas_task. In both cases, it is safe to ask SCSI for
more time to process the command via EH_RESET_TIMER; we cannot blindly
return EH_HANDLED because if (2) happens, we could end up calling
scsi_done while another CPU is heading towards sas_queuecommand, which
causes slab corruption when sas_task_done updates the freed scsi_cmnd.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
acbf167d4ad8c27f9743a4b539d51ae9535bf21c 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Add a sysfs knob to enable/disable a phy

This patch lets a user arbitrarily enable or disable a phy via sysfs.
Potential applications include shutting down a phy to replace one
lane of wide port, and (more importantly) providing a method for the
libata SATL to control the phy.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
b218a0d8e250e0ae8fd4d4e45bd66a588b380752 11-Jan-2007 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: Don't give scsi_cmnds to the EH if they never made it to the SAS LLDD or have already returned

On a system with many SAS targets, it appears possible that a scsi_cmnd
can time out without ever making it to the SAS LLDD or at the same time
that a completion is occurring. In both of these cases, telling the
LLDD to abort the sas_task makes no sense because the LLDD won't know
about the sas_task; what we really want to do is to increase the timer.
Note that this involves creating another sas_task bit to indicate
whether or not the task has been sent to the LLDD; I could have
implemented this by slightly redefining SAS_TASK_STATE_PENDING, but
this way seems cleaner.

This second version amends the aic94xx portion to set the
TASK_AT_INITIATOR flag for all sas_tasks that were passed to
lldd_execute_task.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
06328b4f7919e9d2169d45cadc5a37b828a78eda 06-Dec-2006 David Howells <dhowells@redhat.com> Actually update the fixed up compile failures.

Signed-Off-By: David Howells <dhowells@redhat.com>
/drivers/scsi/libsas/sas_scsi_host.c
dea22214790d1306f3a3444db13d2c726037b189 08-Nov-2006 Darrick J. Wong <djwong@us.ibm.com> [PATCH] aic94xx: handle REQ_DEVICE_RESET

This patch implements a REQ_DEVICE_RESET handler for the aic94xx
driver. Like the earlier REQ_TASK_ABORT patch, this patch defers the
device reset to the Scsi_Host's workqueue, which has the added benefit
of ensuring that the device reset does not happen at the same time
that the abort tmfs are being processed. After the phy reset, the
busted drive should go away and be re-detected later, which is indeed
what I've seen on both a x260 and a x206m.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
79a5eb609b74e7b3638861c41b98eafa74920a1f 31-Oct-2006 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: add sas_abort_task

This patch adds an external function, sas_abort_task, to enable LLDDs
to abort sas_tasks. It also adds a work_struct so that the actual
work of aborting a task can be shifted from tasklet context (in the
LLDD) onto the scsi_host's workqueue.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
f456393e195e0aa16029985f63cd93b601a0d315 31-Oct-2006 Darrick J. Wong <djwong@us.ibm.com> [SCSI] libsas: modify error handler to use scsi_eh_* functions

This patch adds an EH done queue to sas_ha, converts the error handling
strategy function and the sas_scsi_task_done functions in libsas to use
the scsi_eh_* commands for error'd commands, and adds checks for the
INITIATOR_ABORTED flag so that we do the right thing if a sas_task has
been aborted by the initiator.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c
1bdfd554be94def718323659173517c5d4a69d25 01-Oct-2006 Jeff Garzik <jeff@garzik.org> [PATCH] SCSI: fix request flag-related build breakage

The ->flags in struct request was split into two variables, in a recent
changeset. The merge of this change forgot to update SCSI's libsas,
probably because libsas was a very recent merge.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/scsi/libsas/sas_scsi_host.c
3cc27547d6ee2d50ecdd11e9127bc3cd1947e8dd 25-Sep-2006 Al Viro <viro@ftp.linux.org.uk> [PATCH] SCSI gfp_t annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/drivers/scsi/libsas/sas_scsi_host.c
2908d778ab3e244900c310974e1fc1c69066e450 29-Aug-2006 James Bottomley <James.Bottomley@SteelEye.com> [SCSI] aic94xx: new driver

This is the end point of the separate aic94xx driver based on the
original driver and transport class from Luben Tuikov
<ltuikov@yahoo.com>

The log of the separate development is:

Alexis Bruemmer:
o aic94xx: fix hotplug/unplug for expanderless systems
o aic94xx: disable split completion timer/setting by default
o aic94xx: wide port off expander support
o aic94xx: remove various inline functions
o aic94xx: use bitops
o aic94xx: remove queue comment
o aic94xx: remove sas_common.c
o aic94xx: sas remove depot's
o aic94xx: use available list_for_each_entry_safe_reverse()
o aic94xx: sas header file merge

James Bottomley:
o aic94xx: fix TF_TMF_NO_CTX processing
o aic94xx: convert to request_firmware interface
o aic94xx: fix hotplug/unplug
o aic94xx: add link error counts to the expander phys
o aic94xx: add transport class phy reset capability
o aic94xx: remove local_attached flag
o Remove README
o Fixup Makefile variable for libsas rename
o Rename sas->libsas
o aic94xx: correct return code for sas_discover_event
o aic94xx: use parent backlink port
o aic94xx: remove channel abstraction
o aic94xx: fix routing algorithms
o aic94xx: add backlink port
o aic94xx: fix cascaded expander properties
o aic94xx: fix sleep under lock
o aic94xx: fix panic on module removal in complex topology
o aic94xx: make use of the new sas_port
o rename sas_port to asd_sas_port
o Fix for eh_strategy_handler move
o aic94xx: move entirely over to correct transport class formulation
o remove last vestages of sas_rphy_alloc()
o update for eh_timed_out move
o Preliminary expander support for aic94xx
o sas: remove event thread
o minor warning cleanups
o remove last vestiges of id mapping arrays
o Further updates
o Convert aic94xx over entirely to the transport class end device and
o update aic94xx/sas to use the new sas transport class end device
o [PATCH] aic94xx: attaching to the sas transport class
o Add missing completion removal from prior patch
o [PATCH] aic94xx: attaching to the sas transport class
o Build fixes from akpm

Jeff Garzik:
o [scsi aic94xx] Remove ->owner from PCI info table

Luben Tuikov:
o initial aic94xx driver

Mike Anderson:
o aic94xx: fix panic on module insertion
o aic94xx: stub out SATA_DEV case
o aic94xx: compile warning cleanups
o aic94xx: sas_alloc_task
o aic94xx: ref count update
o aic94xx nexus loss time value
o [PATCH] aic94xx: driver assertion in non-x86 BIOS env

Randy Dunlap:
o libsas: externs not needed

Robert Tarte:
o aic94xx: sequence patch - fixes SATA support

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
/drivers/scsi/libsas/sas_scsi_host.c