: isci updates
Subsystems (2)
The isci git tree (still a work in progress) has been updated with the following changes:
1/ Interrupt setup / handling rework incorporating Jeff's and Christoph's comments
2/ Created x86-pending branch to stage proposed adapter rom scanning implementation [1] and dependent code that retrieves the driver's "oem parameters"
3/ Created libsas-pending branch to stage proposed libsas fixes [2] [3] while awaiting acceptance in scsi-misc.
4/ Created upstream-pending branch which is just a convenience merge of master, x86-pending, and libsas-pending. The master branch is still the primary development branch.
5/ A collection of fixlets and cleanups across the driver (full changelog below)
The full diffstat and changelog for upstream-pending are posted below. The included diff only references the lldd (drivers/scsi/isci/) changes relative to the last patch posting [4]. The core changes (drivers/scsi/isci/core/) will be included in the coming review of the core in patch form.
--
Dan (for the isci driver team)
[1]: http://marc.info/?l=linux-scsi&m=129840446430324&w=2
[2]: http://marc.info/?l=linux-scsi&m=129791077719331&w=2
[3]: http://marc.info/?l=linux-scsi&m=129791105419577&w=2
[4]: http://marc.info/?l=linux-scsi&m=129703780424729&w=2
The following changes since commit 4c1db2d085b1d471850056f05fb83b183ddd8fa9:
isci: consolidate core (2011-02-06 10:00:24 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git upstream-pending
Dan Williams (16):
isci: kill SCI_IO_REQUEST_DATA_DIRECTION
isci: cleanup core consolidation leftovers
isci: kill a callback cast
libsas: flush initial device discovery before completing ->scan_finished()
libsas: fix/amend device gone notification in sas_deform_port()
isci: remove SCIC_DEBUG_ENABLED, and fixup an odd macro
isci: bypass scic_controller_get_handler_methods()
isci: cleanup "starting" state handling
isci: implement error isr
isci: advertise linkrate
isci: debug fixes
isci: Add support for probing OROM for OEM params
isci: phy state machine cleanup step1
isci: clean up remaining silicon revision ifdefs in phy init Merge branch 'x86-pending' into upstream-pending
Merge branch 'libsas-pending' into upstream-pending
Dave Jiang (4):
isci: removing unused loglevel module param
isci: Move firmware loading to per PCI device
x86: Moving probe_roms_32 to probe_roms
isci: Adding EFI variable skeletal support
Edmund Nadolski (5):
isci: remove unused SC_LIBRARY_HANDLE_T typedef
isci: remove SCI_INVALID_HANDLE
isci: kill sci_types.h
isci: enable interrupts during controller start, and flush discovery
isci: remove scic_controller_get_handler_methods and ilk
Havard Skinnemoen (2):
isci: Add missing PCI IDs
isci: Initialize proc_name field in scsi_host_template
Henryk Dembkowski (5):
isci: remote device and node cleanup step1
isci: coding style changes for remote device
isci: c99 tables cleanup step1
isci: coding style changes for remote device
isci: Move transport layer registers from port to phy
Jacek Danecki (1):
isci: Add support for user parameters in SCIC layer
Piotr Sawicki (1):
isci: fix for asserts during aborts/resets to SAS/SATA in APC mode
Tomasz Chudy (2):
isci: fix "no outbound task timeout" default value
isci: Add Support for new TC completion codes
arch/x86/include/asm/probe_roms.h | 7 +
arch/x86/include/asm/setup.h | 3 +-
arch/x86/kernel/Makefile | 2 +-
arch/x86/kernel/head32.c | 1 -
arch/x86/kernel/{probe_roms_32.c => probe_roms.c} | 13 +
arch/x86/kernel/x86_init.c | 2 +-
drivers/scsi/aic94xx/aic94xx_init.c | 2 +-
drivers/scsi/isci/Makefile | 2 +-
.../isci/core/sci_base_memory_descriptor_list.c | 6 +-
.../isci/core/sci_base_memory_descriptor_list.h | 4 +-
drivers/scsi/isci/core/sci_base_phy.h | 15 +-
drivers/scsi/isci/core/sci_base_remote_device.h | 31 +-
drivers/scsi/isci/core/sci_base_state_machine.h | 2 +
drivers/scsi/isci/core/sci_controller.h | 2 -
.../scsi/isci/core/sci_memory_descriptor_list.h | 1 -
drivers/scsi/isci/core/sci_object.h | 1 -
drivers/scsi/isci/core/sci_util.h | 7 +-
drivers/scsi/isci/core/scic_config_parameters.h | 44 +--
drivers/scsi/isci/core/scic_controller.h | 97 +---
drivers/scsi/isci/core/scic_io_request.h | 1 -
drivers/scsi/isci/core/scic_phy.h | 6 +-
drivers/scsi/isci/core/scic_port.h | 1 -
drivers/scsi/isci/core/scic_remote_device.h | 1 -
drivers/scsi/isci/core/scic_sds_controller.c | 544 ++---------------
drivers/scsi/isci/core/scic_sds_controller.h | 15 +-
drivers/scsi/isci/core/scic_sds_pci.h | 1 -
drivers/scsi/isci/core/scic_sds_phy.c | 651 ++++++++------------
drivers/scsi/isci/core/scic_sds_phy.h | 60 +--
drivers/scsi/isci/core/scic_sds_phy_registers.h | 61 ++
drivers/scsi/isci/core/scic_sds_port.c | 91 +--
drivers/scsi/isci/core/scic_sds_port.h | 66 +--
.../isci/core/scic_sds_port_configuration_agent.c | 60 ++-
drivers/scsi/isci/core/scic_sds_port_registers.h | 76 ---
drivers/scsi/isci/core/scic_sds_remote_device.c | 478 +++++----------
drivers/scsi/isci/core/scic_sds_remote_device.h | 104 ++--
.../scsi/isci/core/scic_sds_remote_node_context.c | 55 +-
.../scsi/isci/core/scic_sds_remote_node_context.h | 47 +-
.../scsi/isci/core/scic_sds_remote_node_table.h | 1 -
drivers/scsi/isci/core/scic_sds_request.c | 89 ++--
.../scsi/isci/core/scic_sds_smp_remote_device.c | 160 ++----
drivers/scsi/isci/core/scic_sds_smp_request.h | 1 -
drivers/scsi/isci/core/scic_sds_ssp_request.c | 78 +---
.../scsi/isci/core/scic_sds_stp_packet_request.h | 1 -
.../scsi/isci/core/scic_sds_stp_remote_device.c | 294 +++------
drivers/scsi/isci/core/scic_sds_stp_request.c | 65 +--
drivers/scsi/isci/core/scic_sds_stp_request.h | 6 +-
drivers/scsi/isci/core/scic_task_request.h | 1 -
drivers/scsi/isci/core/scic_user_callback.h | 18 +-
drivers/scsi/isci/core/scu_completion_codes.h | 3 +
drivers/scsi/isci/core/scu_registers.h | 8 +-
drivers/scsi/isci/core/scu_remote_node_context.h | 1 -
drivers/scsi/isci/core/scu_task_context.h | 1 -
drivers/scsi/isci/core/scu_unsolicited_frame.h | 2 +-
drivers/scsi/isci/core/scu_viit_data.h | 1 -
drivers/scsi/isci/deprecated.c | 10 +-
drivers/scsi/isci/events.c | 7 +-
drivers/scsi/isci/firmware/create_fw.c | 197 ++-----
drivers/scsi/isci/firmware/create_fw.h | 67 ++
drivers/scsi/isci/host.c | 490 ++++-----------
drivers/scsi/isci/host.h | 32 +-
drivers/scsi/isci/init.c | 130 ++---
drivers/scsi/isci/isci.h | 47 +--
drivers/scsi/isci/port.c | 2 +
drivers/scsi/isci/probe_roms.c | 188 ++++++
.../scsi/isci/{core/sci_types.h => probe_roms.h} | 87 ++-
drivers/scsi/isci/remote_device.c | 10 +-
drivers/scsi/isci/request.c | 42 +--
drivers/scsi/isci/request.h | 3 +-
drivers/scsi/isci/sci_environment.h | 14 +
drivers/scsi/isci/task.c | 3 +-
drivers/scsi/libsas/sas_expander.c | 20 +-
drivers/scsi/libsas/sas_internal.h | 3 +-
drivers/scsi/libsas/sas_phy.c | 4 +-
drivers/scsi/libsas/sas_port.c | 21 +-
drivers/scsi/mvsas/mv_sas.c | 2 +-
drivers/scsi/pm8001/pm8001_sas.c | 2 +-
firmware/isci/isci_firmware.bin.ihex | 25 +-
include/scsi/libsas.h | 13 +
78 files changed, 1667 insertions(+), 3042 deletions(-)
create mode 100644 arch/x86/include/asm/probe_roms.h
rename arch/x86/kernel/{probe_roms_32.c => probe_roms.c} (93%)
create mode 100644 drivers/scsi/isci/firmware/create_fw.h
create mode 100644 drivers/scsi/isci/probe_roms.c
rename drivers/scsi/isci/{core/sci_types.h => probe_roms.h} (61%)commit 705478842ea358a6e6bc1cfbc9264fef29a2ba0a
Merge: bd285f5 9f6d842
Author: Dan Williams <[email protected]>
Date: Wed Feb 23 12:53:52 2011 -0800
Merge branch 'libsas-pending' into upstream-pending
commit bd285f54d2b34a8d318e3015358386d9bddd2aa5
Merge: 3077cf0 4f354bf
Author: Dan Williams <[email protected]>
Date: Wed Feb 23 12:53:46 2011 -0800
Merge branch 'x86-pending' into upstream-pending
Conflicts:
drivers/scsi/isci/core/scic_config_parameters.h drivers/scsi/isci/core/scic_sds_controller.c
commit 4f354bf780db50b091652c2923c53d6468cc25b9
Author: Dave Jiang <[email protected]> Date: Wed Feb 23 00:02:24 2011 -0800
isci: Adding EFI variable skeletal support
Adding EFI variable retrieving for OEM parameters. Still need GUID and variable name.
Also updated the data struct for oem parameters and hex file for firmware
commit 3077cf009b8925ec4762b3138fd6c0faf150df50
Author: Piotr Sawicki <[email protected]> Date: Wed Feb 23 00:09:14 2011 -0800
isci: fix for asserts during aborts/resets to SAS/SATA in APC mode
Sending aborts/resets to SAS/SATA targets in APC mode eventually causes an assert in scic_sds_apc_agent_link_up(). We need to handle the hard reset case for apc mode ports.
commit ac7571b7bb38e63c6a4b89a271377443289d6775
Author: Tomasz Chudy <[email protected]> Date: Wed Feb 23 00:09:04 2011 -0800
isci: Add Support for new TC completion codes
Update the SCI Core to comprehend the changes in the TC completion codes from A0 to B0. Specifically, there isnew R_ER code differences for command and data FISes.
Changes are as follows:
1) 0x16 now additionally indicates an R_ERR received for a COMMAND FIS being sent to a SATA target. 0x16 for SSP still indicates a NAK received for a COMMAND frame. Fix is to retry TC to be compliant with SATA spec or ensure proper error handling of return value (not spec compliant I don't believe).
2) 0x1B was previously called DONE_BREAK_RCVD for STP and DONE_LL_ABORT_ERR for SSP. Now it is universally called DONE_LL_ABORT_ERR. This is purely a superficial change.
3) 0x32 is no longer a reserved code. Now it indicates DONE_CMD_SDMA_ERR for STP/SSP. There was a fatal error on the SDMA for a command IU (includes Raw frames). Consider retry, but at a minimum gracefully fail the request.
4) 0x33 is no longer a reserved code. Now it indicates DONE_CMD_LL_ABORT_ERR for SSP. There was a break receivd during transmission of a command IU. Consider retry, but at a minimum gracefully fail the request.
commit 9c2b8da43649a9aa5a258e4be123e89b7365a60b
Author: Dan Williams <[email protected]> Date: Wed Feb 23 00:09:01 2011 -0800
isci: clean up remaining silicon revision ifdefs in phy init
Use the dynamic revision detection code in scic_sds_phy_link_layer_initialization() and apply some coding style fixups (long deref chains). The compile time max link rate setting is removed in favor of honoring the user-parameter max.
commit e87a52b6ff7912f3a7b8b48894ed7418fe4c6665
Author: Jacek Danecki <[email protected]> Date: Wed Feb 23 00:08:58 2011 -0800
isci: Add support for user parameters in SCIC layer
Add support for the following parameters in SCIC:
/**
* This field specifies the NOTIFY (ENABLE SPIN UP) primitive
* insertion frequency for this phy index.
*/
u32 notify_enable_spin_up_insertion_frequency;
/**
* This method specifies the number of transmitted DWORDs within which
* to transmit a single ALIGN primitive. This value applies regardless
* of what type of device is attached or connection state. A value of
* 0 indicates that no ALIGN primitives will be inserted. */
u16 align_insertion_frequency;
/**
* This method specifies the number of transmitted DWORDs within which
* to transmit 2 ALIGN primitives. This applies for SAS connections
* only. A minimum value of 3 is required for this field. */
u16 in_connection_align_insertion_frequency;
commit 2b318c8e80bf25ff357e969777ec127f539f8c9a
Author: Henryk Dembkowski <[email protected]> Date: Wed Feb 23 00:08:52 2011 -0800
isci: Move transport layer registers from port to phy
At init and RNC resume we need to touch every phy in a port to be sure we have initialized STP properties in the case where port_index != phy_index. Also add some missing __iomem annotations.
commit d9cf9c7c77e6a69dfab5dbead8329175f3c44bba
Author: Tomasz Chudy <[email protected]> Date: Wed Feb 23 00:08:49 2011 -0800
isci: fix "no outbound task timeout" default value
The default should be 5us. The hardware encodes it in 256ns increments, so the value should be 20 to approximate a 5us timeout.
commit 3bd36a4a311c8dae1a3c105a51b3e08fd5176ec2
Author: Dan Williams <[email protected]> Date: Wed Feb 23 00:14:06 2011 -0800
isci: phy state machine cleanup step1
c99 the struct initializers:
1/ allows grep to consistently show method name associations. The
naming is mostly consistent (except when it isn't) so this guarantees coverage of present and future exception cases.
2/ let's the compiler guarantee that the state table array entry
correlates with an actual state name and detect accidental reordering or deletion of states.
/ allows default handler's to be identified easily
commit f502dbe99adc8de6cee74e6549677997c6d719ed
Author: Dan Williams <[email protected]> Date: Wed Feb 23 00:02:22 2011 -0800
isci: Add support for probing OROM for OEM params
We need to scan the OROM for signature and grab the OEM parameters. We also need to do the same for EFI. If all fails then we resort to user binary blob, and if that fails then we go to the defaults.
Share the format with the create_fw utility so that all possible sources of the parameters are in-sync.
commit 353199ee9e69e626d408d26c98478a4af7170a1e
Author: Dave Jiang <[email protected]> Date: Tue Feb 22 15:25:17 2011 -0800
x86: Moving probe_roms_32 to probe_roms
Moving the probe_roms_32 code to probe_roms and make available for all x86. The end result adapter roms data structure is made available read-only to drivers. The Intel isci SAS driver needs to scan the OROM memory in order to pull OEM parameters from the OROM.
commit 1709eec56656e2daae34020acd3aaa927a68b996
Author: Dave Jiang <[email protected]> Date: Tue Feb 22 01:27:03 2011 -0800
isci: Move firmware loading to per PCI device
Moved the firmware loading from per adapter to per PCI device. This should prevent firmware from being loaded twice becuase of 2 SCU controller per PCI device. We do have to do it per PCI device because request_firmware() requires a struct device passed in.
commit 8dbdb430fdb7fc15c049e7a8aa29d64d12dd9566
Author: Havard Skinnemoen <[email protected]> Date: Fri Feb 18 18:32:08 2011 -0800
isci: Initialize proc_name field in scsi_host_template
The proc_name field in struct scsi_host_template is exported through sysfs and allows userspace tools to identify the driver behind a particular SCSI host controller.
Initialize this field so that userspace tools can easily identify isci host controllers through sysfs.
commit c2af8ba967f85a652d102e3ced262f8420d58ff6
Author: Havard Skinnemoen <[email protected]> Date: Fri Feb 18 18:32:07 2011 -0800
isci: Add missing PCI IDs
The SCUDIDOV register can be used to select any value from 0x1d60 to 0x1d6f as the PCI ID. Make sure the driver supports them all.
commit 55b98b72f70edbad922587a66a25d2f3c4a7f144
Author: Edmund Nadolski <[email protected]> Date: Fri Feb 18 09:25:17 2011 -0800
isci: remove scic_controller_get_handler_methods and ilk
This removes scic_controller_get_handler_methods and its associated unused code.
commit 9544923c684632f9f54e838dd8a43d3a3628226b
Author: Dan Williams <[email protected]> Date: Fri Feb 18 09:25:15 2011 -0800
isci: debug fixes
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
commit 2e10c2b47ea7350c72ed7da1f2e4c884efc3e51d
Author: Dan Williams <[email protected]> Date: Fri Feb 18 09:25:13 2011 -0800
isci: advertise linkrate
Inform libsas of the linkrate of direct attached links.
commit 6e3f6ad0a6b59b1bebf3b66dfacbfaae0a98c96e
Author: Dan Williams <[email protected]> Date: Fri Feb 18 09:25:11 2011 -0800
isci: implement error isr
Add basic support for handling/reporting error interrupts.
commit a88bfbcb9b0237deeddd49db7789c3992fb006ce
Author: Edmund Nadolski <[email protected]> Date: Fri Feb 18 09:25:09 2011 -0800
isci: enable interrupts during controller start, and flush discovery
Polling the event queue during scan is an unneeded holdover from the original driver.
commit 2f89431766a7178e4a1beb87d3606d020f981e94
Author: Dan Williams <[email protected]> Date: Fri Feb 18 09:25:07 2011 -0800
isci: cleanup "starting" state handling
The lldd actively disallows requests in the "starting" state. Retrying or holding off commands in this state is sub-optimal:
1/ it adds another state check to the fast path
2/ retrying can cause libsas to give up
However, isci's ->lldd_dev_found() routine already waits for controller start to complete before allowing further progress. Checking the "starting" state in isci_task_execute_task and the isr is redundant and misleading. Clean this up and introduce a controller-wide event queue to start reeling in "completion" proliferation in the driver.
The "stopping" state cleanups are in a similar vein, rely on the the isr and other paths being precluded from occurring rather than implementing state checking logic.
commit bb17c26248fad2e897fb5a351f36bba2d0dcb077
Author: Dan Williams <[email protected]> Date: Fri Feb 18 09:25:05 2011 -0800
isci: bypass scic_controller_get_handler_methods()
The indirection is unecessary and broken in the current case that assigns the handlers based on a not up-to-date pdev->msix_enabled value.
Route the handlers directly to the requisite core routines.
Todo: hook up error interrupt handling
commit 45f72ff3356b79de31a7b91e9464b48db54e9abd
Author: Dan Williams <[email protected]> Date: Thu Feb 17 15:01:46 2011 -0800
isci: remove SCIC_DEBUG_ENABLED, and fixup an odd macro
This will be replaced by state machine tracepoints and should have been a part of the logger removal.
Ran across scic_sds_port_decrement_request_count() which is an ugly macro which silently hides accounting errors. Turn it into a WARN_ONCE to see if it ever triggers.
commit 9f6d842d9512fc839db877cc0d7b8a12fbcda035
Author: Dan Williams <[email protected]> Date: Fri Feb 18 09:22:43 2011 -0800
libsas: fix/amend device gone notification in sas_deform_port()
Commit 56dd2c06 "libsas: Don't issue commands to devices that have been hot-removed" edited Darrick's original patch to remove setting 'gone' in the sas_deform_port() path because that prevented scsi sync cache commands from being issued when the driver was unloaded. However, this allows true device gone notifications (as signaled port phy events) to trigger sync cache commands to devices that are known to be unreachable.
Teach libsas which sas_deform_port() invocations are likely device gone events.
This patch also introduces sas_device_gone() which hopefully allows subtle/tricky locking to be dropped from lldd drivers, like the following in mvsas which is broken if the ata path is ever converted to call lldd_execute_task() with irqs enabled:
flags_libsas = 0;
[...] spin_unlock_irqrestore(dev->sata_dev.ap->lock, flags_libsas); spin_unlock_irqrestore(&mvi->lock, flags); t->task_done(t);
spin_lock_irqsave(&mvi->lock, flags); spin_lock_irqsave(dev->sata_dev.ap->lock, flags_libsas);
commit ca5a014f79e6864810abe943543ff9e10ba0b88c
Author: Dan Williams <[email protected]> Date: Fri Feb 18 09:22:32 2011 -0800
libsas: flush initial device discovery before completing ->scan_finished()
During initial scan libsas drivers start their phys and notify libsas with PORTE_BYTES_DMAED events as port links are established. This notification in turn causes libsas to post DISCE_DISCOVER_DOMAIN events to the queue. Calling scsi_flush_work() at the end of scan_finished guarantees that all preceding PORTE_BYTES_DMAED events have been registered in the queue, but it does not guarantee that the resulting DISCE_DISCOVER_DOMAIN events have been processed because flush_workqueue() explicitly avoids live-locking with incoming work.
Introduce sas_flush_discovery() to guarantee that all initial discovery events have completed. It is called after the driver determines all initial PORTE_BYTES_DMAED events have had a chance to enter the queue. This does not cover BCNs that are generated during expander bring up, only the initial sas_discover_domain() event.
commit ca2f350e97de3a971176aacd412867c2abddd98c
Author: Dan Williams <[email protected]> Date: Sat Feb 12 11:50:15 2011 -0800
isci: kill a callback cast
Callbacks are already type unsafe, obfuscating things further by casting the callback routine is less safe because now function argument number changes will not be caught by the compiler.
commit 2522e96a393af4b1cf18cec4ed7daca0b91991fc
Author: Henryk Dembkowski <[email protected]> Date: Sat Feb 12 11:50:13 2011 -0800
isci: coding style changes for remote device
Change names from upper to low letters
commit dafdb778811d1c9a0c223e1c59d4ab7a3c6f1cb4
Author: Dan Williams <[email protected]> Date: Sat Feb 12 11:50:11 2011 -0800
isci: cleanup core consolidation leftovers
Remove duplicated license and header file includes that were leftover from commit 4c1db2d0 "isci: consolidate core"
commit 30713cf69e3cbe0c8ca8be7604c93637f5834020
Author: Henryk Dembkowski <[email protected]> Date: Sat Feb 12 11:50:09 2011 -0800
isci: c99 tables cleanup step1
scic_sds_stp_remote_device_ready_substate_handler_table[] scic_sds_smp_remote_device_ready_substate_handler_table[]
c99 the struct initializers:
1/ allows grep to consistently show method name associations. The
naming is mostly consistent (except when it isn't) so this guarantees coverage of present and future exception cases.
2/ let's the compiler guarantee that the state table array entry
correlates with an actual state name and detect accidental reordering or deletion of states.
3/ allows default handler's to be identified easily
commit ccfa647727a1c47cbbdf337911ae5f3c62237bd6
Author: Henryk Dembkowski <[email protected]> Date: Sat Feb 12 11:50:07 2011 -0800
isci: coding style changes for remote device
Change names from upper to low letters
commit 506cdedec4c0ced8465aade81dd1a8d3314a2650
Author: Henryk Dembkowski <[email protected]> Date: Sat Feb 12 11:50:05 2011 -0800
isci: remote device and node cleanup step1
c99 the struct initializers (scic_sds_remote_device_state_handler_table[]):
1/ allows grep to consistently show method name associations. The
naming is mostly consistent (except when it isn't) so this guarantees coverage of present and future exception cases.
2/ let's the compiler guarantee that the state table array entry
correlates with an actual state name and detect accidental reordering or deletion of states.
3/ allows default handler's to be identified easily
Change names from upper to low letters
Cleanup empty lines
commit 4252992bcc33b3f9c15d17f15692b7f09d79da98
Author: Dave Jiang <[email protected]> Date: Fri Feb 11 18:04:28 2011 -0800
isci: removing unused loglevel module param
We no longer use the loglevel parameter. Remove.
commit 9f2cbe33334052e38c639866d544b646bef5e846
Author: Edmund Nadolski <[email protected]> Date: Tue Feb 8 09:31:55 2011 -0700
isci: kill sci_types.h
commit 6477c20ad054e70f716e6009f6f601a4bffe5553
Author: Dan Williams <[email protected]> Date: Tue Feb 8 17:53:10 2011 -0800
isci: kill SCI_IO_REQUEST_DATA_DIRECTION
It's an unnecessary typedef that mirrors the kernel's enum dma_data_direction.
Also cleanup some long variable names along the way.
commit b92a6cc143cd71c5b24c34ea95b7c7e80a68852d
Author: Edmund Nadolski <[email protected]> Date: Tue Feb 8 09:28:42 2011 -0700
isci: remove SCI_INVALID_HANDLE
Replace SCI_INVALID_HANDLE with NULL
commit e55e8363ee232ee008b52052995df38eb473f919
Author: Edmund Nadolski <[email protected]> Date: Tue Feb 8 08:09:10 2011 -0700
isci: remove unused SC_LIBRARY_HANDLE_T typedef
drivers/scsi/isci/deprecated.c +2 -8
@@ -139,16 +139,10 @@ u32 scic_cb_io_request_get_transfer_length(* @scic_user_io_request: This parameter points to the user's IO request * object. It is a cookie that allows the user to provide the necessary * information for this callback. -* -* This method returns the value of SCI_IO_REQUEST_DATA_OUT or -* SCI_IO_REQUEST_DATA_IN, or SCI_IO_REQUEST_NO_DATA. */ -SCI_IO_REQUEST_DATA_DIRECTION scic_cb_io_request_get_data_direction ( -void *scic_user_io_request) +enum dma_data_direction scic_cb_io_request_get_data_direction (void *req) { -return isci_request_io_request_get_data_direction ( - scic_user_io_request - ); +return isci_request_io_request_get_data_direction (req); }
drivers/scsi/isci/events.c +3 -4
@@ -399,8 +399,7 @@ void scic_cb_port_invalid_link_up(* port. * @port: This parameter specifies the SCI port object for which the callback * is being invoked. For instances where the phy on which the primitive was -* received is not part of a port, this parameter will be -* SCI_INVALID_HANDLE_T. +* received is not part of a port, this parameter will be NULL. * @phy: This parameter specifies the phy on which the primitive was received. * */
@@ -430,7 +429,7 @@ void scic_cb_port_bc_change_primitive_received(* phy. * @port: This parameter specifies the port object for which the user callback * is being invoked. There may be conditions where this parameter can be -* SCI_INVALID_HANDLE +* NULL * @phy: This parameter specifies the phy object for which the user callback is * being invoked. *
@@ -460,7 +459,7 @@ void scic_cb_port_link_up(* phy. * @port: This parameter specifies the port object for which the user callback * is being invoked. There may be conditions where this parameter can be -* SCI_INVALID_HANDLE +* NULL * @phy: This parameter specifies the phy object for which the user callback is * being invoked. *
drivers/scsi/isci/host.c +118 -367
643 lines not on this page · raw message
drivers/scsi/isci/host.h +15 -15
@@ -53,13 +53,6 @@* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** -* This file contains the isci_module initialization routines. -* -* host.h -*/ - -#if !defined(_SCI_HOST_H_)#define _SCI_HOST_H_
@@ -79,10 +72,6 @@#define SCI_SCU_BAR_SIZE (4*1024*1024)#define SCI_IO_SPACE_BAR0 2#define SCI_IO_SPACE_BAR1 3 -#define SCI_MSIX_NORMAL_VECTOR 0 -#define SCI_MSIX_ERROR_VECTOR 1 -#define SCI_MSIX_SINGLE_VECTOR 1 -#define SCI_MSIX_DOUBLE_VECTOR 2#define ISCI_CAN_QUEUE_VAL 250/* < SCI_MAX_IO_REQUESTS ? */ #define SCIC_CONTROLLER_STOP_TIMEOUT 5000
@@ -96,7 +85,6 @@ struct coherent_memory_info {struct isci_host {struct scic_sds_controller *core_controller; -struct scic_controller_handler_methods scic_irq_handlers[SCI_NUM_MSI_X_INT ];union scic_oem_parameters oem_parameters;int id;/* unique within a given pci device */
@@ -121,13 +109,15 @@ struct isci_host {u8 sas_addr[SAS_ADDR_SIZE ];enum isci_status status; +#define IHOST_START_PENDING 0 +#define IHOST_STOP_PENDING 1 +unsigned long flags; +wait_queue_head_t eventq;struct Scsi_Host *shost;struct tasklet_struct completion_tasklet;struct list_head mdl_struct_list;struct list_head requests_to_complete;struct list_head requests_to_abort; -struct completion stop_complete; -struct completion start_complete;spinlock_t scic_lock;struct isci_host *next; };
@@ -143,7 +133,6 @@ struct isci_host {struct isci_pci_info {struct msix_entry msix_entries[SCI_MAX_MSIX_INT ];int core_lib_array_index; -SCI_LIBRARY_HANDLE_T core_lib_handle;struct isci_host *hosts; };
@@ -215,6 +204,17 @@ static inline void isci_host_can_dequeue(spin_unlock_irqrestore (&isci_host->queue_lock, flags); } +static inline void wait_for_start (struct isci_host *ihost) +{ +wait_event (ihost->eventq, !test_bit (IHOST_START_PENDING , &ihost->flags)); +} + +static inline void wait_for_stop (struct isci_host *ihost) +{ +wait_event (ihost->eventq, !test_bit (IHOST_STOP_PENDING , &ihost->flags)); +} + +/** * isci_host_from_sas_ha() - This accessor retrieves the isci_host object * reference from the Linux sas_ha_struct reference.
drivers/scsi/isci/init.c +105 -5
169 lines not on this page · raw message
drivers/scsi/isci/isci.h +9 -4
@@ -79,15 +79,14 @@#include <scsi/libsas.h> #include <scsi/scsi.h> -#include "sci_types.h" #include "sci_base_controller.h" #include "scic_controller.h" #include "host.h" #include "timers.h" #include "sci_status.h" -extern int loglevel;extern struct kmem_cache *isci_kmem_cache; +extern struct isci_firmware *isci_firmware;#define ISCI_FW_NAME "isci/isci_firmware.bin"
@@ -115,8 +114,14 @@ struct isci_firmware {u8 sas_addrs_size; }; -irqreturn_t isci_isr (int vec,void *data); -irqreturn_t isci_legacy_isr (int vec,void *data); +irqreturn_t isci_msix_isr (int vec,void *data); +irqreturn_t isci_intx_isr (int vec,void *data); +irqreturn_t isci_error_isr (int vec,void *data); + +bool scic_sds_controller_isr (struct scic_sds_controller *scic); +void scic_sds_controller_completion_handler (struct scic_sds_controller *scic); +bool scic_sds_controller_error_isr (struct scic_sds_controller *scic); +void scic_sds_controller_error_handler (struct scic_sds_controller *scic); enum sci_status isci_parse_oem_parameters( union scic_oem_parameters *oem_params,
drivers/scsi/isci/port.c +2 -0
@@ -263,6 +263,8 @@ void isci_port_link_up( success = false; } + isci_phy->sas_phy.phy->negotiated_linkrate =sci_phy_linkrate (phy); +spin_unlock_irqrestore (&isci_phy->sas_phy.frame_rcvd_lock, flags);/* Notify libsas that we have an address frame, if indeed
drivers/scsi/isci/remote_device.c +2 -8
@@ -507,6 +507,8 @@ int isci_remote_device_found(struct domain_device *domain_dev)dev_dbg (&isci_host->pdev->dev,"%s: domain_device = %p\n" , __func__, domain_dev); +wait_for_start (isci_host); + sas_port = domain_dev->port; sas_phy = list_first_entry(&sas_port->phy_list, struct asd_sas_phy, port_phy_el);
@@ -560,8 +562,6 @@ int isci_remote_device_found(struct domain_device *domain_dev)return -ENODEV ; } -wait_for_completion (&isci_host->start_complete); -return 0 ; }/**
@@ -686,12 +686,6 @@ void isci_remote_device_change_state( {unsigned long flags; -dev_dbg (&isci_device->isci_port->isci_host->pdev->dev, -"%s: isci_device = %p, state = 0x%x" , - __func__, - isci_device, - status); -spin_lock_irqsave (&isci_device->state_lock, flags); isci_device->status = status;spin_unlock_irqrestore (&isci_device->state_lock, flags);
drivers/scsi/isci/request.c +5 -37
70 lines not on this page · raw message
drivers/scsi/isci/request.h +1 -2
@@ -346,8 +346,7 @@ void isci_request_io_request_complete(u32 isci_request_io_request_get_transfer_length (struct isci_request *request); -SCI_IO_REQUEST_DATA_DIRECTION isci_request_io_request_get_data_direction ( -struct isci_request *request); +enum dma_data_direction isci_request_io_request_get_data_direction (struct isci_request *req);/** * isci_request_io_request_get_next_sge() - This function is called by the sci
drivers/scsi/isci/sci_environment.h +14 -0
@@ -108,5 +108,19 @@ enum {extern int isci_si_rev; +static inline bool is_a0 (void ) +{ +return isci_si_rev ==ISCI_SI_REVA0 ; +} + +static inline bool is_a2 (void ) +{ +return isci_si_rev ==ISCI_SI_REVA2 ; +} + +static inline bool is_b0 (void ) +{ +return isci_si_rev >ISCI_SI_REVA2 ; +}#endif
drivers/scsi/isci/task.c +1 -2
@@ -164,8 +164,7 @@ int isci_task_execute_task(struct sas_task *task, int num, gfp_t gfp_flags)* for the quiesce spinlock. */ -if (isci_host_get_state (isci_host) == isci_starting || - (device && ((isci_remote_device_get_state (device) == isci_ready) || +if ((device && ((isci_remote_device_get_state (device) == isci_ready) || (isci_remote_device_get_state (device) == isci_host_quiesce)))) {/* Forces a retry from scsi mid layer. */