summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2011-07-03isci: unify remote_device stop_handlersDan Williams
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-03isci: unify remote_device start_handlersDan Williams
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-03isci: fix remote_device start_io regressionsDan Williams
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-03isci: kill scic_remote_device_get_connection_rateDan Williams
A function call to dereference a pointer is a tad much. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: merge remote_device substates into a single state machineDan Williams
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-03isci: Removed sci_object.h from project.Maciej Patelczyk
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-03isci: Removed sci_base_object from scic_sds_request.Maciej Patelczyk
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>
2011-07-03isci: Removed sci_base_object from scic_sds_remote_node_context.Maciej Patelczyk
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>
2011-07-03isci: Removed sci_base_object from scic_sds_remote_device.Maciej Patelczyk
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>
2011-07-03isci: Removed sci_base_object from scic_sds_port.Maciej Patelczyk
The 'struct sci_base_object' was removed from the struct scic_sds_port and was replaced by a pointer to struct isci_port. Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Removed sci_base_object from scic_sds_phy.Maciej Patelczyk
The 'struct sci_base_object' was removed from the struct scic_sds_phy and was replaced by a pointer to struct isci_phy. Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Removed sci_base_object from scic_sds_controller.Maciej Patelczyk
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>
2011-07-03isci: Removed struct sci_base_object from state machine.Maciej Patelczyk
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>
2011-07-03isci: Implement SCU AFE recipe 10.Maciej Patelczyk
Updated SCU AFE initialization values accordingly to the recipe 10. Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Remove excessive log noise with expander hot-unplugDave Jiang
We are logging excessive output when hot unplug from expander. Moving that to debug. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: allow fallback to option-rom if efi variable retrieval failsDan Williams
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>
2011-07-03isci: removing non-working ATAPI codeDave Jiang
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>
2011-07-03isci: remove scic_sds_remote_device_get_port_indexDan Williams
Longer to type than the open-coded equivalent. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove usage of sci_sas_address in scic_sds_remote_deviceDan Williams
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>
2011-07-03isci: kill smp_discover_responseDan Williams
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>
2011-07-03isci: kill smp_discover_response_protocols in favor of domain_device.dev_typeDan Williams
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>
2011-07-03isci: cleanup remote device construction and commentsDan Williams
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>
2011-07-03isci: move remote_device handling out of the coreDan Williams
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>
2011-07-03isci: unify remote_device data structuresDan Williams
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>
2011-07-03isci: remove rnc->device back pointerDan Williams
Now that they are one in the same object remove the back pointer reference in favor of container_of. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: make a remote_node_context a proper member of a remote_deviceDan Williams
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>
2011-07-03isci: rely on irq core for intx multiplexing, and silence screaming intxDan Williams
Remove the extra logic to poll each controller for interrupts, that's the core's job for shared interrupts. While testing noticed that a number of interrupts fire while waiting for the completion tasklet to run, so added an irq-ack. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: replace this_* and the_* variables with more meaningful namesDave Jiang
Removed any instances of the_* and this_* to variable names that are more meaningful and tell us what they actually are. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: validate oem parameters early, and fallbackDan Williams
If the platform specifies invalid parameters warn the user and fallback to internal defaults rather than fail the driver load altogether. Reported-by: Yinghai Lu <yinghai.lu@oracle.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: fix oem parameter header definitionDan Williams
The element_length is 2 bytes. Reported-by: Yinghai Lu <yinghai.lu@oracle.com> Acked-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: audit usage of BUG_ON macro in isci driverBartosz Barcinski
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>
2011-07-03isci: sparse warnings cleanupBartosz Barcinski
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>
2011-07-03isci: replace sci_sas_link_rate with sas_linkrateDan Williams
Drop duplicated enum definition. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove base_phy abstractionMaciej Trela
Merge struct sci_base_phy into scic_sds_phy. Until now sci_base_phy was referenced using scic_sds_phy->parent field. 'sci_base_phy' state machine handlers were also merged into scic_sds_phy state handlers. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Maciej Trela <Maciej.Trela@intel.com> Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove base_port abstractionMaciej Trela
Merge struct sci_base_port into scic_sds_port. Until now sci_base_port was referenced indirectly with scic_sds_port->parent field. 'sci_base_port' state machine handlers were also incorporated into scic_sds_port handlers. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Maciej Trela <Maciej.Trela@intel.com> Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove base_remote_device abstractionMaciej Trela
Merge struct sci_base_remote_device into scic_sds_remote_device. As for now sci_base_remote_device was accessed indirectly using scic_sds_remote_device->parent field. Both machine state handlers are also merged together. Reported-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Maciej Trela <Maciej.Trela@intel.com> Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove scic_controller state handlersChristoph Hellwig
Remove the state handler indirections for the scic_controller, and replace them with procedural calls that check for the correct state first. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: simplify dma coherent allocationChristoph Hellwig
Remove the insane infrastructure for preallocating coheren DMA regions, and just allocate the memory where needed. This also gets rid of the aligment adjustments given that Documentation/DMA-API-HOWTO.txt sais: "The cpu return address and the DMA bus master address are both guaranteed to be aligned to the smallest PAGE_SIZE order which is greater than or equal to the requested size. This invariant exists (for example) to guarantee that if you allocate a chunk which is smaller than or equal to 64 kilobytes, the extent of the buffer you receive will not cross a 64K boundary." Signed-off-by: Christoph Hellwig <hch@lst.de> [djbw: moved allocation from start to init, re-add memset] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: simplify request state handlersChristoph Hellwig
Instead of filling up tables with default handlers call the default handler in the only caller. IMHO the whole state handlers concept is not very suitable for the isci request. For example there is a single real instance of the start handler, and we'd be much better off just having a check for the right state in the only caller, than all this mess. It's quite similar for the abort handler as well. Even the actual state machine has a lot of states that are rather pointless. The initial and constructed states are not needed at all as the request is not reachable for calls before it's fully set up and started. And the abort state should be replaced with an abort actions and a state transition to the completed state. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: kill dead data structurs in scic_io_request.hChristoph Hellwig
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove base_request abstractionChristoph Hellwig
Merge struct sci_base_request into scic_sds_request, and also factor the two types of state machine handlers into one function. While we're at it also remove lots of duplicate incorrect kerneldoc comments for the state machine handlers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove base_controller abstractionChristoph Hellwig
Merge struct sci_base_controller into scic_sds_controller, and also factor the two types of state machine handlers into one function. While we're at it also remove lots of duplicate incorrect kerneldoc comments for the state machine handlers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: remove mmio wrappersChristoph Hellwig
Remove a couple of layers around read/writel to make the driver readable. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: fix fragile/conditional isci_host lookupsDan Williams
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>
2011-07-03isci: cleanup isci_remote_device[_not]_ready interfaceDan Williams
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>
2011-07-03isci: Qualify when the host lock is managed for STP/SATA callbacks.Jeff Skirvin
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>
2011-07-03isci: Fix use of SATA soft reset state machine.Jeff Skirvin
The driver SATA LUN reset function incorrectly sent an SRST deassert FIS, which is unnecessary because the core initiates the entire SATA soft reset state machine from the assert request. Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Free host lock for SATA/STP abort escalation at submission time.Jeff Skirvin
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>
2011-07-03isci: Properly handle requests in the "aborting" state.Jeff Skirvin
When a TMF times-out, the request is set back to "aborting". Requests in the "aborting" state must be terminated when LUN and device resets occur. Signed-off-by: Jeff Skirvin <jeffrey.d.skirvin@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2011-07-03isci: Remove "screaming" data typesDave Jiang
Converting the all CAPS data types to lower case. Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>