All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] smartpqi updates
@ 2017-08-10 18:46 Don Brace
  2017-08-10 18:46 ` [PATCH 1/7] smartpqi: add pqi reset quiesce support Don Brace
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:46 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

These patches are based on Linus's tree

The changes are:

 - smartpqi-add-pqi-reset-quiesce-support
   - allow driver to confirm completion of a reset.
 - smartpqi-enhance-bmic-cache-flush
   - can now distinguish between shutdown and power
     management operation.
 - smartpqi-update-pqi-passthru-ioctl
   - update DMA direction
 - smartpqi-cleanup-doorbell-register-usage
   - change how sis mode is re-enabled
 - smartpqi-update-kexec-power-down-support
   - reset controller on shutdown
 - smartpqi-add-in-new-controller-ids
   - update for latest hw
 - smartpqi-change-driver-version-to-1.1.2-125

---

Kevin Barnett (7):
      smartpqi: add pqi reset quiesce support
      smartpqi: enhance BMIC cache flush
      smartpqi: update pqi passthru ioctl
      smartpqi: cleanup doorbell register usage.
      smartpqi: update kexec and power down support
      smartpqi: add in new controller ids
      smartpqi: change driver version to 1.1.2-125


 drivers/scsi/smartpqi/smartpqi.h      |   44 ++++++++++
 drivers/scsi/smartpqi/smartpqi_init.c |  145 ++++++++++++++++++++-------------
 drivers/scsi/smartpqi/smartpqi_sis.c  |  111 ++++++-------------------
 drivers/scsi/smartpqi/smartpqi_sis.h  |    4 -
 4 files changed, 159 insertions(+), 145 deletions(-)

--
Signature

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

* [PATCH 1/7] smartpqi: add pqi reset quiesce support
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
@ 2017-08-10 18:46 ` Don Brace
  2017-08-17  3:44   ` James Bottomley
  2017-08-10 18:46 ` [PATCH 2/7] smartpqi: enhance BMIC cache flush Don Brace
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:46 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@microseim.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      |   23 +++++++++++++
 drivers/scsi/smartpqi/smartpqi_init.c |   58 ++++++++++++++++++++++++++-------
 drivers/scsi/smartpqi/smartpqi_sis.c  |   30 ++++++++++++++++-
 drivers/scsi/smartpqi/smartpqi_sis.h  |    1 +
 4 files changed, 98 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index e164ffa..6dd0449 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -688,6 +688,28 @@ struct pqi_config_table_heartbeat {
 	__le32	heartbeat_counter;
 };
 
+union pqi_reset_register {
+	struct {
+		u32	reset_type : 3;
+		u32	reserved : 2;
+		u32	reset_action : 3;
+		u32	hold_in_pd1 : 1;
+		u32	reserved2 : 23;
+	} bits;
+	u32	all_bits;
+};
+
+#define PQI_RESET_ACTION_RESET		0x1
+
+#define PQI_RESET_TYPE_NO_RESET		0x0
+#define PQI_RESET_TYPE_SOFT_RESET	0x1
+#define PQI_RESET_TYPE_FIRM_RESET	0x2
+#define PQI_RESET_TYPE_HARD_RESET	0x3
+
+#define PQI_RESET_ACTION_COMPLETED	0x2
+
+#define PQI_RESET_POLL_INTERVAL_MSECS	100
+
 #define PQI_MAX_OUTSTANDING_REQUESTS		((u32)~0)
 #define PQI_MAX_OUTSTANDING_REQUESTS_KDUMP	32
 #define PQI_MAX_TRANSFER_SIZE			(1024U * 1024U)
@@ -995,6 +1017,7 @@ struct pqi_ctrl_info {
 	u8		inbound_spanning_supported : 1;
 	u8		outbound_spanning_supported : 1;
 	u8		pqi_mode_enabled : 1;
+	u8		pqi_reset_quiesce_supported : 1;
 
 	struct list_head scsi_device_list;
 	spinlock_t	scsi_device_list_lock;
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index cb8f886..ffdc32b 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -5889,28 +5889,62 @@ static void pqi_unregister_scsi(struct pqi_ctrl_info *ctrl_info)
 	scsi_host_put(shost);
 }
 
-#define PQI_RESET_ACTION_RESET		0x1
+static int pqi_wait_for_pqi_reset_completion(struct pqi_ctrl_info *ctrl_info)
+{
+	int rc = 0;
+	struct pqi_device_registers __iomem *pqi_registers;
+	unsigned long timeout;
+	unsigned int timeout_msecs;
+	union pqi_reset_register reset_reg;
+
+	pqi_registers = ctrl_info->pqi_registers;
+	timeout_msecs = readw(&pqi_registers->max_reset_timeout) * 100;
+	timeout = msecs_to_jiffies(timeout_msecs) + jiffies;
+
+	while (1) {
+		msleep(PQI_RESET_POLL_INTERVAL_MSECS);
+		reset_reg.all_bits = readl(&pqi_registers->device_reset);
+		if (reset_reg.bits.reset_action == PQI_RESET_ACTION_COMPLETED)
+			break;
+		pqi_check_ctrl_health(ctrl_info);
+		if (pqi_ctrl_offline(ctrl_info)) {
+			rc = -ENXIO;
+			break;
+		}
+		if (time_after(jiffies, timeout)) {
+			rc = -ETIMEDOUT;
+			break;
+		}
+	}
 
-#define PQI_RESET_TYPE_NO_RESET		0x0
-#define PQI_RESET_TYPE_SOFT_RESET	0x1
-#define PQI_RESET_TYPE_FIRM_RESET	0x2
-#define PQI_RESET_TYPE_HARD_RESET	0x3
+	return rc;
+}
 
 static int pqi_reset(struct pqi_ctrl_info *ctrl_info)
 {
 	int rc;
-	u32 reset_params;
+	union pqi_reset_register reset_reg;
 
-	reset_params = (PQI_RESET_ACTION_RESET << 5) |
-		PQI_RESET_TYPE_HARD_RESET;
+	if (ctrl_info->pqi_reset_quiesce_supported) {
+		rc = sis_pqi_reset_quiesce(ctrl_info);
+		if (rc) {
+			dev_err(&ctrl_info->pci_dev->dev,
+				"PQI reset failed during quiesce with error %d\n",
+				rc);
+			return rc;
+		}
+	}
 
-	writel(reset_params,
-		&ctrl_info->pqi_registers->device_reset);
+	reset_reg.all_bits = 0;
+	reset_reg.bits.reset_type = PQI_RESET_TYPE_HARD_RESET;
+	reset_reg.bits.reset_action = PQI_RESET_ACTION_RESET;
 
-	rc = pqi_wait_for_pqi_mode_ready(ctrl_info);
+	writel(reset_reg.all_bits, &ctrl_info->pqi_registers->device_reset);
+
+	rc = pqi_wait_for_pqi_reset_completion(ctrl_info);
 	if (rc)
 		dev_err(&ctrl_info->pci_dev->dev,
-			"PQI reset failed\n");
+			"PQI reset failed with error %d\n", rc);
 
 	return rc;
 }
