Skip to contentSkip to conversation

mptfusion: print Doorbell register in a case of hard reset and timeout

PATCH In review Kei Tokunaga 2 participants 5 messages Apr 26, 2010 – Jun 22, 2010

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

PATCH 1/1 mptfusion: print Doorbell register in a case of hard reset and timeout

Hi Kashyap,

Printing Doorbell register in a case of hard reset and timeout should be useful for figuring out the state of the system.

Thanks,
Kei

 drivers/message/fusion/mptbase.c  |   13 ++++++++-----
 drivers/message/fusion/mptctl.c   |   20 ++++++++++++++++----
 drivers/message/fusion/mptsas.c   |    5 +++--
 drivers/message/fusion/mptscsih.c |   12 ++++++++----
 4 files changed, 35 insertions(+), 15 deletions(-)
drivers/message/fusion/mptbase.c +8 -5
index a6a5701..50d5b23 100644
@@ -5062,8 +5062,9 @@ mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode)
 		if (ioc->mptbase_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET)
 			goto out;
 		if (!timeleft) {
-			printk(KERN_DEBUG "%s: Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
@@ -6454,8 +6455,9 @@ out:
 	mutex_unlock(&ioc->mptbase_cmds.mutex);
 	if (issue_hard_reset) {
 		issue_hard_reset = 0;
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		if (retry_count == 0) {
 			if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0)
 				retry_count++;
@@ -7144,7 +7146,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
 	rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag);
 	if (rc != 0) {
 		printk(KERN_WARNING MYNAM
-		    ": WARNING - (%d) Cannot recover %s\n", rc, ioc->name);
+		       ": WARNING - (%d) Cannot recover %s, doorbell=0x%08x\n",
+		       rc, ioc->name, mpt_GetIocState(ioc, 0));
 	} else {
 		if (ioc->hard_resets < -1)
 			ioc->hard_resets++;
drivers/message/fusion/mptctl.c +16 -4
index f06b291..b8a925c 100644
@@ -946,10 +946,14 @@ retry_wait:
 			mpt_free_msg_frame(iocp, mf);
 			goto fwdl_out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "FW download timeout, doorbell=0x%08x\n",
+			       iocp->name, mpt_GetIocState(iocp, 0));
 			mptctl_timeout_expired(iocp, mf);
-		else
+		} else {
 			goto retry_wait;
+		}
 		goto fwdl_out;
 	}
 
@@ -2293,6 +2297,10 @@ retry_wait:
 			goto done_free_mem;
 		}
 		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "mpt cmd timeout, doorbell=0x%08x"
+			       " function=0x%x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0), function);
 			if (function == MPI_FUNCTION_SCSI_TASK_MGMT)
 				mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 			mptctl_timeout_expired(ioc, mf);
@@ -2600,10 +2608,14 @@ retry_wait:
 			mpt_free_msg_frame(ioc, mf);
 			goto out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "HOST INFO command timeout, doorbell=0x%08x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0));
 			mptctl_timeout_expired(ioc, mf);
-		else
+		} else {
 			goto retry_wait;
+		}
 		goto out;
 	}
 
drivers/message/fusion/mptsas.c +3 -2
index ac000e8..0a34e0c 100644
@@ -4727,8 +4727,9 @@ mptsas_broadcast_primative_work(struct fw_event_work *fw_event)
 	mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 
 	if (issue_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 	}
 	mptsas_free_fw_event(ioc, fw_event);
drivers/message/fusion/mptscsih.c +8 -4
index 7bd4c0f..693af3b 100644
@@ -1704,8 +1704,9 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun,
 
 	CLEAR_MGMT_STATUS(ioc->taskmgmt_cmds.status)
 	if (issue_hard_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		retval = mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 		mpt_free_msg_frame(ioc, mf);
 	}
@@ -3047,8 +3048,11 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
 			goto out;
 		}
 		if (!timeleft) {
-			printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!! doorbell=0x%08xh"
+			       " cmd=0x%02x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0),
+			       cmd);
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
#1 lore raw
Quoted 4 lines · Kei Tokunaga

Hi Kashyap,

Printing Doorbell register in a case of hard reset and timeout should be useful for figuring out the state of the system.

Hi Kashyap,

Can you give this patch an ACK? I confirmed it still applies to 03.04.16.

Thanks,
Kei

