[linux-yocto] [PATCH 69/78] drivers/misc: lsi-smmon - Mask unmonitored bits in the interrupt mask register

Paul Butler butler.paul at gmail.com
Tue Nov 19 20:23:45 PST 2013


From: John Jacques <john.jacques at lsi.com>

When memory is not re-initialized during a reset, some of the
unmonitored bits stay set and cause the interrupt handler to be
unable to clear interrupts.

Signed-off-by: John Jacques <john.jacques at lsi.com>
---
 drivers/misc/lsi-smmon.c | 56 ++++++++++++++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 23 deletions(-)

diff --git a/drivers/misc/lsi-smmon.c b/drivers/misc/lsi-smmon.c
index 5e859db..33c52cf 100644
--- a/drivers/misc/lsi-smmon.c
+++ b/drivers/misc/lsi-smmon.c
@@ -23,7 +23,7 @@
 #error "Only AXM55xx is Supported At Present!"
 #endif
 
-static int log=1;
+static int log = 1;
 module_param(log, int, 0755);
 MODULE_PARM_DESC(log, "Log each error on the console.");
 
@@ -33,28 +33,28 @@ MODULE_PARM_DESC(log, "Log each error on the console.");
   Bit [24] = The software-initiated control word write has completed.
   Bit [23] = The user-initiated DLL resync has completed.
   Bit [22] = A state change has been detected on the dfi_init_complete signal
-             after initialization.
+	     after initialization.
   Bit [21] = The assertion of the INHIBIT_DRAM_CMD parameter has successfully
-             inhibited the command queue.
+	     inhibited the command queue.
   Bit [20] = The register interface-initiated mode register write has completed
-             and another mode register write may be issued.
+	     and another mode register write may be issued.
   Bit [19] = A parity error has been detected on the address/control bus on a
-             registered DIMM.
+	     registered DIMM.
   Bit [18] = The leveling operation has completed.
   Bit [17] = A leveling operation has been requested.
   Bit [16] = A DFI update error has occurred. Error information can be found in
-             the UPDATE_ERROR_STATUS parameter.
+	     the UPDATE_ERROR_STATUS parameter.
   Bit [15] = A write leveling error has occurred. Error information can be found
-             in the WRLVL_ERROR_STATUS parameter.
+	     in the WRLVL_ERROR_STATUS parameter.
   Bit [14] = A read leveling gate training error has occurred. Error information
-             can be found in the RDLVL_ERROR_STATUS parameter.
+	     can be found in the RDLVL_ERROR_STATUS parameter.
   Bit [13] = A read leveling error has occurred. Error information can be found
-             in the RDLVL_ERROR_STATUS parameter.
+	     in the RDLVL_ERROR_STATUS parameter.
   Bit [12] = The user has programmed an invalid setting associated with user
-             words per burst. Examples: Setting param_reduc when burst
-             length = 2. A 1:2 MC:PHY clock ratio with burst length = 2.
+	     words per burst. Examples: Setting param_reduc when burst
+	     length = 2. A 1:2 MC:PHY clock ratio with burst length = 2.
   Bit [11] = A wrap cycle crossing a DRAM page has been detected. This is
-             unsupported & may result in memory data corruption.
+	     unsupported & may result in memory data corruption.
   Bit [10] = The BIST operation has been completed.
   Bit [09] = The low power operation has been completed.
   Bit [08] = The MC initialization has been completed.
@@ -64,9 +64,9 @@ MODULE_PARM_DESC(log, "Log each error on the console.");
   Bit [04] = Multiple correctable ECC events have been detected.
   Bit [03] = A correctable ECC event has been detected.
   Bit [02] = Multiple accesses outside the defined PHYSICAL memory space have
-             occurred.
+	     occurred.
   Bit [01] = A memory access outside the defined PHYSICAL memory space has
-             occurred.
+	     occurred.
   Bit [00] = The memory reset is valid on the DFI bus.
 
   Of these, 1, 2, 3, 4, 5, 6, 7, 11, and 19 are of interest.
@@ -202,15 +202,15 @@ smmon_read_proc(char *page, char **start, off_t offset, int count,
 
 	length = sprintf(page,
 			 "------------ Counts for SM0/SM1 ----------\n"
-			 "                   Illegal Access: %lu/%lu\n"
-			 "        Multiple Illegal Accesses: %lu/%lu\n"
-			 "            Correctable ECC Error: %lu/%lu\n"
+			 "		     Illegal Access: %lu/%lu\n"
+			 "	  Multiple Illegal Accesses: %lu/%lu\n"
+			 "	      Correctable ECC Error: %lu/%lu\n"
 			 "  Multiple Correctable ECC Errors: %lu/%lu\n"
-			 "          Uncorrectable ECC Error: %lu/%lu\n"
+			 "	    Uncorrectable ECC Error: %lu/%lu\n"
 			 "Multiple Uncorrectable ECC Errors: %lu/%lu\n"
-			 "                      Port Errors: %lu/%lu\n"
-			 "                      Wrap Errors: %lu/%lu\n"
-			 "                    Parity Errors: %lu/%lu\n",
+			 "			Port Errors: %lu/%lu\n"
+			 "			Wrap Errors: %lu/%lu\n"
+			 "		      Parity Errors: %lu/%lu\n",
 			 counts.illegal_access[0],
 			 counts.illegal_access[1],
 			 counts.multiple_illegal_access[0],
@@ -245,17 +245,27 @@ smmon_read_proc(char *page, char **start, off_t offset, int count,
 */
 
 /*
-  -------------------------------------------------------------------------------
+  ------------------------------------------------------------------------------
   smmon_init
 */
 
 static int __init smmon_init(void)
 {
 	int rc;
+	int mask;
 
 	printk("smmon: log=%d\n", log);
 	create_proc_read_entry("smmon", 0, NULL, smmon_read_proc, NULL);
 	memset(&counts, 0, sizeof(struct smmon_counts));
+
+	/*
+	  Set the interrupt mask for each controller.
+	*/
+
+	mask = 0x1f7f701;
+	ncr_write(NCP_REGION_ID(0x22, 0), 0x414, 4, &mask);
+	ncr_write(NCP_REGION_ID(0xf, 0), 0x414, 4, &mask);
+
 	rc = request_irq(32 + 161, smmon_isr, IRQF_ONESHOT,
 			"smmon_0", NULL);
 	rc |= request_irq(32 + 160, smmon_isr, IRQF_ONESHOT,
@@ -274,7 +284,7 @@ static int __init smmon_init(void)
 module_init(smmon_init);
 
 /*
-  -------------------------------------------------------------------------------
+  ------------------------------------------------------------------------------
   smmon_exit
 */
 
-- 
1.8.4.3



More information about the linux-yocto mailing list