diff --git a/drivers/scsi/smartpqi/smartpqi_sis.c b/drivers/scsi/smartpqi/smartpqi_sis.c
index e55dfcf..9abbace 100644
--- a/drivers/scsi/smartpqi/smartpqi_sis.c
+++ b/drivers/scsi/smartpqi/smartpqi_sis.c
@@ -36,6 +36,7 @@
 #define SIS_ENABLE_INTX				0x80
 #define SIS_SOFT_RESET				0x100
 #define SIS_TRIGGER_SHUTDOWN			0x800000
+#define SIS_PQI_RESET_QUIESCE			0x1000000
 #define SIS_CMD_READY				0x200
 #define SIS_CMD_COMPLETE			0x1000
 #define SIS_CLEAR_CTRL_TO_HOST_DOORBELL		0x1000
@@ -47,6 +48,7 @@
 #define SIS_EXTENDED_PROPERTIES_SUPPORTED	0x800000
 #define SIS_SMARTARRAY_FEATURES_SUPPORTED	0x2
 #define SIS_PQI_MODE_SUPPORTED			0x4
+#define SIS_PQI_RESET_QUIESCE_SUPPORTED		0x8
 #define SIS_REQUIRED_EXTENDED_PROPERTIES	\
 	(SIS_SMARTARRAY_FEATURES_SUPPORTED | SIS_PQI_MODE_SUPPORTED)
 
@@ -258,6 +260,9 @@ int sis_get_ctrl_properties(struct pqi_ctrl_info *ctrl_info)
 		SIS_REQUIRED_EXTENDED_PROPERTIES)
 		return -ENODEV;
 
+	if (extended_properties & SIS_PQI_RESET_QUIESCE_SUPPORTED)
+		ctrl_info->pqi_reset_quiesce_supported = true;
+
 	return 0;
 }
 
@@ -336,9 +341,10 @@ int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info)
 
 #define SIS_DOORBELL_BIT_CLEAR_TIMEOUT_SECS	30
 
-static void sis_wait_for_doorbell_bit_to_clear(
+static int sis_wait_for_doorbell_bit_to_clear(
 	struct pqi_ctrl_info *ctrl_info, u32 bit)
 {
+	int rc = 0;
 	u32 doorbell_register;
 	unsigned long timeout;
 
@@ -350,16 +356,21 @@ static void sis_wait_for_doorbell_bit_to_clear(
 		if ((doorbell_register & bit) == 0)
 			break;
 		if (readl(&ctrl_info->registers->sis_firmware_status) &
-			SIS_CTRL_KERNEL_PANIC)
+			SIS_CTRL_KERNEL_PANIC) {
+			rc = -ENODEV;
 			break;
+		}
 		if (time_after(jiffies, timeout)) {
 			dev_err(&ctrl_info->pci_dev->dev,
 				"doorbell register bit 0x%x not cleared\n",
 				bit);
+			rc = -ETIMEDOUT;
 			break;
 		}
 		usleep_range(1000, 2000);
 	}
+
+	return rc;
 }
 
 /* Enable MSI-X interrupts on the controller. */
@@ -434,6 +445,21 @@ void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info)
 		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
 }
 
+int sis_pqi_reset_quiesce(struct pqi_ctrl_info *ctrl_info)
+{
+	u32 doorbell_register;
+
+	doorbell_register =
+		readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell);
+	doorbell_register |= SIS_PQI_RESET_QUIESCE;
+
+	writel(doorbell_register,
+		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
+
+	return sis_wait_for_doorbell_bit_to_clear(ctrl_info,
+		SIS_PQI_RESET_QUIESCE);
+}
+
 #define SIS_MODE_READY_TIMEOUT_SECS	30
 
 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info)
diff --git a/drivers/scsi/smartpqi/smartpqi_sis.h b/drivers/scsi/smartpqi/smartpqi_sis.h
index 983184b..394b16e 100644
--- a/drivers/scsi/smartpqi/smartpqi_sis.h
+++ b/drivers/scsi/smartpqi/smartpqi_sis.h
@@ -32,6 +32,7 @@ void sis_enable_intx(struct pqi_ctrl_info *ctrl_info);
 void sis_disable_intx(struct pqi_ctrl_info *ctrl_info);
 void sis_soft_reset(struct pqi_ctrl_info *ctrl_info);
 void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info);
+int sis_pqi_reset_quiesce(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);

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