Quoted 147 lines
 drivers/message/fusion/mptbase.c  |   13 ++++++++-----
 drivers/message/fusion/mptctl.c   |   20 ++++++++++++++++----
 drivers/message/fusion/mptsas.c   |    5 +++--
 drivers/message/fusion/mptscsih.c |   12 ++++++++----
 4 files changed, 35 insertions(+), 15 deletions(-)
drivers/message/fusion/mptbase.c +8 -5
index a6a5701..50d5b23 100644
@@ -5062,8 +5062,9 @@ mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode)
 		if (ioc->mptbase_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET)
 			goto out;
 		if (!timeleft) {
-			printk(KERN_DEBUG "%s: Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
@@ -6454,8 +6455,9 @@ out:
 	mutex_unlock(&ioc->mptbase_cmds.mutex);
 	if (issue_hard_reset) {
 		issue_hard_reset = 0;
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		if (retry_count == 0) {
 			if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0)
 				retry_count++;
@@ -7144,7 +7146,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
 	rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag);
 	if (rc != 0) {
 		printk(KERN_WARNING MYNAM
-		    ": WARNING - (%d) Cannot recover %s\n", rc, ioc->name);
+		       ": WARNING - (%d) Cannot recover %s, doorbell=0x%08x\n",
+		       rc, ioc->name, mpt_GetIocState(ioc, 0));
 	} else {
 		if (ioc->hard_resets < -1)
 			ioc->hard_resets++;
drivers/message/fusion/mptctl.c +16 -4
index f06b291..b8a925c 100644
@@ -946,10 +946,14 @@ retry_wait:
 			mpt_free_msg_frame(iocp, mf);
 			goto fwdl_out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "FW download timeout, doorbell=0x%08x\n",
+			       iocp->name, mpt_GetIocState(iocp, 0));
 			mptctl_timeout_expired(iocp, mf);
-		else
+		} else {
 			goto retry_wait;
+		}
 		goto fwdl_out;
 	}
 
@@ -2293,6 +2297,10 @@ retry_wait:
 			goto done_free_mem;
 		}
 		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "mpt cmd timeout, doorbell=0x%08x"
+			       " function=0x%x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0), function);
 			if (function == MPI_FUNCTION_SCSI_TASK_MGMT)
 				mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 			mptctl_timeout_expired(ioc, mf);
@@ -2600,10 +2608,14 @@ retry_wait:
 			mpt_free_msg_frame(ioc, mf);
 			goto out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "HOST INFO command timeout, doorbell=0x%08x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0));
 			mptctl_timeout_expired(ioc, mf);
-		else
+		} else {
 			goto retry_wait;
+		}
 		goto out;
 	}
 
drivers/message/fusion/mptsas.c +3 -2
index ac000e8..0a34e0c 100644
@@ -4727,8 +4727,9 @@ mptsas_broadcast_primative_work(struct fw_event_work *fw_event)
 	mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 
 	if (issue_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 	}
 	mptsas_free_fw_event(ioc, fw_event);
drivers/message/fusion/mptscsih.c +8 -4
index 7bd4c0f..693af3b 100644
@@ -1704,8 +1704,9 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun,
 
 	CLEAR_MGMT_STATUS(ioc->taskmgmt_cmds.status)
 	if (issue_hard_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		retval = mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 		mpt_free_msg_frame(ioc, mf);
 	}
@@ -3047,8 +3048,11 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
 			goto out;
 		}
 		if (!timeleft) {
-			printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!! doorbell=0x%08xh"
+			       " cmd=0x%02x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0),
+			       cmd);
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
#2 lore raw
Quoted 13 lines

-----Original Message-----
From: Kei Tokunaga [mailto:[email protected]]
Sent: Tuesday, June 22, 2010 2:48 PM
To: Desai, Kashyap
Cc: [email protected]; Kei Tokunaga
Subject: Re: [PATCH] mptfusion: print Doorbell register in a case of hard reset and timeout

Quoted 2 lines · Kei Tokunaga

Hi Kashyap,

Quoted 7 lines
Quoted 2 lines

Printing Doorbell register in a case of hard reset and timeout should be useful for figuring out the state of the system.

Hi Kashyap,

Can you give this patch an ACK? I confirmed it still applies to 03.04.16.

Kei,

Patch looks OK to me. I have commented few things below. Can you please correct it and resend? Thanks, Kashyap

Quoted 67 lines

Thanks,
Kei

Review

