All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] pm80xx updates
@ 2021-03-24 17:03 Viswas G
  2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

This patch set include some bug fixes and 
enhancementments for pm80xx driver.

Chnges from v2:
	- for sysfs attribute patches
		Used sysfs_emit instead of sprintf for sysfs attribute patches.
		Removed debug message for sysfs attribute patches.
	- For "Reset PI and CI memory during re-initialize" patch
		Improved commit message.


Ruksar Devadi (1):
  pm80xx: Completing pending IO after fatal error

Vishakha Channapattan (4):
  pm80xx: Add sysfs attribute to check mpi state
  pm80xx: Add sysfs attribute to track RAAE count
  pm80xx: Add sysfs attribute to track iop0 count
  pm80xx: Add sysfs attribute to track iop1 count

Viswas G (2):
  pm80xx: Reset PI and CI memory during re-initialize
  pm80xx: remove global lock from outbound queue processing

 drivers/scsi/pm8001/pm8001_ctl.c  | 107 +++++++++++++++++++++++++++++++++++++-
 drivers/scsi/pm8001/pm8001_hwi.c  |  68 +++++++++++++++++++++---
 drivers/scsi/pm8001/pm8001_hwi.h  |   1 +
 drivers/scsi/pm8001/pm8001_init.c |   9 ++--
 drivers/scsi/pm8001/pm8001_sas.c  |   2 +-
 drivers/scsi/pm8001/pm8001_sas.h  |   2 +
 drivers/scsi/pm8001/pm80xx_hwi.c  |   7 ++-
 drivers/scsi/pm8001/pm80xx_hwi.h  |   1 +
 8 files changed, 184 insertions(+), 13 deletions(-)

-- 
2.16.3


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

* [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state
  2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
@ 2021-03-24 17:03 ` Viswas G
  2021-03-24 20:04     ` kernel test robot
                     ` (3 more replies)
  2021-03-24 17:03 ` [PATCH v2 2/7] pm80xx: Add sysfs attribute to track RAAE count Viswas G
                   ` (5 subsequent siblings)
  6 siblings, 4 replies; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

From: Vishakha Channapattan <vishakhavc@google.com>

A new sysfs variable 'ctl_mpi_state' is being introduced to
check the state of mpi.

Tested: Using 'ctl_mpi_state' sysfs variable we check the mpi state
mvae14:~# cat /sys/class/scsi_host/host*/ctl_mpi_state
MPI-S=MPI is successfully initialized   HMI_ERR=0
MPI-S=MPI is successfully initialized   HMI_ERR=0

Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Signed-off-by: Radha Ramachandran <radha@google.com>
---
 drivers/scsi/pm8001/pm8001_ctl.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index 12035baf0997..ce4846b1377c 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -41,6 +41,7 @@
 #include <linux/slab.h>
 #include "pm8001_sas.h"
 #include "pm8001_ctl.h"
+#include "pm8001_chips.h"
 
 /* scsi host attributes */
 
@@ -883,9 +884,40 @@ static ssize_t pm8001_show_update_fw(struct device *cdev,
 			flash_error_table[i].err_code,
 			flash_error_table[i].reason);
 }
-
 static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP,
 	pm8001_show_update_fw, pm8001_store_update_fw);
+
+/**
+ * ctl_mpi_state_show - controller MPI state check
+ * @cdev: pointer to embedded class device
+ * @buf: the buffer returned
+ *
+ * A sysfs 'read-only' shost attribute.
+ */
+
+char mpiStateText[][80] = {
+	"MPI is not initialized",
+	"MPI is successfully initialized",
+	"MPI termination is in progress",
+	"MPI initialization failed with error in [31:16]"
+};
+
+static ssize_t ctl_mpi_state_show(struct device *cdev,
+		struct device_attribute *attr, char *buf)
+{
+	struct Scsi_Host *shost = class_to_shost(cdev);
+	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
+	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
+	unsigned int mpidw0;
+	int c;
+
+	mpidw0 = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 0);
+	c = sysfs_emit(buf, "MPI-S=%s\t HMI_ERR=%x\n", mpiStateText[mpidw0 & 0x0003],
+			((mpidw0 & 0xff00) >> 16));
+	return c;
+}
+static DEVICE_ATTR_RO(ctl_mpi_state);
+
 struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_interface_rev,
 	&dev_attr_controller_fatal_error,
@@ -909,6 +941,7 @@ struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_ob_log,
 	&dev_attr_ila_version,
 	&dev_attr_inc_fw_ver,
+	&dev_attr_ctl_mpi_state,
 	NULL,
 };
 
-- 
2.16.3


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

* [PATCH v2 2/7] pm80xx: Add sysfs attribute to track RAAE count
  2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
  2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
@ 2021-03-24 17:03 ` Viswas G
  2021-03-25  4:49   ` Jinpu Wang
  2021-03-24 17:03 ` [PATCH v2 3/7] pm80xx: Add sysfs attribute to track iop0 count Viswas G
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

From: Vishakha Channapattan <vishakhavc@google.com>

A new sysfs variable 'ctl_raae_count' is being introduced that tells if
the controller is alive by indicating controller ticks. If on subsequent
run we see the ticks changing in RAAE count that indicates that
controller is not dead.

Tested: Using 'ctl_raae_count' sysfs variable we can see ticks
incrementing
mvae14:~# cat  /sys/class/scsi_host/host*/ctl_raae_count
0x00002245
0x00002253
0x0000225e

Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Signed-off-by: Radha Ramachandran <radha@google.com>
---
 drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index ce4846b1377c..98e5b47b9bb7 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -918,6 +918,29 @@ static ssize_t ctl_mpi_state_show(struct device *cdev,
 }
 static DEVICE_ATTR_RO(ctl_mpi_state);
 
+/**
+ * ctl_raae_count_show - controller raae count check
+ * @cdev: pointer to embedded class device
+ * @buf: the buffer returned
+ *
+ * A sysfs 'read-only' shost attribute.
+ */
+
+static ssize_t ctl_raae_count_show(struct device *cdev,
+		struct device_attribute *attr, char *buf)
+{
+	struct Scsi_Host *shost = class_to_shost(cdev);
+	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
+	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
+	unsigned int raaecnt;
+	int c;
+
+	raaecnt = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 12);
+	c = sysfs_emit(buf, "0x%08x\n", raaecnt);
+	return c;
+}
+static DEVICE_ATTR_RO(ctl_raae_count);
+
 struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_interface_rev,
 	&dev_attr_controller_fatal_error,
