All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] smartpqi updates
@ 2016-08-26 16:44 Don Brace
  2016-08-26 16:44 ` [PATCH 01/17] smartpqi: change aio sg processing Don Brace
                   ` (16 more replies)
  0 siblings, 17 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

These changes are based on Linus's tree

The changes are:
 - simplify aio processing
 - simplify tmf macro names
 - remove workaround for spanning
 - add message for offlined drives
 - enhance reset logic
 - make some functions in-line
 - add support for kdump
 - correct issue with offlined controller
 - change timeout for events
 - reformat function to match svn version
 - correct update time scheduling
 - minor queuecommand cleanup
 - remove timeout on cache flush operation
 - update smartpqi/Kconfig
   - Martin K. Peterson's review
 - updated MAINTAINERS for smartpqi.txt addition
 - add Documentation/scsi/smartpqi.txt
   - Martin K. Peterson's review
 - bump driver version

---

Kevin Barnett (17):
      smartpqi: change aio sg processing
      smartpqi: change tmf macro names
      smartpqi: simplify spanning
      smartpqi: enhance drive offline informational message
      smartpqi: enhance reset logic
      smartpqi: change commonly used function to inline
      smartpqi: add kdump support
      smartpqi: correct controller offline issue
      smartpqi: correct event acknowledgment timeout issue
      smartpqi: minor function reformating
      smartpqi: minor tweaks to update time support
      smartpqi: scsi queuecommand cleanup
      smartpqi: remove timeout for cache flush operations
      smartpqi: update Kconfig
      smartpqi: update maintainers
      smartpqi: add smartpqi.txt
      smartqi: bump driver version


 Documentation/scsi/smartpqi.txt       |   80 ++++++++
 MAINTAINERS                           |    1 
 drivers/scsi/smartpqi/Kconfig         |    8 +
 drivers/scsi/smartpqi/smartpqi.h      |   35 ++--
 drivers/scsi/smartpqi/smartpqi_init.c |  316 ++++++++++++++++-----------------
 drivers/scsi/smartpqi/smartpqi_sis.c  |   10 +
 drivers/scsi/smartpqi/smartpqi_sis.h  |    2 
 7 files changed, 274 insertions(+), 178 deletions(-)
 create mode 100644 Documentation/scsi/smartpqi.txt

--
Signature