* [PATCH 2/7] smartpqi: enhance BMIC cache flush
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
  2017-08-10 18:46 ` [PATCH 1/7] smartpqi: add pqi reset quiesce support Don Brace
@ 2017-08-10 18:46 ` Don Brace
  2017-08-10 18:46 ` [PATCH 3/7] smartpqi: update pqi passthru ioctl Don Brace
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:46 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

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

 - distinguish between shutdown and non-shutdown.

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      |   21 +++++++++++++++++++--
 drivers/scsi/smartpqi/smartpqi_init.c |   27 ++++++++++++++-------------
 2 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
index 6dd0449..dc3a054 100644
--- a/drivers/scsi/smartpqi/smartpqi.h
+++ b/drivers/scsi/smartpqi/smartpqi.h
@@ -1079,9 +1079,9 @@ enum pqi_ctrl_mode {
 #define BMIC_SENSE_CONTROLLER_PARAMETERS	0x64
 #define BMIC_SENSE_SUBSYSTEM_INFORMATION	0x66
 #define BMIC_WRITE_HOST_WELLNESS		0xa5
-#define BMIC_CACHE_FLUSH			0xc2
+#define BMIC_FLUSH_CACHE			0xc2
 
-#define SA_CACHE_FLUSH				0x1
+#define SA_FLUSH_CACHE				0x1
 
 #define MASKED_DEVICE(lunid)			((lunid)[3] & 0xc0)
 #define CISS_GET_LEVEL_2_BUS(lunid)		((lunid)[7] & 0x3f)
@@ -1187,6 +1187,23 @@ struct bmic_identify_physical_device {
 	u8	padding_to_multiple_of_512[9];
 };
 
+struct bmic_flush_cache {
+	u8	disable_flag;
+	u8	system_power_action;
+	u8	ndu_flush;
+	u8	shutdown_event;
+	u8	reserved[28];
+};
+
+/* for shutdown_event member of struct bmic_flush_cache */
+enum bmic_flush_cache_shutdown_event {
+	NONE_CACHE_FLUSH_ONLY = 0,
+	SHUTDOWN = 1,
+	HIBERNATE = 2,
+	SUSPEND = 3,
+	RESTART = 4
+};
+
 #pragma pack()
 
 int pqi_add_sas_host(struct Scsi_Host *shost, struct pqi_ctrl_info *ctrl_info);
diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index ffdc32b..b36d338 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -431,10 +431,10 @@ static int pqi_build_raid_path_request(struct pqi_ctrl_info *ctrl_info,
 		cdb[1] = CISS_GET_RAID_MAP;
 		put_unaligned_be32(buffer_length, &cdb[6]);
 		break;
-	case SA_CACHE_FLUSH:
+	case SA_FLUSH_CACHE:
 		request->data_direction = SOP_WRITE_FLAG;
 		cdb[0] = BMIC_WRITE;
-		cdb[6] = BMIC_CACHE_FLUSH;
+		cdb[6] = BMIC_FLUSH_CACHE;
 		put_unaligned_be16(buffer_length, &cdb[7]);
 		break;
 	case BMIC_IDENTIFY_CONTROLLER:
@@ -585,14 +585,13 @@ static int pqi_identify_physical_device(struct pqi_ctrl_info *ctrl_info,
 	return rc;
 }
 
-#define SA_CACHE_FLUSH_BUFFER_LENGTH	4
-
-static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
+static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info,
+	enum bmic_flush_cache_shutdown_event shutdown_event)
 {
 	int rc;
 	struct pqi_raid_path_request request;
 	int pci_direction;
-	u8 *buffer;
+	struct bmic_flush_cache *flush_cache;
 
 	/*
 	 * Don't bother trying to flush the cache if the controller is
@@ -601,13 +600,15 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
 	if (pqi_ctrl_offline(ctrl_info))
 		return -ENXIO;
 
-	buffer = kzalloc(SA_CACHE_FLUSH_BUFFER_LENGTH, GFP_KERNEL);
-	if (!buffer)
+	flush_cache = kzalloc(sizeof(*flush_cache), GFP_KERNEL);
+	if (!flush_cache)
 		return -ENOMEM;
 
+	flush_cache->shutdown_event = shutdown_event;
+
 	rc = pqi_build_raid_path_request(ctrl_info, &request,
-		SA_CACHE_FLUSH, RAID_CTLR_LUNID, buffer,
-		SA_CACHE_FLUSH_BUFFER_LENGTH, 0, &pci_direction);
+		SA_FLUSH_CACHE, RAID_CTLR_LUNID, flush_cache,
+		sizeof(*flush_cache), 0, &pci_direction);
 	if (rc)
 		goto out;
 
@@ -618,7 +619,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info)
 		pci_direction);
 
 out:
-	kfree(buffer);
+	kfree(flush_cache);
 
 	return rc;
 }
@@ -6693,7 +6694,7 @@ static void pqi_shutdown(struct pci_dev *pci_dev)
 	 * Write all data in the controller's battery-backed cache to
 	 * storage.
 	 */
-	rc = pqi_flush_cache(ctrl_info);
+	rc = pqi_flush_cache(ctrl_info, SHUTDOWN);
 	if (rc == 0)
 		return;
 
@@ -6737,7 +6738,7 @@ static __maybe_unused int pqi_suspend(struct pci_dev *pci_dev, pm_message_t stat
 	pqi_cancel_rescan_worker(ctrl_info);
 	pqi_wait_until_scan_finished(ctrl_info);
 	pqi_wait_until_lun_reset_finished(ctrl_info);
-	pqi_flush_cache(ctrl_info);
+	pqi_flush_cache(ctrl_info, SUSPEND);
 	pqi_ctrl_block_requests(ctrl_info);
 	pqi_ctrl_wait_until_quiesced(ctrl_info);
 	pqi_wait_until_inbound_queues_empty(ctrl_info);

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

* [PATCH 3/7] smartpqi: update pqi passthru ioctl
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
  2017-08-10 18:46 ` [PATCH 1/7] smartpqi: add pqi reset quiesce support Don Brace
  2017-08-10 18:46 ` [PATCH 2/7] smartpqi: enhance BMIC cache flush Don Brace
@ 2017-08-10 18:46 ` Don Brace
  2017-08-10 18:46 ` [PATCH 4/7] smartpqi: cleanup doorbell register usage Don Brace
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:46 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

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

 - make pass-thru requests bi-directional

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 |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index b36d338..3b05f28 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -5499,6 +5499,7 @@ static int pqi_passthru_ioctl(struct pqi_ctrl_info *ctrl_info, void __user *arg)
 	case XFER_NONE:
 	case XFER_WRITE:
 	case XFER_READ:
+	case XFER_READ | XFER_WRITE:
 		break;
 	default:
 		return -EINVAL;
@@ -5539,6 +5540,9 @@ static int pqi_passthru_ioctl(struct pqi_ctrl_info *ctrl_info, void __user *arg)
 	case XFER_READ:
 		request.data_direction = SOP_READ_FLAG;
 		break;
+	case XFER_READ | XFER_WRITE:
+		request.data_direction = SOP_BIDIRECTIONAL;
+		break;
 	}
 
 	request.task_attribute = SOP_TASK_ATTRIBUTE_SIMPLE;

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

* [PATCH 4/7] smartpqi: cleanup doorbell register usage.
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
                   ` (2 preceding siblings ...)
  2017-08-10 18:46 ` [PATCH 3/7] smartpqi: update pqi passthru ioctl Don Brace
@ 2017-08-10 18:46 ` Don Brace
  2017-08-10 18:47 ` [PATCH 5/7] smartpqi: update kexec and power down support Don Brace
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:46 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@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 |   11 ++-
 drivers/scsi/smartpqi/smartpqi_sis.c  |  105 +++------------------------------
 drivers/scsi/smartpqi/smartpqi_sis.h  |    3 -
 3 files changed, 17 insertions(+), 102 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 3b05f28..70b1f97 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -3008,11 +3008,9 @@ static void pqi_change_irq_mode(struct pqi_ctrl_info *ctrl_info,
 			break;
 		case IRQ_MODE_INTX:
 			pqi_configure_legacy_intx(ctrl_info, true);
-			sis_disable_msix(ctrl_info);
 			sis_enable_intx(ctrl_info);
 			break;
 		case IRQ_MODE_NONE:
-			sis_disable_msix(ctrl_info);
 			break;
 		}
 		break;
@@ -3020,14 +3018,12 @@ static void pqi_change_irq_mode(struct pqi_ctrl_info *ctrl_info,
 		switch (new_mode) {
 		case IRQ_MODE_MSIX:
 			pqi_configure_legacy_intx(ctrl_info, false);
-			sis_disable_intx(ctrl_info);
 			sis_enable_msix(ctrl_info);
 			break;
 		case IRQ_MODE_INTX:
 			break;
 		case IRQ_MODE_NONE:
 			pqi_configure_legacy_intx(ctrl_info, false);
-			sis_disable_intx(ctrl_info);
 			break;
 		}
 		break;
@@ -6046,7 +6042,12 @@ static int pqi_revert_to_sis_mode(struct pqi_ctrl_info *ctrl_info)
 	rc = pqi_reset(ctrl_info);
 	if (rc)
 		return rc;
-	sis_reenable_sis_mode(ctrl_info);
+	rc = sis_reenable_sis_mode(ctrl_info);
+	if (rc) {
+		dev_err(&ctrl_info->pci_dev->dev,
+			"re-enabling SIS mode failed with error %d\n", rc);
+		return rc;
+	}
 	pqi_save_ctrl_mode(ctrl_info, SIS_MODE);
 
 	return 0;
diff --git a/drivers/scsi/smartpqi/smartpqi_sis.c b/drivers/scsi/smartpqi/smartpqi_sis.c
index 9abbace..5141bd4 100644
--- a/drivers/scsi/smartpqi/smartpqi_sis.c
+++ b/drivers/scsi/smartpqi/smartpqi_sis.c
@@ -34,12 +34,13 @@
 #define SIS_REENABLE_SIS_MODE			0x1
 #define SIS_ENABLE_MSIX				0x40
 #define SIS_ENABLE_INTX				0x80
-#define SIS_SOFT_RESET				0x100
+#define SIS_CMD_READY				0x200
 #define SIS_TRIGGER_SHUTDOWN			0x800000
 #define SIS_PQI_RESET_QUIESCE			0x1000000
-#define SIS_CMD_READY				0x200
+
 #define SIS_CMD_COMPLETE			0x1000
 #define SIS_CLEAR_CTRL_TO_HOST_DOORBELL		0x1000
+
 #define SIS_CMD_STATUS_SUCCESS			0x1
 #define SIS_CMD_COMPLETE_TIMEOUT_SECS		30
 #define SIS_CMD_COMPLETE_POLL_INTERVAL_MSECS	10
@@ -373,66 +374,21 @@ static int sis_wait_for_doorbell_bit_to_clear(
 	return rc;
 }
 
-/* Enable MSI-X interrupts on the controller. */
-
-void sis_enable_msix(struct pqi_ctrl_info *ctrl_info)
+static inline int sis_set_doorbell_bit(struct pqi_ctrl_info *ctrl_info, u32 bit)
 {
-	u32 doorbell_register;
-
-	doorbell_register =
-		readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-	doorbell_register |= SIS_ENABLE_MSIX;
+	writel(bit, &ctrl_info->registers->sis_host_to_ctrl_doorbell);
 
-	writel(doorbell_register,
-		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-
-	sis_wait_for_doorbell_bit_to_clear(ctrl_info, SIS_ENABLE_MSIX);
+	return sis_wait_for_doorbell_bit_to_clear(ctrl_info, bit);
 }
 
-/* Disable MSI-X interrupts on the controller. */
-
-void sis_disable_msix(struct pqi_ctrl_info *ctrl_info)
+void sis_enable_msix(struct pqi_ctrl_info *ctrl_info)
 {
-	u32 doorbell_register;
-
-	doorbell_register =
-		readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-	doorbell_register &= ~SIS_ENABLE_MSIX;
-
-	writel(doorbell_register,
-		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
+	sis_set_doorbell_bit(ctrl_info, SIS_ENABLE_MSIX);
 }
 
 void sis_enable_intx(struct pqi_ctrl_info *ctrl_info)
 {
-	u32 doorbell_register;
-
-	doorbell_register =
-		readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-	doorbell_register |= SIS_ENABLE_INTX;
-
-	writel(doorbell_register,
-		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-
-	sis_wait_for_doorbell_bit_to_clear(ctrl_info, SIS_ENABLE_INTX);
-}
-
-void sis_disable_intx(struct pqi_ctrl_info *ctrl_info)
-{
-	u32 doorbell_register;
-
-	doorbell_register =
-		readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-	doorbell_register &= ~SIS_ENABLE_INTX;
-
-	writel(doorbell_register,
-		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-}
-
-void sis_soft_reset(struct pqi_ctrl_info *ctrl_info)
-{
-	writel(SIS_SOFT_RESET,
-		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
+	sis_set_doorbell_bit(ctrl_info, SIS_ENABLE_INTX);
 }
 
 void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info)
@@ -447,51 +403,12 @@ void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info)
 
 int sis_pqi_reset_quiesce(struct pqi_ctrl_info *ctrl_info)
 {
-	u32 doorbell_register;
-
-	doorbell_register =
-		readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-	doorbell_register |= SIS_PQI_RESET_QUIESCE;
-
-	writel(doorbell_register,
-		&ctrl_info->registers->sis_host_to_ctrl_doorbell);
-
-	return sis_wait_for_doorbell_bit_to_clear(ctrl_info,
-		SIS_PQI_RESET_QUIESCE);
+	return sis_set_doorbell_bit(ctrl_info, SIS_PQI_RESET_QUIESCE);
 }
 
-#define SIS_MODE_READY_TIMEOUT_SECS	30
-
 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info)
 {
-	int rc;
-	unsigned long timeout;
-	struct pqi_ctrl_registers __iomem *registers;
-	u32 doorbell;
-
-	registers = ctrl_info->registers;
-
-	writel(SIS_REENABLE_SIS_MODE,
-		&registers->sis_host_to_ctrl_doorbell);
-
-	rc = 0;
-	timeout = (SIS_MODE_READY_TIMEOUT_SECS * HZ) + jiffies;
-
-	while (1) {
-		doorbell = readl(&registers->sis_ctrl_to_host_doorbell);
-		if ((doorbell & SIS_REENABLE_SIS_MODE) == 0)
-			break;
-		if (time_after(jiffies, timeout)) {
-			rc = -ETIMEDOUT;
-			break;
-		}
-	}
-
-	if (rc)
-		dev_err(&ctrl_info->pci_dev->dev,
-			"re-enabling SIS mode failed\n");
-
-	return rc;
+	return sis_set_doorbell_bit(ctrl_info, SIS_REENABLE_SIS_MODE);
 }
 
 void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value)
diff --git a/drivers/scsi/smartpqi/smartpqi_sis.h b/drivers/scsi/smartpqi/smartpqi_sis.h
index 394b16e..2bf889d 100644
--- a/drivers/scsi/smartpqi/smartpqi_sis.h
+++ b/drivers/scsi/smartpqi/smartpqi_sis.h
@@ -27,10 +27,7 @@ int sis_get_ctrl_properties(struct pqi_ctrl_info *ctrl_info);
 int sis_get_pqi_capabilities(struct pqi_ctrl_info *ctrl_info);
 int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info);
 void sis_enable_msix(struct pqi_ctrl_info *ctrl_info);
-void sis_disable_msix(struct pqi_ctrl_info *ctrl_info);
 void sis_enable_intx(struct pqi_ctrl_info *ctrl_info);
-void sis_disable_intx(struct pqi_ctrl_info *ctrl_info);
-void sis_soft_reset(struct pqi_ctrl_info *ctrl_info);
 void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info);
 int sis_pqi_reset_quiesce(struct pqi_ctrl_info *ctrl_info);
 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info);

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

* [PATCH 5/7] smartpqi: update kexec and power down support
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
                   ` (3 preceding siblings ...)
  2017-08-10 18:46 ` [PATCH 4/7] smartpqi: cleanup doorbell register usage Don Brace
@ 2017-08-10 18:47 ` Don Brace
  2017-08-10 18:47 ` [PATCH 6/7] smartpqi: add in new controller ids Don Brace
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:47 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

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

add PQI reset to driver shutdown callback to
work around controller bug.

During an 1.) OS shutdown or 2.) kexec outside of a kdump,
the Linux kernel will clear BME on our controller.

If BME is cleared during a controller/host PCIe transfer,
the controller will lock up.

So we perform a PQI reset in the driver's shutdown callback
function to eliminate the possibility of a controller/host
PCIe transfer being active when the kernel clears BME immediately
after calling the driver's shutdown callback.

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 |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 70b1f97..afd3eed 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -6700,6 +6700,7 @@ static void pqi_shutdown(struct pci_dev *pci_dev)
 	 * storage.
 	 */
 	rc = pqi_flush_cache(ctrl_info, SHUTDOWN);
+	pqi_reset(ctrl_info);
 	if (rc == 0)
 		return;
 

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

* [PATCH 6/7] smartpqi: add in new controller ids
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
                   ` (4 preceding siblings ...)
  2017-08-10 18:47 ` [PATCH 5/7] smartpqi: update kexec and power down support Don Brace
@ 2017-08-10 18:47 ` Don Brace
  2017-08-10 18:47 ` [PATCH 7/7] smartpqi: change driver version to 1.1.2-125 Don Brace
  2017-08-11  0:00 ` [PATCH 0/7] smartpqi updates Martin K. Petersen
  7 siblings, 0 replies; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:47 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

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