@@ -942,6 +965,7 @@ struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_ila_version,
 	&dev_attr_inc_fw_ver,
 	&dev_attr_ctl_mpi_state,
+	&dev_attr_ctl_raae_count,
 	NULL,
 };
 
-- 
2.16.3


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

* [PATCH v2 3/7] pm80xx: Add sysfs attribute to track iop0 count
  2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
  2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
  2021-03-24 17:03 ` [PATCH v2 2/7] pm80xx: Add sysfs attribute to track RAAE count Viswas G
@ 2021-03-24 17:03 ` Viswas G
  2021-03-25  4:48   ` Jinpu Wang
  2021-03-24 17:03 ` [PATCH v2 4/7] pm80xx: Add sysfs attribute to track iop1 count Viswas G
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

From: Vishakha Channapattan <vishakhavc@google.com>

A new sysfs variable 'ctl_iop0_count' is being introduced that tells if
the controller is alive by indicating controller ticks. If on subsequent
run we see the ticks changing that indicates that controller is not
dead.

Tested: Using 'ctl_iop0_count' sysfs variable we can see ticks
incrementing
mvae14:~# cat  /sys/class/scsi_host/host*/ctl_iop0_count
0x000000a3
0x000001db
0x000001e4
0x000001e7

Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Signed-off-by: Radha Ramachandran <radha@google.com>
---
 drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index 98e5b47b9bb7..b8170da49112 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -941,6 +941,29 @@ static ssize_t ctl_raae_count_show(struct device *cdev,
 }
 static DEVICE_ATTR_RO(ctl_raae_count);
 
+/**
+ * ctl_iop0_count_show - controller iop0 count check
+ * @cdev: pointer to embedded class device
+ * @buf: the buffer returned
+ *
+ * A sysfs 'read-only' shost attribute.
+ */
+
+static ssize_t ctl_iop0_count_show(struct device *cdev,
+		struct device_attribute *attr, char *buf)
+{
+	struct Scsi_Host *shost = class_to_shost(cdev);
+	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
+	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
+	unsigned int iop0cnt;
+	int c;
+
+	iop0cnt = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 16);
+	c = sysfs_emit(buf, "0x%08x\n", iop0cnt);
+	return c;
+}
+static DEVICE_ATTR_RO(ctl_iop0_count);
+
 struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_interface_rev,
 	&dev_attr_controller_fatal_error,
@@ -966,6 +989,7 @@ struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_inc_fw_ver,
 	&dev_attr_ctl_mpi_state,
 	&dev_attr_ctl_raae_count,
+	&dev_attr_ctl_iop0_count,
 	NULL,
 };
 
-- 
2.16.3


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

* [PATCH v2 4/7] pm80xx: Add sysfs attribute to track iop1 count
  2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
                   ` (2 preceding siblings ...)
  2021-03-24 17:03 ` [PATCH v2 3/7] pm80xx: Add sysfs attribute to track iop0 count Viswas G
@ 2021-03-24 17:03 ` Viswas G
  2021-03-25  4:49   ` Jinpu Wang
  2021-03-24 17:03 ` [PATCH v2 5/7] pm80xx: Completing pending IO after fatal error Viswas G
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

From: Vishakha Channapattan <vishakhavc@google.com>

A new sysfs variable 'ctl_iop1_count' is being introduced that tells if
the controller is alive by indicating controller ticks. If on subsequent
run we see the ticks changing that indicates that controller is not
dead.

Tested: Using 'ctl_iop1_count' sysfs variable we can see ticks
incrementing
mvae14:~# cat  /sys/class/scsi_host/host*/ctl_iop1_count
0x00000069
0x0000006b
0x0000006d
0x00000072

Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Signed-off-by: Radha Ramachandran <radha@google.com>
---
 drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index b8170da49112..78d5f573eac8 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -964,6 +964,29 @@ static ssize_t ctl_iop0_count_show(struct device *cdev,
 }
 static DEVICE_ATTR_RO(ctl_iop0_count);
 
+/**
+ * ctl_iop1_count_show - controller iop1 count check
+ * @cdev: pointer to embedded class device
+ * @buf: the buffer returned
+ *
+ * A sysfs 'read-only' shost attribute.
+ */
+
+static ssize_t ctl_iop1_count_show(struct device *cdev,
+		struct device_attribute *attr, char *buf)
+{
+	struct Scsi_Host *shost = class_to_shost(cdev);
+	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
+	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
+	unsigned int iop1cnt;
+	int c;
+
+	iop1cnt = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 20);
+	c = sysfs_emit(buf, "0x%08x\n", iop1cnt);
+	return c;
+}
+static DEVICE_ATTR_RO(ctl_iop1_count);
+
 struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_interface_rev,
 	&dev_attr_controller_fatal_error,
@@ -990,6 +1013,7 @@ struct device_attribute *pm8001_host_attrs[] = {
 	&dev_attr_ctl_mpi_state,
 	&dev_attr_ctl_raae_count,
 	&dev_attr_ctl_iop0_count,
+	&dev_attr_ctl_iop1_count,
 	NULL,
 };
 
-- 
2.16.3


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

* [PATCH v2 5/7] pm80xx: Completing pending IO after fatal error
  2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
                   ` (3 preceding siblings ...)
  2021-03-24 17:03 ` [PATCH v2 4/7] pm80xx: Add sysfs attribute to track iop1 count Viswas G
@ 2021-03-24 17:03 ` Viswas G
  2021-03-24 17:03 ` [PATCH v2 6/7] pm80xx: Reset PI and CI memory during re-initialize Viswas G
  2021-03-24 17:03 ` [PATCH v2 7/7] pm80xx: remove global lock from outbound queue processing Viswas G
  6 siblings, 0 replies; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

From: Ruksar Devadi <Ruksar.devadi@microchip.com>

When controller runs into fatal error, IOs get stuck with no response,
handler event is defined to complete the pending IOs
(SAS task and internal task) and also perform the cleanup for the
drives.

Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/scsi/pm8001/pm8001_hwi.c | 66 ++++++++++++++++++++++++++++++++++++----
 drivers/scsi/pm8001/pm8001_hwi.h |  1 +
 drivers/scsi/pm8001/pm8001_sas.c |  2 +-
 drivers/scsi/pm8001/pm8001_sas.h |  1 +
 drivers/scsi/pm8001/pm80xx_hwi.c |  1 +
 drivers/scsi/pm8001/pm80xx_hwi.h |  1 +
 6 files changed, 65 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 49bf2f70a470..4e0ce044ac69 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -1499,12 +1499,14 @@ void pm8001_work_fn(struct work_struct *work)
 	 * was cancelled. This nullification happens when the device
 	 * goes away.
 	 */