^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH 01/17] smartpqi: change aio sg processing
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  8:54   ` Johannes Thumshirn
  2016-08-31 12:51   ` Tomas Henzl
  2016-08-26 16:44 ` [PATCH 02/17] smartpqi: change tmf macro names Don Brace
                   ` (15 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Take advantage of controller improvements.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |   68 +++++++++++++++++++--------------
 1 file changed, 39 insertions(+), 29 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 906f1aa..418f636 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4263,48 +4263,58 @@ static int pqi_build_aio_sg_list(struct pqi_ctrl_info *ctrl_info,
 	int i;
 	u16 iu_length;
 	int sg_count;
-	unsigned int num_sg_in_iu = 0;
+	bool chained;
+	unsigned int num_sg_in_iu;
+	unsigned int max_sg_per_iu;
 	struct scatterlist *sg;
 	struct pqi_sg_descriptor *sg_descriptor;
 
 	sg_count = scsi_dma_map(scmd);
 	if (sg_count < 0)
 		return sg_count;
+
+	iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
+		PQI_REQUEST_HEADER_LENGTH;
+	num_sg_in_iu = 0;
+
 	if (sg_count == 0)
 		goto out;
 
-	if (sg_count <= ctrl_info->max_sg_per_iu) {
-		sg_descriptor = &request->sg_descriptors[0];
-		scsi_for_each_sg(scmd, sg, sg_count, i) {
-			pqi_set_sg_descriptor(sg_descriptor, sg);
-			sg_descriptor++;
-		}
-		put_unaligned_le32(CISS_SG_LAST,
-			&request->sg_descriptors[sg_count - 1].flags);
-		num_sg_in_iu = sg_count;
-	} else {
-		sg_descriptor = &request->sg_descriptors[0];
-		put_unaligned_le64((u64)io_request->sg_chain_buffer_dma_handle,
-			&sg_descriptor->address);
-		put_unaligned_le32(sg_count * sizeof(*sg_descriptor),
-			&sg_descriptor->length);
-		put_unaligned_le32(CISS_SG_CHAIN, &sg_descriptor->flags);
-
-		sg_descriptor = io_request->sg_chain_buffer;
-		scsi_for_each_sg(scmd, sg, sg_count, i) {
-			pqi_set_sg_descriptor(sg_descriptor, sg);
-			sg_descriptor++;
+	sg = scsi_sglist(scmd);
+	sg_descriptor = request->sg_descriptors;
+	max_sg_per_iu = ctrl_info->max_sg_per_iu - 1;
+	chained = false;
+	i = 0;
+
+	while (1) {
+		pqi_set_sg_descriptor(sg_descriptor, sg);
+		if (!chained)
+			num_sg_in_iu++;
+		i++;
+		if (i == sg_count)
+			break;
+		sg_descriptor++;
+		if (i == max_sg_per_iu) {
+			put_unaligned_le64(
+				(u64)io_request->sg_chain_buffer_dma_handle,
+				&sg_descriptor->address);
+			put_unaligned_le32((sg_count - num_sg_in_iu)
+				* sizeof(*sg_descriptor),
+				&sg_descriptor->length);
+			put_unaligned_le32(CISS_SG_CHAIN,
+				&sg_descriptor->flags);
+			chained = true;
+			num_sg_in_iu++;
+			sg_descriptor = io_request->sg_chain_buffer;
 		}
-		put_unaligned_le32(CISS_SG_LAST,
-			&io_request->sg_chain_buffer[sg_count - 1].flags);
-		num_sg_in_iu = 1;
-		request->partial = 1;
+		sg = sg_next(sg);
 	}
 
-out:
-	iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
-		PQI_REQUEST_HEADER_LENGTH;
+	put_unaligned_le32(CISS_SG_LAST, &sg_descriptor->flags);
+	request->partial = chained;
 	iu_length += num_sg_in_iu * sizeof(*sg_descriptor);
+
+out:
 	put_unaligned_le16(iu_length, &request->header.iu_length);
 	request->num_sg_descriptors = num_sg_in_iu;
 


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 02/17] smartpqi: change tmf macro names
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
  2016-08-26 16:44 ` [PATCH 01/17] smartpqi: change aio sg processing Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  8:55   ` Johannes Thumshirn
  2016-08-31 12:52   ` Tomas Henzl
  2016-08-26 16:44 ` [PATCH 03/17] smartpqi: simplify spanning Don Brace
                   ` (14 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

small change to make code look cleaner

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi.h      |    6 ++----
 drivers/scsi/smartpqi/smartpqi_init.c |    4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index ea49005..dbcdb03 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -545,10 +545,8 @@ typedef u32 pqi_index_t;
 #define SOP_TASK_ATTRIBUTE_ORDERED		2
 #define SOP_TASK_ATTRIBUTE_ACA			4
 
-#define SOP_TASK_MANAGEMENT_FUNCTION_COMPLETE	0x0
-#define SOP_TASK_MANAGEMENT_FUNCTION_REJECTED	0x4
-#define SOP_TASK_MANAGEMENT_FUNCTION_FAILED	0x5
-#define SOP_TASK_MANAGEMENT_FUNCTION_SUCCEEDED	0x8
+#define SOP_TMF_COMPLETE		0x0
+#define SOP_TMF_FUNCTION_SUCCEEDED	0x8
 
 /* additional CDB bytes usage field codes */
 #define SOP_ADDITIONAL_CDB_BYTES_0	0	/* 16-byte CDB */
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 418f636..6eab38e 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2469,8 +2469,8 @@ static int pqi_interpret_task_management_response(
 	int rc;
 
 	switch (response->response_code) {
-	case SOP_TASK_MANAGEMENT_FUNCTION_COMPLETE:
-	case SOP_TASK_MANAGEMENT_FUNCTION_SUCCEEDED:
+	case SOP_TMF_COMPLETE:
+	case SOP_TMF_FUNCTION_SUCCEEDED:
 		rc = 0;
 		break;
 	default:


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 03/17] smartpqi: simplify spanning
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
  2016-08-26 16:44 ` [PATCH 01/17] smartpqi: change aio sg processing Don Brace
  2016-08-26 16:44 ` [PATCH 02/17] smartpqi: change tmf macro names Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  8:57   ` Johannes Thumshirn
  2016-08-31 12:59   ` Tomas Henzl
  2016-08-26 16:44 ` [PATCH 04/17] smartpqi: enhance drive offline informational message Don Brace
                   ` (13 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Removed the workaround for the transition to spanning.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |   38 +++++++++++++++++----------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 6eab38e..9922e31 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct pqi_ctrl_info *ctrl_info)
 		return -EINVAL;
 	}
 
+	if (!ctrl_info->inbound_spanning_supported) {
+		dev_err(&ctrl_info->pci_dev->dev,
+			"the controller does not support inbound spanning\n");
+		return -EINVAL;
+	}
+
+	if (ctrl_info->outbound_spanning_supported) {
+		dev_err(&ctrl_info->pci_dev->dev,
+			"the controller supports outbound spanning but this driver does not\n");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
@@ -4138,24 +4150,14 @@ static void pqi_calculate_queue_resources(struct pqi_ctrl_info *ctrl_info)
 
 	ctrl_info->num_queue_groups = num_queue_groups;
 
-	if (ctrl_info->max_inbound_iu_length_per_firmware == 256 &&
-		ctrl_info->outbound_spanning_supported) {
-		/*
-		 * TEMPHACK
-		 * This is older f/w that doesn't actually support spanning.
-		 */
-		ctrl_info->max_inbound_iu_length =
-			PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
-	} else {
-		/*
-		 * Make sure that the max. inbound IU length is an even multiple
-		 * of our inbound element length.
-		 */
-		ctrl_info->max_inbound_iu_length =
-			(ctrl_info->max_inbound_iu_length_per_firmware /
-			PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
-			PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
-	}
+	/*
+	 * Make sure that the max. inbound IU length is an even multiple
+	 * of our inbound element length.
+	 */
+	ctrl_info->max_inbound_iu_length =
+		(ctrl_info->max_inbound_iu_length_per_firmware /
+		PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
+		PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
 
 	num_elements_per_iq =
 		(ctrl_info->max_inbound_iu_length /


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 04/17] smartpqi: enhance drive offline informational message
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (2 preceding siblings ...)
  2016-08-26 16:44 ` [PATCH 03/17] smartpqi: simplify spanning Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  8:59   ` Johannes Thumshirn
  2016-08-31 13:00   ` Tomas Henzl
  2016-08-26 16:44 ` [PATCH 05/17] smartpqi: enhance reset logic Don Brace
                   ` (12 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Made a couple of error messages more verbose.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 9922e31..198a7c2 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2298,11 +2298,16 @@ static inline void pqi_aio_path_disabled(struct pqi_io_request *io_request)
 static inline void pqi_take_device_offline(struct scsi_device *sdev)
 {
 	struct pqi_ctrl_info *ctrl_info;
+	struct pqi_scsi_dev *device;
 
 	if (scsi_device_online(sdev)) {
 		scsi_device_set_state(sdev, SDEV_OFFLINE);
 		ctrl_info = shost_to_hba(sdev->host);
 		schedule_delayed_work(&ctrl_info->rescan_work, 0);
+		device = sdev->hostdata;
+		dev_err(&ctrl_info->pci_dev->dev, "offlined scsi %d:%d:%d:%d\n",
+			ctrl_info->scsi_host->host_no, device->bus,
+			device->target, device->lun);
 	}
 }
 


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 05/17] smartpqi: enhance reset logic
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (3 preceding siblings ...)
  2016-08-26 16:44 ` [PATCH 04/17] smartpqi: enhance drive offline informational message Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  9:05   ` Johannes Thumshirn
  2016-08-31 13:19   ` Tomas Henzl
  2016-08-26 16:44 ` [PATCH 06/17] smartpqi: change commonly used function to inline Don Brace
                   ` (11 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Eliminated timeout from LUN reset logic.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi.h      |    2 -
 drivers/scsi/smartpqi/smartpqi_init.c |  101 +++++++++++----------------------
 2 files changed, 35 insertions(+), 68 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index dbcdb03..053be6b 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -370,7 +370,6 @@ struct pqi_task_management_request {
 };
 
 #define SOP_TASK_MANAGEMENT_LUN_RESET	0x8
-#define PQI_ABORT_TIMEOUT_MSECS		(20 * 1000)
 
 struct pqi_task_management_response {
 	struct pqi_iu_header header;
@@ -762,7 +761,6 @@ struct pqi_scsi_dev {
 
 	struct pqi_sas_port *sas_port;
 	struct scsi_device *sdev;
-	bool	reset_in_progress;
 
 	struct list_head scsi_device_list_entry;
 	struct list_head new_device_list_entry;
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 198a7c2..dbc8b40 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4537,13 +4537,6 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost,
 	bool raid_bypassed;
 
 	device = scmd->device->hostdata;
-
-	if (device->reset_in_progress) {
-		set_host_byte(scmd, DID_RESET);
-		pqi_scsi_done(scmd);
-		return 0;
-	}
-
 	ctrl_info = shost_to_hba(shost);
 
 	if (pqi_ctrl_offline(ctrl_info)) {
@@ -4585,61 +4578,47 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost,
 	return rc;
 }
 
-static inline void pqi_complete_queued_requests_queue_group(
-	struct pqi_queue_group *queue_group,
-	struct pqi_scsi_dev *device_in_reset)
+static void pqi_lun_reset_complete(struct pqi_io_request *io_request,
+	void *context)
 {
-	unsigned int path;
-	unsigned long flags;
-	struct pqi_io_request *io_request;
-	struct pqi_io_request *next;
-	struct scsi_cmnd *scmd;
-	struct pqi_scsi_dev *device;
+	struct completion *waiting = context;
 
-	for (path = 0; path < 2; path++) {
-		spin_lock_irqsave(&queue_group->submit_lock[path], flags);
+	complete(waiting);
+}
 
-		list_for_each_entry_safe(io_request, next,
-			&queue_group->request_list[path],
-			request_list_entry) {
-			scmd = io_request->scmd;
-			if (!scmd)
-				continue;
-			device = scmd->device->hostdata;
-			if (device == device_in_reset) {
-				set_host_byte(scmd, DID_RESET);
-				pqi_scsi_done(scmd);
-				list_del(&io_request->
-					request_list_entry);
-			}
+#define PQI_LUN_RESET_TIMEOUT_SECS	10
+
+static int pqi_wait_for_lun_reset_completion(struct pqi_ctrl_info *ctrl_info,
+	struct pqi_scsi_dev *device, struct completion *wait)
+{
+	int rc;
+	unsigned int wait_secs = 0;
+
+	while (1) {
+		if (wait_for_completion_io_timeout(wait,
+			PQI_LUN_RESET_TIMEOUT_SECS * HZ)) {
+			rc = 0;
+			break;
 		}
 
-		spin_unlock_irqrestore(&queue_group->submit_lock[path], flags);
-	}
-}
+		pqi_check_ctrl_health(ctrl_info);
+		if (pqi_ctrl_offline(ctrl_info)) {
+			rc = -ETIMEDOUT;
+			break;
+		}
 
-static void pqi_complete_queued_requests(struct pqi_ctrl_info *ctrl_info,
-	struct pqi_scsi_dev *device_in_reset)
-{
-	unsigned int i;
-	struct pqi_queue_group *queue_group;
+		wait_secs += PQI_LUN_RESET_TIMEOUT_SECS;
 
-	for (i = 0; i < ctrl_info->num_queue_groups; i++) {
-		queue_group = &ctrl_info->queue_groups[i];
-		pqi_complete_queued_requests_queue_group(queue_group,
-			device_in_reset);
+		dev_err(&ctrl_info->pci_dev->dev,
+			"resetting scsi %d:%d:%d:%d - waiting %u seconds\n",
+			ctrl_info->scsi_host->host_no, device->bus,
+			device->target, device->lun, wait_secs);
 	}
-}
 
-static void pqi_reset_lun_complete(struct pqi_io_request *io_request,
-	void *context)
-{
-	struct completion *waiting = context;
-
-	complete(waiting);
+	return rc;
 }
 
-static int pqi_reset_lun(struct pqi_ctrl_info *ctrl_info,
+static int pqi_lun_reset(struct pqi_ctrl_info *ctrl_info,
 	struct pqi_scsi_dev *device)
 {
 	int rc;
@@ -4650,7 +4629,7 @@ static int pqi_reset_lun(struct pqi_ctrl_info *ctrl_info,
 	down(&ctrl_info->lun_reset_sem);
 
 	io_request = pqi_alloc_io_request(ctrl_info);
-	io_request->io_complete_callback = pqi_reset_lun_complete;
+	io_request->io_complete_callback = pqi_lun_reset_complete;
 	io_request->context = &wait;
 
 	request = io_request->iu;
@@ -4668,12 +4647,9 @@ static int pqi_reset_lun(struct pqi_ctrl_info *ctrl_info,
 		&ctrl_info->queue_groups[PQI_DEFAULT_QUEUE_GROUP], RAID_PATH,
 		io_request);
 
-	if (!wait_for_completion_io_timeout(&wait,
-		msecs_to_jiffies(PQI_ABORT_TIMEOUT_MSECS))) {
-		rc = -ETIMEDOUT;
-	} else {
+	rc = pqi_wait_for_lun_reset_completion(ctrl_info, device, &wait);
+	if (rc == 0)
 		rc = io_request->status;
-	}
 
 	pqi_free_io_request(io_request);
 	up(&ctrl_info->lun_reset_sem);
@@ -4692,15 +4668,9 @@ static int pqi_device_reset(struct pqi_ctrl_info *ctrl_info,
 	if (pqi_ctrl_offline(ctrl_info))
 		return FAILED;
 
-	device->reset_in_progress = true;
-	pqi_complete_queued_requests(ctrl_info, device);
-	rc = pqi_reset_lun(ctrl_info, device);
-	device->reset_in_progress = false;
-
-	if (rc)
-		return FAILED;
+	rc = pqi_lun_reset(ctrl_info, device);
 
-	return SUCCESS;
+	return rc == 0 ? SUCCESS : FAILED;
 }
 
 static int pqi_eh_device_reset_handler(struct scsi_cmnd *scmd)
@@ -4710,7 +4680,6 @@ static int pqi_eh_device_reset_handler(struct scsi_cmnd *scmd)
 	struct pqi_scsi_dev *device;
 
 	ctrl_info = shost_to_hba(scmd->device->host);
-
 	device = scmd->device->hostdata;
 
 	dev_err(&ctrl_info->pci_dev->dev,


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 06/17] smartpqi: change commonly used function to inline
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (4 preceding siblings ...)
  2016-08-26 16:44 ` [PATCH 05/17] smartpqi: enhance reset logic Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  9:06   ` Johannes Thumshirn
  2016-08-26 16:44 ` [PATCH 07/17] smartpqi: add kdump support Don Brace
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

A tiny tweak to convert a small, commonly used function to inline.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index dbc8b40..2656124 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -316,7 +316,7 @@ static struct pqi_io_request *pqi_alloc_io_request(
 	return io_request;
 }
 
-static void pqi_free_io_request(struct pqi_io_request *io_request)
+static inline void pqi_free_io_request(struct pqi_io_request *io_request)
 {
 	atomic_dec(&io_request->refcount);
 }


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 07/17] smartpqi: add kdump support
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (5 preceding siblings ...)
  2016-08-26 16:44 ` [PATCH 06/17] smartpqi: change commonly used function to inline Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  9:11   ` Johannes Thumshirn
  2016-08-31 13:41   ` Tomas Henzl
  2016-08-26 16:44 ` [PATCH 08/17] smartpqi: correct controller offline issue Don Brace
                   ` (9 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi.h      |   13 +++++++++---
 drivers/scsi/smartpqi/smartpqi_init.c |   35 +++++++++++++++++++++++++++++++++
 drivers/scsi/smartpqi/smartpqi_sis.c  |   10 +++++++++
 drivers/scsi/smartpqi/smartpqi_sis.h  |    2 ++
 4 files changed, 57 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index 053be6b..5f965ad 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -79,11 +79,13 @@ struct pqi_ctrl_registers {
 	__le32	sis_ctrl_to_host_doorbell;		/* 9Ch */
 	u8	reserved3[0xa0 - (0x9c + sizeof(__le32))];
 	__le32	sis_ctrl_to_host_doorbell_clear;	/* A0h */
-	u8	reserved4[0xbc - (0xa0 + sizeof(__le32))];
+	u8	reserved4[0xb0 - (0xa0 + sizeof(__le32))];
+	__le32	sis_driver_scratch;			/* B0h */
+	u8	reserved5[0xbc - (0xb0 + sizeof(__le32))];
 	__le32	sis_firmware_status;			/* BCh */
-	u8	reserved5[0x1000 - (0xbc + sizeof(__le32))];
+	u8	reserved6[0x1000 - (0xbc + sizeof(__le32))];
 	__le32	sis_mailbox[8];				/* 1000h */
-	u8	reserved6[0x4000 - (0x1000 + (sizeof(__le32) * 8))];
+	u8	reserved7[0x4000 - (0x1000 + (sizeof(__le32) * 8))];
 	/*
 	 * The PQI spec states that the PQI registers should be at
 	 * offset 0 from the PCIe BAR 0.  However, we can't map
@@ -963,6 +965,11 @@ struct pqi_ctrl_info {
 	struct semaphore lun_reset_sem;
 };
 
+enum pqi_ctrl_mode {
+	UNKNOWN,
+	PQI_MODE
+};
+
 /*
  * assume worst case: SATA queue depth of 31 minus 4 internal firmware commands
  */
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 2656124..67661de 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -153,6 +153,18 @@ static inline bool pqi_is_hba_lunid(u8 *scsi3addr)
 	return pqi_scsi3addr_equal(scsi3addr, RAID_CTLR_LUNID);
 }
 
+static inline enum pqi_ctrl_mode pqi_get_ctrl_mode(
+	struct pqi_ctrl_info *ctrl_info)
+{
+	return sis_read_driver_scratch(ctrl_info);
+}
+
+static inline void pqi_save_ctrl_mode(struct pqi_ctrl_info *ctrl_info,
+	enum pqi_ctrl_mode mode)
+{
+	sis_write_driver_scratch(ctrl_info, mode);
+}
+
 #define PQI_RESCAN_WORK_INTERVAL	(10 * HZ)
 
 static inline void pqi_schedule_rescan_worker(struct pqi_ctrl_info *ctrl_info)
@@ -5266,10 +5278,30 @@ out:
 	return rc;
 }
 
+static int pqi_kdump_init(struct pqi_ctrl_info *ctrl_info)
+{
+	if (!sis_is_firmware_running(ctrl_info))
+		return -ENXIO;
+
+	if (pqi_get_ctrl_mode(ctrl_info) == PQI_MODE) {
+		sis_disable_msix(ctrl_info);
+		if (pqi_reset(ctrl_info) == 0)
+			sis_reenable_sis_mode(ctrl_info);
+	}
+
+	return 0;
+}
+
 static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
 {
 	int rc;
 
+	if (reset_devices) {
+		rc = pqi_kdump_init(ctrl_info);
+		if (rc)
+			return rc;
+	}
+
 	/*
 	 * When the controller comes out of reset, it is always running
 	 * in legacy SIS mode.  This is so that it can be compatible
@@ -5343,6 +5375,7 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info)
 
 	/* From here on, we are running in PQI mode. */
 	ctrl_info->pqi_mode_enabled = true;
+	pqi_save_ctrl_mode(ctrl_info, PQI_MODE);
 
 	rc = pqi_alloc_admin_queues(ctrl_info);
 	if (rc) {
@@ -5879,6 +5912,8 @@ static void __attribute__((unused)) verify_structures(void)
 	BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
 		sis_ctrl_to_host_doorbell_clear) != 0xa0);
 	BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
+		sis_driver_scratch) != 0xb0);
+	BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
 		sis_firmware_status) != 0xbc);
 	BUILD_BUG_ON(offsetof(struct pqi_ctrl_registers,
 		sis_mailbox) != 0x1000);
diff --git a/drivers/scsi/smartpqi/smartpqi_sis.c b/drivers/scsi/smartpqi/smartpqi_sis.c
index 5d416a8..71408f9 100644
--- a/drivers/scsi/smartpqi/smartpqi_sis.c
+++ b/drivers/scsi/smartpqi/smartpqi_sis.c
@@ -376,6 +376,16 @@ int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info)
 	return rc;
 }
 
+void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value)
+{
+	writel(value, &ctrl_info->registers->sis_driver_scratch);
+}
+
+u32 sis_read_driver_scratch(struct pqi_ctrl_info *ctrl_info)
+{
+	return readl(&ctrl_info->registers->sis_driver_scratch);
+}
+
 static void __attribute__((unused)) verify_structures(void)
 {
 	BUILD_BUG_ON(offsetof(struct sis_base_struct,
diff --git a/drivers/scsi/smartpqi/smartpqi_sis.h b/drivers/scsi/smartpqi/smartpqi_sis.h
index d2ff8d5..bd6e7b0 100644
--- a/drivers/scsi/smartpqi/smartpqi_sis.h
+++ b/drivers/scsi/smartpqi/smartpqi_sis.h
@@ -28,5 +28,7 @@ void sis_enable_msix(struct pqi_ctrl_info *ctrl_info);
 void sis_disable_msix(struct pqi_ctrl_info *ctrl_info);
 void sis_soft_reset(struct pqi_ctrl_info *ctrl_info);
 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info);
+void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value);
+u32 sis_read_driver_scratch(struct pqi_ctrl_info *ctrl_info);
 
 #endif	/* _SMARTPQI_SIS_H */


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 08/17] smartpqi: correct controller offline issue
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (6 preceding siblings ...)
  2016-08-26 16:44 ` [PATCH 07/17] smartpqi: add kdump support Don Brace
@ 2016-08-26 16:44 ` Don Brace
  2016-08-29  9:19   ` Johannes Thumshirn
  2016-08-31 14:15   ` Tomas Henzl
  2016-08-26 16:45 ` [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue Don Brace
                   ` (8 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:44 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Fixed a bug where the driver would not free all of the
controller resources if the controller ever went offline.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 67661de..6dda9f5 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -5609,19 +5609,14 @@ static void pqi_free_ctrl_resources(struct pqi_ctrl_info *ctrl_info)
 
 static void pqi_remove_ctrl(struct pqi_ctrl_info *ctrl_info)
 {
-	int rc;
+	cancel_delayed_work_sync(&ctrl_info->rescan_work);
+	cancel_delayed_work_sync(&ctrl_info->update_time_work);
+	pqi_remove_all_scsi_devices(ctrl_info);
+	pqi_unregister_scsi(ctrl_info);
 
-	if (ctrl_info->controller_online) {
-		cancel_delayed_work_sync(&ctrl_info->rescan_work);
-		cancel_delayed_work_sync(&ctrl_info->update_time_work);
-		pqi_remove_all_scsi_devices(ctrl_info);
-		pqi_unregister_scsi(ctrl_info);
-		ctrl_info->controller_online = false;
-	}
 	if (ctrl_info->pqi_mode_enabled) {
 		sis_disable_msix(ctrl_info);
-		rc = pqi_reset(ctrl_info);
-		if (rc == 0)
+		if (pqi_reset(ctrl_info) == 0)
 			sis_reenable_sis_mode(ctrl_info);
 	}
 	pqi_free_ctrl_resources(ctrl_info);


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (7 preceding siblings ...)
  2016-08-26 16:44 ` [PATCH 08/17] smartpqi: correct controller offline issue Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:28   ` Johannes Thumshirn
  2016-08-31 14:43   ` Tomas Henzl
  2016-08-26 16:45 ` [PATCH 10/17] smartpqi: minor function reformating Don Brace
                   ` (7 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

the driver no longer waits for the firmware to consume
the event ack IU.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi.h      |   14 +++++++-------
 drivers/scsi/smartpqi/smartpqi_init.c |   20 --------------------
 2 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index 5f965ad..07b6444 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -634,13 +634,6 @@ struct pqi_encryption_info {
 
 #define RAID_MAP_MAX_ENTRIES		1024
 
-#define PQI_RESERVED_IO_SLOTS_LUN_RESET			1
-#define PQI_RESERVED_IO_SLOTS_EVENT_ACK			1
-#define PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS	3
-#define PQI_RESERVED_IO_SLOTS				\
-	(PQI_RESERVED_IO_SLOTS_LUN_RESET + PQI_RESERVED_IO_SLOTS_EVENT_ACK + \
-	PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS)
-
 #define PQI_PHYSICAL_DEVICE_BUS		0
 #define PQI_RAID_VOLUME_BUS		1
 #define PQI_HBA_BUS			2
@@ -884,6 +877,13 @@ struct pqi_event {
 	__le32	additional_event_id;
 };
 
+#define PQI_RESERVED_IO_SLOTS_LUN_RESET			1
+#define PQI_RESERVED_IO_SLOTS_EVENT_ACK			PQI_NUM_SUPPORTED_EVENTS
+#define PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS	3
+#define PQI_RESERVED_IO_SLOTS				\
+	(PQI_RESERVED_IO_SLOTS_LUN_RESET + PQI_RESERVED_IO_SLOTS_EVENT_ACK + \
+	PQI_RESERVED_IO_SLOTS_SYNCHRONOUS_REQUESTS)
+
 struct pqi_ctrl_info {
 	unsigned int	ctrl_id;
 	struct pci_dev	*pci_dev;
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 6dda9f5..52c752f 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2642,26 +2642,6 @@ static void pqi_start_event_ack(struct pqi_ctrl_info *ctrl_info,
 	writel(iq_pi, queue_group->iq_pi[RAID_PATH]);
 
 	spin_unlock_irqrestore(&queue_group->submit_lock[RAID_PATH], flags);
-
-	/*
-	 * We have to special-case this type of request because the firmware
-	 * does not generate an interrupt when this type of request completes.
-	 * Therefore, we have to poll until we see that the firmware has
-	 * consumed the request before we move on.
-	 */
-
-	timeout = (PQI_EVENT_ACK_TIMEOUT * HZ) + jiffies;
-
-	while (1) {
-		if (*queue_group->iq_ci[RAID_PATH] == iq_pi)
-			break;
-		if (time_after(jiffies, timeout)) {
-			dev_err(&ctrl_info->pci_dev->dev,
-				"completing event acknowledge timed out\n");
-			break;
-		}
-		usleep_range(1000, 2000);
-	}
 }
 
 static void pqi_acknowledge_event(struct pqi_ctrl_info *ctrl_info,


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 10/17] smartpqi: minor function reformating
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (8 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-31 14:44   ` Tomas Henzl
  2016-08-26 16:45 ` [PATCH 11/17] smartpqi: minor tweaks to update time support Don Brace
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

reformatted pqi_num_elements_free() to match the rest of the driver

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 52c752f..2759c90 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -2576,8 +2576,7 @@ static unsigned int pqi_process_io_intr(struct pqi_ctrl_info *ctrl_info,
 }
 
 static inline unsigned int pqi_num_elements_free(unsigned int pi,
-						unsigned int ci,
-						unsigned int elements_in_queue)
+	unsigned int ci, unsigned int elements_in_queue)
 {
 	unsigned int num_elements_used;
 


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 11/17] smartpqi: minor tweaks to update time support
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (9 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 10/17] smartpqi: minor function reformating Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:33   ` Johannes Thumshirn
  2016-08-26 16:45 ` [PATCH 12/17] smartpqi: scsi queuecommand cleanup Don Brace
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

minor tweaks to update time support

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 2759c90..a8b8671 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -588,10 +588,6 @@ static void pqi_update_time_worker(struct work_struct *work)
 	ctrl_info = container_of(to_delayed_work(work), struct pqi_ctrl_info,
 		update_time_work);
 
-	if (!ctrl_info) {
-		printk("%s: NULL controller pointer.\n", __func__);
-		return;
-	}
 	rc = pqi_write_current_time_to_host_wellness(ctrl_info);
 	if (rc)
 		dev_warn(&ctrl_info->pci_dev->dev,
@@ -602,9 +598,9 @@ static void pqi_update_time_worker(struct work_struct *work)
 }
 
 static inline void pqi_schedule_update_time_worker(
-			struct pqi_ctrl_info *ctrl_info)
+	struct pqi_ctrl_info *ctrl_info)
 {
-	schedule_delayed_work(&ctrl_info->update_time_work, 120);
+	schedule_delayed_work(&ctrl_info->update_time_work, 0);
 }
 
 static int pqi_report_luns(struct pqi_ctrl_info *ctrl_info, u8 cmd,


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 12/17] smartpqi: scsi queuecommand cleanup
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (10 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 11/17] smartpqi: minor tweaks to update time support Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:35   ` Johannes Thumshirn
  2016-08-31 14:46   ` Tomas Henzl
  2016-08-26 16:45 ` [PATCH 13/17] smartpqi: remove timeout for cache flush operations Don Brace
                   ` (4 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

minor cleanup of scsi queue command function

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index a8b8671..87eb603 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -4514,7 +4514,7 @@ static int pqi_aio_submit_io(struct pqi_ctrl_info *ctrl_info,
 }
 
 static int pqi_scsi_queue_command(struct Scsi_Host *shost,
-				struct scsi_cmnd *scmd)
+	struct scsi_cmnd *scmd)
 {
 	int rc;
 	struct pqi_ctrl_info *ctrl_info;
@@ -4532,6 +4532,12 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost,
 		return 0;
 	}
 
+	/*
+	 * This is necessary because the SML doesn't zero out this field during
+	 * error recovery.
+	 */
+	scmd->result = 0;
+
 	hwq = blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(scmd->request));
 	if (hwq >= ctrl_info->num_queue_groups)
 		hwq = 0;


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 13/17] smartpqi: remove timeout for cache flush operations
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (11 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 12/17] smartpqi: scsi queuecommand cleanup Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:39   ` Johannes Thumshirn
  2016-08-31 14:47   ` Tomas Henzl
  2016-08-26 16:45 ` [PATCH 14/17] smartpqi: update Kconfig Don Brace
                   ` (3 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Some cache flush operations can take longer than the
timeout value. Best to not impose a time limit to
handle all cases.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 87eb603..e7d7e99 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -407,7 +407,6 @@ static int pqi_identify_physical_device(struct pqi_ctrl_info *ctrl_info,
 }
 
 #define SA_CACHE_FLUSH_BUFFER_LENGTH	4
-#define PQI_FLUSH_CACHE_TIMEOUT		(30 * 1000)
 
 static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
 {
@@ -434,7 +433,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
 		goto out;
 
 	rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header,
-		0, NULL, PQI_FLUSH_CACHE_TIMEOUT);
+		0, NULL, NO_TIMEOUT);
 
 	pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1,
 		pci_direction);


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 14/17] smartpqi: update Kconfig
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (12 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 13/17] smartpqi: remove timeout for cache flush operations Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:40   ` Johannes Thumshirn
  2016-08-31 14:48   ` Tomas Henzl
  2016-08-26 16:45 ` [PATCH 15/17] smartpqi: update maintainers Don Brace
                   ` (2 subsequent siblings)
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

The aacraid driver will not managage Microsemi
smartpqi controllers, but will still manage
older aacraid devices.

Updated help section.

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/Kconfig |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/smartpqi/Kconfig b/drivers/scsi/smartpqi/Kconfig
index 5d77a80..97e159c 100644
--- a/drivers/scsi/smartpqi/Kconfig
+++ b/drivers/scsi/smartpqi/Kconfig
@@ -37,7 +37,6 @@
 
 config SCSI_SMARTPQI
 	tristate "Microsemi PQI Driver"
-	default n
 	depends on PCI && SCSI && !S390
 	select SCSI_SAS_ATTRS
 	select RAID_ATTRS
@@ -47,4 +46,9 @@ config SCSI_SMARTPQI
 	<http://www.microsemi.com>
 
 	To compile this driver as a module, choose M here: the
-	module will be called smartpqi
+	module will be called smartpqi.
+
+        Note: the aacraid driver will not manage a smartpqi
+              controller. You need to enable smartpqi for smartpqi
+              controllers. For more information, please see
+              Documentation/scsi/smartpqi.txt


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 15/17] smartpqi: update maintainers
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (13 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 14/17] smartpqi: update Kconfig Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:42   ` Johannes Thumshirn
  2016-08-26 16:45 ` [PATCH 16/17] smartpqi: add smartpqi.txt Don Brace
  2016-08-26 16:45 ` [PATCH 17/17] smartqi: bump driver version Don Brace
  16 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

added Documentation/scsi/smartpqi.txt

Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 MAINTAINERS |    1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f50fe50..d980685 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5447,6 +5447,7 @@ F:	drivers/scsi/smartpqi/Kconfig
 F:	drivers/scsi/smartpqi/Makefile
 F:	include/linux/cciss*.h
 F:	include/uapi/linux/cciss*.h
+F:	Documentation/scsi/smartpqi.txt
 
 HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
 M:	Don Brace <don.brace@microsemi.com>


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 16/17] smartpqi: add smartpqi.txt
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (14 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 15/17] smartpqi: update maintainers Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:45   ` Johannes Thumshirn
  2016-08-26 16:45 ` [PATCH 17/17] smartqi: bump driver version Don Brace
  16 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 Documentation/scsi/smartpqi.txt |   80 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
 create mode 100644 Documentation/scsi/smartpqi.txt

diff --git a/Documentation/scsi/smartpqi.txt b/Documentation/scsi/smartpqi.txt
new file mode 100644
index 0000000..ab377d9
--- /dev/null
+++ b/Documentation/scsi/smartpqi.txt
@@ -0,0 +1,80 @@
+
+SMARTPQI - Microsemi Smart PQI Driver
+-----------------------------------------
+
+This file describes the smartpqi SCSI driver for Microsemi
+(http://www.microsemi.com) PQI controllers. The smartpqi driver
+is the next generation SCSI driver for Microsemi Corp. The smartpqi
+driver is the first SCSI driver to implement the PQI queuing model.
+
+The smartpqi driver will replace the aacraid driver for Adaptec Series 9
+controllers. Customers running an older kernel (Pre-4.9) using an Adaptec
+Series 9 controller will have to configure the smartpqi driver or their
+volumes will not be added to the OS.
+
+For Microsemi smartpqi controller support, enable the smartpqi driver
+when configuring the kernel.
+
+For more information on the PQI Queuing Interface, please see:
+http://www.t10.org/drafts.htm
+http://www.t10.org/members/w_pqi2.htm
+
+Supported devices:
+------------------
+<Controller names to be added as they become publically available.>
+
+smartpqi specific entries in /sys
+-----------------------------
+
+  smartpqi host attributes:
+  -------------------------
+  /sys/class/scsi_host/host*/rescan
+  /sys/class/scsi_host/host*/version
+
+  The host rescan attribute is a write only attribute. Writing to this
+  attribute will trigger the driver to scan for new, changed, or removed
+  devices and notify the SCSI mid-layer of any changes detected.
+
+  The version attribute is read-only and will return the driver version
+  and the controller firmware version.
+  For example:
+              driver: 0.9.13-370
+              firmware: 0.01-522
+
+  smartpqi sas device attributes
+  ------------------------------
+  HBA devices are added to the SAS transport layer. These attributes are
+  automatically added by the SAS transport layer.
+
+  /sys/class/sas_device/end_device-X:X/sas_address
+  /sys/class/sas_device/end_device-X:X/enclosure_identifier
+  /sys/class/sas_device/end_device-X:X/scsi_target_id
+
+smartpqi specific ioctls:
+-------------------------
+
+  For compatibility with applications written for the cciss protocol.
+
+  CCISS_DEREGDISK
+  CCISS_REGNEWDISK
+  CCISS_REGNEWD
+
+  The above three ioctls all do exactly the same thing, which is to cause the driver
+  to rescan for new devices.  This does exactly the same thing as writing to the
+  smartpqi specific host "rescan" attribute.
+
+  CCISS_GETPCIINFO
+
+	Returns PCI domain, bus, device and function and "board ID" (PCI subsystem ID).
+
+  CCISS_GETDRIVVER
+
+	Returns driver version in three bytes encoded as:
+	(DRIVER_MAJOR << 28) | (DRIVER_MINOR << 24) | (DRIVER_RELEASE << 16) | DRIVER_REVISION;
+
+  CCISS_PASSTHRU
+
+	Allows "BMIC" and "CISS" commands to be passed through to the Smart Storage Array.
+	These are used extensively by the SSA Array Configuration Utility, SNMP storage
+	agents, etc.
+


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH 17/17] smartqi: bump driver version
  2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
                   ` (15 preceding siblings ...)
  2016-08-26 16:45 ` [PATCH 16/17] smartpqi: add smartpqi.txt Don Brace
@ 2016-08-26 16:45 ` Don Brace
  2016-08-29  9:46   ` Johannes Thumshirn
  2016-08-31 14:49   ` Tomas Henzl
  16 siblings, 2 replies; 60+ messages in thread
