Skip to contentSkip to conversation

isci: fixes and cleanups

GIT Dan Williams 2 participants 4 messages Mar 10, 2011 – Mar 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

The isci git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git master

...has been updated with the following:

1/ task lifetime fixes
2/ removal of drivers/scsi/isci/deprecated.c (os abstraction layer) 3/ dma api and kmap fixes
4/ locking cleanups (host_quiesce_lock and remote_device_lock removed) 5/ first round of lldd_dev lifetime fixes
6/ workaround for a port task scheduler silicon issue
7/ various other fixes and cleanups
8/ userspace visible changes
- sysfs 'isci_id' attribute under hostX to identify the controller
- phy enable/disable support

Diffstat, log, and and the lldd portion of the diff included below (i.e. git diff 3077cf00.. $(gls drivers/scsi/isci/ | grep -v /core/)). I could post these as separate patches but I thought I would conserve list bandwidth for the upcoming posting of the core as a set of omnibus patches.

Dan Williams (14):
isci: fix sas address reporting
isci: rework timer api
isci: fix hang after target reset
isci: pad stp and smp request sizes
isci: enable isci for dmar builds
isci: kill isci_host list in favor of an array
isci: remove sci_device_handle
isci: kill "host quiesce" mechanism
isci: replace isci_remote_device completion with event queue
isci: preallocate remote devices
isci: replace remote_device_lock with scic_lock
isci: cleanup debug leftovers in isci.h
isci: Errors in the submit path for SATA devices manage the ap lock.
isci: add "isci_id" attribute

Dave Jiang (7):
isci: Removed special macros that does 64bit address math
isci: Make the driver copy data directly from and to sg for PIO
isci: have the driver use native SG calls and DMA-API
isci: Change event notify calls from scic_cb_* to isci_event_*
isci: Removing deprecated functions
isci: Adding support for phy enable and disable
isci: Cleanup warning messages for phy resets

Jeff Skirvin (12):
isci: isci_request_cleanup_completed_loiterer checks task before task_done
isci: Changes in isci_host_completion_routine
isci: fix completion / abort path.
isci: Any reset indicated on an I/O completion escalates it to the error path.
isci: save the i/o tag outside the scic request structure.
isci: Cleaning up task execute path.
isci: Code review change for completion pointer cleanup.
isci: Termination handling cleanup, added termination timeouts.
isci: Fix TMF build for SAS/SATA LUN reset cases.
isci: Fixed BUG_ON in isci_abort_task_process_cb callback.
isci: Always set response/status for requests going into the error path.
isci: All pending requests are terminated before stopping the device.

Pawel Marek (1):
isci: controller stop/start fixes

Piotr Sawicki (1):
isci: handle cases where a d2h fis is used report an ncq error