Update the driver’s PCI IDs to match the latest
Microsemi controllers

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 |   36 +++++++++++++--------------------
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index afd3eed..59b6301 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -6822,7 +6822,7 @@ static const struct pci_device_id pqi_pci_id_table[] = {
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
-			       PCI_VENDOR_ID_ADAPTEC2, 0x0605)
+			       PCI_VENDOR_ID_ADAPTEC2, 0x0608)
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
@@ -6854,6 +6854,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
+			       PCI_VENDOR_ID_ADAPTEC2, 0x0807)
+	},
+	{
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
 			       PCI_VENDOR_ID_ADAPTEC2, 0x0900)
 	},
 	{
@@ -6890,6 +6894,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
+			       PCI_VENDOR_ID_ADAPTEC2, 0x090a)
+	},
+	{
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
 			       PCI_VENDOR_ID_ADAPTEC2, 0x1200)
 	},
 	{
@@ -6922,6 +6930,10 @@ static const struct pci_device_id pqi_pci_id_table[] = {
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
+			       PCI_VENDOR_ID_DELL, 0x1fe0)
+	},
+	{
+		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
 			       PCI_VENDOR_ID_HP, 0x0600)
 	},
 	{
@@ -6938,11 +6950,7 @@ static const struct pci_device_id pqi_pci_id_table[] = {
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
-			       PCI_VENDOR_ID_HP, 0x0604)
-	},
-	{
-		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
-			       PCI_VENDOR_ID_HP, 0x0606)
+			       PCI_VENDOR_ID_HP, 0x0609)
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
@@ -6970,14 +6978,6 @@ static const struct pci_device_id pqi_pci_id_table[] = {
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
-			       PCI_VENDOR_ID_HP, 0x0656)
-	},
-	{
-		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
-			       PCI_VENDOR_ID_HP, 0x0657)
-	},
-	{
-		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
 			       PCI_VENDOR_ID_HP, 0x0700)
 	},
 	{
@@ -6998,14 +6998,6 @@ static const struct pci_device_id pqi_pci_id_table[] = {
 	},
 	{
 		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
-			       PCI_VENDOR_ID_HP, 0x1102)
-	},
-	{
-		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
-			       PCI_VENDOR_ID_HP, 0x1150)
-	},
-	{
-		PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f,
 			       PCI_ANY_ID, PCI_ANY_ID)
 	},
 	{ 0 }

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