From: Don Brace @ 2016-08-26 16:45 UTC (permalink / raw)
  To: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microsemi.com>

Reviewed-by: Scott Teel <scott.teel@microsemi.com>
Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
Signed-off-by: Don Brace <don.brace@microsemi.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index e7d7e99..3b3c7eb 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -38,11 +38,11 @@
 #define BUILD_TIMESTAMP
 #endif
 
-#define DRIVER_VERSION		"0.9.9-100"
+#define DRIVER_VERSION		"0.9.13-370"
 #define DRIVER_MAJOR		0
 #define DRIVER_MINOR		9
-#define DRIVER_RELEASE		9
-#define DRIVER_REVISION		100
+#define DRIVER_RELEASE		13
+#define DRIVER_REVISION		370
 
 #define DRIVER_NAME		"Microsemi PQI Driver (v" DRIVER_VERSION ")"
 #define DRIVER_NAME_SHORT	"smartpqi"


^ permalink raw reply related	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/17] smartpqi: change aio sg processing
  2016-08-26 16:44 ` [PATCH 01/17] smartpqi: change aio sg processing Don Brace
@ 2016-08-29  8:54   ` Johannes Thumshirn
  2016-08-29 21:44     ` Don Brace
  2016-08-31 12:51   ` Tomas Henzl
  1 sibling, 1 reply; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  8:54 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:11AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Take advantage of controller improvements.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |   68 +++++++++++++++++++--------------
