Commit Graph

253301 Commits (67ea838d17acdad3331aeae848683c768df96aaa)

Author SHA1 Message Date
Dan Williams 67ea838d17 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>
2011-07-03 04:04:47 -07:00
Dan Williams b7645818cf isci: make command/response iu explicit request object members
Final elimination of the anonymous data at the end of the request
structure.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:47 -07:00
Dan Williams 26298264a5 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>
2011-07-03 04:04:47 -07:00
Dan Williams 0d84366fbe isci: make sgl explicit/aligned request object member
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>
2011-07-03 04:04:47 -07:00
Dan Williams 827a84d4e0 isci: move stp request info to scic_sds_request
In preparation for unifying allocation of all request information make stp
data available in all requests.  Incidentally collapse indentation.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:47 -07:00
Dan Williams e531381e2f 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>
2011-07-03 04:04:47 -07:00
Dan Williams 4b33981ade 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>
2011-07-03 04:04:47 -07:00
Jacek Danecki a98a7426bc isci: rnc state machine table c99 conversion
This makes the subsequent patches to delete rnc->state_handler more
clear.

Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:47 -07:00
Edmund Nadolski b9988b8e7f isci: remove scic_sds_port_increment_request_count
Removes excessive encapsulation function.

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:46 -07:00
Edmund Nadolski ed30c275dd isci: kill scic_controller_get_port_handle function
This function is just overkill and its usage is inconsistent. Replace
with inlined code.

Signed-off-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:46 -07:00
Dave Jiang 9286a1959c isci: Removing unnecessary functions in request.c
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>
2011-07-03 04:04:46 -07:00
Artur Wojcik cc3dbd0a91 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>
2011-07-03 04:04:46 -07:00
Dan Williams d06b487b78 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>
2011-07-03 04:04:46 -07:00
Dan Williams 5b3f2bd877 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>
2011-07-03 04:04:46 -07:00
Dave Jiang 8694e79287 isci: removing intel_*.h headers
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:46 -07:00
Dave Jiang 2d9c2240e0 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>
2011-07-03 04:04:46 -07:00
Dave Jiang 51a57cff7c 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>
2011-07-03 04:04:46 -07:00
Dave Jiang d7b90fc343 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>
2011-07-03 04:04:46 -07:00
Dave Jiang f700ad4331 isci: remove redundant copies of IAF
We need to remove the extra copies of identify address frame that's
being kept around. We only need the one copy that libsas is using.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
[further cleanups]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:46 -07:00
Dave Jiang d20930a2b3 isci: Converting smp_response to Linux native smp_resp
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:46 -07:00
Dave Jiang 2ec53eb4d5 isci: Fixup of smp request
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>
2011-07-03 04:04:46 -07:00
Dave Jiang af5ae89350 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>
2011-07-03 04:04:46 -07:00
Dave Jiang 0cfa890e5a isci: Fixup SSP command IU and task IU
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>
2011-07-03 04:04:46 -07:00
Dave Jiang ed0e24830e 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>
2011-07-03 04:04:46 -07:00
Dave Jiang 1dea554fce isci: Collapsing of phy_type data structure
Collapsing of struct scic_sds_phy phy_type data structure

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:46 -07:00
Dave Jiang 4b7ebd05fc isci: Convert SAS identify address frame to Linux Native format
Convert struct sci_sas_identify_address_frame to struct sas_identify_frame

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:46 -07:00
Dave Jiang e76d6180da 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>
2011-07-03 04:04:46 -07:00
Dave Jiang f2f300806f isci: Convert SATA fis data structures to Linux native
Converting of sata_fis_reg_d2h to dev_to_host_fis
Converting of sata_fis_reg_h2d to host_to_dev_fis

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams c6d4225789 isci: remove compile-time (Kconfig) silicon configuration
Pre-production silicon support is deprecated, and will be removed
completely in the future.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dave Jiang d6f6404c03 isci: Removing unused define SCIC_SDS_4_ENABLED
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03 04:04:45 -07:00
Dan Williams 971cc2ff90 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>
2011-07-03 04:04:45 -07:00
Dan Williams 01bec7788d 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>
2011-07-03 04:04:45 -07:00
Dan Williams e622571f0f 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>
2011-07-03 04:04:45 -07:00
Dan Williams 978edfef46 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>
2011-07-03 04:04:45 -07:00
Dan Williams 323f0ec0fc 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>
2011-07-03 04:04:45 -07:00
Dan Williams e4a867bb4a 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>
2011-07-03 04:04:45 -07:00
Dan Williams 84b9b029bc 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>
2011-07-03 04:04:45 -07:00
Dan Williams c027a20bf3 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>
2011-07-03 04:04:45 -07:00
Dan Williams 10a09e64be 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>
2011-07-03 04:04:45 -07:00
Dan Williams 1860655706 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>
2011-07-03 04:04:45 -07:00
Dan Williams 8151518265 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>
2011-07-03 04:04:45 -07:00
Dan Williams 4fd0d2e9bf 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>
2011-07-03 04:04:45 -07:00
Dan Williams b8d82f6cdd 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>
2011-07-03 04:04:45 -07:00
Dan Williams 1a6de2562b 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>
2011-07-03 04:04:45 -07:00
Dan Williams ec5756699b 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>
2011-07-03 04:04:45 -07:00
Dan Williams eb229671b1 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>
2011-07-03 04:04:44 -07:00
Dan Williams f619fffb40 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>
2011-07-03 04:00:39 -07:00
Dan Williams 8f304c36ee 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>
2011-07-03 04:00:39 -07:00
Dan Williams ab2e8f7d07 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>
2011-07-03 04:00:39 -07:00
Maciej Patelczyk be2f41c611 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>
2011-07-03 04:00:39 -07:00