Tomasz Chudy (1):
isci: workaround port task scheduler starvation issue

 drivers/scsi/Kconfig                               |    3 -
 drivers/scsi/isci/Makefile                         |    2 +-
 drivers/scsi/isci/core/sci_util.c                  |   31 +
 drivers/scsi/isci/core/sci_util.h                  |   51 +--
 drivers/scsi/isci/core/scic_port.h                 |   17 -
 drivers/scsi/isci/core/scic_sds_controller.c       |  215 ++++--
 drivers/scsi/isci/core/scic_sds_controller.h       |   29 +-
 drivers/scsi/isci/core/scic_sds_phy.c              |  166 +++--
 drivers/scsi/isci/core/scic_sds_phy.h              |    3 +
 drivers/scsi/isci/core/scic_sds_port.c             |  399 ++++++++---
 drivers/scsi/isci/core/scic_sds_port.h             |    9 +
 .../isci/core/scic_sds_port_configuration_agent.c  |   10 +-
 drivers/scsi/isci/core/scic_sds_remote_device.c    |   21 +-
 drivers/scsi/isci/core/scic_sds_request.c          |  324 +++++----
 drivers/scsi/isci/core/scic_sds_request.h          |   39 +-
 .../scsi/isci/core/scic_sds_smp_remote_device.c    |    5 +-
 drivers/scsi/isci/core/scic_sds_smp_request.c      |  124 ++--
 .../scsi/isci/core/scic_sds_stp_packet_request.c   |   20 +-
 .../scsi/isci/core/scic_sds_stp_remote_device.c    |  135 ++--
 drivers/scsi/isci/core/scic_sds_stp_request.c      |  284 +++-----
 drivers/scsi/isci/core/scic_sds_stp_request.h      |    2 +-
 .../isci/core/scic_sds_unsolicited_frame_control.c |   74 +-
 drivers/scsi/isci/core/scic_user_callback.h        |  736 ------------------
 drivers/scsi/isci/deprecated.c                     |  485 ------------
 drivers/scsi/isci/events.c                         |  163 ++---
 drivers/scsi/isci/events.h                         |  373 ++++++++++
 drivers/scsi/isci/host.c                           |  126 ++--
 drivers/scsi/isci/host.h                           |   36 +-
 drivers/scsi/isci/init.c                           |   84 +--
 drivers/scsi/isci/isci.h                           |   31 +-
 drivers/scsi/isci/phy.c                            |   91 ++--
 drivers/scsi/isci/port.c                           |   18 +-
 drivers/scsi/isci/port.h                           |    2 -
 drivers/scsi/isci/remote_device.c                  |  219 ++----
 drivers/scsi/isci/remote_device.h                  |   41 +-
 drivers/scsi/isci/request.c                        |  114 ++--
 drivers/scsi/isci/request.h                        |    3 +-
 drivers/scsi/isci/sata.c                           |    4 +-
 drivers/scsi/isci/task.c                           |  782 +++++++++++---------
 drivers/scsi/isci/task.h                           |  118 ++--
 drivers/scsi/isci/timers.c                         |  173 ++---
 drivers/scsi/isci/timers.h                         |   60 +--
 42 files changed, 2484 insertions(+), 3138 deletions(-)
 delete mode 100644 drivers/scsi/isci/core/scic_user_callback.h
 delete mode 100644 drivers/scsi/isci/deprecated.c
 create mode 100644 drivers/scsi/isci/events.h

commit 119c8f35648d7cbc24339eeb9d02c7c2e35db685

Author: Dan Williams <[email protected]>
Date:   Thu Mar 10 00:01:43 2011 -0800

isci: add "isci_id" attribute

Allow each controller to be identified via sysfs.

# cat /sys/class/scsi_host/host13/isci_id
1

commit fa4d37357b355fde9c9fc8ec3c3eef932d16c10c

Author: Jeff Skirvin <[email protected]>
Date:   Tue Mar 8 20:32:16 2011 -0700

isci: All pending requests are terminated before stopping the device.

Make sure all pending I/O including any in the libsas error handler process is cleaned-up.

commit 828339b14f3948c6fa023353d1dfa5f67e549542

Author: Jeff Skirvin <[email protected]>
Date:   Mon Mar 7 16:40:47 2011 -0700

isci: Always set response/status for requests going into the error path.

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.

commit ec745eb31b7e12791bd74988e90aea02242e98f0

Author: Dan Williams <[email protected]>
Date:   Wed Mar 9 21:27:46 2011 -0800

isci: Errors in the submit path for SATA devices manage the ap lock.

Since libsas takes the domain device sata_dev.ap->lock before submitting a task, error completions in the submit path for SATA devices must unlock/relock when completing the sas_task back to libsas.

commit 7df663b34aeb46cd310873ab3f3a7e5a031e4ed0

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:58 2011 -0800

isci: Fixed BUG_ON in isci_abort_task_process_cb callback.

The request may be in the "aborted" or the "completed" state when performing a task management operation on it.

commit 0b08e9fe99941263e3757dd8abf8adf43977470f

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:56 2011 -0800

isci: Fix TMF build for SAS/SATA LUN reset cases.