>  1 file changed, 39 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index 906f1aa..418f636 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -4263,48 +4263,58 @@ static int pqi_build_aio_sg_list(struct pqi_ctrl_info *ctrl_info,
>  	int i;
>  	u16 iu_length;
>  	int sg_count;
> -	unsigned int num_sg_in_iu = 0;
> +	bool chained;
> +	unsigned int num_sg_in_iu;
> +	unsigned int max_sg_per_iu;
>  	struct scatterlist *sg;
>  	struct pqi_sg_descriptor *sg_descriptor;
>  
>  	sg_count = scsi_dma_map(scmd);
>  	if (sg_count < 0)
>  		return sg_count;
> +
> +	iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
> +		PQI_REQUEST_HEADER_LENGTH;
> +	num_sg_in_iu = 0;
> +
>  	if (sg_count == 0)
>  		goto out;
>  
> -	if (sg_count <= ctrl_info->max_sg_per_iu) {
> -		sg_descriptor = &request->sg_descriptors[0];
> -		scsi_for_each_sg(scmd, sg, sg_count, i) {
> -			pqi_set_sg_descriptor(sg_descriptor, sg);
> -			sg_descriptor++;
> -		}
> -		put_unaligned_le32(CISS_SG_LAST,
> -			&request->sg_descriptors[sg_count - 1].flags);
> -		num_sg_in_iu = sg_count;
> -	} else {
> -		sg_descriptor = &request->sg_descriptors[0];
> -		put_unaligned_le64((u64)io_request->sg_chain_buffer_dma_handle,
> -			&sg_descriptor->address);
> -		put_unaligned_le32(sg_count * sizeof(*sg_descriptor),
> -			&sg_descriptor->length);
> -		put_unaligned_le32(CISS_SG_CHAIN, &sg_descriptor->flags);
> -
> -		sg_descriptor = io_request->sg_chain_buffer;
> -		scsi_for_each_sg(scmd, sg, sg_count, i) {
> -			pqi_set_sg_descriptor(sg_descriptor, sg);
> -			sg_descriptor++;
> +	sg = scsi_sglist(scmd);
> +	sg_descriptor = request->sg_descriptors;
> +	max_sg_per_iu = ctrl_info->max_sg_per_iu - 1;
> +	chained = false;
> +	i = 0;
> +
> +	while (1) {

Is there any compelling reason why you didn't use scsi_for_each_sg()
here? I don't see a reason for the while (1) construct.


> +		pqi_set_sg_descriptor(sg_descriptor, sg);
> +		if (!chained)
> +			num_sg_in_iu++;
> +		i++;
> +		if (i == sg_count)
> +			break;
> +		sg_descriptor++;
> +		if (i == max_sg_per_iu) {
> +			put_unaligned_le64(
> +				(u64)io_request->sg_chain_buffer_dma_handle,
> +				&sg_descriptor->address);
> +			put_unaligned_le32((sg_count - num_sg_in_iu)
> +				* sizeof(*sg_descriptor),
> +				&sg_descriptor->length);
> +			put_unaligned_le32(CISS_SG_CHAIN,
> +				&sg_descriptor->flags);
> +			chained = true;
> +			num_sg_in_iu++;
> +			sg_descriptor = io_request->sg_chain_buffer;
>  		}
> -		put_unaligned_le32(CISS_SG_LAST,
> -			&io_request->sg_chain_buffer[sg_count - 1].flags);
> -		num_sg_in_iu = 1;
> -		request->partial = 1;
> +		sg = sg_next(sg);
>  	}
>  
> -out:
> -	iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
> -		PQI_REQUEST_HEADER_LENGTH;
> +	put_unaligned_le32(CISS_SG_LAST, &sg_descriptor->flags);
> +	request->partial = chained;
>  	iu_length += num_sg_in_iu * sizeof(*sg_descriptor);
> +
> +out:
>  	put_unaligned_le16(iu_length, &request->header.iu_length);
>  	request->num_sg_descriptors = num_sg_in_iu;
>  
> 
> --
> 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

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 02/17] smartpqi: change tmf macro names
  2016-08-26 16:44 ` [PATCH 02/17] smartpqi: change tmf macro names Don Brace
@ 2016-08-29  8:55   ` Johannes Thumshirn
  2016-08-31 12:52   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  8:55 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:17AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> small change to make code look cleaner
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/17] smartpqi: simplify spanning
  2016-08-26 16:44 ` [PATCH 03/17] smartpqi: simplify spanning Don Brace
@ 2016-08-29  8:57   ` Johannes Thumshirn
  2016-08-31 12:59   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  8:57 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:24AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Removed the workaround for the transition to spanning.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/17] smartpqi: enhance drive offline informational message
  2016-08-26 16:44 ` [PATCH 04/17] smartpqi: enhance drive offline informational message Don Brace
@ 2016-08-29  8:59   ` Johannes Thumshirn
  2016-08-31 13:00   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  8:59 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:30AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Made a couple of error messages more verbose.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index 9922e31..198a7c2 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -2298,11 +2298,16 @@ static inline void pqi_aio_path_disabled(struct pqi_io_request *io_request)