* [PATCH 7/7] smartpqi: change driver version to 1.1.2-125
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
                   ` (5 preceding siblings ...)
  2017-08-10 18:47 ` [PATCH 6/7] smartpqi: add in new controller ids Don Brace
@ 2017-08-10 18:47 ` Don Brace
  2017-08-11  0:00 ` [PATCH 0/7] smartpqi updates Martin K. Petersen
  7 siblings, 0 replies; 17+ messages in thread
From: Don Brace @ 2017-08-10 18:47 UTC (permalink / raw)
  To: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

From: Kevin Barnett <kevin.barnett@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, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 59b6301..83bdbd8 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -40,11 +40,11 @@
 #define BUILD_TIMESTAMP
 #endif
 
-#define DRIVER_VERSION		"1.0.4-100"
+#define DRIVER_VERSION		"1.1.2-125"
 #define DRIVER_MAJOR		1
-#define DRIVER_MINOR		0
-#define DRIVER_RELEASE		4
-#define DRIVER_REVISION		100
+#define DRIVER_MINOR		1
+#define DRIVER_RELEASE		2
+#define DRIVER_REVISION		125
 
 #define DRIVER_NAME		"Microsemi PQI Driver (v" \
 				DRIVER_VERSION BUILD_TIMESTAMP ")"

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

