i7core: check if the memory error is fatal or non-fatal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
		
					parent
					
						
							
								310cbb7284
							
						
					
				
			
			
				commit
				
					
						c5d3452869
					
				
			
		
					 1 changed files with 13 additions and 3 deletions
				
			
		|  | @ -1352,7 +1352,7 @@ static void check_mc_test_err(struct mem_ctl_info *mci, u8 socket) | |||
| static void i7core_mce_output_error(struct mem_ctl_info *mci, | ||||
| 				    struct mce *m) | ||||
| { | ||||
| 	char *type="NON-FATAL"; | ||||
| 	char *type; | ||||
| 	char *err, *msg; | ||||
| 	unsigned long error = m->status & 0x1ff0000l; | ||||
| 	u32 core_err_cnt = (m->status >> 38) && 0x7fff; | ||||
|  | @ -1361,6 +1361,11 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci, | |||
| 	u32 syndrome = m->misc >> 32; | ||||
| 	u32 errnum = find_first_bit(&error, 32); | ||||
| 
 | ||||
| 	if (m->mcgstatus & 1) | ||||
| 		type = "FATAL"; | ||||
| 	else | ||||
| 		type = "NON_FATAL"; | ||||
| 
 | ||||
| 	switch (errnum) { | ||||
| 	case 16: | ||||
| 		err = "read ECC error"; | ||||
|  | @ -1454,7 +1459,8 @@ static void i7core_check_error(struct mem_ctl_info *mci) | |||
|  */ | ||||
| static int i7core_mce_check_error(void *priv, struct mce *mce) | ||||
| { | ||||
| 	struct i7core_pvt *pvt = priv; | ||||
| 	struct mem_ctl_info *mci = priv; | ||||
| 	struct i7core_pvt *pvt = mci->pvt_info; | ||||
| 	unsigned long flags; | ||||
| 
 | ||||
| 	debugf0(__FILE__ ": %s()\n", __func__); | ||||
|  | @ -1477,6 +1483,10 @@ static int i7core_mce_check_error(void *priv, struct mce *mce) | |||
| 	} | ||||
| 	spin_unlock_irqrestore(&pvt->mce_lock, flags); | ||||
| 
 | ||||
| 	/* Handle fatal errors immediately */ | ||||
| 	if (mce->mcgstatus & 1) | ||||
| 		i7core_check_error(mci); | ||||
| 
 | ||||
| 	/* Advice mcelog that the error were handled */ | ||||
| 	return 1; | ||||
| } | ||||
|  | @ -1601,7 +1611,7 @@ static int __devinit i7core_probe(struct pci_dev *pdev, | |||
| 	pvt->inject.col = -1; | ||||
| 
 | ||||
| 	/* Registers on edac_mce in order to receive memory errors */ | ||||
| 	pvt->edac_mce.priv = pvt; | ||||
| 	pvt->edac_mce.priv = mci; | ||||
| 	pvt->edac_mce.check_error = i7core_mce_check_error; | ||||
| 	spin_lock_init(&pvt->mce_lock); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mauro Carvalho Chehab
				Mauro Carvalho Chehab