>  static inline void pqi_take_device_offline(struct scsi_device *sdev)
>  {
>  	struct pqi_ctrl_info *ctrl_info;
> +	struct pqi_scsi_dev *device;
>  
>  	if (scsi_device_online(sdev)) {
>  		scsi_device_set_state(sdev, SDEV_OFFLINE);
>  		ctrl_info = shost_to_hba(sdev->host);
>  		schedule_delayed_work(&ctrl_info->rescan_work, 0);
> +		device = sdev->hostdata;
> +		dev_err(&ctrl_info->pci_dev->dev, "offlined scsi %d:%d:%d:%d\n",
> +			ctrl_info->scsi_host->host_no, device->bus,
> +			device->target, device->lun);
>  	}
>  }
>  
> 
> --
> 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

You /could/ move the definition of device into the if() block to
shorten it's scope, but that's purely cosmetical.

Otherwise,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 05/17] smartpqi: enhance reset logic
  2016-08-26 16:44 ` [PATCH 05/17] smartpqi: enhance reset logic Don Brace
@ 2016-08-29  9:05   ` Johannes Thumshirn
  2016-08-31 13:19   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:05 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:36AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Eliminated timeout from LUN reset logic.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 06/17] smartpqi: change commonly used function to inline
  2016-08-26 16:44 ` [PATCH 06/17] smartpqi: change commonly used function to inline Don Brace
@ 2016-08-29  9:06   ` Johannes Thumshirn
  2016-08-29 20:32     ` Don Brace
  0 siblings, 1 reply; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:06 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:42AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> A tiny tweak to convert a small, commonly used function to inline.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index dbc8b40..2656124 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -316,7 +316,7 @@ static struct pqi_io_request *pqi_alloc_io_request(
>  	return io_request;
>  }
>  
> -static void pqi_free_io_request(struct pqi_io_request *io_request)
> +static inline void pqi_free_io_request(struct pqi_io_request *io_request)
>  {
>  	atomic_dec(&io_request->refcount);
>  }
> 

Did you check whether the compiler does this for you already?

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 07/17] smartpqi: add kdump support
  2016-08-26 16:44 ` [PATCH 07/17] smartpqi: add kdump support Don Brace
@ 2016-08-29  9:11   ` Johannes Thumshirn
  2016-08-31 13:41   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:11 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:48AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 08/17] smartpqi: correct controller offline issue
  2016-08-26 16:44 ` [PATCH 08/17] smartpqi: correct controller offline issue Don Brace
@ 2016-08-29  9:19   ` Johannes Thumshirn
  2016-08-31 14:15   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:19 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:44:54AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Fixed a bug where the driver would not free all of the
> controller resources if the controller ever went offline.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Fixes: 6c223761e 'smartpqi: initial commit of Microsemi smartpqi driver' ?

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue
  2016-08-26 16:45 ` [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue Don Brace
@ 2016-08-29  9:28   ` Johannes Thumshirn
  2016-08-31 14:43   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:28 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:00AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> the driver no longer waits for the firmware to consume
> the event ack IU.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 11/17] smartpqi: minor tweaks to update time support
  2016-08-26 16:45 ` [PATCH 11/17] smartpqi: minor tweaks to update time support Don Brace
@ 2016-08-29  9:33   ` Johannes Thumshirn
  2016-08-29 20:29     ` Don Brace
  0 siblings, 1 reply; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:33 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:12AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> minor tweaks to update time support
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |    8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index 2759c90..a8b8671 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -588,10 +588,6 @@ static void pqi_update_time_worker(struct work_struct *work)
>  	ctrl_info = container_of(to_delayed_work(work), struct pqi_ctrl_info,
>  		update_time_work);
>  
> -	if (!ctrl_info) {
> -		printk("%s: NULL controller pointer.\n", __func__);
> -		return;
> -	}
>  	rc = pqi_write_current_time_to_host_wellness(ctrl_info);
>  	if (rc)
>  		dev_warn(&ctrl_info->pci_dev->dev,
> @@ -602,9 +598,9 @@ static void pqi_update_time_worker(struct work_struct *work)
>  }
>  
>  static inline void pqi_schedule_update_time_worker(
> -			struct pqi_ctrl_info *ctrl_info)
> +	struct pqi_ctrl_info *ctrl_info)
>  {
> -	schedule_delayed_work(&ctrl_info->update_time_work, 120);
> +	schedule_delayed_work(&ctrl_info->update_time_work, 0);
>  }

Why are you using schedule_delayed_work() if you have a timeout of 0?
>From __queue_delayed_work():
1513         /*
1514          * If @delay is 0, queue @dwork->work immediately.  This is for
1515          * both optimization and correctness.  The earliest @timer can
1516          * expire is on the closest next tick and delayed_work users depend
1517          * on that there's no such delay when @delay is 0.
1518          */
1519         if (!delay) {
1520                 __queue_work(cpu, wq, &dwork->work);
1521                 return;
1522         }


-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 12/17] smartpqi: scsi queuecommand cleanup
  2016-08-26 16:45 ` [PATCH 12/17] smartpqi: scsi queuecommand cleanup Don Brace
@ 2016-08-29  9:35   ` Johannes Thumshirn
  2016-08-31 14:46   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:35 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:18AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> minor cleanup of scsi queue command function
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 13/17] smartpqi: remove timeout for cache flush operations
  2016-08-26 16:45 ` [PATCH 13/17] smartpqi: remove timeout for cache flush operations Don Brace
@ 2016-08-29  9:39   ` Johannes Thumshirn
  2016-08-29 21:36     ` Don Brace
  2016-08-31 14:47   ` Tomas Henzl
  1 sibling, 1 reply; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:39 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:24AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Some cache flush operations can take longer than the
> timeout value. Best to not impose a time limit to
> handle all cases.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index 87eb603..e7d7e99 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -407,7 +407,6 @@ static int pqi_identify_physical_device(struct pqi_ctrl_info *ctrl_info,
>  }
>  
>  #define SA_CACHE_FLUSH_BUFFER_LENGTH	4
> -#define PQI_FLUSH_CACHE_TIMEOUT		(30 * 1000)
>  
>  static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
>  {
> @@ -434,7 +433,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
>  		goto out;
>  
>  	rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header,
> -		0, NULL, PQI_FLUSH_CACHE_TIMEOUT);
> +		0, NULL, NO_TIMEOUT);
>  
>  	pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1,
>  		pci_direction);

IIRC I asked you to introduce this timeout, as you're calling
pqi_flush_cache() from the driver's shutdown callback and I still
doubt users like their shutdown's to hang indefinitely because cache
flush isn't working. Just my $0.02.

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 14/17] smartpqi: update Kconfig
  2016-08-26 16:45 ` [PATCH 14/17] smartpqi: update Kconfig Don Brace
@ 2016-08-29  9:40   ` Johannes Thumshirn
  2016-08-31 14:48   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:40 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:30AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> The aacraid driver will not managage Microsemi
> smartpqi controllers, but will still manage
> older aacraid devices.
> 
> Updated help section.
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 15/17] smartpqi: update maintainers
  2016-08-26 16:45 ` [PATCH 15/17] smartpqi: update maintainers Don Brace
@ 2016-08-29  9:42   ` Johannes Thumshirn
  2016-08-29 20:57     ` Don Brace
  0 siblings, 1 reply; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:42 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:36AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> added Documentation/scsi/smartpqi.txt
> 
> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---
>  MAINTAINERS |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f50fe50..d980685 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5447,6 +5447,7 @@ F:	drivers/scsi/smartpqi/Kconfig
>  F:	drivers/scsi/smartpqi/Makefile
>  F:	include/linux/cciss*.h
>  F:	include/uapi/linux/cciss*.h
> +F:	Documentation/scsi/smartpqi.txt

This should be foldet into the next patch where you actually add the
documentation ;-).

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 16/17] smartpqi: add smartpqi.txt
  2016-08-26 16:45 ` [PATCH 16/17] smartpqi: add smartpqi.txt Don Brace
@ 2016-08-29  9:45   ` Johannes Thumshirn
  0 siblings, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:45 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:43AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

With the MAINTAINERS update patch folded in
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 17/17] smartqi: bump driver version
  2016-08-26 16:45 ` [PATCH 17/17] smartqi: bump driver version Don Brace
@ 2016-08-29  9:46   ` Johannes Thumshirn
  2016-08-31 14:49   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-29  9:46 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Fri, Aug 26, 2016 at 11:45:49AM -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
> 
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* RE: [PATCH 11/17] smartpqi: minor tweaks to update time support
  2016-08-29  9:33   ` Johannes Thumshirn
@ 2016-08-29 20:29     ` Don Brace
  2016-08-30  7:17       ` Johannes Thumshirn
  0 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-29 20:29 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Monday, August 29, 2016 4:34 AM
> To: Don Brace
> Cc: jejb@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> hch@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> elliott@hpe.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 11/17] smartpqi: minor tweaks to update time support
> 
> EXTERNAL EMAIL
> 
> 


> >
> >  static inline void pqi_schedule_update_time_worker(
> > -                     struct pqi_ctrl_info *ctrl_info)
> > +     struct pqi_ctrl_info *ctrl_info)
> >  {
> > -     schedule_delayed_work(&ctrl_info->update_time_work, 120);
> > +     schedule_delayed_work(&ctrl_info->update_time_work, 0);
> >  }
> 
> Why are you using schedule_delayed_work() if you have a timeout of 0?
> From __queue_delayed_work():
> 1513         /*
> 1514          * If @delay is 0, queue @dwork->work immediately.  This is for
> 1515          * both optimization and correctness.  The earliest @timer can
> 1516          * expire is on the closest next tick and delayed_work users depend
> 1517          * on that there's no such delay when @delay is 0.
> 1518          */
> 1519         if (!delay) {
> 1520                 __queue_work(cpu, wq, &dwork->work);
> 1521                 return;
> 1522         }
> 
> 
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

The reason is that we want it run immediately (or close to immediately).

The code could be restructured to avoid calling this function with a 0, but it would result in more code and no benefit.

Kevin



^ permalink raw reply	[flat|nested] 60+ messages in thread

* RE: [PATCH 06/17] smartpqi: change commonly used function to inline
  2016-08-29  9:06   ` Johannes Thumshirn
@ 2016-08-29 20:32     ` Don Brace
  0 siblings, 0 replies; 60+ messages in thread
