History log of /linux-master/drivers/scsi/isci/remote_device.c
Revision Date Author Comments
# 242e15d7 17-Mar-2021 Lee Jones <lee.jones@linaro.org>

scsi: isci: remote_device: Fix a bunch of doc-rot issues

Fixes the following W=1 kernel build warning(s):

drivers/scsi/isci/remote_device.c:299: warning: Function parameter or member 'ihost' not described in 'isci_remote_device_not_ready'
drivers/scsi/isci/remote_device.c:299: warning: Function parameter or member 'idev' not described in 'isci_remote_device_not_ready'
drivers/scsi/isci/remote_device.c:299: warning: Function parameter or member 'reason' not described in 'isci_remote_device_not_ready'
drivers/scsi/isci/remote_device.c:299: warning: Excess function parameter 'isci_host' description in 'isci_remote_device_not_ready'
drivers/scsi/isci/remote_device.c:299: warning: Excess function parameter 'isci_device' description in 'isci_remote_device_not_ready'
drivers/scsi/isci/remote_device.c:1015: warning: Function parameter or member 'idev' not described in 'sci_remote_device_destruct'
drivers/scsi/isci/remote_device.c:1015: warning: Excess function parameter 'remote_device' description in 'sci_remote_device_destruct'
drivers/scsi/isci/remote_device.c:1249: warning: Function parameter or member 'iport' not described in 'sci_remote_device_construct'
drivers/scsi/isci/remote_device.c:1249: warning: Function parameter or member 'idev' not described in 'sci_remote_device_construct'
drivers/scsi/isci/remote_device.c:1249: warning: Excess function parameter 'sci_port' description in 'sci_remote_device_construct'
drivers/scsi/isci/remote_device.c:1249: warning: Excess function parameter 'sci_dev' description in 'sci_remote_device_construct'
drivers/scsi/isci/remote_device.c:1275: warning: Function parameter or member 'iport' not described in 'sci_remote_device_da_construct'
drivers/scsi/isci/remote_device.c:1275: warning: Function parameter or member 'idev' not described in 'sci_remote_device_da_construct'
drivers/scsi/isci/remote_device.c:1311: warning: Function parameter or member 'iport' not described in 'sci_remote_device_ea_construct'
drivers/scsi/isci/remote_device.c:1311: warning: Function parameter or member 'idev' not described in 'sci_remote_device_ea_construct'
drivers/scsi/isci/remote_device.c:1453: warning: Function parameter or member 'idev' not described in 'sci_remote_device_start'
drivers/scsi/isci/remote_device.c:1453: warning: Excess function parameter 'remote_device' description in 'sci_remote_device_start'
drivers/scsi/isci/remote_device.c:1513: warning: Function parameter or member 'ihost' not described in 'isci_remote_device_alloc'
drivers/scsi/isci/remote_device.c:1513: warning: Function parameter or member 'iport' not described in 'isci_remote_device_alloc'
drivers/scsi/isci/remote_device.c:1513: warning: expecting prototype for This function builds the isci_remote_device when a libsas dev_found message(). Prototype was for isci_remote_device_alloc() instead
drivers/scsi/isci/remote_device.c:1558: warning: Function parameter or member 'ihost' not described in 'isci_remote_device_stop'
drivers/scsi/isci/remote_device.c:1558: warning: Function parameter or member 'idev' not described in 'isci_remote_device_stop'
drivers/scsi/isci/remote_device.c:1558: warning: Excess function parameter 'isci_host' description in 'isci_remote_device_stop'
drivers/scsi/isci/remote_device.c:1558: warning: Excess function parameter 'isci_device' description in 'isci_remote_device_stop'
drivers/scsi/isci/remote_device.c:1592: warning: Function parameter or member 'dev' not described in 'isci_remote_device_gone'
drivers/scsi/isci/remote_device.c:1592: warning: Excess function parameter 'domain_device' description in 'isci_remote_device_gone'
drivers/scsi/isci/remote_device.c:1614: warning: Function parameter or member 'dev' not described in 'isci_remote_device_found'
drivers/scsi/isci/remote_device.c:1614: warning: Excess function parameter 'domain_device' description in 'isci_remote_device_found'

Link: https://lore.kernel.org/r/20210317091230.2912389-27-lee.jones@linaro.org
Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# ab3f2d15 17-Mar-2021 Lee Jones <lee.jones@linaro.org>

scsi: isci: Make local function isci_remote_device_wait_for_resume_from_abort() static

Fixes the following W=1 kernel build warning(s):

drivers/scsi/isci/remote_device.c:1387:6: warning: no previous prototype for ‘isci_remote_device_wait_for_resume_from_abort’ [-Wmissing-prototypes]