-	pm8001_dev = pw->data; /* Most stash device structure */
-	if ((pm8001_dev == NULL)
-	 || ((pw->handler != IO_XFER_ERROR_BREAK)
-	  && (pm8001_dev->dev_type == SAS_PHY_UNUSED))) {
-		kfree(pw);
-		return;
+	if (pw->handler != IO_FATAL_ERROR) {
+		pm8001_dev = pw->data; /* Most stash device structure */
+		if ((pm8001_dev == NULL)
+		 || ((pw->handler != IO_XFER_ERROR_BREAK)
+			 && (pm8001_dev->dev_type == SAS_PHY_UNUSED))) {
+			kfree(pw);
+			return;
+		}
 	}
 
 	switch (pw->handler) {
@@ -1668,6 +1670,58 @@ void pm8001_work_fn(struct work_struct *work)
 		dev = pm8001_dev->sas_device;
 		pm8001_I_T_nexus_reset(dev);
 		break;
+	case IO_FATAL_ERROR:
+	{
+		struct pm8001_hba_info *pm8001_ha = pw->pm8001_ha;
+		struct pm8001_ccb_info *ccb;
+		struct task_status_struct *ts;
+		struct sas_task *task;
+		int i;
+		u32 tag, device_id;
+
+		for (i = 0; ccb = NULL, i < PM8001_MAX_CCB; i++) {
+			ccb = &pm8001_ha->ccb_info[i];
+			task = ccb->task;
+			ts = &task->task_status;
+			tag = ccb->ccb_tag;
+			/* check if tag is NULL */
+			if (!tag) {
+				pm8001_dbg(pm8001_ha, FAIL,
+					"tag Null\n");
+				continue;
+			}
+			if (task != NULL) {
+				dev = task->dev;
+				if (!dev) {
+					pm8001_dbg(pm8001_ha, FAIL,
+						"dev is NULL\n");
+					continue;
+				}
+				/*complete sas task and update to top layer */
+				pm8001_ccb_task_free(pm8001_ha, task, ccb, tag);
+				ts->resp = SAS_TASK_COMPLETE;
+				task->task_done(task);
+			} else if (tag != 0xFFFFFFFF) {
+				/* complete the internal commands/non-sas task */
+				pm8001_dev = ccb->device;
+				if (pm8001_dev->dcompletion) {
+					complete(pm8001_dev->dcompletion);
+					pm8001_dev->dcompletion = NULL;
+				}
+				complete(pm8001_ha->nvmd_completion);
+				pm8001_tag_free(pm8001_ha, tag);
+			}
+		}
+		/* Deregsiter all the device ids  */
+		for (i = 0; i < PM8001_MAX_DEVICES; i++) {
+			pm8001_dev = &pm8001_ha->devices[i];
+			device_id = pm8001_dev->device_id;
+			if (device_id) {
+				PM8001_CHIP_DISP->dereg_dev_req(pm8001_ha, device_id);
+				pm8001_free_dev(pm8001_dev);
+			}
+		}
+	}	break;
 	}
 	kfree(pw);
 }
diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h
index 6d91e2446542..d1f3aa93325b 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.h
+++ b/drivers/scsi/pm8001/pm8001_hwi.h
@@ -805,6 +805,7 @@ struct set_dev_state_resp {
 #define IO_ABORT_IN_PROGRESS				0x40
 #define IO_ABORT_DELAYED				0x41
 #define IO_INVALID_LENGTH				0x42
+#define IO_FATAL_ERROR					0x51
 
 /* WARNING: This error code must always be the last number.
  * If you add error code, modify this code also
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index a98d4496ff8b..edec599ac641 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -590,7 +590,7 @@ struct pm8001_device *pm8001_find_dev(struct pm8001_hba_info *pm8001_ha,
 	return NULL;
 }
 
-static void pm8001_free_dev(struct pm8001_device *pm8001_dev)
+void pm8001_free_dev(struct pm8001_device *pm8001_dev)
 {
 	u32 id = pm8001_dev->id;
 	memset(pm8001_dev, 0, sizeof(*pm8001_dev));
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index 039ed91e9841..36cd37c8c29a 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -727,6 +727,7 @@ ssize_t pm80xx_get_non_fatal_dump(struct device *cdev,
 		struct device_attribute *attr, char *buf);
 ssize_t pm8001_get_gsm_dump(struct device *cdev, u32, char *buf);
 int pm80xx_fatal_errors(struct pm8001_hba_info *pm8001_ha);
+void pm8001_free_dev(struct pm8001_device *pm8001_dev);
 /* ctl shared API */
 extern struct device_attribute *pm8001_host_attrs[];
 
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 84315560e8e1..1aa3a499c85a 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -4126,6 +4126,7 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec)
 			pm8001_dbg(pm8001_ha, FAIL,
 				   "Firmware Fatal error! Regval:0x%x\n",
 				   regval);
+			pm8001_handle_event(pm8001_ha, NULL, IO_FATAL_ERROR);
 			print_scratchpad_registers(pm8001_ha);
 			return ret;
 		}
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
index 2c8e85cfdbc4..c7e5d93bea92 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.h
+++ b/drivers/scsi/pm8001/pm80xx_hwi.h
@@ -1272,6 +1272,7 @@ typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;
 #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE	0x47
 #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED	0x48
 #define IO_DS_INVALID					0x49
+#define IO_FATAL_ERROR					0x51
 /* WARNING: the value is not contiguous from here */
 #define IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR	0x52
 #define IO_XFER_DMA_ACTIVATE_TIMEOUT		0x53
-- 
2.16.3


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

* [PATCH v2 6/7] pm80xx: Reset PI and CI memory during re-initialize
  2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
                   ` (4 preceding siblings ...)
  2021-03-24 17:03 ` [PATCH v2 5/7] pm80xx: Completing pending IO after fatal error Viswas G
@ 2021-03-24 17:03 ` Viswas G
  2021-03-24 17:03 ` [PATCH v2 7/7] pm80xx: remove global lock from outbound queue processing Viswas G
  6 siblings, 0 replies; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