From: Don Brace @ 2016-08-29 20:32 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Monday, August 29, 2016 4:07 AM
> To: Don Brace
> Cc: jejb@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> hch@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> elliott@hpe.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 06/17] smartpqi: change commonly used function to
> inline
> 
> EXTERNAL EMAIL
> 
> 
> On Fri, Aug 26, 2016 at 11:44:42AM -0500, Don Brace wrote:
> > From: Kevin Barnett <kevin.barnett@microsemi.com>
> >
> > A tiny tweak to convert a small, commonly used function to inline.
> >
> > Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> > Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> > Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> > Signed-off-by: Don Brace <don.brace@microsemi.com>
> > ---
> >  drivers/scsi/smartpqi/smartpqi_init.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/scsi/smartpqi/smartpqi_init.c
> b/drivers/scsi/smartpqi/smartpqi_init.c
> > index dbc8b40..2656124 100644
> > --- a/drivers/scsi/smartpqi/smartpqi_init.c
> > +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> > @@ -316,7 +316,7 @@ static struct pqi_io_request *pqi_alloc_io_request(
> >       return io_request;
> >  }
> >
> > -static void pqi_free_io_request(struct pqi_io_request *io_request)
> > +static inline void pqi_free_io_request(struct pqi_io_request *io_request)
> >  {
> >       atomic_dec(&io_request->refcount);
> >  }
> >
> 
> Did you check whether the compiler does this for you already?

You are correct, it does. I will redact this patch.

> 
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* RE: [PATCH 15/17] smartpqi: update maintainers
  2016-08-29  9:42   ` Johannes Thumshirn
@ 2016-08-29 20:57     ` Don Brace
  2016-08-30  7:14       ` Johannes Thumshirn
  0 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-29 20:57 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Monday, August 29, 2016 4:42 AM
> To: Don Brace
> Cc: jejb@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> hch@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> elliott@hpe.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 15/17] smartpqi: update maintainers
> 
> EXTERNAL EMAIL
> 
> 
> On Fri, Aug 26, 2016 at 11:45:36AM -0500, Don Brace wrote:
> > From: Kevin Barnett <kevin.barnett@microsemi.com>
> >
> > added Documentation/scsi/smartpqi.txt
> >
> > Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
> > Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> > Signed-off-by: Don Brace <don.brace@microsemi.com>
> > ---
> >  MAINTAINERS |    1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index f50fe50..d980685 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -5447,6 +5447,7 @@ F:      drivers/scsi/smartpqi/Kconfig
> >  F:   drivers/scsi/smartpqi/Makefile
> >  F:   include/linux/cciss*.h
> >  F:   include/uapi/linux/cciss*.h
> > +F:   Documentation/scsi/smartpqi.txt
> 
> This should be foldet into the next patch where you actually add the
> documentation ;-).

I squash smartpqi-add-smartpqi.txt and smartpqi-update-maintainers

Thanks,
Don
> 
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* RE: [PATCH 13/17] smartpqi: remove timeout for cache flush operations
  2016-08-29  9:39   ` Johannes Thumshirn
@ 2016-08-29 21:36     ` Don Brace
  2016-08-30  7:13       ` Johannes Thumshirn
  0 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-29 21:36 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Monday, August 29, 2016 4:40 AM
> To: Don Brace
> Cc: jejb@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> hch@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> elliott@hpe.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 13/17] smartpqi: remove timeout for cache flush
> operations
> 
> EXTERNAL EMAIL
> 
> 
> On Fri, Aug 26, 2016 at 11:45:24AM -0500, Don Brace wrote:
> > From: Kevin Barnett <kevin.barnett@microsemi.com>
> >
> > Some cache flush operations can take longer than the
> > timeout value. Best to not impose a time limit to
> > handle all cases.
> >
> > Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> > Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> > Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> > Signed-off-by: Don Brace <don.brace@microsemi.com>
> > ---
> >  drivers/scsi/smartpqi/smartpqi_init.c |    3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/scsi/smartpqi/smartpqi_init.c
> b/drivers/scsi/smartpqi/smartpqi_init.c
> > index 87eb603..e7d7e99 100644
> > --- a/drivers/scsi/smartpqi/smartpqi_init.c
> > +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> > @@ -407,7 +407,6 @@ static int pqi_identify_physical_device(struct
> pqi_ctrl_info *ctrl_info,
> >  }
> >
> >  #define SA_CACHE_FLUSH_BUFFER_LENGTH 4
> > -#define PQI_FLUSH_CACHE_TIMEOUT              (30 * 1000)
> >
> >  static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
> >  {
> > @@ -434,7 +433,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info
> *ctrl_info)
> >               goto out;
> >
> >       rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header,
> > -             0, NULL, PQI_FLUSH_CACHE_TIMEOUT);
> > +             0, NULL, NO_TIMEOUT);
> >
> >       pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1,
> >               pci_direction);
> 
> IIRC I asked you to introduce this timeout, as you're calling
> pqi_flush_cache() from the driver's shutdown callback and I still
> doubt users like their shutdown's to hang indefinitely because cache
> flush isn't working. Just my $0.02.
> 

The issue is that we do not know how long to wait. The cache module has gotten
quite large and some flush operations can take longer to complete than others.
That is why we took the timeout value out.

Thanks,
Don Brace
ESC - Smart Storage
Microsemi Corporation
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* RE: [PATCH 01/17] smartpqi: change aio sg processing
  2016-08-29  8:54   ` Johannes Thumshirn
@ 2016-08-29 21:44     ` Don Brace
  2016-08-30  7:23       ` Johannes Thumshirn
  0 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-29 21:44 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Monday, August 29, 2016 3:54 AM
> To: Don Brace
> Cc: jejb@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> hch@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> elliott@hpe.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 01/17] smartpqi: change aio sg processing
> 
> EXTERNAL EMAIL
> 
> 
> On Fri, Aug 26, 2016 at 11:44:11AM -0500, Don Brace wrote:
> > From: Kevin Barnett <kevin.barnett@microsemi.com>
> >
> > Take advantage of controller improvements.
> >
> > Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> > Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> > Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> > Signed-off-by: Don Brace <don.brace@microsemi.com>
> > ---
> >  drivers/scsi/smartpqi/smartpqi_init.c |   68 +++++++++++++++++++--------
> ------
> >  1 file changed, 39 insertions(+), 29 deletions(-)
> >
> > diff --git a/drivers/scsi/smartpqi/smartpqi_init.c
> b/drivers/scsi/smartpqi/smartpqi_init.c
> > index 906f1aa..418f636 100644
> > --- a/drivers/scsi/smartpqi/smartpqi_init.c
> > +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> > @@ -4263,48 +4263,58 @@ static int pqi_build_aio_sg_list(struct
> pqi_ctrl_info *ctrl_info,
> >       int i;
> >       u16 iu_length;
> >       int sg_count;
> > -     unsigned int num_sg_in_iu = 0;
> > +     bool chained;
> > +     unsigned int num_sg_in_iu;
> > +     unsigned int max_sg_per_iu;
> >       struct scatterlist *sg;
> >       struct pqi_sg_descriptor *sg_descriptor;
> >
> >       sg_count = scsi_dma_map(scmd);
> >       if (sg_count < 0)
> >               return sg_count;
> > +
> > +     iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
> > +             PQI_REQUEST_HEADER_LENGTH;
> > +     num_sg_in_iu = 0;
> > +
> >       if (sg_count == 0)
> >               goto out;
> >
> > -     if (sg_count <= ctrl_info->max_sg_per_iu) {
> > -             sg_descriptor = &request->sg_descriptors[0];
> > -             scsi_for_each_sg(scmd, sg, sg_count, i) {
> > -                     pqi_set_sg_descriptor(sg_descriptor, sg);
> > -                     sg_descriptor++;
> > -             }
> > -             put_unaligned_le32(CISS_SG_LAST,
> > -                     &request->sg_descriptors[sg_count - 1].flags);
> > -             num_sg_in_iu = sg_count;
> > -     } else {
> > -             sg_descriptor = &request->sg_descriptors[0];
> > -             put_unaligned_le64((u64)io_request-
> >sg_chain_buffer_dma_handle,
> > -                     &sg_descriptor->address);
> > -             put_unaligned_le32(sg_count * sizeof(*sg_descriptor),
> > -                     &sg_descriptor->length);
> > -             put_unaligned_le32(CISS_SG_CHAIN, &sg_descriptor->flags);
> > -
> > -             sg_descriptor = io_request->sg_chain_buffer;
> > -             scsi_for_each_sg(scmd, sg, sg_count, i) {
> > -                     pqi_set_sg_descriptor(sg_descriptor, sg);
> > -                     sg_descriptor++;
> > +     sg = scsi_sglist(scmd);
> > +     sg_descriptor = request->sg_descriptors;
> > +     max_sg_per_iu = ctrl_info->max_sg_per_iu - 1;
> > +     chained = false;
> > +     i = 0;
> > +
> > +     while (1) {
> 
> Is there any compelling reason why you didn't use scsi_for_each_sg()
> here? I don't see a reason for the while (1) construct.
> 
The PQI chaining makes using scsi_for_each_sg a little more difficult to
maintain. We would prefer to leave the code as is.

> 
> > +             pqi_set_sg_descriptor(sg_descriptor, sg);
> > +             if (!chained)
> > +                     num_sg_in_iu++;
> > +             i++;
> > +             if (i == sg_count)
> > +                     break;
> > +             sg_descriptor++;
> > +             if (i == max_sg_per_iu) {
> > +                     put_unaligned_le64(
> > +                             (u64)io_request->sg_chain_buffer_dma_handle,
> > +                             &sg_descriptor->address);
> > +                     put_unaligned_le32((sg_count - num_sg_in_iu)
> > +                             * sizeof(*sg_descriptor),
> > +                             &sg_descriptor->length);
> > +                     put_unaligned_le32(CISS_SG_CHAIN,
> > +                             &sg_descriptor->flags);
> > +                     chained = true;
> > +                     num_sg_in_iu++;
> > +                     sg_descriptor = io_request->sg_chain_buffer;
> >               }
> > -             put_unaligned_le32(CISS_SG_LAST,
> > -                     &io_request->sg_chain_buffer[sg_count - 1].flags);
> > -             num_sg_in_iu = 1;
> > -             request->partial = 1;
> > +             sg = sg_next(sg);
> >       }
> >
> > -out:
> > -     iu_length = offsetof(struct pqi_aio_path_request, sg_descriptors) -
> > -             PQI_REQUEST_HEADER_LENGTH;
> > +     put_unaligned_le32(CISS_SG_LAST, &sg_descriptor->flags);
> > +     request->partial = chained;
> >       iu_length += num_sg_in_iu * sizeof(*sg_descriptor);
> > +
> > +out:
> >       put_unaligned_le16(iu_length, &request->header.iu_length);
> >       request->num_sg_descriptors = num_sg_in_iu;
> >
> >
> > --
> > 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
> 
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 13/17] smartpqi: remove timeout for cache flush operations
  2016-08-29 21:36     ` Don Brace
@ 2016-08-30  7:13       ` Johannes Thumshirn
  0 siblings, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-30  7:13 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

On Mon, Aug 29, 2016 at 09:36:32PM +0000, Don Brace wrote:
> > -----Original Message-----

[...]

> > 
> > IIRC I asked you to introduce this timeout, as you're calling
> > pqi_flush_cache() from the driver's shutdown callback and I still
> > doubt users like their shutdown's to hang indefinitely because cache
> > flush isn't working. Just my $0.02.
> > 
> 
> The issue is that we do not know how long to wait. The cache module has gotten
> quite large and some flush operations can take longer to complete than others.
> That is why we took the timeout value out.


OK, thanks for the clarification. I think we can still sort this out
when real non-theoretical issues arise.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 15/17] smartpqi: update maintainers
  2016-08-29 20:57     ` Don Brace
