mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
EDAC/i5100: disable error reporting at teardown and create helper
Error reporting is enabled during init but not reverted when init fails. It is also not disabled at normal driver teardown. Create i5100_set_error_reporting() to enable/disable reporting. Move enable reporting write to after initialization success. Disable reporting at driver teardown. Signed-off-by: Tushar Tibude <tushar.tibude1000@gmail.com> Signed-off-by: Tony Luck <tony.luck@intel.com> Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Link: https://patch.msgid.link/20260430084223.9298-3-tushar.tibude1000@gmail.com
This commit is contained in:
parent
dfe7d89d20
commit
2951f7bc4e
|
|
@ -859,6 +859,21 @@ static void i5100_init_csrows(struct mem_ctl_info *mci)
|
|||
}
|
||||
}
|
||||
|
||||
static void i5100_set_error_reporting(struct pci_dev *pdev, bool enable)
|
||||
{
|
||||
u32 dw;
|
||||
|
||||
pci_read_config_dword(pdev, I5100_EMASK_MEM, &dw);
|
||||
|
||||
/* Enable with 0, disable with 1 */
|
||||
if (enable)
|
||||
dw &= ~I5100_FERR_NF_MEM_ANY_MASK;
|
||||
else
|
||||
dw |= I5100_FERR_NF_MEM_ANY_MASK;
|
||||
|
||||
pci_write_config_dword(pdev, I5100_EMASK_MEM, dw);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Error injection routines
|
||||
****************************************************************************/
|
||||
|
|
@ -1004,11 +1019,6 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
pci_read_config_dword(pdev, I5100_MS, &dw);
|
||||
ranksperch = !!(dw & (1 << 8)) * 2 + 4;
|
||||
|
||||
/* enable error reporting... */
|
||||
pci_read_config_dword(pdev, I5100_EMASK_MEM, &dw);
|
||||
dw &= ~I5100_FERR_NF_MEM_ANY_MASK;
|
||||
pci_write_config_dword(pdev, I5100_EMASK_MEM, dw);
|
||||
|
||||
/* device 21, func 0, Channel 0 Memory Map, Error Flag/Mask, etc... */
|
||||
ch0mm = pci_get_device_func(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_5100_21, 0);
|
||||
|
|
@ -1125,6 +1135,9 @@ static int i5100_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
|
||||
i5100_setup_debugfs(mci);
|
||||
|
||||
/* Enable error reporting on success */
|
||||
i5100_set_error_reporting(pdev, true);
|
||||
|
||||
return ret;
|
||||
|
||||
bail_scrub:
|
||||
|
|
@ -1169,6 +1182,9 @@ static void i5100_remove_one(struct pci_dev *pdev)
|
|||
|
||||
priv = mci->pvt_info;
|
||||
|
||||
/* Disable error reporting at teardown */
|
||||
i5100_set_error_reporting(pdev, false);
|
||||
|
||||
edac_debugfs_remove_recursive(priv->debugfs);
|
||||
|
||||
priv->scrub_enable = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user