Producer index(PI) outbound queue and consumer index(CI)
for Outbound queue are in DMA memory. During resume(),
the stale PI and CI Values will leads to unexpected behavior.
These values should be reset to 0 during driver reinitialization.

Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/scsi/pm8001/pm8001_hwi.c | 2 ++
 drivers/scsi/pm8001/pm80xx_hwi.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 4e0ce044ac69..783149b8b127 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -240,6 +240,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 			pm8001_ha->memoryMap.region[ci_offset + i].phys_addr_lo;
 		pm8001_ha->inbnd_q_tbl[i].ci_virt		=
 			pm8001_ha->memoryMap.region[ci_offset + i].virt_ptr;
+		pm8001_write_32(pm8001_ha->inbnd_q_tbl[i].ci_virt, 0, 0);
 		offsetib = i * 0x20;
 		pm8001_ha->inbnd_q_tbl[i].pi_pci_bar		=
 			get_pci_bar_index(pm8001_mr32(addressib,
@@ -268,6 +269,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 			0 | (10 << 16) | (i << 24);
 		pm8001_ha->outbnd_q_tbl[i].pi_virt		=
 			pm8001_ha->memoryMap.region[pi_offset + i].virt_ptr;
+		pm8001_write_32(pm8001_ha->outbnd_q_tbl[i].pi_virt, 0, 0);
 		offsetob = i * 0x24;
 		pm8001_ha->outbnd_q_tbl[i].ci_pci_bar		=
 			get_pci_bar_index(pm8001_mr32(addressob,
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 1aa3a499c85a..0f2c57e054ac 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -787,6 +787,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 			pm8001_ha->memoryMap.region[ci_offset + i].phys_addr_lo;
 		pm8001_ha->inbnd_q_tbl[i].ci_virt		=
 			pm8001_ha->memoryMap.region[ci_offset + i].virt_ptr;
+		pm8001_write_32(pm8001_ha->inbnd_q_tbl[i].ci_virt, 0, 0);
 		offsetib = i * 0x20;
 		pm8001_ha->inbnd_q_tbl[i].pi_pci_bar		=
 			get_pci_bar_index(pm8001_mr32(addressib,
@@ -820,6 +821,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 		pm8001_ha->outbnd_q_tbl[i].interrup_vec_cnt_delay = (i << 24);
 		pm8001_ha->outbnd_q_tbl[i].pi_virt		=
 			pm8001_ha->memoryMap.region[pi_offset + i].virt_ptr;
+		pm8001_write_32(pm8001_ha->outbnd_q_tbl[i].pi_virt, 0, 0);
 		offsetob = i * 0x24;
 		pm8001_ha->outbnd_q_tbl[i].ci_pci_bar		=
 			get_pci_bar_index(pm8001_mr32(addressob,
-- 
2.16.3


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

* [PATCH v2 7/7] pm80xx: remove global lock from outbound queue processing
  2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
                   ` (5 preceding siblings ...)
  2021-03-24 17:03 ` [PATCH v2 6/7] pm80xx: Reset PI and CI memory during re-initialize Viswas G
@ 2021-03-24 17:03 ` Viswas G
  6 siblings, 0 replies; 19+ messages in thread
From: Viswas G @ 2021-03-24 17:03 UTC (permalink / raw)
  To: linux-scsi
  Cc: Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi, vishakhavc,
	radha, jinpu.wang, Ashokkumar N, John Garry

Introduced spin lock for outbound queue. With this, driver need not
acquire hba global lock for outbound queue processing.

Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
---
 drivers/scsi/pm8001/pm8001_init.c | 9 ++++++---
 drivers/scsi/pm8001/pm8001_sas.h  | 1 +
 drivers/scsi/pm8001/pm80xx_hwi.c  | 4 ++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index bd626ef876da..a3c8fb9a885f 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -267,7 +267,8 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
 {
 	int i, count = 0, rc = 0;
 	u32 ci_offset, ib_offset, ob_offset, pi_offset;
-	struct inbound_queue_table *circularQ;
+	struct inbound_queue_table *ibq;
+	struct outbound_queue_table *obq;
 
 	spin_lock_init(&pm8001_ha->lock);
 	spin_lock_init(&pm8001_ha->bitmap_lock);
@@ -315,8 +316,8 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
 	pm8001_ha->memoryMap.region[IOP].alignment = 32;
 
 	for (i = 0; i < count; i++) {
-		circularQ = &pm8001_ha->inbnd_q_tbl[i];
-		spin_lock_init(&circularQ->iq_lock);
+		ibq = &pm8001_ha->inbnd_q_tbl[i];
+		spin_lock_init(&ibq->iq_lock);
 		/* MPI Memory region 3 for consumer Index of inbound queues */
 		pm8001_ha->memoryMap.region[ci_offset+i].num_elements = 1;
 		pm8001_ha->memoryMap.region[ci_offset+i].element_size = 4;
@@ -345,6 +346,8 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
 	}
 
 	for (i = 0; i < count; i++) {
+		obq = &pm8001_ha->outbnd_q_tbl[i];
+		spin_lock_init(&obq->oq_lock);
 		/* MPI Memory region 4 for producer Index of outbound queues */
 		pm8001_ha->memoryMap.region[pi_offset+i].num_elements = 1;
 		pm8001_ha->memoryMap.region[pi_offset+i].element_size = 4;
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index 36cd37c8c29a..f835557ee354 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -457,6 +457,7 @@ struct outbound_queue_table {
 	u32			dinterrup_to_pci_offset;
 	__le32			producer_index;
 	u32			consumer_idx;
+	spinlock_t		oq_lock;
 };
 struct pm8001_hba_memspace {
 	void __iomem  		*memvirtaddr;
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 0f2c57e054ac..f1276baebe1d 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -4133,8 +4133,8 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec)
 			return ret;
 		}
 	}
-	spin_lock_irqsave(&pm8001_ha->lock, flags);
 	circularQ = &pm8001_ha->outbnd_q_tbl[vec];
+	spin_lock_irqsave(&circularQ->oq_lock, flags);
 	do {
 		/* spurious interrupt during setup if kexec-ing and
 		 * driver doing a doorbell access w/ the pre-kexec oq
@@ -4160,7 +4160,7 @@ static int process_oq(struct pm8001_hba_info *pm8001_ha, u8 vec)
 				break;
 		}
 	} while (1);
-	spin_unlock_irqrestore(&pm8001_ha->lock, flags);
+	spin_unlock_irqrestore(&circularQ->oq_lock, flags);
 	return ret;
 }
 
-- 
2.16.3


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

* Re: [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state
  2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
@ 2021-03-24 20:04     ` kernel test robot
  2021-03-24 20:04     ` kernel test robot
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-03-24 20:04 UTC (permalink / raw)
  To: Viswas G, linux-scsi
  Cc: kbuild-all, Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi,
	vishakhavc, radha, jinpu.wang, Ashokkumar N, John Garry

[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]

Hi Viswas,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.12-rc4 next-20210324]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Viswas-G/pm80xx-updates/20210325-005709
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-randconfig-s021-20210324 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-277-gc089cd2d-dirty
        # https://github.com/0day-ci/linux/commit/47c563cdbc763e6fdd8e08f49e1ea5066bbf3c9b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Viswas-G/pm80xx-updates/20210325-005709
        git checkout 47c563cdbc763e6fdd8e08f49e1ea5066bbf3c9b
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
>> drivers/scsi/pm8001/pm8001_ctl.c:898:6: sparse: sparse: symbol 'mpiStateText' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41538 bytes --]

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

* Re: [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state
@ 2021-03-24 20:04     ` kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-03-24 20:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2175 bytes --]

Hi Viswas,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.12-rc4 next-20210324]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Viswas-G/pm80xx-updates/20210325-005709
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-randconfig-s021-20210324 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-277-gc089cd2d-dirty
        # https://github.com/0day-ci/linux/commit/47c563cdbc763e6fdd8e08f49e1ea5066bbf3c9b
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Viswas-G/pm80xx-updates/20210325-005709
        git checkout 47c563cdbc763e6fdd8e08f49e1ea5066bbf3c9b
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
   drivers/scsi/pm8001/pm8001_ctl.c:742:33: sparse: sparse: cast to restricted __be32
>> drivers/scsi/pm8001/pm8001_ctl.c:898:6: sparse: sparse: symbol 'mpiStateText' was not declared. Should it be static?

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 41538 bytes --]

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

* [RFC PATCH] pm80xx: mpiStateText[] can be static
  2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
@ 2021-03-24 20:04     ` kernel test robot
  2021-03-24 20:04     ` kernel test robot
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-03-24 20:04 UTC (permalink / raw)
  To: Viswas G, linux-scsi
  Cc: kbuild-all, Vasanthalakshmi.Tharmarajan, Viswas.G, Ruksar.devadi,
	vishakhavc, radha, jinpu.wang, Ashokkumar N, John Garry


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 pm8001_ctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index ce4846b1377c9..f8fe919133b6e 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -895,7 +895,7 @@ static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP,
  * A sysfs 'read-only' shost attribute.
  */
 
-char mpiStateText[][80] = {
+static char mpiStateText[][80] = {
 	"MPI is not initialized",
 	"MPI is successfully initialized",
 	"MPI termination is in progress",

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

* [RFC PATCH] pm80xx: mpiStateText[] can be static
@ 2021-03-24 20:04     ` kernel test robot
  0 siblings, 0 replies; 19+ messages in thread
From: kernel test robot @ 2021-03-24 20:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]


Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
 pm8001_ctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
index ce4846b1377c9..f8fe919133b6e 100644
--- a/drivers/scsi/pm8001/pm8001_ctl.c
+++ b/drivers/scsi/pm8001/pm8001_ctl.c
@@ -895,7 +895,7 @@ static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP,
  * A sysfs 'read-only' shost attribute.
  */
 
-char mpiStateText[][80] = {
+static char mpiStateText[][80] = {
 	"MPI is not initialized",
 	"MPI is successfully initialized",
 	"MPI termination is in progress",

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

* Re: [PATCH v2 3/7] pm80xx: Add sysfs attribute to track iop0 count
  2021-03-24 17:03 ` [PATCH v2 3/7] pm80xx: Add sysfs attribute to track iop0 count Viswas G
@ 2021-03-25  4:48   ` Jinpu Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Jinpu Wang @ 2021-03-25  4:48 UTC (permalink / raw)
  To: Viswas G
  Cc: Linux SCSI Mailinglist, Vasanthalakshmi.Tharmarajan,
	Ruksar Devadi, Vishakha Channapattan, Radha Ramachandran,
	Jack Wang, Ashokkumar N, John Garry

On Wed, Mar 24, 2021 at 5:54 PM Viswas G <Viswas.G@microchip.com> wrote:
>
> From: Vishakha Channapattan <vishakhavc@google.com>
>
> A new sysfs variable 'ctl_iop0_count' is being introduced that tells if
> the controller is alive by indicating controller ticks. If on subsequent
> run we see the ticks changing that indicates that controller is not
> dead.
>
> Tested: Using 'ctl_iop0_count' sysfs variable we can see ticks
> incrementing
> mvae14:~# cat  /sys/class/scsi_host/host*/ctl_iop0_count
> 0x000000a3
> 0x000001db
> 0x000001e4
> 0x000001e7
>
> Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
> Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
> Signed-off-by: Radha Ramachandran <radha@google.com>
Looks you've addressed comments from me and John, thx!
Acked-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
> index 98e5b47b9bb7..b8170da49112 100644
> --- a/drivers/scsi/pm8001/pm8001_ctl.c
> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> @@ -941,6 +941,29 @@ static ssize_t ctl_raae_count_show(struct device *cdev,
>  }
>  static DEVICE_ATTR_RO(ctl_raae_count);
>
> +/**
> + * ctl_iop0_count_show - controller iop0 count check
> + * @cdev: pointer to embedded class device
> + * @buf: the buffer returned
> + *
> + * A sysfs 'read-only' shost attribute.
> + */
> +
> +static ssize_t ctl_iop0_count_show(struct device *cdev,
> +               struct device_attribute *attr, char *buf)
> +{
> +       struct Scsi_Host *shost = class_to_shost(cdev);
> +       struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
> +       struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
> +       unsigned int iop0cnt;
> +       int c;
> +
> +       iop0cnt = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 16);
> +       c = sysfs_emit(buf, "0x%08x\n", iop0cnt);
> +       return c;
> +}
> +static DEVICE_ATTR_RO(ctl_iop0_count);
> +
>  struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_interface_rev,
>         &dev_attr_controller_fatal_error,
> @@ -966,6 +989,7 @@ struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_inc_fw_ver,
>         &dev_attr_ctl_mpi_state,
>         &dev_attr_ctl_raae_count,
> +       &dev_attr_ctl_iop0_count,
>         NULL,
>  };
>
> --
> 2.16.3
>

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

* Re: [PATCH v2 2/7] pm80xx: Add sysfs attribute to track RAAE count
  2021-03-24 17:03 ` [PATCH v2 2/7] pm80xx: Add sysfs attribute to track RAAE count Viswas G
@ 2021-03-25  4:49   ` Jinpu Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Jinpu Wang @ 2021-03-25  4:49 UTC (permalink / raw)
  To: Viswas G
  Cc: Linux SCSI Mailinglist, Vasanthalakshmi.Tharmarajan,
	Ruksar Devadi, Vishakha Channapattan, Radha Ramachandran,
	Jack Wang, Ashokkumar N, John Garry

On Wed, Mar 24, 2021 at 5:54 PM Viswas G <Viswas.G@microchip.com> wrote:
>
> From: Vishakha Channapattan <vishakhavc@google.com>
>
> A new sysfs variable 'ctl_raae_count' is being introduced that tells if
> the controller is alive by indicating controller ticks. If on subsequent
> run we see the ticks changing in RAAE count that indicates that
> controller is not dead.
>
> Tested: Using 'ctl_raae_count' sysfs variable we can see ticks
> incrementing
> mvae14:~# cat  /sys/class/scsi_host/host*/ctl_raae_count
> 0x00002245
> 0x00002253
> 0x0000225e
>
> Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
> Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
> Signed-off-by: Radha Ramachandran <radha@google.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
> index ce4846b1377c..98e5b47b9bb7 100644
> --- a/drivers/scsi/pm8001/pm8001_ctl.c
> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> @@ -918,6 +918,29 @@ static ssize_t ctl_mpi_state_show(struct device *cdev,
>  }
>  static DEVICE_ATTR_RO(ctl_mpi_state);
>
> +/**
> + * ctl_raae_count_show - controller raae count check
> + * @cdev: pointer to embedded class device
> + * @buf: the buffer returned
> + *
> + * A sysfs 'read-only' shost attribute.
> + */
> +
> +static ssize_t ctl_raae_count_show(struct device *cdev,
> +               struct device_attribute *attr, char *buf)
> +{
> +       struct Scsi_Host *shost = class_to_shost(cdev);
> +       struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
> +       struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
> +       unsigned int raaecnt;
> +       int c;
> +
> +       raaecnt = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 12);
> +       c = sysfs_emit(buf, "0x%08x\n", raaecnt);
> +       return c;
> +}
> +static DEVICE_ATTR_RO(ctl_raae_count);
> +
>  struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_interface_rev,
>         &dev_attr_controller_fatal_error,
> @@ -942,6 +965,7 @@ struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_ila_version,
>         &dev_attr_inc_fw_ver,
>         &dev_attr_ctl_mpi_state,
> +       &dev_attr_ctl_raae_count,
>         NULL,
>  };
>
> --
> 2.16.3
>

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

* Re: [PATCH v2 4/7] pm80xx: Add sysfs attribute to track iop1 count
  2021-03-24 17:03 ` [PATCH v2 4/7] pm80xx: Add sysfs attribute to track iop1 count Viswas G
@ 2021-03-25  4:49   ` Jinpu Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Jinpu Wang @ 2021-03-25  4:49 UTC (permalink / raw)
  To: Viswas G
  Cc: Linux SCSI Mailinglist, Vasanthalakshmi.Tharmarajan,
	Ruksar Devadi, Vishakha Channapattan, Radha Ramachandran,
	Jack Wang, Ashokkumar N, John Garry

On Wed, Mar 24, 2021 at 5:54 PM Viswas G <Viswas.G@microchip.com> wrote:
>
> From: Vishakha Channapattan <vishakhavc@google.com>
>
> A new sysfs variable 'ctl_iop1_count' is being introduced that tells if
> the controller is alive by indicating controller ticks. If on subsequent
> run we see the ticks changing that indicates that controller is not
> dead.
>
> Tested: Using 'ctl_iop1_count' sysfs variable we can see ticks
> incrementing
> mvae14:~# cat  /sys/class/scsi_host/host*/ctl_iop1_count
> 0x00000069
> 0x0000006b
> 0x0000006d
> 0x00000072
>
> Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
> Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
> Signed-off-by: Radha Ramachandran <radha@google.com>
Acked-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/scsi/pm8001/pm8001_ctl.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
> index b8170da49112..78d5f573eac8 100644
> --- a/drivers/scsi/pm8001/pm8001_ctl.c
> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> @@ -964,6 +964,29 @@ static ssize_t ctl_iop0_count_show(struct device *cdev,
>  }
>  static DEVICE_ATTR_RO(ctl_iop0_count);
>
> +/**
> + * ctl_iop1_count_show - controller iop1 count check
> + * @cdev: pointer to embedded class device
> + * @buf: the buffer returned
> + *
> + * A sysfs 'read-only' shost attribute.
> + */
> +
> +static ssize_t ctl_iop1_count_show(struct device *cdev,
> +               struct device_attribute *attr, char *buf)
> +{
> +       struct Scsi_Host *shost = class_to_shost(cdev);
> +       struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
> +       struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
> +       unsigned int iop1cnt;
> +       int c;
> +
> +       iop1cnt = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 20);
> +       c = sysfs_emit(buf, "0x%08x\n", iop1cnt);
> +       return c;
> +}
> +static DEVICE_ATTR_RO(ctl_iop1_count);
> +
>  struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_interface_rev,
>         &dev_attr_controller_fatal_error,
> @@ -990,6 +1013,7 @@ struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_ctl_mpi_state,
>         &dev_attr_ctl_raae_count,
>         &dev_attr_ctl_iop0_count,
> +       &dev_attr_ctl_iop1_count,
>         NULL,
>  };
>
> --
> 2.16.3
>

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

* Re: [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state
  2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
  2021-03-24 20:04     ` kernel test robot
  2021-03-24 20:04     ` kernel test robot
@ 2021-03-25  4:55   ` Jinpu Wang
  2021-03-25  7:10     ` Dan Carpenter
  3 siblings, 0 replies; 19+ messages in thread
From: Jinpu Wang @ 2021-03-25  4:55 UTC (permalink / raw)
  To: Viswas G, Martin K. Petersen
  Cc: Linux SCSI Mailinglist, Vasanthalakshmi.Tharmarajan,
	Ruksar Devadi, Vishakha Channapattan, Radha Ramachandran,
	Jack Wang, Ashokkumar N, John Garry

On Wed, Mar 24, 2021 at 5:54 PM Viswas G <Viswas.G@microchip.com> wrote:
>
> From: Vishakha Channapattan <vishakhavc@google.com>
>
> A new sysfs variable 'ctl_mpi_state' is being introduced to
> check the state of mpi.
>
> Tested: Using 'ctl_mpi_state' sysfs variable we check the mpi state
> mvae14:~# cat /sys/class/scsi_host/host*/ctl_mpi_state
> MPI-S=MPI is successfully initialized   HMI_ERR=0
> MPI-S=MPI is successfully initialized   HMI_ERR=0
>
> Signed-off-by: Vishakha Channapattan <vishakhavc@google.com>
> Signed-off-by: Viswas G <Viswas.G@microchip.com>
> Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
> Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
> Signed-off-by: Radha Ramachandran <radha@google.com>

> ---
>  drivers/scsi/pm8001/pm8001_ctl.c | 35 ++++++++++++++++++++++++++++++++++-
>  1 file changed, 34 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c
> index 12035baf0997..ce4846b1377c 100644
> --- a/drivers/scsi/pm8001/pm8001_ctl.c
> +++ b/drivers/scsi/pm8001/pm8001_ctl.c
> @@ -41,6 +41,7 @@
>  #include <linux/slab.h>
>  #include "pm8001_sas.h"
>  #include "pm8001_ctl.h"
> +#include "pm8001_chips.h"
>
>  /* scsi host attributes */
>
> @@ -883,9 +884,40 @@ static ssize_t pm8001_show_update_fw(struct device *cdev,
>                         flash_error_table[i].err_code,
>                         flash_error_table[i].reason);
>  }
> -
>  static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP,
>         pm8001_show_update_fw, pm8001_store_update_fw);
> +
> +/**
> + * ctl_mpi_state_show - controller MPI state check
> + * @cdev: pointer to embedded class device
> + * @buf: the buffer returned
> + *
> + * A sysfs 'read-only' shost attribute.
> + */
> +
> +char mpiStateText[][80] = {
> +       "MPI is not initialized",
> +       "MPI is successfully initialized",
> +       "MPI termination is in progress",
> +       "MPI initialization failed with error in [31:16]"
> +};
As reported by buildbot, mpiStateText should be static.
other than this it looks fine.
I see buildbot already sent a RFC fix for it.
Martin, do you prefer to have v3 for this one, or you can merge this
and the RFC fix from buildbot altogether?
Both are fine from my side.

Thanks!

> +
> +static ssize_t ctl_mpi_state_show(struct device *cdev,
> +               struct device_attribute *attr, char *buf)
> +{
> +       struct Scsi_Host *shost = class_to_shost(cdev);
> +       struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
> +       struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
> +       unsigned int mpidw0;
> +       int c;
> +
> +       mpidw0 = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 0);
> +       c = sysfs_emit(buf, "MPI-S=%s\t HMI_ERR=%x\n", mpiStateText[mpidw0 & 0x0003],
> +                       ((mpidw0 & 0xff00) >> 16));
> +       return c;
> +}
> +static DEVICE_ATTR_RO(ctl_mpi_state);
> +
>  struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_interface_rev,
>         &dev_attr_controller_fatal_error,
> @@ -909,6 +941,7 @@ struct device_attribute *pm8001_host_attrs[] = {
>         &dev_attr_ob_log,
>         &dev_attr_ila_version,
>         &dev_attr_inc_fw_ver,
> +       &dev_attr_ctl_mpi_state,
>         NULL,
>  };
>
> --
> 2.16.3
>

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

* [kbuild] Re: [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state
  2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
  2021-03-24 20:04     ` kernel test robot
@ 2021-03-25  7:10     ` Dan Carpenter
  2021-03-25  4:55   ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Jinpu Wang
  2021-03-25  7:10     ` Dan Carpenter
  3 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2021-03-25  7:10 UTC (permalink / raw)
  To: kbuild, Viswas G, linux-scsi
  Cc: lkp, kbuild-all, Vasanthalakshmi.Tharmarajan, Viswas.G,
	Ruksar.devadi, vishakhavc, radha, jinpu.wang, Ashokkumar N,
	John Garry

[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]

Hi Viswas,

url:    https://github.com/0day-ci/linux/commits/Viswas-G/pm80xx-updates/20210325-005709
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git  for-next
config: x86_64-randconfig-m001-20210323 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/scsi/pm8001/pm8001_ctl.c:916 ctl_mpi_state_show() warn: mask and shift to zero

Old smatch warnings:
drivers/scsi/pm8001/pm8001_ctl.c:758 pm8001_update_flash() warn: inconsistent indenting

vim +916 drivers/scsi/pm8001/pm8001_ctl.c

47c563cdbc763e Vishakha Channapattan 2021-03-24  905  static ssize_t ctl_mpi_state_show(struct device *cdev,
47c563cdbc763e Vishakha Channapattan 2021-03-24  906  		struct device_attribute *attr, char *buf)
47c563cdbc763e Vishakha Channapattan 2021-03-24  907  {
47c563cdbc763e Vishakha Channapattan 2021-03-24  908  	struct Scsi_Host *shost = class_to_shost(cdev);
47c563cdbc763e Vishakha Channapattan 2021-03-24  909  	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
47c563cdbc763e Vishakha Channapattan 2021-03-24  910  	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
47c563cdbc763e Vishakha Channapattan 2021-03-24  911  	unsigned int mpidw0;
47c563cdbc763e Vishakha Channapattan 2021-03-24  912  	int c;
47c563cdbc763e Vishakha Channapattan 2021-03-24  913  
47c563cdbc763e Vishakha Channapattan 2021-03-24  914  	mpidw0 = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 0);
47c563cdbc763e Vishakha Channapattan 2021-03-24  915  	c = sysfs_emit(buf, "MPI-S=%s\t HMI_ERR=%x\n", mpiStateText[mpidw0 & 0x0003],
47c563cdbc763e Vishakha Channapattan 2021-03-24 @916  			((mpidw0 & 0xff00) >> 16));
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^
0xff00 >> 16 is zero.

47c563cdbc763e Vishakha Channapattan 2021-03-24  917  	return c;
47c563cdbc763e Vishakha Channapattan 2021-03-24  918  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31712 bytes --]

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

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

* Re: [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state
@ 2021-03-25  7:10     ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2021-03-25  7:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2369 bytes --]

Hi Viswas,

url:    https://github.com/0day-ci/linux/commits/Viswas-G/pm80xx-updates/20210325-005709
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git  for-next
config: x86_64-randconfig-m001-20210323 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/scsi/pm8001/pm8001_ctl.c:916 ctl_mpi_state_show() warn: mask and shift to zero

Old smatch warnings:
drivers/scsi/pm8001/pm8001_ctl.c:758 pm8001_update_flash() warn: inconsistent indenting

vim +916 drivers/scsi/pm8001/pm8001_ctl.c

47c563cdbc763e Vishakha Channapattan 2021-03-24  905  static ssize_t ctl_mpi_state_show(struct device *cdev,
47c563cdbc763e Vishakha Channapattan 2021-03-24  906  		struct device_attribute *attr, char *buf)
47c563cdbc763e Vishakha Channapattan 2021-03-24  907  {
47c563cdbc763e Vishakha Channapattan 2021-03-24  908  	struct Scsi_Host *shost = class_to_shost(cdev);
47c563cdbc763e Vishakha Channapattan 2021-03-24  909  	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
47c563cdbc763e Vishakha Channapattan 2021-03-24  910  	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
47c563cdbc763e Vishakha Channapattan 2021-03-24  911  	unsigned int mpidw0;
47c563cdbc763e Vishakha Channapattan 2021-03-24  912  	int c;
47c563cdbc763e Vishakha Channapattan 2021-03-24  913  
47c563cdbc763e Vishakha Channapattan 2021-03-24  914  	mpidw0 = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 0);
47c563cdbc763e Vishakha Channapattan 2021-03-24  915  	c = sysfs_emit(buf, "MPI-S=%s\t HMI_ERR=%x\n", mpiStateText[mpidw0 & 0x0003],
47c563cdbc763e Vishakha Channapattan 2021-03-24 @916  			((mpidw0 & 0xff00) >> 16));
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^
0xff00 >> 16 is zero.

47c563cdbc763e Vishakha Channapattan 2021-03-24  917  	return c;
47c563cdbc763e Vishakha Channapattan 2021-03-24  918  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31712 bytes --]

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

* [kbuild] Re: [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state
@ 2021-03-25  7:10     ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2021-03-25  7:10 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2369 bytes --]

Hi Viswas,

url:    https://github.com/0day-ci/linux/commits/Viswas-G/pm80xx-updates/20210325-005709
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git  for-next
config: x86_64-randconfig-m001-20210323 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
drivers/scsi/pm8001/pm8001_ctl.c:916 ctl_mpi_state_show() warn: mask and shift to zero

Old smatch warnings:
drivers/scsi/pm8001/pm8001_ctl.c:758 pm8001_update_flash() warn: inconsistent indenting

vim +916 drivers/scsi/pm8001/pm8001_ctl.c

47c563cdbc763e Vishakha Channapattan 2021-03-24  905  static ssize_t ctl_mpi_state_show(struct device *cdev,
47c563cdbc763e Vishakha Channapattan 2021-03-24  906  		struct device_attribute *attr, char *buf)
47c563cdbc763e Vishakha Channapattan 2021-03-24  907  {
47c563cdbc763e Vishakha Channapattan 2021-03-24  908  	struct Scsi_Host *shost = class_to_shost(cdev);
47c563cdbc763e Vishakha Channapattan 2021-03-24  909  	struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost);
47c563cdbc763e Vishakha Channapattan 2021-03-24  910  	struct pm8001_hba_info *pm8001_ha = sha->lldd_ha;
47c563cdbc763e Vishakha Channapattan 2021-03-24  911  	unsigned int mpidw0;
47c563cdbc763e Vishakha Channapattan 2021-03-24  912  	int c;
47c563cdbc763e Vishakha Channapattan 2021-03-24  913  
47c563cdbc763e Vishakha Channapattan 2021-03-24  914  	mpidw0 = pm8001_mr32(pm8001_ha->general_stat_tbl_addr, 0);
47c563cdbc763e Vishakha Channapattan 2021-03-24  915  	c = sysfs_emit(buf, "MPI-S=%s\t HMI_ERR=%x\n", mpiStateText[mpidw0 & 0x0003],
47c563cdbc763e Vishakha Channapattan 2021-03-24 @916  			((mpidw0 & 0xff00) >> 16));
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^
0xff00 >> 16 is zero.

47c563cdbc763e Vishakha Channapattan 2021-03-24  917  	return c;
47c563cdbc763e Vishakha Channapattan 2021-03-24  918  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31712 bytes --]

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

end of thread, other threads:[~2021-03-25  7:12 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 17:03 [PATCH v2 0/7] pm80xx updates Viswas G
2021-03-24 17:03 ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Viswas G
2021-03-24 20:04   ` kernel test robot
2021-03-24 20:04     ` kernel test robot
2021-03-24 20:04   ` [RFC PATCH] pm80xx: mpiStateText[] can be static kernel test robot
2021-03-24 20:04     ` kernel test robot
2021-03-25  4:55   ` [PATCH v2 1/7] pm80xx: Add sysfs attribute to check mpi state Jinpu Wang
2021-03-25  7:10   ` [kbuild] " Dan Carpenter
2021-03-25  7:10     ` Dan Carpenter
2021-03-25  7:10     ` Dan Carpenter
2021-03-24 17:03 ` [PATCH v2 2/7] pm80xx: Add sysfs attribute to track RAAE count Viswas G
2021-03-25  4:49   ` Jinpu Wang
2021-03-24 17:03 ` [PATCH v2 3/7] pm80xx: Add sysfs attribute to track iop0 count Viswas G
2021-03-25  4:48   ` Jinpu Wang
2021-03-24 17:03 ` [PATCH v2 4/7] pm80xx: Add sysfs attribute to track iop1 count Viswas G
2021-03-25  4:49   ` Jinpu Wang
2021-03-24 17:03 ` [PATCH v2 5/7] pm80xx: Completing pending IO after fatal error Viswas G
2021-03-24 17:03 ` [PATCH v2 6/7] pm80xx: Reset PI and CI memory during re-initialize Viswas G
2021-03-24 17:03 ` [PATCH v2 7/7] pm80xx: remove global lock from outbound queue processing Viswas G

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.