In the case where a SAS or SATA LUN reset TMF is built a NULL pointer dereference occurred because of the (unused) callback data pointer.

commit cc476493a6883df996c5d5912e677795fcb9b65b

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:52 2011 -0800

isci: Termination handling cleanup, added termination timeouts.

Added a request "dead" state for use when a termination wait times-out.

isci_terminate_pending_requests now detaches the device's pending list and terminates each entry on the detached list.

commit afdfc7a2f730f7b21f36507e2d8389d4b82c3b13

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:50 2011 -0800

isci: Code review change for completion pointer cleanup.

Since the request structure contains a pointer to the completion to be used if the request is being aborted or terminated, there is no reason to pass the completion as a pointer to isci_terminate_request_core().

commit a2f5738193192f6dda498f448ff6bb1c44662816

Author: Jeff Skirvin <[email protected]>
Date:   Tue Mar 8 19:22:07 2011 -0700

isci: Cleaning up task execute path.

Made sure the device ready check accounts for all states. Moved the aborted task check into the loop of pulling task requests off of the submitted list.

[remove host and device starting state checks]

commit 871cd89bc64acb03fb202c3849d1b5378b637b06

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:46 2011 -0800

isci: save the i/o tag outside the scic request structure.

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.

commit 03674d66d44ed96b4ab4b96209ab1a8a3ab174e3

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:44 2011 -0800

isci: Any reset indicated on an I/O completion escalates it to the error path.

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.

commit faa7690e2ba061a79ef8d3fdaf63976d455e1cf4

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:42 2011 -0800

isci: fix completion / abort path.

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.

commit c49bd907f09e753dafc23fad95bffbd70dfa7e8c

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:40 2011 -0800

isci: Changes in isci_host_completion_routine

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.

commit 563ee3a3878bf066495a22e1ef07e71032c8181b

Author: Jeff Skirvin <[email protected]>
Date:   Fri Mar 4 14:06:38 2011 -0800

isci: isci_request_cleanup_completed_loiterer checks task before task_done

In the condition where outstanding I/Os are being cleaned from the device requests in process list, the cleanup function needs to check that the request is actually a sas-task and not a task management function.

commit c89d0a12ddd42c7d3e26fe84317e99320885d5a3

Author: Dan Williams <[email protected]>
Date:   Tue Mar 8 21:30:28 2011 -0800

isci: cleanup debug leftovers in isci.h

commit bbca7739a6b4dbb8fb0452fa7953f03a4fcd9b26

Author: Dan Williams <[email protected]>
Date:   Thu Mar 3 18:01:43 2011 -0800

isci: replace remote_device_lock with scic_lock

The remote_device_lock is currently used to protect a controller global resource (RNCs), but the remote_device_lock is per-port.

commit 8897a1f8f81685404521c2595542e0439f117da7

Author: Dan Williams <[email protected]>
Date:   Thu Mar 3 17:59:32 2011 -0800

isci: preallocate remote devices

Until we synchronize against device removal this limits the damage of use after free bugs to the driver's own objects. Unless we implement reference counting we need to ensure at least a subset of a remote device is valid at all times. We follow the lead of other libsas drivers that also preallocate devices.

This also enforces maximum remote device accounting at the lldd layer, but the core may still run out of RNC's before we hit this limit.

commit a713b1bb72faef44e803ec57b331e71bc90346f0

Author: Dan Williams <[email protected]>
Date:   Fri Mar 4 12:10:29 2011 -0800

isci: replace isci_remote_device completion with event queue

Replace the device completion infrastructure with the controller wide event queue. There was a potential for the stop and ready notifications to corrupt each other, now that cannot happen.

The stop pending flag cannot be used until devices are statically allocated. We temporarily need to maintain a completion to handle waiting for an object that has disappeared, but we can at least stop scribbling on freed memory.

A future change will also get rid of the "stopping" state as it should not be exposed to the rest of the driver.