* Re: [PATCH 0/7] smartpqi updates
  2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
                   ` (6 preceding siblings ...)
  2017-08-10 18:47 ` [PATCH 7/7] smartpqi: change driver version to 1.1.2-125 Don Brace
@ 2017-08-11  0:00 ` Martin K. Petersen
  7 siblings, 0 replies; 17+ messages in thread
From: Martin K. Petersen @ 2017-08-11  0:00 UTC (permalink / raw)
  To: Don Brace
  Cc: joseph.szczypek, gerry.morong, john.hall, jejb, Kevin.Barnett,
	Mahesh.Rajashekhara, bader.alisaleh, hch, scott.teel, Viswas.G,
	Justin.Lindley, scott.benesh, POSWALD, linux-scsi


Don,

> These patches are based on Linus's tree
>
> The changes are:
>
>  - smartpqi-add-pqi-reset-quiesce-support
>    - allow driver to confirm completion of a reset.
>  - smartpqi-enhance-bmic-cache-flush
>    - can now distinguish between shutdown and power
>      management operation.
>  - smartpqi-update-pqi-passthru-ioctl
>    - update DMA direction
>  - smartpqi-cleanup-doorbell-register-usage
>    - change how sis mode is re-enabled
>  - smartpqi-update-kexec-power-down-support
>    - reset controller on shutdown
>  - smartpqi-add-in-new-controller-ids
>    - update for latest hw
>  - smartpqi-change-driver-version-to-1.1.2-125

Applied to 4.14/scsi-queue. Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 1/7] smartpqi: add pqi reset quiesce support
  2017-08-10 18:46 ` [PATCH 1/7] smartpqi: add pqi reset quiesce support Don Brace
@ 2017-08-17  3:44   ` James Bottomley
  2017-08-17 15:15     ` Don Brace
  0 siblings, 1 reply; 17+ messages in thread
From: James Bottomley @ 2017-08-17  3:44 UTC (permalink / raw)
  To: Don Brace, joseph.szczypek, gerry.morong, john.hall,
	Kevin.Barnett, Mahesh.Rajashekhara, bader.alisaleh, hch,
	scott.teel, Viswas.G, Justin.Lindley, scott.benesh, POSWALD
  Cc: linux-scsi

On Thu, 2017-08-10 at 13:46 -0500, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microseim.com>

To misspell someone else's company name could be considered unfortunate
... to misspell your own looks like carelessness.

You've done this twice, by the way.

James

> 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>

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

* RE: [PATCH 1/7] smartpqi: add pqi reset quiesce support
  2017-08-17  3:44   ` James Bottomley
@ 2017-08-17 15:15     ` Don Brace
  0 siblings, 0 replies; 17+ messages in thread
From: Don Brace @ 2017-08-17 15:15 UTC (permalink / raw)
  To: James Bottomley, joseph.szczypek@hpe.com, Gerry Morong, John Hall,
	Kevin Barnett, Mahesh Rajashekhara, Bader Ali - Saleh,
	hch@infradead.org, Scott Teel, Viswas G, Justin Lindley,
	Scott Benesh, POSWALD@suse.com
  Cc: linux-scsi@vger.kernel.org

> -----Original Message-----
> From: James Bottomley [mailto:jejb@linux.vnet.ibm.com]
> Sent: Wednesday, August 16, 2017 10:44 PM
> To: Don Brace <don.brace@microsemi.com>; joseph.szczypek@hpe.com;
> Gerry Morong <gerry.morong@microsemi.com>; John Hall
> <John.Hall@microsemi.com>; Kevin Barnett
> <kevin.barnett@microsemi.com>; Mahesh Rajashekhara
> <mahesh.rajashekhara@microsemi.com>; Bader Ali - Saleh
> <bader.alisaleh@microsemi.com>; hch@infradead.org; Scott Teel
> <scott.teel@microsemi.com>; Viswas G <viswas.g@microsemi.com>; Justin
> Lindley <justin.lindley@microsemi.com>; Scott Benesh
> <scott.benesh@microsemi.com>; POSWALD@suse.com
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 1/7] smartpqi: add pqi reset quiesce support
> 
> EXTERNAL EMAIL
> 
> 
> On Thu, 2017-08-10 at 13:46 -0500, Don Brace wrote:
> > From: Kevin Barnett <kevin.barnett@microseim.com>
> 
> To misspell someone else's company name could be considered unfortunate
> ... to misspell your own looks like carelessness.
> 
> You've done this twice, by the way.
> 
> James
> 
> > 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>

That's my bad. I'll be more careful in the future.

Thanks,
Don Brace

ESC - Smart Storage
Microsemi Corporation



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

* [PATCH 0/7] smartpqi updates
@ 2020-07-31 21:01 Don Brace
  2020-08-12 20:03 ` Martin Wilck
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Don Brace @ 2020-07-31 21:01 UTC (permalink / raw)
  To: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD
  Cc: linux-scsi

These patches are based on Linus's tree

The changes are:
smartpqi-identify-physical-devices-without-issuing-INQUIRY
 - eliminate sending INQUIRYs to physical devices
smartpqi-add-id-support-for-smartRAID-3152-8i
 - add support for a new controller
smartpqi-update-logical-volume-size-after-expansion
 - update volume size in OS after expansion.
smartpqi-avoid-crashing-kernel-for-controller-issues
 - remove BUG calls for rare cases when controller returns
   bad responses.
smartpqi-support-device-deletion-via-sysfs
 - handle device removal using sysfs file
   /sys/block/sd<X>/device/delete where X is device name is a, b, ...
smartpqi-add-RAID-bypass-counter
 - aid to identify when RAID bypass is in use.
smartpqi-bump-version-to-1.2.16-010

---

Don Brace (1):
      smartpqi: bump version to 1.2.16-010

Kevin Barnett (4):
      smartpqi identify physical devices without issuing INQUIRY
      smartpqi: avoid crashing kernel for controller issues
      smartpqi: support device deletion via sysfs
      smartpqi: add RAID bypass counter

Mahesh Rajashekhara (2):
      smartpqi: add id support for SmartRAID 3152-8i
      smartpqi: update logical volume size after expansion


 drivers/scsi/smartpqi/smartpqi.h      |   4 +-
 drivers/scsi/smartpqi/smartpqi_init.c | 301 ++++++++++++++++----------
 2 files changed, 189 insertions(+), 116 deletions(-)

--
Signature

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

* Re: [PATCH 0/7] smartpqi updates
  2020-07-31 21:01 Don Brace
@ 2020-08-12 20:03 ` Martin Wilck
  2020-08-13  2:50 ` Martin K. Petersen
  2020-08-18  3:11 ` Martin K. Petersen
  2 siblings, 0 replies; 17+ messages in thread
