With these handlers gone the rest of the state handler infrastructure is
removed.
Added some WARN_ONCEs where previously we would cause NULL pointer
dereferences or silently run handlers from a previous state.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Unlike the other conversions this only updates
scic_sds_io_request_tc_completion() to call the old state handlers directly
(with less verbose names). This was done for future patch readability, the
implementations have only minor differences for different completion codes.
Without a reference to the function name it would be difficult to dicern which
state is being updated. Considered changing the order to look up the
completion code before the state but that was not a clean conversion either.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
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>
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>
Unify the implementation in scic_sds_io_request_terminate and kill the state
handler.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Remove usage of the request substate machine for stp requests, and kill
the request substate infrastructure.
Similar to the previous conversions this adds the substates to the
primary state machine and arranges for the 'started' state to transition
to the proper stp substate.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Remove usage of the request substate machine for smp requests identified by:
task->task_proto == SAS_PROTOCOL_SMP
While merging over the smp_request infrastructure noticed that all the
assign buffer implementations are now equal, so moved it to
scic_sds_general_request_construct.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Remove usage of the request substate machine for ssp task management
requests identified by:
ireq->ttype == tmf_task && dev->dev_type == SAS_END_DEV;
The only routine that checks the base 'started' state is
scic_sds_io_request_tc_completion which calls the substate machine
handler if we are not in the 'started' state or we are 'started' and no
substate machine is defined. This routine requires no conversion
because we have transitioned out of 'started' and the substate routine
will be called naturally as a result.
There are also no side effects of this conversion on exiting the
'started', state because it only stops the substate machine, which is no
longer relevant for this transaction type.
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* 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>
* 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>
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>
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>
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>
Towards unifying request objects we need all members to be defined in the
object and not carved out of anonymous buffer space.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
No need for wrappers, just access sas_task directly.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
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>
The struct smp_request data structure has be fixed up for Linux consumption.
This probably should go to scsi/sas.h eventually.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Fixup of SSP command IU and SSP task IU to something that looks like Linux
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
The 'struct sci_base_object' was removed from the struct
scic_sds_request and was replaced by a pointer to
struct isci_request.
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
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>
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>
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>
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>
In the case of internal discovery related STP/SATA I/O started
through sas_execute_task the host lock is not taken by libsas before
calling lldd_execute_task, so the lock should not be managed before
calling back to libsas through task->task_done or sas_task_abort.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
In the case of I/O requests that fail at submit time because of a
pending reset condition, the host lock for SATA/STP devices must be
managed for any SCSI-initiated I/O before sas_task_abort is called.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* mark needlessly global routines static
* delete unused functions
* move kernel-doc blocks from header files to source
* reorder some functions to delete declarations
* more default handler cleanups phy
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
In the case where submitted I/Os fail with the status code
SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, the execute function now waits
until scic_lock is cleared before calling the helper function
"isci_request_signal_device_reset" which sets the flag for the pending
reset condition on the I/O.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
In the case of I/O requests being failed because of a required device
reset condition, set the response and status to indicate an I/O failure.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
The pointer to the core representation of a request is marked NULL at
completion, but we need to save the i/o tag for task management.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
[revise changelog]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
If there is a pending device reset, the I/O is used to accomplish the reset by setting the
RESET bit in the task status, and then putting the task into the error handler
path using sas abort task.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Corrected use of the request state_lock in the completion callback.
In the case where an abort (or reset) thread is trying to terminate an
I/O request, it sets the request state to "aborting" (or "terminating")
if the state is still "starting". One of the bugs was to never set the
state to "completed". Another was to not correctly recognize the
situation where the I/O had completed but the sas_task was still pending
callback to task_done - this was typically a problem in the LUN and
device reset cases.
It is now possible that we leave isci_task_abort_task() with
request->io_request_completion pointing to localy allocated
aborted_io_completion struct. It may result in a system crash.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Maciej Trela <Maciej.Trela@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Changes to move management of the reqs_in_process entry for the request here.
Made changes to note when the task is already in the abort path and
cannot be completed through callbacks.
Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
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>
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>
It's an unnecessary typedef that mirrors the kernel's enum
dma_data_direction.
Also cleanup some long variable names along the way.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
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>