All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Cc: David Milburn <dmilburn@redhat.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Ed Ciechanowski <ed.ciechanowski@intel.com>,
	Ed Nadolski <edmund.nadolski@intel.com>,
	Jacek Danecki <jacek.danecki@intel.com>,
	hch@infradead.org, Jeff Skirvin <jeffrey.d.skirvin@intel.com>
Subject: [GIT] isci: fixes and cleanups from review
Date: Sat, 26 Mar 2011 19:47:47 -0700	[thread overview]
Message-ID: <1301194067.28442.22.camel@dwillia2-linux> (raw)

isci.git [1]  has been updated with some fixes as well as some upstream
cleanups.  The cleanups are too large to include in their entirety
(~3000 deletions), but the full log (since the last [GIT] isci message)
is below along with the diffs from the smaller patches.

Of course more cleanups are still in progress, this is the set that is
easily verified with a compile check.

--
Dan

[1]: http://git.kernel.org/?p=linux/kernel/git/djbw/isci.git;a=summary

The following changes since commit fa3fa74342e372611ce79636f8fdba69f96c84c4:

  Merge branch 'x86-pending' into upstream-pending (2011-03-17 08:59:58 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/djbw/isci.git upstream-pending

Dan Williams (11):
      Revert "isci: SATA/STP and SMP tasks are never explicitly put in the error path."
      Revert "isci: only call sas_task_abort for tasks with NEED_DEV_RESET"
      isci: reset hardware at init
      isci: fix apc mode definition
      isci: fix a build warning
      Merge branch 'x86-pending' into devel
      isci: reorder init to cleanup unneeded declarations
      isci: kill some long macros
      isci: namespacecheck cleanups
      isci: remove unused "remote_device_started"
      Merge branch 'libsas-pending' into upstream-pending

Dave Jiang (2):
      isci: Remove event_* calls as they are just wrappers
      isci: Remove "screaming" data types

 drivers/scsi/isci/Makefile                         |    2 +-
 drivers/scsi/isci/core/sati_translator_sequence.h  |   16 +-
 drivers/scsi/isci/core/sci_base_port.h             |   56 +-
 drivers/scsi/isci/core/sci_base_request.h          |   10 +-
 drivers/scsi/isci/core/sci_base_state.h            |    8 +-
 drivers/scsi/isci/core/sci_base_state_machine.c    |    4 +-
 drivers/scsi/isci/core/sci_status.h                |    6 +-
 drivers/scsi/isci/core/scic_config_parameters.h    |   13 -
 drivers/scsi/isci/core/scic_controller.h           |  348 ------
 drivers/scsi/isci/core/scic_io_request.h           |    2 +-
 drivers/scsi/isci/core/scic_port.h                 |  100 +--
 drivers/scsi/isci/core/scic_sds_controller.c       | 1274 ++++++++++----------
 drivers/scsi/isci/core/scic_sds_controller.h       |  109 +--
 drivers/scsi/isci/core/scic_sds_phy.c              |  893 +++++---------
 drivers/scsi/isci/core/scic_sds_phy.h              |   91 +--
 drivers/scsi/isci/core/scic_sds_port.c             | 1147 +++++++-----------
 drivers/scsi/isci/core/scic_sds_port.h             |  141 +--
 .../isci/core/scic_sds_port_configuration_agent.c  |   99 +-
 .../isci/core/scic_sds_port_configuration_agent.h  |    6 +-
 drivers/scsi/isci/core/scic_sds_remote_device.c    |  679 +++--------
 drivers/scsi/isci/core/scic_sds_remote_device.h    |   21 -
 .../scsi/isci/core/scic_sds_remote_node_context.c  |   46 +-
 .../scsi/isci/core/scic_sds_remote_node_context.h  |   15 +-
 drivers/scsi/isci/core/scic_sds_request.c          |  345 ++----
 drivers/scsi/isci/core/scic_sds_request.h          |   15 +-
 .../scsi/isci/core/scic_sds_smp_remote_device.c    |   44 +-
 drivers/scsi/isci/core/scic_sds_smp_request.c      |  137 ++--
 drivers/scsi/isci/core/scic_sds_ssp_request.c      |    2 +-
 .../scsi/isci/core/scic_sds_stp_packet_request.c   |    4 +-
 .../scsi/isci/core/scic_sds_stp_packet_request.h   |    2 +-
 drivers/scsi/isci/core/scic_sds_stp_pio_request.h  |   13 +-
 .../scsi/isci/core/scic_sds_stp_remote_device.c    |   76 +-
 drivers/scsi/isci/core/scic_sds_stp_request.c      |  251 ++---
 drivers/scsi/isci/core/scic_sds_stp_request.h      |   35 +-
 .../isci/core/scic_sds_unsolicited_frame_control.h |    6 +-
 drivers/scsi/isci/core/scu_registers.h             |   62 +-
 drivers/scsi/isci/core/scu_task_context.h          |   48 +-
 drivers/scsi/isci/events.c                         |  609 ----------
 drivers/scsi/isci/events.h                         |  373 ------
 drivers/scsi/isci/firmware/README                  |    2 +-
 drivers/scsi/isci/host.c                           |   44 +-
 drivers/scsi/isci/init.c                           |   26 +-
 drivers/scsi/isci/isci.h                           |    1 -
 drivers/scsi/isci/port.c                           |   53 +-
 drivers/scsi/isci/port.h                           |   10 +
 drivers/scsi/isci/probe_roms.c                     |    5 +-
 drivers/scsi/isci/probe_roms.h                     |   10 +-
 drivers/scsi/isci/request.c                        |  132 +--
 drivers/scsi/isci/request.h                        |    6 -
 drivers/scsi/isci/task.c                           |   13 +-
 drivers/scsi/isci/task.h                           |   30 +-
 firmware/isci/isci_firmware.bin.ihex               |    4 +-
 52 files changed, 2253 insertions(+), 5191 deletions(-)
 delete mode 100644 drivers/scsi/isci/events.c
 delete mode 100644 drivers/scsi/isci/events.h

commit 2fdebe19b880dbf1e3d5b265da2f2aab887d9522
Author: Dave Jiang <dave.jiang@intel.com>
Date:   Sat Mar 26 17:14:07 2011 -0700

    isci: Remove "screaming" data types
    
    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>

commit 26b604703fb4f8c55a11dcb26d43448b6b3b7a9e
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Sat Mar 26 16:56:55 2011 -0700

    isci: remove unused "remote_device_started"
    
    These routines are just stubs, re-add them when / if they are needed.  Also
    cleanup remote_device_stopped.
    
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit fad023f98205a4852ff12ac3b2f5ba82c528e344
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Sat Mar 26 16:43:01 2011 -0700

    isci: namespacecheck cleanups
    
    * mark needlessly global routines static
    * delete unused functions
    * move kernel-doc blocks from header files to source
    * reorder some functions to delete declarations
    * more default handler cleanups phy
    
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit 92314c6110081a0060f913acd26767e9886e009e
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Sat Mar 26 16:30:35 2011 -0700

    isci: kill some long macros
    
    Delete some macros that are longer to type than the open coded operation
    that they perform.
    
    scic_sds_phy_get_base_state_machine
    scic_sds_phy_get_starting_substate_machine
    scic_sds_port_get_base_state_machine
    scic_sds_port_get_ready_substate_machine
    scic_sds_remote_device_get_base_state_machine
    scic_sds_remote_device_get_ready_substate_machine
    scic_sds_remote_node_context_set_remote_node_index
    scic_sds_controller_get_base_state_machine
    
    Also performs some collateral cleanups like killing casts that assume
    structure member ordering, and consolidating a lot of duplicated default
    handler code (the primary callers of the *_get_base_state_machine macros) via
    a helper.
    
    Reported-by: Christoph Hellwig <hch@infradead.org>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

commit 0711f8f8ccee3137cd19a327e9232e9777ec5bb2
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Sat Mar 26 16:30:06 2011 -0700

    isci: reorder init to cleanup unneeded declarations
    
    Just move isci_pci_driver below the function definitions and delete the
    declarations.  A couple other whitespace fixups, and unused symbol
    deletions.
    
    Reported-by: Christoph Hellwig <hch@infradead.org>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index 7ca2a08..dd96113 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -88,23 +88,8 @@ static DEFINE_PCI_DEVICE_TABLE(isci_id_table) = {
 	{}
 };
 
-struct isci_firmware *isci_firmware;
-
-static int __devinit isci_pci_probe(
-	struct pci_dev *pdev,
-	const struct pci_device_id *device_id_p);
-
-static void __devexit isci_pci_remove(struct pci_dev *pdev);
-
 MODULE_DEVICE_TABLE(pci, isci_id_table);
 
-static struct pci_driver isci_pci_driver = {
-	.name		= DRV_NAME,
-	.id_table	= isci_id_table,
-	.probe		= isci_pci_probe,
-	.remove		= __devexit_p(isci_pci_remove),
-};
-
 /* linux isci specific settings */
 
 #if defined(CONFIG_PBG_HBA_A0)
@@ -343,7 +328,7 @@ static int num_controllers(struct pci_dev *pdev)
 	 */
 	resource_size_t scu_bar_size = pci_resource_len(pdev, SCI_SCU_BAR*2);
 	resource_size_t smu_bar_size = pci_resource_len(pdev, SCI_SMU_BAR*2);
-	
+
 	if (scu_bar_size >= SCI_SCU_BAR_SIZE*SCI_MAX_CONTROLLERS &&
 	    smu_bar_size >= SCI_SMU_BAR_SIZE*SCI_MAX_CONTROLLERS)
 		return SCI_MAX_CONTROLLERS;
@@ -488,7 +473,7 @@ static void check_si_rev(struct pci_dev *pdev)
 	dev_info(&pdev->dev, "driver configured for %s silicon (rev: %d)\n",
 		 isci_si_rev == ISCI_SI_REVA0 ? "A0" :
 		 isci_si_rev == ISCI_SI_REVA2 ? "A2" : "B0", pdev->revision);
-		
+
 }
 
 static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
