Piotr Sawicki [Wed, 11 May 2011 23:52:21 +0000 (23:52 +0000)]
isci: merge port ready substates into primary state machine
This conversion was complicated by the fact that the ready state exit routine
took unconditional action beyond just stopping the substate machine (like in
previous conversions). In order to ensure identical behaviour every state
transition needs to be instrumented to catch ready-->!ready transitions and
execute scic_sds_port_invalidate_dummy_remote_node()
Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Piotr Sawicki <piotr.sawicki@intel.com>
[fix ready state exit handling] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Thu, 12 May 2011 13:00:31 +0000 (06:00 -0700)]
isci: clarify phy to port lookups
While cleaning up the driver it is very tempting to convert scic_sds_get_*
macros to their open coded equivalent. They are all just pointer dereferences
*except* scic_sds_phy_get_port() which returns NULL if the phy is assigned to
the dummy port. Clarify this by renaming it to phy_get_non_dummy_port().
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Adam Gruchala [Tue, 10 May 2011 23:54:23 +0000 (23:54 +0000)]
isci: merge phy substates
Merged states and substates into one state machine, as we always
unconditionally transitioned to the substate machine it was straightforward to
enter that substate from the starting state.
Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Adam Gruchala <adam.gruchala@intel.com>
[fixed construction, starting_state_enter, and starting check] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Wed, 11 May 2011 15:27:47 +0000 (08:27 -0700)]
isci: remove request task context completion state handler
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>
Piotr Sawicki [Tue, 10 May 2011 23:50:32 +0000 (23:50 +0000)]
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>
Dan Williams [Tue, 10 May 2011 09:28:49 +0000 (02:28 -0700)]
isci: merge stp request substates into primary state machine
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>
Dan Williams [Tue, 10 May 2011 09:28:48 +0000 (02:28 -0700)]
isci: merge smp request substates into primary state machine
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>
Dan Williams [Tue, 10 May 2011 09:28:47 +0000 (02:28 -0700)]
isci: merge ssp task management substates into primary state machine
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>
Dan Williams [Sun, 8 May 2011 22:49:15 +0000 (15:49 -0700)]
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>
Dan Williams [Sun, 8 May 2011 18:47:15 +0000 (11:47 -0700)]
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>
Dan Williams [Sun, 8 May 2011 02:07:14 +0000 (19:07 -0700)]
isci: move task context alignment from run-time to compile time
Remove usage of PTR_ALIGN by arranging for the task context to be aligned by
the compiler. Another step towards unifying isci_request and
scic_sds_request. Once this is complete the task context in the request can
likely be removed in favor of building the task directly to tc memory (see:
scic_sds_controller_copy_task_context). It's not clear why this needs to be
cacheline aligned if we just end up copying before submission...
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Sat, 7 May 2011 17:11:43 +0000 (10:11 -0700)]
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>
Dan Williams [Sat, 7 May 2011 00:36:38 +0000 (17:36 -0700)]
isci: unify phy data structures
Make scic_sds_phy a member of isci_phy and merge their lifetimes which
means removing the phy table from scic_sds_controller in favor of the
one at that isci_host level.
Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Mon, 2 May 2011 20:59:25 +0000 (13:59 -0700)]
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>
Dan Williams [Fri, 6 May 2011 00:47:44 +0000 (17:47 -0700)]
isci: fix ata locking
Upstream commit a29b5dad "libata: fix locking for sas paths" switched
libsas ata locking to the ata_host lock. We need to do the same when
returning ata tasks from the execute path.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dave Jiang [Thu, 5 May 2011 01:28:32 +0000 (18:28 -0700)]
isci: Remove SCIC_SWAP_DWORD()
Use Linux native swab32() call instead of SCIC_SWAP_DWORD().
We need to swab() because the hardware munges the data into a
"big-endian dword" stream which is byte-swapped from the sas definition
regardless of host endian.
Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dave Jiang [Thu, 5 May 2011 01:22:33 +0000 (18:22 -0700)]
isci: fixup SAS iaf protocols data structure
Moved the actual data structure that's read from the phy register to phy
header. Removed the parsing of identify address frame protocol bits as
that seemed not necessary and we can use existing information.
Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dave Jiang [Thu, 5 May 2011 00:53:24 +0000 (17:53 -0700)]
isci: Convert of sci_ssp_response_iu to ssp_response_iu
Converting to Linux native format. However the isci driver does a lot of
the calculation based on the max size of this data structure and the
Linux data structure only has a pointer to the response data. Thus the
sizeof(struct ssp_response_iu) will be incorrect and we need to define
the max size.
Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dave Jiang [Wed, 4 May 2011 23:16:44 +0000 (16:16 -0700)]
isci: renaming sas_capabilities to scic_phy_cap
This seems to be a data structure that represents the phy capabilities
register from the hardware and has nothing to do with SAS data structs.
Moving and fixup
Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dave Jiang [Wed, 4 May 2011 22:02:03 +0000 (15:02 -0700)]
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>
Dan Williams [Sun, 1 May 2011 17:13:04 +0000 (10:13 -0700)]
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>
Dan Williams [Wed, 27 Apr 2011 23:32:45 +0000 (16:32 -0700)]
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>
Maciej Patelczyk [Thu, 28 Apr 2011 22:06:36 +0000 (22:06 +0000)]
isci: Removed sci_object.h from project.
The sci_object.h file was removed. No sci_base_object
is now in the code.
Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Tue, 26 Apr 2011 20:19:53 +0000 (13:19 -0700)]
isci: allow fallback to option-rom if efi variable retrieval fails
If the scu efi driver is disabled but the option-rom is enabled (during an efi
boot) allow the code to fallback to scanning legacy option-rom space for the
parameters.
Reported-by: Yinghai Lu <yinghai.lu@oracle.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dave Jiang [Tue, 26 Apr 2011 19:31:37 +0000 (12:31 -0700)]
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>
Dan Williams [Mon, 25 Apr 2011 21:29:29 +0000 (14:29 -0700)]
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>
Dan Williams [Fri, 22 Apr 2011 01:44:45 +0000 (18:44 -0700)]
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>
Dan Williams [Mon, 25 Apr 2011 18:48:29 +0000 (11:48 -0700)]
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>
Dan Williams [Sat, 23 Apr 2011 02:18:03 +0000 (19:18 -0700)]
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>
Dan Williams [Tue, 19 Apr 2011 20:48:49 +0000 (13:48 -0700)]
isci: make a remote_node_context a proper member of a remote_device
A rnc object has the same lifetime as its associated remote_device. It might
get re-initialized, but a remote device always has an rnc member. Preparation
for unifying scic_sds_remote_device and isci_remote_device
Signed-off-by: Dan Williams <dan.j.williams@intel.com>