From: Martin Wilck @ 2020-08-12 20:03 UTC (permalink / raw)
  To: Don Brace, Kevin.Barnett, scott.teel, Justin.Lindley,
	scott.benesh, bader.alisaleh, gerry.morong, mahesh.rajashekhara,
	hch, jejb, joseph.szczypek, POSWALD
  Cc: linux-scsi

On Fri, 2020-07-31 at 16:01 -0500, Don Brace wrote:
> These patches are based on Linus's tree
> 
> The changes are:
> smartpqi-identify-physical-devices-without-issuing-INQUIRY
>  - eliminate sending INQUIRYs to physical devices
> smartpqi-add-id-support-for-smartRAID-3152-8i
>  - add support for a new controller
> smartpqi-update-logical-volume-size-after-expansion
>  - update volume size in OS after expansion.
> smartpqi-avoid-crashing-kernel-for-controller-issues
>  - remove BUG calls for rare cases when controller returns
>    bad responses.
> smartpqi-support-device-deletion-via-sysfs
>  - handle device removal using sysfs file
>    /sys/block/sd<X>/device/delete where X is device name is a, b, ...
> smartpqi-add-RAID-bypass-counter
>  - aid to identify when RAID bypass is in use.
> smartpqi-bump-version-to-1.2.16-010
> 
> ---
> 
> Don Brace (1):
>       smartpqi: bump version to 1.2.16-010
> 
> Kevin Barnett (4):
>       smartpqi identify physical devices without issuing INQUIRY
>       smartpqi: avoid crashing kernel for controller issues
>       smartpqi: support device deletion via sysfs
>       smartpqi: add RAID bypass counter
> 
> Mahesh Rajashekhara (2):
>       smartpqi: add id support for SmartRAID 3152-8i
>       smartpqi: update logical volume size after expansion
> 
> 
>  drivers/scsi/smartpqi/smartpqi.h      |   4 +-
>  drivers/scsi/smartpqi/smartpqi_init.c | 301 ++++++++++++++++------
> ----
>  2 files changed, 189 insertions(+), 116 deletions(-)
> 
> --

For this series:
Reviewed-by: Martin Wilck <mwilck@suse.com>

Nitpick: It'd be nice to the separate functional changes from
whitespace and formatting fixes for easier review.



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

* Re: [PATCH 0/7] smartpqi updates
  2020-07-31 21:01 Don Brace
  2020-08-12 20:03 ` Martin Wilck
@ 2020-08-13  2:50 ` Martin K. Petersen
  2020-08-18  3:11 ` Martin K. Petersen
  2 siblings, 0 replies; 17+ messages in thread
From: Martin K. Petersen @ 2020-08-13  2:50 UTC (permalink / raw)
  To: Don Brace
  Cc: Kevin.Barnett, scott.teel, Justin.Lindley, scott.benesh,
	bader.alisaleh, gerry.morong, mahesh.rajashekhara, hch, jejb,
	joseph.szczypek, POSWALD, linux-scsi


Don,

> Don Brace (1):
>       smartpqi: bump version to 1.2.16-010

Applied to my staging tree. You'll get a formal merge message once 5.10
opens.

Please revisit Documentation/process/submitting-patches.rst section 2
about how to write commit messages.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 0/7] smartpqi updates
  2020-07-31 21:01 Don Brace
  2020-08-12 20:03 ` Martin Wilck
  2020-08-13  2:50 ` Martin K. Petersen
@ 2020-08-18  3:11 ` Martin K. Petersen
  2 siblings, 0 replies; 17+ messages in thread
From: Martin K. Petersen @ 2020-08-18  3:11 UTC (permalink / raw)
  To: Kevin.Barnett, hch, jejb, joseph.szczypek, Justin.Lindley,
	bader.alisaleh, scott.teel, gerry.morong, POSWALD, Don Brace,
	scott.benesh, mahesh.rajashekhara
  Cc: Martin K . Petersen, linux-scsi

On Fri, 31 Jul 2020 16:01:05 -0500, Don Brace wrote:

> These patches are based on Linus's tree
> 
> The changes are:
> smartpqi-identify-physical-devices-without-issuing-INQUIRY
>  - eliminate sending INQUIRYs to physical devices
> smartpqi-add-id-support-for-smartRAID-3152-8i
>  - add support for a new controller
> smartpqi-update-logical-volume-size-after-expansion
>  - update volume size in OS after expansion.
> smartpqi-avoid-crashing-kernel-for-controller-issues
>  - remove BUG calls for rare cases when controller returns
>    bad responses.
> smartpqi-support-device-deletion-via-sysfs
>  - handle device removal using sysfs file
>    /sys/block/sd<X>/device/delete where X is device name is a, b, ...
> smartpqi-add-RAID-bypass-counter
>  - aid to identify when RAID bypass is in use.
> smartpqi-bump-version-to-1.2.16-010

Applied to 5.10/scsi-queue, thanks!

[1/7] scsi: smartpqi: Identify physical devices without issuing INQUIRY
      https://git.kernel.org/mkp/scsi/c/79d98a09024f
[2/7] scsi: smartpqi: Add id support for SmartRAID 3152-8i
      https://git.kernel.org/mkp/scsi/c/0451304e8e8e
[3/7] scsi: smartpqi: Update logical volume size after expansion
      https://git.kernel.org/mkp/scsi/c/9e0ab6e5b185
[4/7] scsi: smartpqi: Avoid crashing kernel for controller issues
      https://git.kernel.org/mkp/scsi/c/d4f7505924ca
[5/7] scsi: smartpqi: Support device deletion via sysfs
      https://git.kernel.org/mkp/scsi/c/a5a3cb83cf3a
[6/7] scsi: smartpqi: Add RAID bypass counter
      https://git.kernel.org/mkp/scsi/c/bdd6dac631bc