commit bb86966f2ce1773be8660a0b93fbeff9514b1229

Author: Dan Williams <[email protected]>
Date:   Mon Mar 7 14:47:35 2011 -0800

isci: kill "host quiesce" mechanism

The midlayer is already throttling i/o in the places where host_quiesce was trying to prevent further i/o to the device. It's also problematic in that it holds a lock over GFP_KERNEL allocations.

commit f8d8ced6e8d0b0903877ff3d1e412da1836c76c8

Author: Dan Williams <[email protected]>
Date:   Fri Mar 4 11:51:43 2011 -0800

isci: remove sci_device_handle

It belies the fact that isci_remote_device and scic_sds_remote_device are one in same object with the same lifetime rules.

commit f7da6e00938a482298ec089816c7b52fee9d4ba8

Author: Dan Williams <[email protected]>
Date:   Mon Mar 7 16:02:25 2011 -0800

isci: kill isci_host list in favor of an array

isci_host_by_id() should have been a clue that an array would have been a simpler approach.

commit 4c68db90e2301b4d672b9571aad6f47bc61e5a80

Author: Dan Williams <[email protected]>
Date:   Thu Mar 3 17:59:25 2011 -0800

isci: enable isci for dmar builds

Now that phys_to_virt() and virt_to_phys() have been removed we are no longer violating the dma mapping (or kmap apis).

commit 0113f67b3f070712aa544f4c9a3668a106998121

Author: Dan Williams <[email protected]>
Date:   Thu Mar 3 14:58:11 2011 -0800

isci: pad stp and smp request sizes

Ross says:
"The memory allocation for these requests doesn’t take into account the
additional memory needed when the code in scic_sds_s[mst]p_request_assign_buffers() shifts the struct scu_task_context so that it is cache line aligned:

In an example from my machine, total buffer that I’ve given to SCIC goes from 0x410024566f84 to 0x410024567308. From this same example, this call shifts my task_context_buffer from 0x410024567208 to 0x410024567240.

This means that the task_context_buffer that used to range from 0x410024567208 to 0x410024567308 instead now goes from 0x410024567240 to 0x410024567340.

When the memset() call at the end of scic_task_request_construct() clears out this task_context_buffer, it does so from 0x410024567240 to 0x410024567340, effectively killing whatever buffer follows this allocation in memory."

djbw:
Use the kernel's PTR_ALIGN instead of scic_sds_request_align_task_context_buffer() and SMP_CACHE_BYTES instead of the local CACHE_LINE_SIZE definition.

TODO: These allocations really want to be better defined in a union rather than opaque buffers carved up by macros.

commit 72bea0ed7761942d5b09b38c0b149e4fc41f2807

Author: Dan Williams <[email protected]>
Date:   Wed Mar 2 16:45:18 2011 -0800

isci: fix hang after target reset

When aborting a task context we need to be sure that the hardware has acted on this request (retrieved the task context) before invalidating the remote node context. In the case of the "dummy" task context and remote node we do not have the full state machine that goes through the complete tc abort and rnc invalidate states. Instead we ensure the hardware has seen and acted on

commit 1cca16b180063d36a96ac21a5dc60736983151b3

Author: Dave Jiang <[email protected]>
Date:   Wed Mar 2 13:10:45 2011 -0800

isci: Cleanup warning messages for phy resets

Moving some of the chattiness of warning messages to debug so only the Linux system messages are shown.

commit 3da551128b49035dfcaa43c1bbba82e147d18b32

Author: Dave Jiang <[email protected]>
Date:   Wed Mar 2 12:31:24 2011 -0800

isci: Adding support for phy enable and disable

Adding support for PHY_FUNC_LINK_RESET and PHY_FUNC_DISABLE. This allow the sysfs knob enable (both 0 and 1) and link_reset to work properly.

commit e10094cbc7245fafdcc9d03f909a1a5eab6b1829

Author: Pawel Marek <[email protected]>
Date:   Tue Mar 1 12:31:06 2011 -0800

