History log of /linux-master/drivers/scsi/isci/remote_device.h
Revision Date Author Comments
# 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>


# 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>


# 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>


# 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>


# 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>


# 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>


# 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>


# 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>


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

isci: Manage the link layer hang detect timer for RNC suspensions.

For STP devices under certain protocol conditions, an RNC will not
suspend until the current transfer state is broken with a SYNC/ESC
sequence from the SCU. The SYNC/ESC driven by expiration of the
SCU link layer hang detect timer, which has too small a dynamic
range to support slow SATA devices, so normally it is disabled.

This change enables the timer with the minimum period at the point
when the suspension is requested.

Note that there is potential collateral damage to other open
connections to slow SATA devices on the same port, since there
is no alternative but to enable the LLHANG timer on every phy in
the port for the current suspension request - there is no way to
tell on which phy the RNC in question is currently active.

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>


# 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>


# 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>


# 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>


# 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>


# 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>


# 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>


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

isci: unify constants

cross driver constants are spread out over multiple header files, consolidate
them into isci.h, and push some includes out to the source files that need
them.

TODO: remove SCI_MODE_SIZE infrastructure.
TODO: task.h is full of inlines that are too large

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>


# 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>


# 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>


# 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>


# 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>


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

isci: remove scic_sds_remote_device_get_port_index

Longer to type than the open-coded equivalent.

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>


# 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>


# 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>


# 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>


# 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>


# 7392d275 23-Feb-2011 Dave Jiang <dave.jiang@intel.com>

isci: Removing deprecated functions

Removed all callbacks in the deprecated.c. Core will call the appropriate
functions directly.

Signed-off-by: Dave Jiang <dave.jiang@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>