@@ -577,6 +562,13 @@ static void __devexit isci_pci_remove(struct pci_dev *pdev)
 	}
 }
 
+static struct pci_driver isci_pci_driver = {
+	.name		= DRV_NAME,
+	.id_table	= isci_id_table,
+	.probe		= isci_pci_probe,
+	.remove		= __devexit_p(isci_pci_remove),
+};
+
 static __init int isci_init(void)
 {
 	int err;

commit cc41fde7c95fa8672ae32d3f696ba860621ce956
Author: Dave Jiang <dave.jiang@intel.com>
Date:   Sat Mar 26 16:11:51 2011 -0700

    isci: Remove event_* calls as they are just wrappers
    
    Removed isci_event_* calls and call those functions directly.
    
    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>

commit f498041a46e7f9f2c931d157661914cdfdbd66bd
Merge: b1d1718 4ac5ee3
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Sat Mar 26 16:07:05 2011 -0700

    Merge branch 'x86-pending' into devel
    
    pci_map_biosrom() has been accepted into tip.git/x86/platform, so
    unblock the backlog of changes that were pinned behind this patch.
    
    * x86-pending:
      isci: fix a build warning
      isci: fix apc mode definition
      isci: exposing user parameters via module params
      isci: fix oem parameter initialization and mode detection
      isci: Fixup for OEM parameter EFI variable retrieval
      isci: fixup with testing from isci OROM in BIOS
      isci: copy the oem parameters instead of assign
      isci: update efi variable name and guid
      isci: add support for 2 more oem parmeters
      isci: Adding EFI variable skeletal support
      isci: Add support for probing OROM for OEM params
      x86: introduce pci_map_biosrom()

commit 4ac5ee33ded761273337fef0e0f32332be57b349
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Mar 25 10:05:58 2011 -0700

    isci: fix a build warning
    
    Use min_t to address:
    drivers/scsi/isci/probe_roms.c: In function ‘isci_get_efi_var’:
    drivers/scsi/isci/probe_roms.c:241: warning: comparison of distinct pointer types lacks a cast
    
    Reported-by: David Milburn <dmilburn@redhat.com>
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

diff --git a/drivers/scsi/isci/probe_roms.c b/drivers/scsi/isci/probe_roms.c
index a69be59..b53d1c2 100644
--- a/drivers/scsi/isci/probe_roms.c
+++ b/drivers/scsi/isci/probe_roms.c
@@ -238,9 +238,8 @@ struct isci_orom *isci_get_efi_var(struct pci_dev *pdev)
 		return NULL;
 	}
 