@ 2016-08-30  7:14       ` Johannes Thumshirn
  0 siblings, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-30  7:14 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

On Mon, Aug 29, 2016 at 08:57:19PM +0000, Don Brace wrote:
> > -----Original Message-----

[...]

> > 
> > This should be foldet into the next patch where you actually add the
> > documentation ;-).
> 
> I squash smartpqi-add-smartpqi.txt and smartpqi-update-maintainers

Thanks,
	Johannes

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 11/17] smartpqi: minor tweaks to update time support
  2016-08-29 20:29     ` Don Brace
@ 2016-08-30  7:17       ` Johannes Thumshirn
  2016-08-30 15:26         ` Don Brace
  0 siblings, 1 reply; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-30  7:17 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

On Mon, Aug 29, 2016 at 08:29:20PM +0000, Don Brace wrote:
> > -----Original Message-----
> > From: Johannes Thumshirn [mailto:jthumshirn@suse.de]

[...]

> 
> The reason is that we want it run immediately (or close to immediately).
> 
> The code could be restructured to avoid calling this function with a 0, but it would result in more code and no benefit.

OK, now I'm not sure if we talked past each other. I didn't mean
"don't call schedule_delayed_work() with a delay of 0" but "why aren't
you using schedule_work() instead". But maybe it's just too early in
the morning and I didn't have enough coffee yet.

Thanks,
	Johannes

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/17] smartpqi: change aio sg processing
  2016-08-29 21:44     ` Don Brace
@ 2016-08-30  7:23       ` Johannes Thumshirn
  0 siblings, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-30  7:23 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

On Mon, Aug 29, 2016 at 09:44:36PM +0000, Don Brace wrote:
> > -----Original Message-----
> > From: Johannes Thumshirn [mailto:jthumshirn@suse.de]

[...]

> > > +     while (1) {
> > 
> > Is there any compelling reason why you didn't use scsi_for_each_sg()
> > here? I don't see a reason for the while (1) construct.
> > 
> The PQI chaining makes using scsi_for_each_sg a little more difficult to
> maintain. We would prefer to leave the code as is.

Hmmm OK. The only other thing that springs to my mind is this:

     for (i = 0; i <= sg_count; i++) {
     	 pqi_set_sg_descriptor(sg_descriptor, sg);
	 if (!chained)
	    num_sg_in_iu++;
	 if (i == sg_count)
	    break;

which isn't neccesserily better to read...

> 
> > 
> > > +             pqi_set_sg_descriptor(sg_descriptor, sg);
> > > +             if (!chained)
> > > +                     num_sg_in_iu++;
> > > +             i++;
> > > +             if (i == sg_count)
> > > +                     break;

I guess we'll have to live with it then.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* RE: [PATCH 11/17] smartpqi: minor tweaks to update time support
  2016-08-30  7:17       ` Johannes Thumshirn
@ 2016-08-30 15:26         ` Don Brace
  2016-08-31  7:33           ` Johannes Thumshirn
  0 siblings, 1 reply; 60+ messages in thread
From: Don Brace @ 2016-08-30 15:26 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

> -----Original Message-----
> From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> Sent: Tuesday, August 30, 2016 2:18 AM
> To: Don Brace
> Cc: jejb@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> hch@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> elliott@hpe.com; linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 11/17] smartpqi: minor tweaks to update time support
> 
> EXTERNAL EMAIL
> 
> 
> On Mon, Aug 29, 2016 at 08:29:20PM +0000, Don Brace wrote:
> > > -----Original Message-----
> > > From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> 
> [...]
> 
> >
> > The reason is that we want it run immediately (or close to immediately).
> >
> > The code could be restructured to avoid calling this function with a 0, but it
> would result in more code and no benefit.
> 
> OK, now I'm not sure if we talked past each other. I didn't mean
> "don't call schedule_delayed_work() with a delay of 0" but "why aren't
> you using schedule_work() instead". But maybe it's just too early in
> the morning and I didn't have enough coffee yet.

Because the two functions take different work structures as arguments:

static inline bool schedule_delayed_work(struct delayed_work *dwork,
					 unsigned long delay)

static inline bool schedule_work(struct work_struct *work)


> 
> Thanks,
>         Johannes
> 
> --
> Johannes Thumshirn                                          Storage
> jthumshirn@suse.de                                +49 911 74053 689
> SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
> GF: Felix Imendörffer, Jane Smithard, Graham Norton
> HRB 21284 (AG Nürnberg)
> Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 11/17] smartpqi: minor tweaks to update time support
  2016-08-30 15:26         ` Don Brace
@ 2016-08-31  7:33           ` Johannes Thumshirn
  0 siblings, 0 replies; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-31  7:33 UTC (permalink / raw)
  To: Don Brace
  Cc: jejb, Viswas G, Mahesh Rajashekhara, hch, Scott Teel,
	Kevin Barnett, Justin Lindley, Scott Benesh, elliott, linux-scsi

On Tue, Aug 30, 2016 at 03:26:15PM +0000, Don Brace wrote:
> > -----Original Message-----
> > From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> > Sent: Tuesday, August 30, 2016 2:18 AM
> > To: Don Brace
> > Cc: jejb@linux.vnet.ibm.com; Viswas G; Mahesh Rajashekhara;
> > hch@infradead.org; Scott Teel; Kevin Barnett; Justin Lindley; Scott Benesh;
> > elliott@hpe.com; linux-scsi@vger.kernel.org
> > Subject: Re: [PATCH 11/17] smartpqi: minor tweaks to update time support
> > 
> > EXTERNAL EMAIL
> > 
> > 
> > On Mon, Aug 29, 2016 at 08:29:20PM +0000, Don Brace wrote:
> > > > -----Original Message-----
> > > > From: Johannes Thumshirn [mailto:jthumshirn@suse.de]
> > 
> > [...]
> > 
> > >
> > > The reason is that we want it run immediately (or close to immediately).
> > >
> > > The code could be restructured to avoid calling this function with a 0, but it
> > would result in more code and no benefit.
> > 
> > OK, now I'm not sure if we talked past each other. I didn't mean
> > "don't call schedule_delayed_work() with a delay of 0" but "why aren't
> > you using schedule_work() instead". But maybe it's just too early in
> > the morning and I didn't have enough coffee yet.
> 
> Because the two functions take different work structures as arguments:
> 
> static inline bool schedule_delayed_work(struct delayed_work *dwork,
> 					 unsigned long delay)
> 
> static inline bool schedule_work(struct work_struct *work)

If that's the only concern, schedule_work(&dwork->work);

Anyway, that's probably just cosmetics.

With or without schedule_work()
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

But I bet someone comes up with a coccinelle spatch to change this
pattern some day.

Byte,
	Johannes

-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 01/17] smartpqi: change aio sg processing
  2016-08-26 16:44 ` [PATCH 01/17] smartpqi: change aio sg processing Don Brace
  2016-08-29  8:54   ` Johannes Thumshirn
@ 2016-08-31 12:51   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 12:51 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Take advantage of controller improvements.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 02/17] smartpqi: change tmf macro names
  2016-08-26 16:44 ` [PATCH 02/17] smartpqi: change tmf macro names Don Brace
  2016-08-29  8:55   ` Johannes Thumshirn
@ 2016-08-31 12:52   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 12:52 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> small change to make code look cleaner
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/17] smartpqi: simplify spanning
  2016-08-26 16:44 ` [PATCH 03/17] smartpqi: simplify spanning Don Brace
  2016-08-29  8:57   ` Johannes Thumshirn
@ 2016-08-31 12:59   ` Tomas Henzl
  2016-08-31 13:10     ` Johannes Thumshirn
  1 sibling, 1 reply; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 12:59 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Removed the workaround for the transition to spanning.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |   38 +++++++++++++++++----------------
>  1 file changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index 6eab38e..9922e31 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct pqi_ctrl_info *ctrl_info)
>  		return -EINVAL;
>  	}
>  
> +	if (!ctrl_info->inbound_spanning_supported) {
> +		dev_err(&ctrl_info->pci_dev->dev,
> +			"the controller does not support inbound spanning\n");
> +		return -EINVAL;
> +	}
> +
> +	if (ctrl_info->outbound_spanning_supported) {
> +		dev_err(&ctrl_info->pci_dev->dev,
> +			"the controller supports outbound spanning but this driver does not\n");
> +		return -EINVAL;
> +	}
> +
>  	return 0;
>  }

This looks like you are dropping support for a probably older firmware devices,
is that necessary - can't you continue a keep the support with something similar to that
'TEMPHACk' below ?

Tomas

>  
> @@ -4138,24 +4150,14 @@ static void pqi_calculate_queue_resources(struct pqi_ctrl_info *ctrl_info)
>  
>  	ctrl_info->num_queue_groups = num_queue_groups;
>  
> -	if (ctrl_info->max_inbound_iu_length_per_firmware == 256 &&
> -		ctrl_info->outbound_spanning_supported) {
> -		/*
> -		 * TEMPHACK
> -		 * This is older f/w that doesn't actually support spanning.
> -		 */
> -		ctrl_info->max_inbound_iu_length =
> -			PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
> -	} else {
> -		/*
> -		 * Make sure that the max. inbound IU length is an even multiple
> -		 * of our inbound element length.
> -		 */
> -		ctrl_info->max_inbound_iu_length =
> -			(ctrl_info->max_inbound_iu_length_per_firmware /
> -			PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
> -			PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
> -	}
> +	/*
> +	 * Make sure that the max. inbound IU length is an even multiple
> +	 * of our inbound element length.
> +	 */
> +	ctrl_info->max_inbound_iu_length =
> +		(ctrl_info->max_inbound_iu_length_per_firmware /
> +		PQI_OPERATIONAL_IQ_ELEMENT_LENGTH) *
> +		PQI_OPERATIONAL_IQ_ELEMENT_LENGTH;
>  
>  	num_elements_per_iq =
>  		(ctrl_info->max_inbound_iu_length /
>
> --
> 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



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 04/17] smartpqi: enhance drive offline informational message
  2016-08-26 16:44 ` [PATCH 04/17] smartpqi: enhance drive offline informational message Don Brace
  2016-08-29  8:59   ` Johannes Thumshirn
@ 2016-08-31 13:00   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 13:00 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Made a couple of error messages more verbose.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

> ---
>  drivers/scsi/smartpqi/smartpqi_init.c |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index 9922e31..198a7c2 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -2298,11 +2298,16 @@ static inline void pqi_aio_path_disabled(struct pqi_io_request *io_request)
>  static inline void pqi_take_device_offline(struct scsi_device *sdev)
>  {
>  	struct pqi_ctrl_info *ctrl_info;
> +	struct pqi_scsi_dev *device;
>  
>  	if (scsi_device_online(sdev)) {
>  		scsi_device_set_state(sdev, SDEV_OFFLINE);
>  		ctrl_info = shost_to_hba(sdev->host);
>  		schedule_delayed_work(&ctrl_info->rescan_work, 0);
> +		device = sdev->hostdata;
> +		dev_err(&ctrl_info->pci_dev->dev, "offlined scsi %d:%d:%d:%d\n",
> +			ctrl_info->scsi_host->host_no, device->bus,
> +			device->target, device->lun);
>  	}
>  }
>  
>
> --
> 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



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/17] smartpqi: simplify spanning
  2016-08-31 12:59   ` Tomas Henzl
@ 2016-08-31 13:10     ` Johannes Thumshirn
  2016-08-31 13:30       ` Tomas Henzl
  0 siblings, 1 reply; 60+ messages in thread
From: Johannes Thumshirn @ 2016-08-31 13:10 UTC (permalink / raw)
  To: Tomas Henzl
  Cc: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On Wed, Aug 31, 2016 at 02:59:16PM +0200, Tomas Henzl wrote:
> On 26.8.2016 18:44, Don Brace wrote:
> > From: Kevin Barnett <kevin.barnett@microsemi.com>
> >
> > Removed the workaround for the transition to spanning.
> >
> > Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> > Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> > Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> > Signed-off-by: Don Brace <don.brace@microsemi.com>
> > ---
> >  drivers/scsi/smartpqi/smartpqi_init.c |   38 +++++++++++++++++----------------
> >  1 file changed, 20 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> > index 6eab38e..9922e31 100644
> > --- a/drivers/scsi/smartpqi/smartpqi_init.c
> > +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> > @@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct pqi_ctrl_info *ctrl_info)
> >  		return -EINVAL;
> >  	}
> >  
> > +	if (!ctrl_info->inbound_spanning_supported) {
> > +		dev_err(&ctrl_info->pci_dev->dev,
> > +			"the controller does not support inbound spanning\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (ctrl_info->outbound_spanning_supported) {
> > +		dev_err(&ctrl_info->pci_dev->dev,
> > +			"the controller supports outbound spanning but this driver does not\n");
> > +		return -EINVAL;
> > +	}
> > +
> >  	return 0;
> >  }
> 
> This looks like you are dropping support for a probably older firmware devices,
> is that necessary - can't you continue a keep the support with something similar to that
> 'TEMPHACk' below ?