isci: controller stop/start fixes

Core reworks to support stopping and re-starting the controller, lays the groundwork for phy disable / re-enable and fixes other bugs around port/phy setup/teardown.

commit 0a1292e1268b000215e504e5beae3501fc01ac97

Author: Piotr Sawicki <[email protected]>
Date:   Fri Feb 25 13:07:38 2011 -0800

isci: handle cases where a d2h fis is used report an ncq error

Observed that some devices return a d2h fis, treat like an sdb error fis.

commit c40a3a21e3fea3bcb29b903608361e172fa6e7d9

Author: Tomasz Chudy <[email protected]>
Date:   Fri Feb 25 02:25:09 2011 -0800

isci: workaround port task scheduler starvation issue

There is a condition whereby TCs (task contexts) can jump to the head of the round robin queue causing indefinite starvation of pending tasks. Posting a TC to a suspended RNC (remote node context) causes the hardware to select that task first, but since the RNC is suspended the scheduler proceeds to the next task in the expected round robin fashion, restoring TC arbitration fairness.

commit 8d32e5b2aefe0d5e966cc7f5c5e887aa2d2b6090

Author: Dan Williams <[email protected]>
Date:   Wed Mar 2 11:49:26 2011 -0800

isci: rework timer api

Prepare the timer api for the arrival of dynamic creation and destruction events from the core. It pretended to do this previously but the core to date only used it in a static init-time only fashion. This is an interim fix until a cleaner event queue can be developed.

1/ make all locking external to the api (add WARN_ONCE to verify) 2/ add a timer_destroy interface (to be used by the core) 3/ use del_timer_sync() prior to deallocating timer data 4/ delete the "timer_list" indirection, we only have timers allocated
for the isci_host
5/ fix detection of timer list allocation errors

commit db3dd417bed5b2be0c95ace9e4b8871102ca5dcf

Author: Dan Williams <[email protected]>
Date:   Fri Feb 25 10:25:21 2011 -0800

isci: fix sas address reporting

Undo the open coded and incorrect translation of the oem parameter sas address to its libsas expected format.

commit 709637fec5ad729f864bebebcea378f725a1eea9

Author: Dave Jiang <[email protected]>
Date:   Wed Feb 23 15:57:33 2011 -0800

isci: Removing deprecated functions

Removed all callbacks in the deprecated.c. Core will call the appropriate functions directly.

commit f8cd82b1be3aa8cf98c0e1da31d209829c54560f

Author: Dave Jiang <[email protected]>
Date:   Wed Feb 23 15:57:30 2011 -0800

isci: Change event notify calls from scic_cb_* to isci_event_*

Renaming the callbacks to apparopriate event notify calls for the LLDD.

commit c32acaf4b9003f9d2d4855fdcc4e24c6a6836237

Author: Dave Jiang <[email protected]>
Date:   Wed Feb 23 15:57:27 2011 -0800

isci: have the driver use native SG calls and DMA-API

Remove abstraction for SG building and get rid of callbacks for getting DMA memory mapping.

commit f67153dc4f1f6921cfb25c0e12b962f180a12756

Author: Dave Jiang <[email protected]>
Date:   Wed Feb 23 15:57:24 2011 -0800

isci: Make the driver copy data directly from and to sg for PIO

We can copy the data directly to and from sg for SATA PIO read operations. There is no reason to involve the hardware SGL. In the process we also need to kmap the sg because we don't know where that can come from.

We also do to not call phys_to_virt(). The driver already has the information. We can just calculcate the appropriate offets.

commit c249d29aebcc4adda8d5d6e25a90aceaf0bbb501

Author: Dave Jiang <[email protected]>
Date:   Tue Feb 22 16:39:32 2011 -0700

isci: Removed special macros that does 64bit address math

These macros are not necessary. We can do 64bit math directly.