Quoted 9 lines
 drivers/message/fusion/mptbase.c  |   13 ++++++++-----
 drivers/message/fusion/mptctl.c   |   20 ++++++++++++++++----
 drivers/message/fusion/mptsas.c   |    5 +++--
 drivers/message/fusion/mptscsih.c |   12 ++++++++----
 4 files changed, 35 insertions(+), 15 deletions(-)
(quoted diff) +0 -0

b/drivers/message/fusion/mptbase.c

drivers/message/fusion/mptbase.c mptbase_sas_persist_operation(MPT_ADAPTER *ioc,

Quoted 4 lines

index a6a5701..50d5b23 100644

drivers/message/fusion/mptbase.c +0 -0
@@ -5062,8 +5062,9 @@ mptbase_sas_persist_operation(MPT_ADAPTER *ioc,

u8 persist_opcode)

drivers/message/fusion/mptbase.c mptbase_sas_persist_operation(MPT_ADAPTER *ioc, · line 5062

Quoted 1 line
drivers/message/fusion/mptbase.c +0 -0
 		if (ioc->mptbase_cmds.status &

MPT_MGMT_STATUS_DID_IOCRESET)

drivers/message/fusion/mptbase.c mpt_HardResetHandler(MPT_ADAPTER *ioc, int

Quoted 23 lines
drivers/message/fusion/mptbase.c +6 -4
 			goto out;
 		if (!timeleft) {
-			printk(KERN_DEBUG "%s: Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
@@ -6454,8 +6455,9 @@ out:
 	mutex_unlock(&ioc->mptbase_cmds.mutex);
 	if (issue_hard_reset) {
 		issue_hard_reset = 0;
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		if (retry_count == 0) {
 			if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0)
 				retry_count++;
@@ -7144,7 +7146,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int

sleepFlag)

drivers/message/fusion/mptbase.c mpt_HardResetHandler(MPT_ADAPTER *ioc, int · line 7146

Quoted 1 line
drivers/message/fusion/mptbase.c +0 -0
 	rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER,

sleepFlag);

drivers/message/fusion/mptbase.c mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)

Quoted 4 lines
drivers/message/fusion/mptbase.c +1 -1
 	if (rc != 0) {
 		printk(KERN_WARNING MYNAM
-		    ": WARNING - (%d) Cannot recover %s\n", rc, ioc->name);
+		       ": WARNING - (%d) Cannot recover %s,

doorbell=0x%08x\n",

Review

Quoted 5 lines
drivers/message/fusion/mptbase.c +1 -0
+		       rc, ioc->name, mpt_GetIocState(ioc, 0));
 	} else {
 		if (ioc->hard_resets < -1)
 			ioc->hard_resets++;
(quoted diff) +0 -0

b/drivers/message/fusion/mptctl.c

Quoted 9 lines

index f06b291..b8a925c 100644

drivers/message/fusion/mptctl.c +1 -1
@@ -946,10 +946,14 @@ retry_wait:
 			mpt_free_msg_frame(iocp, mf);
 			goto fwdl_out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
Quoted 8 lines

drivers/message/fusion/mptctl.c retry_wait: · line 956

Quoted 8 lines
drivers/message/fusion/mptctl.c +5 -1
+			printk(MYIOC_s_WARN_FMT
+			       "FW download timeout, doorbell=0x%08x\n",
+			       iocp->name, mpt_GetIocState(iocp, 0));
 			mptctl_timeout_expired(iocp, mf);
-		else
+		} else {
 			goto retry_wait;
+		}

This extra brackets are not required if it has single code line.

Quoted 23 lines
Quoted 15 lines
drivers/message/fusion/mptctl.c +4 -0
 		goto fwdl_out;
 	}
 
@@ -2293,6 +2297,10 @@ retry_wait:
 			goto done_free_mem;
 		}
 		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "mpt cmd timeout, doorbell=0x%08x"
+			       " function=0x%x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0), function);
 			if (function == MPI_FUNCTION_SCSI_TASK_MGMT)
 				mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 			mptctl_timeout_expired(ioc, mf);

drivers/message/fusion/mptctl.c retry_wait: · line 2613

Quoted 7 lines
drivers/message/fusion/mptctl.c +3 -1
@@ -2600,10 +2608,14 @@ retry_wait:
 			mpt_free_msg_frame(ioc, mf);
 			goto out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "HOST INFO command timeout,

doorbell=0x%08x\n",

Quoted 6 lines

drivers/message/fusion/mptctl.c retry_wait: · line 2618

Quoted 6 lines
drivers/message/fusion/mptctl.c +3 -1
+			       ioc->name, mpt_GetIocState(ioc, 0));
 			mptctl_timeout_expired(ioc, mf);