Link: https://lore.kernel.org/r/20210317091125.2910058-7-lee.jones@linaro.org
Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 1125c70a 24-Oct-2019 Geert Uytterhoeven <geert+renesas@glider.be>

scsi: Fix various misspellings of "connect"

Fix misspellings of "disonnect", "reconnect", "connection", "connected",
and "disconnection".

Link: https://lore.kernel.org/r/20191024152633.30404-1-geert+renesas@glider.be
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 924a3541 10-Jun-2019 John Garry <john.garry@huawei.com>

scsi: libsas: aic94xx: hisi_sas: mvsas: pm8001: Use dev_is_expander()

Many times in libsas, and in LLDDs which use libsas, the check for an
expander device is re-implemented or open coded.

Use dev_is_expander() instead. We rename this from
sas_dev_type_is_expander() to not spill so many lines in referencing.

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Jason Yan <yanaijie@huawei.com>
Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 4f09ac9d 27-Nov-2018 Gustavo A. R. Silva <gustavo@embeddedor.com>

scsi: isci: remote_device: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where
we are expecting to fall through.

Notice that, in this particular case, a dash is added as a token in order
to separate the "fall through" annotations from the rest of the comment on
the same line, which is what GCC is expecting to find.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>


# 4e857c58 17-Mar-2014 Peter Zijlstra <peterz@infradead.org>

arch: Mass conversion of smp_mb__*()

Mostly scripted conversion of the smp_mb__* barriers.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/n/tip-55dhyhocezdw1dg7u19hmh1u@git.kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-arch@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>


# aa9f8328 07-May-2013 James Bottomley <JBottomley@Parallels.com>

[SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type

These enums have been separate since the dawn of SAS, mainly because the
latter is a procotol only enum and the former includes additional state
for libsas. The dichotomy causes endless confusion about which one you
should use where and leads to pointless warnings like this:

drivers/scsi/mvsas/mv_sas.c: In function 'mvs_update_phyinfo':
drivers/scsi/mvsas/mv_sas.c:1162:34: warning: comparison between 'enum sas_device_type' and 'enum sas_dev_type' [-Wenum-compare]

Fix by eliminating one of them. The one kept is effectively the sas.h
one, but call it sas_device_type and make sure the enums are all
properly namespaced with the SAS_ prefix.

Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# de2eb4d5 13-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: End the RNC resumption wait when the RNC is destroyed.

While the RNC is suspended for I/O cleanup, the remote device can be
stopped and the RNC setup for destruction. These changes accomodate that
case in the abort path.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 3ef768c6 12-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Manage the IREQ_NO_AUTO_FREE_TAG under scic_lock.

Since there is a possibilty of a timeout waiting for the RNC suspension,
handle the exit case from the task termination under scic_lock, and leave
the tag allocated if the termination timed-out.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 87805162 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Restore the ATAPI device RNC management code.

The ATAPI specific and STP general RNC suspension code had been
incorrectly removed from the remote device code.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 1f053889 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Don't wait for an RNC suspend if it's being destroyed.

Make sure that the wait for suspend can handle the RNC destruction case.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 8c731888 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Added timeouts to RNC suspensions in the abort path.

This change adds timeouts to the RNC suspension wait. It makes the
suspend and resume timeouts the same.

The previous resume timeout of 5 ms was too short, and timeouts were
seen in resumptions of devices in the abort task/LUN reset path - which
would receive an RNC resumed message within a tenth of a second later.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 0cce165e 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Wait for RNC resumption before leaving the abort path.

In the case of TMF execution, or device resets, wait for the RNC to fully
resume before returning to the caller. This ensures that the remote
device will not fail I/O requests while waiting for the RNC resumption to
complete.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 621120ca 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Manage tag releases differently when aborting tasks.

When an individual request is being terminated, the request's tag
is managed in the terminate function.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 033d19d2 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Callbacks to libsas occur under scic_lock and are synchronized.

This patch changes the callback mechanism to libsas to only occur while
the scic_lock is held; the abort path cleanup of I/Os also checks to make
sure IREQ_ABORT_PATH_ACTIVE is clear before proceding.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 0c3ce38f 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: When in the abort path, defeat other resume calls until done.

Completion of I/Os during the one of the abort path interface calls
from libsas can drive remote device state changes and the resumption
of the device RNC. This is a problem when the abort path is
attempting to cleanup outstanding I/O at the same time - the resumption
can prevent the termination from occuring correctly.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 31a38ef0 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Implement waiting for suspend in the abort path.

In order to prevent a device from receiving an I/O request while still
in an RNC suspending or resuming state (and therefore failing that
I/O back to libsas with a reset required status) wait for the RNC state
change before proceding in the abort path.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 9608b640 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Manage the LLHANG timer enable/disable per-device.

The LLHANG timer should be enabled once per device. This patch corrects
both the timer enable and the timer disable for the remote device.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 447bfbce 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Save the suspension hint for upcoming suspensions.

In the case of a suspend call while in SCI_RNC_POSTING or INVALIDATING
states, the LLHANG detect needed to be saved so the upcoming suspension
would enable it correctly. The unused suspend callback parameters were
removed.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# c94fc1ad 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Distinguish between remote device suspension cases

For NCQ error conditions among others, there is no need to enable
the link layer hang detect timer.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d6b2a0e4 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Remove isci_device reqs_in_process and dev_node from isci_device.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 033751f6 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Only set IDEV_GONE in the device stop path.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 59e35396 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Add suspension cases for RNC INVALIDATING, POSTING states.

The RNC can be any of the states in the loop from suspended to
ready when the API "suspend" or "resume" are called. This change
adds destination states parameters that control the suspension /
resumption action of the RNC statemachine for those transition states.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 14aaa9f0 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Redesign device suspension, abort, cleanup.

This commit changes the means by which outstanding I/Os are handled
for cleanup.
The likelihood is that this commit will be broken into smaller pieces,
however that will be a later revision. Among the changes:

- All completion structures have been removed from the tmf and
abort paths.
- Now using one completed I/O list, with the I/O completed in host bit being
used to select error or normal callback paths.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 83884014 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Remote device stop also suspends the RNC and terminates I/O.

Fixing the remote device state machine to suspend and terminate
all outstanding I/O before the device stopped state is reached.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 23ec2aa9 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Remote device must be suspended for NCQ cleanup.

When the remote device enters the NCQ error state, the device must
be suspended so that the I/O terminations can take place.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 5b6bf225 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Manage device suspensions during TC terminations.

TCs must be terminated only while the RNC is suspended. This commit
adds remote device suspensions and resumptions in the abort, reset and
termination paths.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 726980d5 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Terminate outstanding TCs on TX/RX RNC suspensions.

TCs must only be terminated when RNCs are suspended.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# ac78ed0f 08-Mar-2012 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Handle all suspending TC completions

Add comprehensive decode for all TC completions that generate RNC
suspensions.

Note that this commit also removes unconditional resumptions of ATAPI
devices when in the SCI_STP_DEV_ATAPI_ERROR state, and STP devices
when in the SCI_STP_DEV_IDLE state. This is because the SCI_STP_DEV_IDLE
and SCI_STP_DEV_ATAPI state entry functions manage the RNC resumption.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 11cc5183 01-Feb-2012 Dan Williams <dan.j.williams@intel.com>

isci: kill ->is_direct_attached

domain_device ->parent conveys the same information.

Occurrences of ->is_direct_attached appear next to incomplete open-coded
versions of dev_is_sata(), clean those up as well.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d7a0ccdd 10-Feb-2012 Dan Williams <dan.j.williams@intel.com>

[SCSI] isci: debug, provide state-enum-to-string conversions

Debugging the driver requires tracing the state transtions and tracing
state names is less work than decoding numbers.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 5a998328 12-Dec-2011 Dan Williams <dan.j.williams@intel.com>

[SCSI] isci: remove IDEV_EH hack to disable "discovery-time" ata resets

Prior to commit 61aaff49 "isci: filter broadcast change notifications
during SMP phy resets" we borrowed the MVS_DEV_EH approach from the
mvsas driver for preventing ->lldd_I_T_nexus_reset() events during ata
discovery. This hack was protecting against the old ->phy_reset() in
ata_bus_probe(), but since the conversion to the new error handling this
hack is preventing resets from reaching ata devices.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# fca4ecbd 04-Jan-2012 Dan Williams <dan.j.williams@intel.com>

[SCSI] isci: kill isci_port->status

It only tracks whether the port is stopping in order to gate new devices
being discovered while the port is stopping. However, since the check
and subsequent handling is unlocked there is nothing to stop the port
from going down immediately after the check.

Driver is already prepared to handle devices arriving on stale ports,
and those will be cleaned up by an eventual ->lldd_dev_gone()
notification.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# c132f692 04-Jan-2012 Dan Williams <dan.j.williams@intel.com>

[SCSI] isci: kill iphy->isci_port lookups

This field is a holdover from the OS abstraction conversion. The stable
phy to port lookups are done via iphy->ownining_port under scic_lock.
After this conversion to use port->lldd_port the only volatile lookup is
the initial lookup in isci_port_formed(). After that point any lookup
via a successfully notified domain_device is guaranteed to be valid
until the domain_device is destroyed.

Delete ->start_complete as it is only set once and is set as a
consequence of the port going link up, by definition of getting a port
formed event the port is "ready".

While we are correcting port lookups also move the asd_sas_port table
out from under the isci_port. This is to preclude any temptation to use
container_of() to convert an asd_sas_port to an isci_port, the
association is dynamic and under libsas control.

Tested-by: Maciej Trela <maciej.trela@intel.com>
[dmilburn@redhat.com: fix i686 compile error]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 7e629841 04-Jan-2012 Bartek Nowakowski <bartek.nowakowski@intel.com>

[SCSI] isci: enable wide port targets

Arrange for task_contexts prepared for the wide targets to account for
all the attached phys in the port.

Signed-off-by: Bartek Nowakowski <bartek.nowakowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 5412e25c 27-Oct-2011 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

[SCSI] isci: No need to manage the pending reset bit on pending requests.

The lldd does not need to look at or manage the pending device
reset bit in pending sas_tasks.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 3b34c169 27-Oct-2011 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

[SCSI] isci: Remove redundant isci_request.ttype field.

Use the existing IREQ_TMF flag as a request type indicator.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 98145cb7 27-Oct-2011 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

[SCSI] isci: Fix task management for SMP, SATA and on dev remove.

libsas uses the LLDD abort task interface to handle I/O timeouts
in the SATA/STP and SMP discovery paths, so this change will terminate
STP/SMP requests. Also, if the device is gone, the lldd will prevent
libsas from further escalations in the error handler.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# b50102d3 30-Sep-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>


# a5ec7f86 03-Jul-2011 James Bottomley <James.Bottomley@HansenPartnership.com>

[SCSI] isci: fix checkpatch errors

Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 34a99158 01-Jul-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill 'get/set' macros

Most of these simple dereference macros are longer than their open coded
equivalent. Deleting enum sci_controller_mode is thrown in for good
measure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 89a7301f 30-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: retire scic_sds_ and scic_ prefixes

The distinction between scic_sds_ scic_ and sci_ are no longer relevant
so just unify the prefixes on sci_. The distinction between isci_ and
sci_ is historically significant, and useful for comparing the old
'core' to the current Linux driver. 'sci_' represents the former core as
well as the routines that are closer to the hardware and protocol than
their 'isci_' brethren. sci == sas controller interface.

Also unwind the 'sds1' out of the parameter structs.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d9dcb4ba 30-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_host and scic_sds_controller

Remove the distinction between these two implementations and unify on
isci_host (local instances named ihost). Hmmm, we had two
'oem_parameters' instances, one was unused... nice.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 78a6f06e 30-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_remote_device and scic_sds_remote_device

Remove the distinction between these two implementations and unify on
isci_remote_device (local instances named idev).

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# ffe191c9 29-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_port and scic_sds_port

Remove the distinction between these two implementations and unify on
isci_port (local instances named iport). The duplicate '->owning_port' and
'->isci_port' in both isci_phy and isci_remote_device will be fixed in a later
patch... this is just the straightforward rename/unification.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 76802ce6 29-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: fix scic_sds_remote_device_terminate_requests

Commit 0815632 "isci: unify remote_device stop_handlers" introduced the
possibility that not all requests get terminated if we reach the
request_count. Now that we properly reference count devices we don't
need this self-defense and can do the straightforward scan of all active
requests.

Reported-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Acked-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 85280955 28-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_phy and scic_sds_phy

They are one in the same object so remove the distinction. The near
duplicate fields (owning_port, and isci_port) will be cleaned up
after the scic_sds_port isci_port unification.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 5076a1a9 27-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify isci_request and scic_sds_request

They are one in the same object so remove the distinction. The near
duplicate fields (owning_controller, and isci_host) will be cleaned up
after the scic_sds_contoller isci_host unification.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# db056250 17-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: preallocate requests

the dma_pool interface is optimized for object_size << page_size which
is not the case with isci_request objects and the dma_pool routines show
up in the top of the profile.

The old io_request_table which tracked whether tci slots were in-flight
or not is replaced with an IREQ_ACTIVE flag per request.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 9274f45e 23-Jun-2011 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: Terminate dev requests on FIS err bit rx in NCQ

When the remote device transitions to a not-ready state because of
an NCQ error condition, all outstanding requests to that device
are terminated and completed to libsas on the normal path. The
device then waits for a READ LOG EXT command to issue on the task
management path.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# ff60639d 17-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill device_sequence

Now that we have upleveled device reassignment protection to the
isci_remote_device reference count we no longer need this level of
self-defense.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# f2088267 16-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill isci_remote_device_change_state()

Now that "stopping/stopped" are one in the same and signalled by a NULL device
pointer the rest of the device status infrastructure can be removed (->status
and ->state_lock). The "not ready for i/o state" is replaced with a state
flag, and is evaluated under scic_lock so that we don't see transients from
taking the device reference to submitting the i/o.

This also fixes a potential leakage of can_queue slots in the rare case that
SAS_TASK_ABORTED is set at submission.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 209fae14 13-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: atomic device lookup and reference counting

We have unsafe references to remote devices that are notified to
disappear at lldd_dev_gone. In order to clean this up we need a single
canonical source for device lookups and stable references once a lookup
succeeds. Towards that end guarantee that domain_device.lldd_dev is
NULL as soon as we start the process of stopping a device. Any code
path that wants to safely lookup a remote device must do so through
task->dev->lldd_dev (isci_lookup_device()).

For in-flight references outside of scic_lock we need reference counting
to ensure that the device is not recycled before we are done with it.
Simplify device back references to just scic_sds_request.target_device
which is now the only permissible internal reference that is maintained
relative to the reference count.

There were two occasions where we wanted new i/o's to be treated as
SAS_TASK_UNDELIVERED but where the domain_dev->lldd_dev link is still
intact. Introduce a 'gone' flag to prevent i/o while waiting for libsas
to take action on the port down event.

One 'core' leftover is that we currently call
scic_remote_device_destruct() from isci_remote_device_deconstruct()
which is called when the 'core' says the device is stopped. It would be
more natural for the final put to trigger
isci_remote_device_deconstruct() but this implementation is deferred as
it requires other changes.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 980d3aeb 20-Jun-2011 Dan Williams <dan.j.williams@intel.com>

isci: fix isci_terminate_pending() list management

Walk through the list of pending requests being careful to consider that
multiple requests can be terminated when the lock is dropped (i.e.
invalidating the 'next' reference established by
list_for_each_entry_safe).

Also noticed that all callers to isci_terminate_pending_requests()
specifying terminating, so just drop the parameter.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 12ef6544 01-Jun-2011 Edmund Nadolski <edmund.nadolski@intel.com>

isci: additional state machine cleanup

Additional state machine cleanups:

o Remove static functions sci_state_machine_exit_state() and
sci_state_machine_enter_state()
o Combines sci_base_state_machine_construct() and
sci_base_state_machine_start() into a single function,
sci_init_sm()
o Remove sci_base_state_machine_stop() which is unused.
o Kill state_machine.[ch]

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
[fixed too large to inline functions]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# e301370a 01-Jun-2011 Edmund Nadolski <edmund.nadolski@intel.com>

isci: state machine cleanup

This cleans up several areas of the state machine mechanism:

o Rename sci_base_state_machine_change_state to sci_change_state
o Remove sci_base_state_machine_get_state function
o Rename 'state_machine' struct member to 'sm' in client structs
o Shorten the name of request states
o Shorten state machine state names as follows:
SCI_BASE_CONTROLLER_STATE_xxx to SCIC_xxx
SCI_BASE_PHY_STATE_xxx to SCI_PHY_xxx
SCIC_SDS_PHY_STARTING_SUBSTATE_xxx to SCI_PHY_SUB_xxx
SCI_BASE_PORT_STATE_xxx to SCI_PORT_xxx and
SCIC_SDS_PORT_READY_SUBSTATE_xxx to SCI_PORT_SUB_xxx
SCI_BASE_REMOTE_DEVICE_STATE_xxx to SCI_DEV_xxx
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_STP_DEV_xxx
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_xxx to SCI_SMP_DEV_xxx
SCIC_SDS_REMOTE_NODE_CONTEXT_xxx_STATE to SCI_RNC_xxx

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 9269e0e8 12-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: add some type safety to the state machine interface

Now that any given object type only has one state_machine we can use
container_of() to get back to the given state machine owner.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d1c637c3 11-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify request frame handlers

Unify the implementation in scic_sds_io_request_frame_handler and kill
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# f4636a7b 10-May-2011 Piotr Sawicki <piotr.sawicki@intel.com>

isci: unify request start handlers

Unify the implementation in scic_sds_request_start and kill the state
handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com>
[remove scic_sds_request_constructed_state_start_handler]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# e2f8db50 10-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: uplevel port infrastructure

* Move port configuration agent implementation
* Merge core/scic_sds_port.[ch] into port.[ch]

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d35bc1bd 10-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: uplevel phy infrastructure

Merge core/scic_sds_phy.[ch] into phy.[ch]

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# f1f52e75 10-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: uplevel request infrastructure

* Consolidate tiny header files
* Move files out of core/ (drop core/scic_sds_ prefix)
* Merge core/scic_sds_request.[ch] into request.[ch]
* Cleanup request.c namespace (clean forward declarations and global
namespace pollution)

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# cc9203bf 08-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: move core/controller to host

Now that the data structures are unified unify the implementation in
host.[ch] and cleanup namespace pollution.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 67ea838d 08-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify request data structures

Make scic_sds_request a proper member of isci_request. Also let's us
get rid of the dma pool object size tracking since we now know that all
requests are sizeof(isci_request). While cleaning up the construct
routine incidentally replaced SCI_FIELD_OFFSET with offsetof.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# e531381e 07-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify port data structures

Make scic_sds_port a member of isci_port and merge their lifetimes which
means removing the port table from scic_sds_controller in favor of the
one at the isci_host level. Merge ihost->sas_ports into ihost->ports.
_
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# cc3dbd0a 04-May-2011 Artur Wojcik <artur.wojcik@intel.com>

isci: unify isci_host data structures

Make it explicit that isci_host and scic_sds_controller are one in the same
object.

Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
[removed ->ihost back pointer]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d06b487b 02-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: implement I_T_nexus_reset

This is a requirement for 2.6.39's new libata eh.

Still some questions about lldd_dev_gone racing against dev->lldd_dev
lookups, but we are at least no more broken than mvsas in this regard.

We also short-circuit I_T_nexus_reset invocations from the device
discovery path (IDEV_EH similar to MVS_DEV_EH) to filter out the
resulting domain rediscoveries triggered by the reset.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 8694e792 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: removing intel_*.h headers

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 2d9c2240 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: Using Linux SSP frame header

Removing of struct sci_ssp_frame_header and migrate to struct ssp_frame_hdr.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# e76d6180 04-May-2011 Dave Jiang <dave.jiang@intel.com>

isci: Convert ATA defines to Linux native defines

* Removing all intel_sata and intel_ata defines
* Removing the usage of SAT_PROTOCOL_*. We can get everything from sas_task
* Moved SATA FIS types to local sas.h. These defines will have to go
into include/scsi/sas.h eventually.
* Added offsets for SATA FIS header in order to grab the values

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 971cc2ff 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill scic_sds_remote_device.state_handlers

Remove the now unused state_handler infrastructure for remote_devices.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 01bec778 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device frame_handlers

Implement all states in scic_sds_remote_device_frame() and delete
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# e622571f 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device event_handlers

Implement all states in scic_sds_remote_device_event() and delete
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 978edfef 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill remote_device resume_handler

This is unused infrastructure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 323f0ec0 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device suspend_handlers

Implement all states in scic_sds_remote_device_suspend() and delete
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# e4a867bb 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill remote_device complete_task_handler

This is unused infrastructure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 84b9b029 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device start_task_handlers

Implement all states in scic_sds_remote_device_start_task() and delete
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# c027a20b 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill remote_device continue_io_handler

This is unused infrastructure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 10a09e64 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device complete_io_handlers

Implement all states in scic_sds_remote_device_complete_io() and delete
the state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 18606557 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device start_io_handlers

Implement all states in scic_sds_remote_device_start_io() and delete the
state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 81515182 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device reset_complete_handlers

Implement all states in scic_remote_device_reset_complete() and delete the
state handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 4fd0d2e9 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device reset_handlers

Implement all states in scic_remote_device_reset() and delete the state
handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# b8d82f6c 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device destruct_handlers

Implement all states in scic_remote_device_destruct() and delete the state
handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 1a6de256 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill remote_device fail_handler

This is just unused infrastructure.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# ec575669 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device stop_handlers

Implement all states in scic_remote_device_stop() and delete the state
handlers.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# eb229671 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device start_handlers

Implement all states in scic_remote_device_start() and delete the state
handler.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# f619fffb 01-May-2011 Dan Williams <dan.j.williams@intel.com>

isci: fix remote_device start_io regressions

While reducing indentation commits 7ab92c9e "isci: make a
remote_node_context a proper member of a remote_device", 0879e6a6 "isci:
merge remote_device substates into a single state machine" broke
handling of situations where i/o's successfully started at the port
level need to terminated when the remote_node declines to start the i/o.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 8f304c36 29-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill scic_remote_device_get_connection_rate

A function call to dereference a pointer is a tad much.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# ab2e8f7d 27-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: merge remote_device substates into a single state machine

A substate is just a state, so uplevel the smp and stp device substates.
Three tricks at work here:

1/ scic_sds_remote_device_ready_state_enter: needs to know the the device type
so it can immediately transition to a stp or smp ready substate.

2/ scic_sds_remote_device_ready_state_exit: needs to know the device type. In
the ssp case the device is no longer ready, in the stp, and smp case we have
simply exited to a ready "substate".

3/ scic_sds_remote_device_resume_complete_handler: The one location
where we directly check the current state against
SCI_BASE_REMOTE_DEVICE_STATE_READY needed to comprehend the possible ready
substates.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# af23e857 28-Apr-2011 Maciej Patelczyk <maciej.patelczyk@intel.com>

isci: Removed sci_base_object from scic_sds_remote_node_context.

The 'struct sci_base_object' was removed from the struct
scic_sds_remote_node_context.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 5d937e96 28-Apr-2011 Maciej Patelczyk <maciej.patelczyk@intel.com>

isci: Removed sci_base_object from scic_sds_remote_device.

The 'struct sci_base_object' was removed from the struct
scic_sds_remote_device.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[cleaned up sci_dev_to_idev]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d3757c3a 28-Apr-2011 Maciej Patelczyk <maciej.patelczyk@intel.com>

isci: Removed sci_base_object from scic_sds_controller.

The 'struct sci_base_object' was removed from the struct
scic_sds_controller and was replaced by a pointer to
struct isci_host.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 9a0fff7b 28-Apr-2011 Maciej Patelczyk <maciej.patelczyk@intel.com>

isci: Removed struct sci_base_object from state machine.

Changed any occurrence of struct sci_base_object into void.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 3d6e428c 26-Apr-2011 Dave Jiang <dave.jiang@intel.com>

isci: removing non-working ATAPI code

Removing not used / bit-rotten ATAPI code. This needs to go back
and debugged at a later date.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[reflow against devel, delete dead sati headers]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# a3d568f0 26-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: remove usage of sci_sas_address in scic_sds_remote_device

The sas address can be retrieved from the domain device and then
converted to the always little-endian format in the remote node context.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 00d680ef 25-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill smp_discover_response

An lldd need never look at the contents of an smp_discover_response frame.
Kill the remaining locations where isci is looking at it:

1/ covering for expanders that do not set the stp_attached bit (already
handled by sas_ex_discover_end_dev)
2/ an overkill method to notifiy the rest of the driver about remote_device
sas addresses

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# a1a113b0 21-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill smp_discover_response_protocols in favor of domain_device.dev_type

This is step 1 of removing the contortions to:
1/ unparse expander phy data into a smp discover frame
2/ open-code-parse the smp discover fram into a domain_device.dev_type equivalent

libsas has already spent cycles determining the dev_type, so now that
scic_sds_remote_device is unified with isci_remote_device we can
directly reference dev_type.

This might also change multi-level expander detection as we previously only
looked at dev_type == EDGE_DEV and we did not consider the FANOUT_DEV case.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# b87ee307 25-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: cleanup remote device construction and comments

The construction routines scic_remote_device_[de]a_construct both reference
the need to call scic_remote_device_construct first. Delete that comment and
just have them call it explicitly, also:
* move the comments from header to source
* delete dead references to scic_[de]a_remote_device_add_phy

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 88f3b62a 22-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: move remote_device handling out of the core

Now that the core/lldd remote_device data structures are nominally unified
merge the corresponding sources into the top-level directory. Also move the
remote_node_context infrastructure which has no analog at the lldd level.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 57f20f4e 21-Apr-2011 Dan Williams <dan.j.williams@intel.com>

isci: unify remote_device data structures

Make it explicit that isci_remote_device and scic_sds_remote_device are
one in the same object.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 6cb4d6b3 12-Apr-2011 Bartosz Barcinski <Bartosz.Barcinski@intel.com>

isci: audit usage of BUG_ON macro in isci driver

Removes unnecessary usage of BUG_ON macro, excluding core directory.
In some cases macro is unnecesary, check is done in caller function.
In other cases macro is replaced by if construction with
appropriate warning.

Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[changed some survivable bug conditions to WARN_ONCE]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 467e855a 12-Apr-2011 Bartosz Barcinski <Bartosz.Barcinski@intel.com>

isci: sparse warnings cleanup

Clean warnings and errors reported by sparse tool.

request.c:430:50: warning: mixing different enum types
remote_device.c:534:39: warning: symbol 'flags' shadows an earlier one
task.c:495:44: warning: mixing different enum types
scic_sds_controller.c:2155:24: warning: mixing different enum types
scic_sds_controller.c:2272:36: warning: mixing different enum types
scic_sds_controller.c:2911:38: warning: incorrect type in initializer (different address spaces)
scic_sds_controller.c:2913:25: warning: incorrect type in argument 2 (different address spaces)
scic_sds_request.c:875:34: warning: cast removes address space of expression
scic_sds_request.c:876:123: warning: incorrect type in argument 2 (different address spaces)
scic_sds_port.c:585:51: warning: incorrect type in assignment (different address spaces)
scic_sds_port.c:712:9: warning: incorrect type in argument 2 (different address spaces)
scic_sds_port.c:1770:25: warning: incorrect type in argument 2 (different address spaces)

Signed-off-by: Bartosz Barcinski <Bartosz.Barcinski@intel.com>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[fixed up some false positives and misconversions]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 4393aa4e 31-Mar-2011 Dan Williams <dan.j.williams@intel.com>

isci: fix fragile/conditional isci_host lookups

A domain_device can always reference back to ->lldd_ha unlike local lldd
structures. Fix up cases where the driver uses local objects to look up the
isci_host. This also changes the calling conventions of some routines to
expect a valid isci_host parameter rather than re-lookup the pointer on entry.

Incidentally cleans up some macros that are longer to type than the open-coded
equivalent:
isci_host_from_sas_ha
isci_dev_from_domain_dev

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 037afc78 31-Mar-2011 Dan Williams <dan.j.williams@intel.com>

isci: cleanup isci_remote_device[_not]_ready interface

Require a valid isci_host in support of the general cleanup to not
re-lookup the host via potentially fragile methods when more robust
methods are available. Also cleans up some more casting that should be
using container_of() to up-cast a base structure in a more type-safe
manner.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 6e2802a7 08-Mar-2011 Jeff Skirvin <jeffrey.d.skirvin@intel.com>

isci: All pending requests are terminated before stopping the device.

Make sure all pending I/O including any in the libsas error handler
process is cleaned-up.

Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 1a38045b 03-Mar-2011 Dan Williams <dan.j.williams@intel.com>

isci: replace remote_device_lock with scic_lock

The remote_device_lock is currently used to protect a controller global
resource (RNCs), but the remote_device_lock is per-port.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d9c37390 03-Mar-2011 Dan Williams <dan.j.williams@intel.com>

isci: preallocate remote devices

Until we synchronize against device removal this limits the damage of
use after free bugs to the driver's own objects. Unless we implement
reference counting we need to ensure at least a subset of a remote
device is valid at all times. We follow the lead of other libsas
drivers that also preallocate devices.

This also enforces maximum remote device accounting at the lldd layer,
but the core may still run out of RNC's before we hit this limit.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 6ad31fec 04-Mar-2011 Dan Williams <dan.j.williams@intel.com>

isci: replace isci_remote_device completion with event queue

Replace the device completion infrastructure with the controller wide
event queue. There was a potential for the stop and ready notifications
to corrupt each other, now that cannot happen.

The stop pending flag cannot be used until devices are statically
allocated. We temporarily need to maintain a completion to handle
waiting for an object that has disappeared, but we can at least stop
scribbling on freed memory.

A future change will also get rid of the "stopping" state as it should
not be exposed to the rest of the driver.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 8acaec15 07-Mar-2011 Dan Williams <dan.j.williams@intel.com>

isci: kill "host quiesce" mechanism

The midlayer is already throttling i/o in the places where host_quiesce
was trying to prevent further i/o to the device. It's also problematic
in that it holds a lock over GFP_KERNEL allocations.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 3a97eec6 04-Mar-2011 Dan Williams <dan.j.williams@intel.com>

isci: remove sci_device_handle

It belies the fact that isci_remote_device and scic_sds_remote_device
are one in same object with the same lifetime rules.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# d7628d05 02-Mar-2011 Dave Jiang <dave.jiang@intel.com>

isci: Cleanup warning messages for phy resets

Moving some of the chattiness of warning messages to debug so only the Linux
system messages are shown.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 83f5eeef 18-Feb-2011 Dan Williams <dan.j.williams@intel.com>

isci: debug fixes

Some of the chain walks to get back to our dev are invalid.

isci_remote_device_change_state: delete rather than adding conditional deref
chain walking
isci_request_change_state: fix, it was being called too early
isci_request_ssp_io_request_get_lun: fix compile breakage hidden by ifdef DEBUG

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 0cf89d1d 18-Feb-2011 Dan Williams <dan.j.williams@intel.com>

isci: cleanup "starting" state handling

The lldd actively disallows requests in the "starting" state. Retrying
or holding off commands in this state is sub-optimal:
1/ it adds another state check to the fast path
2/ retrying can cause libsas to give up

However, isci's ->lldd_dev_found() routine already waits for controller
start to complete before allowing further progress. Checking the
"starting" state in isci_task_execute_task and the isr is redundant and
misleading. Clean this up and introduce a controller-wide event queue
to start reeling in "completion" proliferation in the driver.

The "stopping" state cleanups are in a similar vein, rely on the the isr
and other paths being precluded from occurring rather than implementing
state checking logic.

Reported-by: Christoph Hellwig <hch@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>


# 6f231dda 02-Jul-2011 Dan Williams <dan.j.williams@intel.com>

isci: Intel(R) C600 Series Chipset Storage Control Unit Driver

Support for the up to 2x4-port 6Gb/s SAS controllers embedded in the
chipset.

This is a snapshot of the first publicly available version of the driver,
commit 4c1db2d0 in the 'historical' branch.

git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git historical

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>