drivers/scsi/isci/Makefile +1 -1
index 34f7af3..d402d67 100644
@@ -8,7 +8,7 @@ EXTRA_CFLAGS += -DDISABLE_ATAPI
 EXTRA_CFLAGS += -Idrivers/scsi/isci/core/ -Idrivers/scsi/isci/
 obj-$(CONFIG_SCSI_ISCI) += isci.o
 isci-objs := init.o phy.o request.o sata.o \
-	     remote_device.o port.o timers.o deprecated.o \
+	     remote_device.o port.o timers.o \
 	     host.o task.o events.o \
 	     core/scic_sds_controller.o  \
 	     core/scic_sds_remote_device.o    \
drivers/scsi/isci/events.c +77 -86

405 lines not on this page · raw message

drivers/scsi/isci/events.h new file +373 -0

373 lines not on this page · raw message

drivers/scsi/isci/host.c +78 -48

218 lines not on this page · raw message

drivers/scsi/isci/host.h +27 -9
index 26768c5..889a785 100644
@@ -61,7 +61,7 @@
 /*#include "task.h"*/
 #include "timers.h"
 #include "remote_device.h"
-#include "scic_user_callback.h"
+#include "scic_remote_device.h"
 
 #define DRV_NAME "isci"
 #define SCI_PCI_BAR_COUNT 2