-		else
+		} else {
 			goto retry_wait;
+		}

Same as above.

Quoted 60 lines

Review

Quoted 4 lines
drivers/message/fusion/mptctl.c +0 -0
 		goto out;
 	}
 
(quoted diff) +0 -0

b/drivers/message/fusion/mptsas.c

drivers/message/fusion/mptsas.c mptsas_broadcast_primative_work(struct

Quoted 4 lines

index ac000e8..0a34e0c 100644

drivers/message/fusion/mptsas.c +0 -0
@@ -4727,8 +4727,9 @@ mptsas_broadcast_primative_work(struct

fw_event_work *fw_event)

Review

Quoted 12 lines
drivers/message/fusion/mptsas.c +3 -2
 	mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 
 	if (issue_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 	}
 	mptsas_free_fw_event(ioc, fw_event);
(quoted diff) +0 -0

b/drivers/message/fusion/mptscsih.c

drivers/message/fusion/mptscsih.c mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8

Quoted 4 lines

index 7bd4c0f..693af3b 100644

drivers/message/fusion/mptscsih.c +0 -0
@@ -1704,8 +1704,9 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8

type, u8 channel, u8 id, int lun,

drivers/message/fusion/mptscsih.c mptscsih_do_cmd(MPT_SCSI_HOST *hd,

Quoted 12 lines
drivers/message/fusion/mptscsih.c +3 -2
 	CLEAR_MGMT_STATUS(ioc->taskmgmt_cmds.status)
 	if (issue_hard_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		retval = mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 		mpt_free_msg_frame(ioc, mf);
 	}
@@ -3047,8 +3048,11 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd,

INTERNAL_CMD *io)

Quoted 19 lines
drivers/message/fusion/mptscsih.c +5 -2
 			goto out;
 		}
 		if (!timeleft) {
-			printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!! doorbell=0x%08xh"
+			       " cmd=0x%02x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0),
+			       cmd);
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
#3 lore raw
Quoted 18 lines · Kashyap
Quoted 18 lines

-----Original Message-----
From: Kei Tokunaga [mailto:[email protected]]
Sent: Tuesday, June 22, 2010 2:48 PM
To: Desai, Kashyap
Cc: [email protected]; Kei Tokunaga
Subject: Re: [PATCH] mptfusion: print Doorbell register in a case of hard reset and timeout

Quoted 5 lines · Kei Tokunaga

Hi Kashyap,

Printing Doorbell register in a case of hard reset and timeout should be useful for figuring out the state of the system.

Hi Kashyap,

Quoted 7 lines
Quoted 3 lines

Can you give this patch an ACK? I confirmed it still applies to 03.04.16.

Kei,

Patch looks OK to me. I have commented few things below. Can you please correct it and resend? Thanks, Kashyap

Thanks for reviewing it. Here is a corrected version of it.

 drivers/message/fusion/mptbase.c  |   13 ++++++++-----
 drivers/message/fusion/mptctl.c   |   18 ++++++++++++++----
 drivers/message/fusion/mptsas.c   |    5 +++--
 drivers/message/fusion/mptscsih.c |   12 ++++++++----
 4 files changed, 33 insertions(+), 15 deletions(-)
drivers/message/fusion/mptbase.c +8 -5
index c36d5b9..e319abc 100644
@@ -5063,8 +5063,9 @@ mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode)
 		if (ioc->mptbase_cmds.status & MPT_MGMT_STATUS_DID_IOCRESET)
 			goto out;
 		if (!timeleft) {
-			printk(KERN_DEBUG "%s: Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
@@ -6455,8 +6456,9 @@ out:
 	mutex_unlock(&ioc->mptbase_cmds.mutex);
 	if (issue_hard_reset) {
 		issue_hard_reset = 0;
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		if (retry_count == 0) {
 			if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0)
 				retry_count++;
@@ -7146,7 +7148,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag)
 	rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER, sleepFlag);
 	if (rc != 0) {
 		printk(KERN_WARNING MYNAM
-		    ": WARNING - (%d) Cannot recover %s\n", rc, ioc->name);
+		       ": WARNING - (%d) Cannot recover %s, doorbell=0x%08x\n",
+		       rc, ioc->name, mpt_GetIocState(ioc, 0));
 	} else {
 		if (ioc->hard_resets < -1)
 			ioc->hard_resets++;
drivers/message/fusion/mptctl.c +14 -4
index 9bd89ce..40046f5 100644
@@ -954,9 +954,12 @@ retry_wait:
 			mpt_free_msg_frame(iocp, mf);
 			goto fwdl_out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "FW download timeout, doorbell=0x%08x\n",
+			       iocp->name, mpt_GetIocState(iocp, 0));
 			mptctl_timeout_expired(iocp, mf);