-	copy_len = min(evar->DataSize,
-		       min(oem_hdr->len - sizeof(*oem_hdr),
-			   sizeof(*rom)));
+	copy_len = min_t(u16, evar->DataSize,
+			 min_t(u16, oem_hdr->len - sizeof(*oem_hdr), sizeof(*rom)));
 
 	memcpy(rom, (char *)evar->Data + sizeof(*oem_hdr), copy_len);
 

commit d9d38c386335cd1247cf3d5f7ce51bdc24417ca7
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Fri Mar 25 09:58:15 2011 -0700

    isci: fix apc mode definition
    
    The original apc mode definition is the correct one, the fix from commit
    f7ec5db1 "isci: fix oem parameter initialization and mode detection" was based
    on a typo from a specification update.
    
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

diff --git a/drivers/scsi/isci/probe_roms.h b/drivers/scsi/isci/probe_roms.h
index 1b44483..c2162cf 100644
--- a/drivers/scsi/isci/probe_roms.h
+++ b/drivers/scsi/isci/probe_roms.h
@@ -96,10 +96,6 @@ struct isci_oem_hdr {
 #define ISCI_ROM_SIG		"ISCUOEMB"
 #define ISCI_ROM_SIG_SIZE	8
 
-#define ISCI_PREBOOT_SOURCE_INIT     (0x00)
-#define ISCI_PREBOOT_SOURCE_OROM     (0x80)
-#define ISCI_PREBOOT_SOURCE_EFI      (0x81)
-
 #define ISCI_EFI_VENDOR_GUID	\
 	EFI_GUID(0x193dfefa, 0xa445, 0x4302, 0x99, 0xd8, 0xef, 0x3a, 0xad, \
 			0x1a, 0x04, 0xc6)
@@ -116,8 +112,8 @@ struct isci_oem_hdr {
  * being assigned is sufficient to declare manual PORT configuration.
  */
 enum SCIC_PORT_CONFIGURATION_MODE {
-	SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE = 0,
-	SCIC_PORT_MANUAL_CONFIGURATION_MODE = 1
+	SCIC_PORT_MANUAL_CONFIGURATION_MODE = 0,
+	SCIC_PORT_AUTOMATIC_CONFIGURATION_MODE = 1
 };
 
 struct sci_bios_oem_param_block_hdr {
diff --git a/firmware/isci/isci_firmware.bin.ihex b/firmware/isci/isci_firmware.bin.ihex
index 4f8767c..31b5ecf 100644
--- a/firmware/isci/isci_firmware.bin.ihex
+++ b/firmware/isci/isci_firmware.bin.ihex
@@ -1,11 +1,11 @@
 :10000000495343554F454D42E70017100002000089
-:10001000000000000000000001000000000000FFE0
+:10001000000000000000000101000000000000FFDF
 :10002000FFCF5F01000000037C0E00037C0E000385
 :100030007C0E00037C0E00FFFFCF5F010000000379
 :100040007C0E00037C0E00037C0E00037C0E00FF80
 :10005000FFCF5F01000000037C0E00037C0E000355
 :100060007C0E00037C0E00FFFFCF5F010000000349
-:100070007C0E00037C0E00037C0E00037C0E00004F
+:100070007C0E00037C0E00037C0E00037C0E00014E
 :1000800001000000000000FFFFCF5F02000000033E
 :100090007C0E00037C0E00037C0E00037C0E00FF30
 :1000A000FFCF5F02000000037C0E00037C0E000304

commit b1d171853724d7cd5e151785535aff242ce98860
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Wed Mar 23 17:31:27 2011 -0700

    isci: reset hardware at init
    
    Don't assume the hardware is in a known state at init.
    
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

diff --git a/drivers/scsi/isci/core/scic_sds_controller.c b/drivers/scsi/isci/core/scic_sds_controller.c
index 180bb1e..799a04b 100644
--- a/drivers/scsi/isci/core/scic_sds_controller.c
+++ b/drivers/scsi/isci/core/scic_sds_controller.c
@@ -2116,7 +2116,7 @@ enum sci_status scic_controller_construct(struct scic_sds_controller *controller
 	/* Initialize the User and OEM parameters to default values. */
 	scic_sds_controller_set_default_config_parameters(controller);
 
-	return SCI_SUCCESS;
+	return scic_controller_reset(controller);
 }
 
 /* --------------------------------------------------------------------------- */
@@ -3562,6 +3562,7 @@ const struct scic_sds_controller_state_handler scic_sds_controller_state_handler
 		.terminate_request = scic_sds_controller_default_request_handler,
 	},
 	[SCI_BASE_CONTROLLER_STATE_RESET] = {
+		.base.reset        = scic_sds_controller_general_reset_handler,
 		.base.initialize   = scic_sds_controller_reset_state_initialize_handler,
 		.base.start_io     = scic_sds_controller_default_start_operation_handler,
 		.base.complete_io  = scic_sds_controller_default_request_handler,

commit 7f218d67ce8de2c3390f319137d96cafe946f38b
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Tue Mar 22 17:45:11 2011 -0700

    Revert "isci: only call sas_task_abort for tasks with NEED_DEV_RESET"
    
    This reverts commit 8dc962d12c66ebacf1ce60f510b3a41d6aa5ffe1.
    
    Gating which tasks are eligible for sas_task_abort is already handled by
    libsas no need to add explicit handling.
    
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 1d2e417..eba8e0b 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -798,8 +798,7 @@ static void isci_task_save_for_upper_layer_completion(
 
 	task_notification_selection
 		= isci_task_set_completion_status(task, response, status,
-						  task_notification_selection,
-						  request->status);
+						  task_notification_selection);
 
 	/* Tasks aborted specifically by a call to the lldd_abort_task
 	 * function should not be completed to the host in the regular path.
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index a80685f..d483680 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -84,7 +84,7 @@ static void isci_task_refuse(struct isci_host *ihost, struct sas_task *task,
 
 	disposition = isci_perform_normal_io_completion;
 	disposition = isci_task_set_completion_status(task, response, status,
-						      disposition, completed);
+						      disposition);
 
 	/* Tasks aborted specifically by a call to the lldd_abort_task
 	 * function should not be completed to the host in the regular path.
diff --git a/drivers/scsi/isci/task.h b/drivers/scsi/isci/task.h
index 11c0b8a..9754b43 100644
--- a/drivers/scsi/isci/task.h
+++ b/drivers/scsi/isci/task.h
@@ -293,23 +293,19 @@ static inline void isci_task_all_done(
 */
 static inline enum isci_completion_selection
 isci_task_set_completion_status(
-	struct sas_task                *task,
-	enum service_response          response,
-	enum exec_status               status,
-	enum isci_completion_selection task_notification_selection,
-	enum isci_request_status       request_status)
+	struct sas_task *task,
+	enum service_response response,
+	enum exec_status status,
+	enum isci_completion_selection task_notification_selection)
 {
 	unsigned long flags;
 
 	spin_lock_irqsave(&task->task_state_lock, flags);
 
-	/* Only let an I/O into the error path for reset purposes
-	 * if it's not already being aborted; if "completed", and if a device
-	 * reset is being indicated, make sure the I/O is in the error path.
-	 */
-	if (request_status == completed &&
-	    (task->task_state_flags & SAS_TASK_NEED_DEV_RESET)) {
-
+	/* If a device reset is being indicated, make sure the I/O
+	* is in the error path.
+	*/
+	if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET) {
 		/* Fail the I/O to make sure it goes into the error path. */
 		response = SAS_TASK_UNDELIVERED;
 		status = SAM_STAT_TASK_ABORTED;

commit bcc5d45c87ee5a0adee4558f10b578b2cf3106e9
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Tue Mar 22 17:41:00 2011 -0700

    Revert "isci: SATA/STP and SMP tasks are never explicitly put in the error path."
    
    This reverts commit 7a18a48e0f70b8d17064523d8473d48a87d0400a.
    
    sas_task_abort already handles internal commands so this determination
    is not needed in lldd's.
    
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>

diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c
index 15b9509..dc231c2 100644
--- a/drivers/scsi/isci/host.c
+++ b/drivers/scsi/isci/host.c
@@ -331,39 +331,21 @@ static void isci_host_completion_routine(unsigned long data)
 
 		task = isci_request_access_task(request);
 
+		/* Use sas_task_abort */
+		dev_warn(&isci_host->pdev->dev,
+			 "%s: Error - request/task = %p/%p\n",
+			 __func__,
+			 request,
+			 task);
+
 		if (task != NULL) {
 
-			if (task->task_proto & (SAS_PROTOCOL_SATA
-					      | SAS_PROTOCOL_SMP
-					      | SAS_PROTOCOL_STP)) {
-				/* SATA/STP and SMP tasks are not put into the
-				 * error path because of those protocols'
-				 * discovery implementation in libsas.
-				 *
-				 * The only thing that can be done now is to
-				 * let the I/O timeout so that the abort
-				 * task interface will be called.
-				 */
-				dev_warn(&isci_host->pdev->dev,
-					 "%s: Error - SMP/SATA/STP (%x) "
-					 "request/task = %p/%p is being left"
-					 "to time out!\n",
-					 __func__, task->task_proto, request,
-					 task);
-
-			} else {
-				/* Use sas_task_abort */
-				dev_warn(&isci_host->pdev->dev,
-					 "%s: Error - request/task = %p/%p\n",
-					 __func__, request, task);
-
-				/* Put the task into the abort path if it's
-				 * not there already.
-				*/
-				if (!(task->task_state_flags
-				     & SAS_TASK_STATE_ABORTED))
-					sas_task_abort(task);
-			}
+			/* Put the task into the abort path if it's not there
+			 * already.
+			 */
+			if (!(task->task_state_flags & SAS_TASK_STATE_ABORTED))
+				sas_task_abort(task);
+
 		} else {
 			/* This is a case where the request has completed with a
 			 * status such that it needed further target servicing,
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 6d81c41..1d2e417 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -356,6 +356,33 @@ int isci_request_alloc_tmf(
 }
 
 /**
+ * isci_request_signal_device_reset() - This function will set the "device
+ *    needs target reset" flag in the given sas_tasks' task_state_flags, and
+ *    then cause the task to be added into the SCSI error handler queue which
+ *    will eventually be escalated to a target reset.
+ *
+ *
+ */
+static void isci_request_signal_device_reset(
+	struct isci_request *isci_request)
+{
+	unsigned long flags;
+	struct sas_task *task = isci_request_access_task(isci_request);
+
+	dev_dbg(&isci_request->isci_host->pdev->dev,
+		"%s: request=%p, task=%p\n", __func__, isci_request, task);
+
+	spin_lock_irqsave(&task->task_state_lock, flags);
+	task->task_state_flags |= SAS_TASK_NEED_DEV_RESET;
+	spin_unlock_irqrestore(&task->task_state_lock, flags);
+
+	/* Cause this task to be scheduled in the SCSI error handler
+	 * thread.
+	 */
+	sas_task_abort(task);
+}
+
+/**
  * isci_request_execute() - This function allocates the isci_request object,
  *    all fills in some common fields.
  * @isci_host: This parameter specifies the ISCI host object
@@ -408,8 +435,7 @@ int isci_request_execute(
 			);
 
 		if (status == SCI_SUCCESS ||
-		    (status == SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED &&
-		     task->task_proto != SAS_PROTOCOL_SMP)) {
+		    status == SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED) {
 
 			/* Either I/O started OK, or the core has signaled that
 			 * the device needs a target reset.
@@ -427,12 +453,6 @@ int isci_request_execute(
 				/* Save the tag for possible task mgmt later. */
 				request->io_tag = scic_io_request_get_io_tag(
 						     request->sci_request_handle);
-			} else {
-				/* The request did not really start in the
-				 * hardware, so clear the request handle
-				 * here so no terminations will be done.
-				*/
-				request->sci_request_handle = NULL;
 			}
 		} else
 			dev_warn(&isci_host->pdev->dev,
@@ -441,28 +461,14 @@ int isci_request_execute(
 
 		spin_unlock_irqrestore(&isci_host->scic_lock, flags);
 
-		if (status == SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED &&
-		    task->task_proto != SAS_PROTOCOL_SMP) {
-
-			dev_dbg(&request->isci_host->pdev->dev,
-				"%s: request=%p, task=%p\n",
-				__func__, request, task);
-
+		if (status ==
+		    SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED) {
 			/* Signal libsas that we need the SCSI error
 			* handler thread to work on this I/O and that
 			* we want a device reset.
 			*/
-			spin_lock_irqsave(&task->task_state_lock, flags);
-			task->task_state_flags |= SAS_TASK_NEED_DEV_RESET;
-			spin_unlock_irqrestore(&task->task_state_lock, flags);
-
-			if (task->task_proto & SAS_PROTOCOL_SSP) {
+			isci_request_signal_device_reset(request);
 
-				/* Cause this task to be scheduled in the SCSI
-				 * error handler thread.
-				 */
-				sas_task_abort(task);
-			}
 			/* Change the status, since we are holding
 			* the I/O until it is managed by the SCSI
 			* error handler.


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

             reply	other threads:[~2011-03-27  2:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27  2:47 Dan Williams [this message]
2011-04-02  1:15 ` [GIT] isci: update for 4/1 Dan Williams
2011-04-02 12:16   ` Christoph Hellwig
2011-04-04 14:35     ` Jiang, Dave
2011-04-04 19:50     ` Jiang, Dave
2011-04-04 21:34       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301194067.28442.22.camel@dwillia2-linux \
    --to=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dmilburn@redhat.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=edmund.nadolski@intel.com \
    --cc=hch@infradead.org \
    --cc=jacek.danecki@intel.com \
    --cc=jeffrey.d.skirvin@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.