The question is, if any of these older firmware devices ever left the
Microsemi buildings. If not I _think_ it's save to drop it, as no real
users are harmed.

Byte,
      Johannes
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 05/17] smartpqi: enhance reset logic
  2016-08-26 16:44 ` [PATCH 05/17] smartpqi: enhance reset logic Don Brace
  2016-08-29  9:05   ` Johannes Thumshirn
@ 2016-08-31 13:19   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 13:19 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Eliminated timeout from LUN reset logic.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 03/17] smartpqi: simplify spanning
  2016-08-31 13:10     ` Johannes Thumshirn
@ 2016-08-31 13:30       ` Tomas Henzl
  0 siblings, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 13:30 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott, linux-scsi

On 31.8.2016 15:10, Johannes Thumshirn wrote:
> On Wed, Aug 31, 2016 at 02:59:16PM +0200, Tomas Henzl wrote:
>> On 26.8.2016 18:44, Don Brace wrote:
>>> From: Kevin Barnett <kevin.barnett@microsemi.com>
>>>
>>> Removed the workaround for the transition to spanning.
>>>
>>> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
>>> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
>>> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
>>> Signed-off-by: Don Brace <don.brace@microsemi.com>
>>> ---
>>>  drivers/scsi/smartpqi/smartpqi_init.c |   38 +++++++++++++++++----------------
>>>  1 file changed, 20 insertions(+), 18 deletions(-)
>>>
>>> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
>>> index 6eab38e..9922e31 100644
>>> --- a/drivers/scsi/smartpqi/smartpqi_init.c
>>> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
>>> @@ -3663,6 +3663,18 @@ static int pqi_validate_device_capability(struct pqi_ctrl_info *ctrl_info)
>>>  		return -EINVAL;
>>>  	}
>>>  
>>> +	if (!ctrl_info->inbound_spanning_supported) {
>>> +		dev_err(&ctrl_info->pci_dev->dev,
>>> +			"the controller does not support inbound spanning\n");
>>> +		return -EINVAL;
>>> +	}
>>> +
>>> +	if (ctrl_info->outbound_spanning_supported) {
>>> +		dev_err(&ctrl_info->pci_dev->dev,
>>> +			"the controller supports outbound spanning but this driver does not\n");
>>> +		return -EINVAL;
>>> +	}
>>> +
>>>  	return 0;
>>>  }
>> This looks like you are dropping support for a probably older firmware devices,
>> is that necessary - can't you continue a keep the support with something similar to that
>> 'TEMPHACk' below ?
> The question is, if any of these older firmware devices ever left the
> Microsemi buildings. If not I _think_ it's save to drop it, as no real
> users are harmed.

Well yes, likely it was used only during development - in that case also
if all devices support inbound_spanning it is not needed to test at all and
that bit could have been used for anything else (it's too late now for this though.)
Also if Microsemi doesn't want support future devices with this driver
a better option is to not use PCI_ANY_ID in pci_device_id instead of testing
the outbound_spanning_supported.

All that is minor, so -

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


>
> Byte,
>       Johannes



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 07/17] smartpqi: add kdump support
  2016-08-26 16:44 ` [PATCH 07/17] smartpqi: add kdump support Don Brace
  2016-08-29  9:11   ` Johannes Thumshirn
@ 2016-08-31 13:41   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 13:41 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 08/17] smartpqi: correct controller offline issue
  2016-08-26 16:44 ` [PATCH 08/17] smartpqi: correct controller offline issue Don Brace
  2016-08-29  9:19   ` Johannes Thumshirn
@ 2016-08-31 14:15   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 14:15 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:44, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Fixed a bug where the driver would not free all of the
> controller resources if the controller ever went offline.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue
  2016-08-26 16:45 ` [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue Don Brace
  2016-08-29  9:28   ` Johannes Thumshirn
@ 2016-08-31 14:43   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 14:43 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> the driver no longer waits for the firmware to consume
> the event ack IU.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 10/17] smartpqi: minor function reformating
  2016-08-26 16:45 ` [PATCH 10/17] smartpqi: minor function reformating Don Brace
@ 2016-08-31 14:44   ` Tomas Henzl
  0 siblings, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 14:44 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> reformatted pqi_num_elements_free() to match the rest of the driver
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 12/17] smartpqi: scsi queuecommand cleanup
  2016-08-26 16:45 ` [PATCH 12/17] smartpqi: scsi queuecommand cleanup Don Brace
  2016-08-29  9:35   ` Johannes Thumshirn
@ 2016-08-31 14:46   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 14:46 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> minor cleanup of scsi queue command function
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 13/17] smartpqi: remove timeout for cache flush operations
  2016-08-26 16:45 ` [PATCH 13/17] smartpqi: remove timeout for cache flush operations Don Brace
  2016-08-29  9:39   ` Johannes Thumshirn
@ 2016-08-31 14:47   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 14:47 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Some cache flush operations can take longer than the
> timeout value. Best to not impose a time limit to
> handle all cases.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 14/17] smartpqi: update Kconfig
  2016-08-26 16:45 ` [PATCH 14/17] smartpqi: update Kconfig Don Brace
  2016-08-29  9:40   ` Johannes Thumshirn
@ 2016-08-31 14:48   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 14:48 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> The aacraid driver will not managage Microsemi
> smartpqi controllers, but will still manage
> older aacraid devices.
>
> Updated help section.
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Reviewed-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>
> ---

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [PATCH 17/17] smartqi: bump driver version
  2016-08-26 16:45 ` [PATCH 17/17] smartqi: bump driver version Don Brace
  2016-08-29  9:46   ` Johannes Thumshirn
@ 2016-08-31 14:49   ` Tomas Henzl
  1 sibling, 0 replies; 60+ messages in thread
From: Tomas Henzl @ 2016-08-31 14:49 UTC (permalink / raw)
  To: Don Brace, jejb, Viswas.G, Mahesh.Rajashekhara, hch, scott.teel,
	Kevin.Barnett, Justin.Lindley, scott.benesh, elliott
  Cc: linux-scsi

On 26.8.2016 18:45, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microsemi.com>
>
> Reviewed-by: Scott Teel <scott.teel@microsemi.com>
> Reviewed-by: Scott Benesh <scott.benesh@microsemi.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microsemi.com>
> Signed-off-by: Don Brace <don.brace@microsemi.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>


^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2016-08-31 14:49 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26 16:44 [PATCH 00/17] smartpqi updates Don Brace
2016-08-26 16:44 ` [PATCH 01/17] smartpqi: change aio sg processing Don Brace
2016-08-29  8:54   ` Johannes Thumshirn
2016-08-29 21:44     ` Don Brace
2016-08-30  7:23       ` Johannes Thumshirn
2016-08-31 12:51   ` Tomas Henzl
2016-08-26 16:44 ` [PATCH 02/17] smartpqi: change tmf macro names Don Brace
2016-08-29  8:55   ` Johannes Thumshirn
2016-08-31 12:52   ` Tomas Henzl
2016-08-26 16:44 ` [PATCH 03/17] smartpqi: simplify spanning Don Brace
2016-08-29  8:57   ` Johannes Thumshirn
2016-08-31 12:59   ` Tomas Henzl
2016-08-31 13:10     ` Johannes Thumshirn
2016-08-31 13:30       ` Tomas Henzl
2016-08-26 16:44 ` [PATCH 04/17] smartpqi: enhance drive offline informational message Don Brace
2016-08-29  8:59   ` Johannes Thumshirn
2016-08-31 13:00   ` Tomas Henzl
2016-08-26 16:44 ` [PATCH 05/17] smartpqi: enhance reset logic Don Brace
2016-08-29  9:05   ` Johannes Thumshirn
2016-08-31 13:19   ` Tomas Henzl
2016-08-26 16:44 ` [PATCH 06/17] smartpqi: change commonly used function to inline Don Brace
2016-08-29  9:06   ` Johannes Thumshirn
2016-08-29 20:32     ` Don Brace
2016-08-26 16:44 ` [PATCH 07/17] smartpqi: add kdump support Don Brace
2016-08-29  9:11   ` Johannes Thumshirn
2016-08-31 13:41   ` Tomas Henzl
2016-08-26 16:44 ` [PATCH 08/17] smartpqi: correct controller offline issue Don Brace
2016-08-29  9:19   ` Johannes Thumshirn
2016-08-31 14:15   ` Tomas Henzl
2016-08-26 16:45 ` [PATCH 09/17] smartpqi: correct event acknowledgment timeout issue Don Brace
2016-08-29  9:28   ` Johannes Thumshirn
2016-08-31 14:43   ` Tomas Henzl
2016-08-26 16:45 ` [PATCH 10/17] smartpqi: minor function reformating Don Brace
2016-08-31 14:44   ` Tomas Henzl
2016-08-26 16:45 ` [PATCH 11/17] smartpqi: minor tweaks to update time support Don Brace
2016-08-29  9:33   ` Johannes Thumshirn
2016-08-29 20:29     ` Don Brace
2016-08-30  7:17       ` Johannes Thumshirn
2016-08-30 15:26         ` Don Brace
2016-08-31  7:33           ` Johannes Thumshirn
2016-08-26 16:45 ` [PATCH 12/17] smartpqi: scsi queuecommand cleanup Don Brace
2016-08-29  9:35   ` Johannes Thumshirn
2016-08-31 14:46   ` Tomas Henzl
2016-08-26 16:45 ` [PATCH 13/17] smartpqi: remove timeout for cache flush operations Don Brace
2016-08-29  9:39   ` Johannes Thumshirn
2016-08-29 21:36     ` Don Brace
2016-08-30  7:13       ` Johannes Thumshirn
2016-08-31 14:47   ` Tomas Henzl
2016-08-26 16:45 ` [PATCH 14/17] smartpqi: update Kconfig Don Brace
2016-08-29  9:40   ` Johannes Thumshirn
2016-08-31 14:48   ` Tomas Henzl
2016-08-26 16:45 ` [PATCH 15/17] smartpqi: update maintainers Don Brace
2016-08-29  9:42   ` Johannes Thumshirn
2016-08-29 20:57     ` Don Brace
2016-08-30  7:14       ` Johannes Thumshirn
2016-08-26 16:45 ` [PATCH 16/17] smartpqi: add smartpqi.txt Don Brace
2016-08-29  9:45   ` Johannes Thumshirn
2016-08-26 16:45 ` [PATCH 17/17] smartqi: bump driver version Don Brace
2016-08-29  9:46   ` Johannes Thumshirn
2016-08-31 14:49   ` Tomas Henzl

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.