-		else
+		} else
 			goto retry_wait;
 		goto fwdl_out;
 	}
@@ -2301,6 +2304,10 @@ retry_wait:
 			goto done_free_mem;
 		}
 		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "mpt cmd timeout, doorbell=0x%08x"
+			       " function=0x%x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0), function);
 			if (function == MPI_FUNCTION_SCSI_TASK_MGMT)
 				mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 			mptctl_timeout_expired(ioc, mf);
@@ -2608,9 +2615,12 @@ retry_wait:
 			mpt_free_msg_frame(ioc, mf);
 			goto out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "HOST INFO command timeout, doorbell=0x%08x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0));
 			mptctl_timeout_expired(ioc, mf);
-		else
+		} else
 			goto retry_wait;
 		goto out;
 	}
drivers/message/fusion/mptsas.c +3 -2
index f42781b..8cdc58c 100644
@@ -4816,8 +4816,9 @@ mptsas_broadcast_primative_work(struct fw_event_work *fw_event)
 	mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 
 	if (issue_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 	}
 	mptsas_free_fw_event(ioc, fw_event);
drivers/message/fusion/mptscsih.c +8 -4
index c5c8fb8..dceb67a 100644
@@ -1706,8 +1706,9 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun,
 
 	CLEAR_MGMT_STATUS(ioc->taskmgmt_cmds.status)
 	if (issue_hard_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		retval = mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 		mpt_free_msg_frame(ioc, mf);
 	}
@@ -3051,8 +3052,11 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io)
 			goto out;
 		}
 		if (!timeleft) {
-			printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!! doorbell=0x%08xh"
+			       " cmd=0x%02x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0),
+			       cmd);
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);
 		}
#4 lore raw

James,

Can you please consider below patch sent by Kei as an Acked patch and consider it for next merge window.

A much thanks,
Kashyap

Quoted 189 lines

-----Original Message-----
From: Kei Tokunaga [mailto:[email protected]]
Sent: Tuesday, June 22, 2010 3:32 PM
To: Desai, Kashyap
Cc: [email protected]; Kei Tokunaga
Subject: Re: [PATCH] mptfusion: print Doorbell register in a case of hard reset and timeout

Quoted 16 lines · Kashyap
Quoted 16 lines

-----Original Message-----
From: Kei Tokunaga [mailto:[email protected]]
Sent: Tuesday, June 22, 2010 2:48 PM
To: Desai, Kashyap
Cc: [email protected]; Kei Tokunaga
Subject: Re: [PATCH] mptfusion: print Doorbell register in a case of hard reset and timeout

Quoted 5 lines · Kei Tokunaga

Hi Kashyap,

Printing Doorbell register in a case of hard reset and timeout should be useful for figuring out the state of the system.

Quoted 8 lines
Quoted 5 lines

Hi Kashyap,

Can you give this patch an ACK? I confirmed it still applies to 03.04.16.

Kei,

Patch looks OK to me. I have commented few things below. Can you

please correct it and resend?

Quoted 1 line

Thanks, Kashyap

Thanks for reviewing it. Here is a corrected version of it.

 drivers/message/fusion/mptbase.c  |   13 ++++++++-----
 drivers/message/fusion/mptctl.c   |   18 ++++++++++++++----
 drivers/message/fusion/mptsas.c   |    5 +++--
 drivers/message/fusion/mptscsih.c |   12 ++++++++----
 4 files changed, 33 insertions(+), 15 deletions(-)