[7/7] scsi: smartpqi: Bump version to 1.2.16-010
      https://git.kernel.org/mkp/scsi/c/441c5e632c1b

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* [PATCH 0/7] smartpqi updates
@ 2024-08-27 18:54 Don Brace
  2024-08-29  2:18 ` Martin K. Petersen
  0 siblings, 1 reply; 17+ messages in thread
From: Don Brace @ 2024-08-27 18:54 UTC (permalink / raw)
  To: don.brace, scott.teel, Justin.Lindley, scott.benesh, gerry.morong,
	mahesh.rajashekhara, mike.mcgowen, murthy.bhat, kumar.meiyappan,
	jeremy.reeves, david.strahan, hch, James Bottomley,
	Martin Petersen, joseph.szczypek, POSWALD
  Cc: linux-scsi

These patches are based on Martin Petersen's 6.12/scsi-queue tree
  https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
  6.12/scsi-queue

There are two functional changes:
    smartpqi-add-fw-log-to-kdump
    smartpqi-add-counter-for-parity-write-stream-requests

There are three minor bug fixes:
    smartpqi-fix-stream-detection
    smartpqi-fix-rare-system-hang-during-LUN-reset
    smartpqi-fix-volume-size-updates

The other two patches add PCI-IDs for new controllers and change the
driver version.

This set of changes consists of:
* smartpqi-add-fw-log-to-kdump

  During a kdump, the driver tells the controller to copy its logging information to some
  pre-allocated buffers that can be analyzed later.

  This is a "feature" driven capability and is backward compatible with existing controller FW.

  This patch renames some prefixes for OFA (Online-Firmware Activation ofa_*) buffers
  to host_memory_*. So, not a lot of actual functional changes to smartpqi_init.c,
  mainly determining the memory size allocation.

  We added a function to notify the controller to copy debug data into host memory before
  continuing kdump.

  Most of the functional changes are in smartpqi_sis.c where the actual handshaking is done.

* smartpqi-fix-stream-detection

  Correct some false write-stream detections. The data structure used to check for write-streams
  was not initialized to all 0's causing some false write stream detections. The driver sends
  down streamed requests to the raid engine instead of using AIO bypass for some extra performance.
  (Potential full-stripe write verses Read Modify Write).

  False detections have not caused any data corruption.
  Found by internal testing. No known externally reported bugs.

* smartpqi-add-counter-for-parity-write-stream-requests

  Adding some counters for raid_bypass and write streams. These two counters are related
  because write stream detection is only checked if an I/O request is eligible for bypass (AIO).

  The bypass counter (raid_bypass_cnt) was moved into a common structure (pqi_raid_io_stats) and
  changed to type __percpu. The write stream counter is (write_stream_cnt) has been added to
  this same structure.

  These counters are __percpu counters for performance. We added a sysfs entry to show the
  write stream count. The raid bypass counter sysfs entry already exists.

  Useful for checking streaming writes. The change in the sysfs entry write_stream_cnt can be
  checked during AIO eligible write operations.

* smartpqi-add-new-controller-PCI-IDs

  Adding support for new controller HW.
  No functional changes.

* smartpqi-fix-rare-system-hang-during-LUN-reset

  We found a rare race condition that can occur during a LUN reset. We were not emptying
  our internal queue completely.

  There have been some rare conditions where our internal request queue has requests for
  multiple LUNs and a reset comes in for one of the LUNs. The driver waits for this internal
  queue to empty. We were only clearing out the requests for the LUN being reset so the
  request queue was never empty causing a hang.

  The Fix:
     For all requests in our internal request queue:
        Complete requests with DID_RESET for queued requests for the device undergoing a reset.
        Complete requests with DID_REQUEUE for all other queued requests.

  Found by internal testing. No known externally reported bugs.

* smartpqi-fix-volume-size-updates

  The current code only checks for a size change if there is also a queue depth change.
  We are separating the check for queue depth and the size changes.

  Found by internal testing. No known bugs were filed.

* smartpqi-update-version-to-2.1.30-031
  No functional changes.

---

David Strahan (1):
  smartpqi: add new controller PCI IDs

Don Brace (2):
  smartpqi: fix volume size updates
  smartpqi: update driver version to 2.1.30-031

Mahesh Rajashekhara (2):
  smartpqi: correct stream detection
  smartpqi: add counter for parity write stream requests

Murthy Bhat (2):
  smartpqi: Add fw log to kdump
  smartpqi: fix rare system hang during LUN reset

 drivers/scsi/smartpqi/smartpqi.h      |  39 ++-
 drivers/scsi/smartpqi/smartpqi_init.c | 352 +++++++++++++++++---------
 drivers/scsi/smartpqi/smartpqi_sis.c  |  60 +++++
 drivers/scsi/smartpqi/smartpqi_sis.h  |   3 +
 4 files changed, 322 insertions(+), 132 deletions(-)

-- 
2.46.0.421.g159f2d50e7


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

* Re: [PATCH 0/7] smartpqi updates
  2024-08-27 18:54 Don Brace
@ 2024-08-29  2:18 ` Martin K. Petersen
  0 siblings, 0 replies; 17+ messages in thread
From: Martin K. Petersen @ 2024-08-29  2:18 UTC (permalink / raw)
  To: Don Brace
  Cc: scott.teel, Justin.Lindley, scott.benesh, gerry.morong,
	mahesh.rajashekhara, mike.mcgowen, murthy.bhat, kumar.meiyappan,
	jeremy.reeves, david.strahan, hch, James Bottomley,
	Martin Petersen, joseph.szczypek, POSWALD, linux-scsi


Don,

> These patches are based on Martin Petersen's 6.12/scsi-queue tree
>   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
>   6.12/scsi-queue

Applied to 6.12/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2024-08-29  2:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 18:46 [PATCH 0/7] smartpqi updates Don Brace
2017-08-10 18:46 ` [PATCH 1/7] smartpqi: add pqi reset quiesce support Don Brace
2017-08-17  3:44   ` James Bottomley
2017-08-17 15:15     ` Don Brace
2017-08-10 18:46 ` [PATCH 2/7] smartpqi: enhance BMIC cache flush Don Brace
2017-08-10 18:46 ` [PATCH 3/7] smartpqi: update pqi passthru ioctl Don Brace
2017-08-10 18:46 ` [PATCH 4/7] smartpqi: cleanup doorbell register usage Don Brace
2017-08-10 18:47 ` [PATCH 5/7] smartpqi: update kexec and power down support Don Brace
2017-08-10 18:47 ` [PATCH 6/7] smartpqi: add in new controller ids Don Brace
2017-08-10 18:47 ` [PATCH 7/7] smartpqi: change driver version to 1.1.2-125 Don Brace
2017-08-11  0:00 ` [PATCH 0/7] smartpqi updates Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2020-07-31 21:01 Don Brace
2020-08-12 20:03 ` Martin Wilck
2020-08-13  2:50 ` Martin K. Petersen
2020-08-18  3:11 ` Martin K. Petersen
2024-08-27 18:54 Don Brace
2024-08-29  2:18 ` Martin K. Petersen

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.