@@ -88,7 +88,7 @@ struct isci_host {
 	union scic_oem_parameters oem_parameters;
 
 	int id; /* unique within a given pci device */
-	struct isci_timer_list timer_list_struct;
+	struct list_head timers;
 	void *core_ctrl_memory;
 	struct dma_pool *dma_pool;
 	unsigned int dma_pool_alloc_size;
@@ -106,7 +106,6 @@ struct isci_host {
 	spinlock_t state_lock;
 
 	struct pci_dev *pdev;
-	u8 sas_addr[SAS_ADDR_SIZE];
 
 	enum isci_status status;
 	#define IHOST_START_PENDING 0
@@ -117,11 +116,20 @@ struct isci_host {
 	struct tasklet_struct completion_tasklet;
 	struct list_head mdl_struct_list;
 	struct list_head requests_to_complete;
-	struct list_head requests_to_abort;
+	struct list_head requests_to_errorback;
 	spinlock_t scic_lock;
-	struct isci_host *next;
+
+	/* careful only access this via idev_by_id */
+	struct isci_remote_device devices[0];
 };
 
+static inline struct isci_remote_device *idev_by_id(struct isci_host *ihost, int i)
+{
+	void *p = ihost->devices;
+
+	return p + i * (sizeof(struct isci_remote_device) +
+			scic_remote_device_get_object_size());
+}
 
 /**
  * struct isci_pci_info - This class represents the pci function containing the
@@ -133,7 +141,7 @@ struct isci_host {
 struct isci_pci_info {
 	struct msix_entry msix_entries[SCI_MAX_MSIX_INT];
 	int core_lib_array_index;
-	struct isci_host *hosts;
+	struct isci_host *hosts[SCI_MAX_CONTROLLERS];
 };
 
 static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev)
@@ -141,9 +149,10 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev)
 	return pci_get_drvdata(pdev);
 }
 
-#define for_each_isci_host(isci_host, pdev) \
-	for (isci_host = to_pci_info(pdev)->hosts;\
-	     isci_host; isci_host = isci_host->next)
+#define for_each_isci_host(id, ihost, pdev) \
+	for (id = 0, ihost = to_pci_info(pdev)->hosts[id]; \
+	     id < ARRAY_SIZE(to_pci_info(pdev)->hosts) && ihost; \
+	     ihost = to_pci_info(pdev)->hosts[++id])
 
 static inline
 enum isci_status isci_host_get_state(
@@ -214,6 +223,15 @@ static inline void wait_for_stop(struct isci_host *ihost)
 	wait_event(ihost->eventq, !test_bit(IHOST_STOP_PENDING, &ihost->flags));
 }
 
+static inline void wait_for_device_start(struct isci_host *ihost, struct isci_remote_device *idev)
+{
+	wait_event(ihost->eventq, !test_bit(IDEV_START_PENDING, &idev->flags));
+}
+
+static inline void wait_for_device_stop(struct isci_host *ihost, struct isci_remote_device *idev)
+{
+	wait_event(ihost->eventq, !test_bit(IDEV_STOP_PENDING, &idev->flags));
+}
 
 /**
  * isci_host_from_sas_ha() - This accessor retrieves the isci_host object
drivers/scsi/isci/init.c +41 -43

182 lines not on this page · raw message

drivers/scsi/isci/isci.h +7 -24
index 6c79b29..b3f63f1 100644
@@ -53,21 +53,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/**
- * This file contains the isci_module object definition.
- *
- * isci.h
- */
-
-#if !defined(_SCI_MODULE_H_)
-#define _SCI_MODULE_H_
-
-/**
- * This file contains the SCI low level driver interface to the SCI and Libsas
- *    Libraries.
- *
- * isci.h
- */
+#ifndef __ISCI_H__
+#define __ISCI_H__
 
 #include <linux/kernel.h>
 #include <linux/list.h>
@@ -84,8 +71,11 @@
 #include "host.h"
 #include "timers.h"
 #include "sci_status.h"
+#include "request.h"
+#include "events.h"
+#include "task.h"
+#include "sata.h"
 
-extern struct kmem_cache *isci_kmem_cache;
 extern struct isci_firmware *isci_firmware;
 
 #define ISCI_FW_NAME		"isci/isci_firmware.bin"
@@ -133,11 +123,4 @@ enum sci_status isci_parse_user_parameters(
 	int scu_index,
 	struct isci_firmware *fw);
 
-#ifdef ISCI_SLAVE_ALLOC
-extern int ISCI_SLAVE_ALLOC(struct scsi_device *scsi_dev);
-#endif /* ISCI_SLAVE_ALLOC */
-
-#ifdef ISCI_SLAVE_DESTROY
-extern void ISCI_SLAVE_DESTROY(struct scsi_device *scsi_dev);
-#endif  /* ISCI_SLAVE_DESTROY */
-#endif  /* !defined(_SCI_MODULE_H_) */
+#endif  /* __ISCI_H__ */
drivers/scsi/isci/phy.c +45 -46

131 lines not on this page · raw message

drivers/scsi/isci/port.c +7 -11
index 446da20..a5b2565 100644
@@ -94,7 +94,6 @@ void isci_port_init(
 
 	INIT_LIST_HEAD(&isci_port->remote_dev_list);
 	INIT_LIST_HEAD(&isci_port->domain_dev_list);
-	spin_lock_init(&isci_port->remote_device_lock);
 	spin_lock_init(&isci_port->state_lock);
 	init_completion(&isci_port->start_complete);
 	isci_port->isci_host = isci_host;
@@ -192,6 +191,7 @@ void isci_port_link_up(
 	scic_port_get_properties(port, &properties);
 
 	if (properties.remote.protocols.u.bits.stp_target) {
+		u64 attached_sas_address;
 
 		struct scic_sata_phy_properties sata_phy_properties;
 
@@ -220,17 +220,13 @@ void isci_port_link_up(
 		 * will not be the same as assigned to the PHY and needs
 		 * to be obtained from struct scic_port_properties properties.
 		 */
+		attached_sas_address = properties.remote.sas_address.high;
+		attached_sas_address <<= 32;
+		attached_sas_address |= properties.remote.sas_address.low;
+		swab64s(&attached_sas_address);
 
-		BUG_ON(((size_t)SAS_ADDR_SIZE / 2)
-		       != sizeof(properties.remote.sas_address.low));
-
-		memcpy(&isci_phy->sas_phy.attached_sas_addr[0],
-		       &properties.remote.sas_address.low,
-		       SAS_ADDR_SIZE / 2);
-
-		memcpy(&isci_phy->sas_phy.attached_sas_addr[4],
-		       &properties.remote.sas_address.high,
-		       SAS_ADDR_SIZE / 2);
+		memcpy(&isci_phy->sas_phy.attached_sas_addr,
+		       &attached_sas_address, sizeof(attached_sas_address));
 
 	} else if (properties.remote.protocols.u.bits.ssp_target ||
 		   properties.remote.protocols.u.bits.smp_target) {
drivers/scsi/isci/port.h +0 -2
index b01b0c6..b7a7dd7 100644
@@ -73,7 +73,6 @@ enum isci_status {
 	isci_ready_for_io = 0x03,
 	isci_stopping     = 0x04,
 	isci_stopped      = 0x05,
-	isci_host_quiesce = 0x06
 };
 
 /**
@@ -91,7 +90,6 @@ struct isci_port {
 	struct isci_host *isci_host;
 	struct asd_sas_port sas_port;
 	struct list_head remote_dev_list;
-	spinlock_t remote_device_lock;
 	spinlock_t state_lock;
 	struct list_head domain_dev_list;
 	struct completion start_complete;
drivers/scsi/isci/remote_device.c +78 -141

366 lines not on this page · raw message

drivers/scsi/isci/remote_device.h +12 -29

78 lines not on this page · raw message

drivers/scsi/isci/request.c +62 -52

228 lines not on this page · raw message

drivers/scsi/isci/request.h +2 -1
index 166295e..b45c0f1 100644
@@ -71,7 +71,8 @@ enum isci_request_status {
 	completed   = 0x03,
 	aborting    = 0x04,
 	aborted     = 0x05,
-	terminating = 0x06
+	terminating = 0x06,
+	dead        = 0x07
 };
 
 enum task_type {
drivers/scsi/isci/sata.c +2 -2
index 19b0eea..7a1b586 100644
@@ -324,7 +324,7 @@ int isci_task_send_lu_reset_sata(
 
 	/* Leave SRST high for a bit. */
 	#define ISCI_SRST_ASSERT_DELAY 100 /* usecs */
-	scic_cb_stall_execution(ISCI_SRST_ASSERT_DELAY);
+	udelay(ISCI_SRST_ASSERT_DELAY);
 
 	/* Deassert SRST. */
 	isci_task_build_tmf(&tmf, isci_device, isci_tmf_sata_srst_low,
@@ -348,7 +348,7 @@ int isci_task_send_lu_reset_sata(
 	spin_lock_irqsave(&isci_host->scic_lock, flags);
 
 	/* Resume the device. */
-	scic_sds_remote_device_resume(isci_device->sci_device_handle);
+	scic_sds_remote_device_resume(to_sci_dev(isci_device));
 
 	spin_unlock_irqrestore(&isci_host->scic_lock, flags);
 
drivers/scsi/isci/task.c +429 -353

807 lines not on this page · raw message

drivers/scsi/isci/task.h +50 -68

118 lines not on this page · raw message

drivers/scsi/isci/timers.c +49 -124

173 lines not on this page · raw message

drivers/scsi/isci/timers.h +11 -49

60 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 5 lines · Dan Williams

The isci git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git master

...has been updated with the following:

Care to post a patch, or in case it's too large a patch link? git trees are inherently unreviewable.

#2 lore raw
Quoted 2 lines · Christoph Hellwig

Care to post a patch, or in case it's too large a patch link? git trees are inherently unreviewable.

Sorry, just noticed the patch series. I still don't quite see the connection between the series and the tree, but I'll assume they end up with the same result.

#3 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 2 lines · Christoph Hellwig

Care to post a patch, or in case it's too large a patch link?  git trees are inherently unreviewable.

Sorry, just noticed the patch series.  I still don't quite see the connection between the series and the tree, but I'll assume they end up with the same result.

They will end up with the same result. I'm assuming the in-progress rework state is not that interesting to post every patch to linux-scsi.

As we have release candidates I will reflow the patch series (lldd+core) for review.

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html