drivers/message/fusion/mptbase.c +3 -2
index c36d5b9..e319abc 100644
@@ -5063,8 +5063,9 @@ mptbase_sas_persist_operation(MPT_ADAPTER *ioc,
 u8 persist_opcode)
 		if (ioc->mptbase_cmds.status &
 MPT_MGMT_STATUS_DID_IOCRESET)
 			goto out;
 		if (!timeleft) {
-			printk(KERN_DEBUG "%s: Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
drivers/message/fusion/mptbase.c +5 -3
 			mpt_free_msg_frame(ioc, mf);
 		}
@@ -6455,8 +6456,9 @@ out:
 	mutex_unlock(&ioc->mptbase_cmds.mutex);
 	if (issue_hard_reset) {
 		issue_hard_reset = 0;
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!!, doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		if (retry_count == 0) {
 			if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0)
 				retry_count++;
@@ -7146,7 +7148,8 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int
 sleepFlag)
 	rc = mpt_do_ioc_recovery(ioc, MPT_HOSTEVENT_IOC_RECOVER,
 sleepFlag);
 	if (rc != 0) {
 		printk(KERN_WARNING MYNAM
-		    ": WARNING - (%d) Cannot recover %s\n", rc, ioc->name);
+		       ": WARNING - (%d) Cannot recover %s,
 doorbell=0x%08x\n",
+		       rc, ioc->name, mpt_GetIocState(ioc, 0));
drivers/message/fusion/mptbase.c +0 -0
 	} else {
 		if (ioc->hard_resets < -1)
 			ioc->hard_resets++;
drivers/message/fusion/mptctl.c +14 -4
index 9bd89ce..40046f5 100644
@@ -954,9 +954,12 @@ retry_wait:
 			mpt_free_msg_frame(iocp, mf);
 			goto fwdl_out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "FW download timeout, doorbell=0x%08x\n",
+			       iocp->name, mpt_GetIocState(iocp, 0));
 			mptctl_timeout_expired(iocp, mf);
-		else
+		} else
 			goto retry_wait;
 		goto fwdl_out;
 	}
@@ -2301,6 +2304,10 @@ retry_wait:
 			goto done_free_mem;
 		}
 		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "mpt cmd timeout, doorbell=0x%08x"
+			       " function=0x%x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0), function);
 			if (function == MPI_FUNCTION_SCSI_TASK_MGMT)
 				mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 			mptctl_timeout_expired(ioc, mf);
@@ -2608,9 +2615,12 @@ retry_wait:
 			mpt_free_msg_frame(ioc, mf);
 			goto out;
 		}
-		if (!timeleft)
+		if (!timeleft) {
+			printk(MYIOC_s_WARN_FMT
+			       "HOST INFO command timeout,
 doorbell=0x%08x\n",
+			       ioc->name, mpt_GetIocState(ioc, 0));
 			mptctl_timeout_expired(ioc, mf);
-		else
+		} else
 			goto retry_wait;
 		goto out;
drivers/message/fusion/mptctl.c +0 -0
 	}
drivers/message/fusion/mptsas.c +3 -2
index f42781b..8cdc58c 100644
@@ -4816,8 +4816,9 @@ mptsas_broadcast_primative_work(struct
 fw_event_work *fw_event)
 	mutex_unlock(&ioc->taskmgmt_cmds.mutex);
 
 	if (issue_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-		    ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 	}
drivers/message/fusion/mptsas.c +0 -0
 	mptsas_free_fw_event(ioc, fw_event);
drivers/message/fusion/mptscsih.c +3 -2
index c5c8fb8..dceb67a 100644
@@ -1706,8 +1706,9 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8
 type, u8 channel, u8 id, int lun,
 
 	CLEAR_MGMT_STATUS(ioc->taskmgmt_cmds.status)
 	if (issue_hard_reset) {
-		printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			ioc->name, __func__);
+		printk(MYIOC_s_WARN_FMT
+		       "Issuing Reset from %s!! doorbell=0x%08x\n",
+		       ioc->name, __func__, mpt_GetIocState(ioc, 0));
 		retval = mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 		mpt_free_msg_frame(ioc, mf);
drivers/message/fusion/mptscsih.c +5 -2
 	}
@@ -3051,8 +3052,11 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD
 *io)
 			goto out;
 		}
 		if (!timeleft) {
-			printk(MYIOC_s_WARN_FMT "Issuing Reset from %s!!\n",
-			    ioc->name, __func__);
+			printk(MYIOC_s_WARN_FMT
+			       "Issuing Reset from %s!! doorbell=0x%08xh"
+			       " cmd=0x%02x\n",
+			       ioc->name, __func__, mpt_GetIocState(ioc, 0),
+			       cmd);
 			mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP);
 			mpt_free_msg_frame(ioc, mf);

}