#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/edac.h>
#include <linux/mmzone.h>
#include <linux/smp.h>
#include <asm/mce.h>
#include <asm/processor.h>
#include <asm/div64.h>
#include "edac_module.h"
static LIST_HEAD(i7core_edac_list);
static DEFINE_MUTEX(i7core_edac_lock);
static int probed;
static int use_pci_fixup;
module_param(use_pci_fixup, int, 0444);
MODULE_PARM_DESC(…) …;
#define MAX_SOCKET_BUSES …
#define I7CORE_REVISION …
#define EDAC_MOD_STR …
#define i7core_printk(level, fmt, arg...) …
#define i7core_mc_printk(mci, level, fmt, arg...) …
#define MC_CFG_CONTROL …
#define MC_CFG_UNLOCK …
#define MC_CFG_LOCK …
#define MC_CONTROL …
#define MC_STATUS …
#define MC_MAX_DOD …
#define MC_TEST_ERR_RCV1 …
#define DIMM2_COR_ERR(r) …
#define MC_TEST_ERR_RCV0 …
#define DIMM1_COR_ERR(r) …
#define DIMM0_COR_ERR(r) …
#define MC_SSRCONTROL …
#define SSR_MODE_DISABLE …
#define SSR_MODE_ENABLE …
#define SSR_MODE_MASK …
#define MC_SCRUB_CONTROL …
#define STARTSCRUB …
#define SCRUBINTERVAL_MASK …
#define MC_COR_ECC_CNT_0 …
#define MC_COR_ECC_CNT_1 …
#define MC_COR_ECC_CNT_2 …
#define MC_COR_ECC_CNT_3 …
#define MC_COR_ECC_CNT_4 …
#define MC_COR_ECC_CNT_5 …
#define DIMM_TOP_COR_ERR(r) …
#define DIMM_BOT_COR_ERR(r) …
#define MC_CHANNEL_DIMM_INIT_PARAMS …
#define THREE_DIMMS_PRESENT …
#define SINGLE_QUAD_RANK_PRESENT …
#define QUAD_RANK_PRESENT …
#define REGISTERED_DIMM …
#define MC_CHANNEL_MAPPER …
#define RDLCH(r, ch) …
#define WRLCH(r, ch) …
#define MC_CHANNEL_RANK_PRESENT …
#define RANK_PRESENT_MASK …
#define MC_CHANNEL_ADDR_MATCH …
#define MC_CHANNEL_ERROR_MASK …
#define MC_CHANNEL_ERROR_INJECT …
#define INJECT_ADDR_PARITY …
#define INJECT_ECC …
#define MASK_CACHELINE …
#define MASK_FULL_CACHELINE …
#define MASK_MSB32_CACHELINE …
#define MASK_LSB32_CACHELINE …
#define NO_MASK_CACHELINE …
#define REPEAT_EN …
#define MC_DOD_CH_DIMM0 …
#define MC_DOD_CH_DIMM1 …
#define MC_DOD_CH_DIMM2 …
#define RANKOFFSET_MASK …
#define RANKOFFSET(x) …
#define DIMM_PRESENT_MASK …
#define DIMM_PRESENT(x) …
#define MC_DOD_NUMBANK_MASK …
#define MC_DOD_NUMBANK(x) …
#define MC_DOD_NUMRANK_MASK …
#define MC_DOD_NUMRANK(x) …
#define MC_DOD_NUMROW_MASK …
#define MC_DOD_NUMROW(x) …
#define MC_DOD_NUMCOL_MASK …
#define MC_DOD_NUMCOL(x) …
#define MC_RANK_PRESENT …
#define MC_SAG_CH_0 …
#define MC_SAG_CH_1 …
#define MC_SAG_CH_2 …
#define MC_SAG_CH_3 …
#define MC_SAG_CH_4 …
#define MC_SAG_CH_5 …
#define MC_SAG_CH_6 …
#define MC_SAG_CH_7 …
#define MC_RIR_LIMIT_CH_0 …
#define MC_RIR_LIMIT_CH_1 …
#define MC_RIR_LIMIT_CH_2 …
#define MC_RIR_LIMIT_CH_3 …
#define MC_RIR_LIMIT_CH_4 …
#define MC_RIR_LIMIT_CH_5 …
#define MC_RIR_LIMIT_CH_6 …
#define MC_RIR_LIMIT_CH_7 …
#define MC_RIR_LIMIT_MASK …
#define MC_RIR_WAY_CH …
#define MC_RIR_WAY_OFFSET_MASK …
#define MC_RIR_WAY_RANK_MASK …
#define NUM_CHANS …
#define MAX_DIMMS …
#define MAX_MCR_FUNC …
#define MAX_CHAN_FUNC …
struct i7core_info { … };
struct i7core_inject { … };
struct i7core_channel { … };
struct pci_id_descr { … };
struct pci_id_table { … };
struct i7core_dev { … };
struct i7core_pvt { … };
#define PCI_DESCR(device, function, device_id) …
static const struct pci_id_descr pci_dev_descr_i7core_nehalem[] = …;
static const struct pci_id_descr pci_dev_descr_lynnfield[] = …;
static const struct pci_id_descr pci_dev_descr_i7core_westmere[] = …;
#define PCI_ID_TABLE_ENTRY(A) …
static const struct pci_id_table pci_dev_table[] = …;
static const struct pci_device_id i7core_pci_tbl[] = …;
#define CH_ACTIVE(pvt, ch) …
#define ECCx8(pvt) …
#define ECC_ENABLED(pvt) …
#define CH_DISABLED(pvt, ch) …
static inline int numdimms(u32 dimms)
{ … }
static inline int numrank(u32 rank)
{ … }
static inline int numbank(u32 bank)
{ … }
static inline int numrow(u32 row)
{ … }
static inline int numcol(u32 col)
{ … }
static struct i7core_dev *get_i7core_dev(u8 socket)
{ … }
static struct i7core_dev *alloc_i7core_dev(u8 socket,
const struct pci_id_table *table)
{ … }
static void free_i7core_dev(struct i7core_dev *i7core_dev)
{ … }
static int get_dimm_config(struct mem_ctl_info *mci)
{ … }
#define to_mci(k) …
static int disable_inject(const struct mem_ctl_info *mci)
{ … }
static ssize_t i7core_inject_section_store(struct device *dev,
struct device_attribute *mattr,
const char *data, size_t count)
{ … }
static ssize_t i7core_inject_section_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t i7core_inject_type_store(struct device *dev,
struct device_attribute *mattr,
const char *data, size_t count)
{ … }
static ssize_t i7core_inject_type_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
static ssize_t i7core_inject_eccmask_store(struct device *dev,
struct device_attribute *mattr,
const char *data, size_t count)
{ … }
static ssize_t i7core_inject_eccmask_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
#define DECLARE_ADDR_MATCH(param, limit) …
#define ATTR_ADDR_MATCH(param) …
DECLARE_ADDR_MATCH(channel, 3);
DECLARE_ADDR_MATCH(dimm, 3);
DECLARE_ADDR_MATCH(rank, 4);
DECLARE_ADDR_MATCH(bank, 32);
DECLARE_ADDR_MATCH(page, 0x10000);
DECLARE_ADDR_MATCH(col, 0x4000);
ATTR_ADDR_MATCH(…);
ATTR_ADDR_MATCH(…);
ATTR_ADDR_MATCH(…);
ATTR_ADDR_MATCH(…);
ATTR_ADDR_MATCH(…);
ATTR_ADDR_MATCH(…);
static int write_and_test(struct pci_dev *dev, const int where, const u32 val)
{ … }
static ssize_t i7core_inject_enable_store(struct device *dev,
struct device_attribute *mattr,
const char *data, size_t count)
{ … }
static ssize_t i7core_inject_enable_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{ … }
#define DECLARE_COUNTER(param) …
#define ATTR_COUNTER(param) …
DECLARE_COUNTER(0);
DECLARE_COUNTER(1);
DECLARE_COUNTER(2);
ATTR_COUNTER(…);
ATTR_COUNTER(…);
ATTR_COUNTER(…);
static struct attribute *i7core_addrmatch_attrs[] = …;
static const struct attribute_group addrmatch_grp = …;
static const struct attribute_group *addrmatch_groups[] = …;
static void addrmatch_release(struct device *device)
{ … }
static const struct device_type addrmatch_type = …;
static struct attribute *i7core_udimm_counters_attrs[] = …;
static const struct attribute_group all_channel_counts_grp = …;
static const struct attribute_group *all_channel_counts_groups[] = …;
static void all_channel_counts_release(struct device *device)
{ … }
static const struct device_type all_channel_counts_type = …;
static DEVICE_ATTR(inject_section, S_IRUGO | S_IWUSR,
i7core_inject_section_show, i7core_inject_section_store);
static DEVICE_ATTR(inject_type, S_IRUGO | S_IWUSR,
i7core_inject_type_show, i7core_inject_type_store);
static DEVICE_ATTR(inject_eccmask, S_IRUGO | S_IWUSR,
i7core_inject_eccmask_show, i7core_inject_eccmask_store);
static DEVICE_ATTR(inject_enable, S_IRUGO | S_IWUSR,
i7core_inject_enable_show, i7core_inject_enable_store);
static struct attribute *i7core_dev_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int i7core_create_sysfs_devices(struct mem_ctl_info *mci)
{ … }
static void i7core_delete_sysfs_devices(struct mem_ctl_info *mci)
{ … }
static void i7core_put_devices(struct i7core_dev *i7core_dev)
{ … }
static void i7core_put_all_devices(void)
{ … }
static void __init i7core_xeon_pci_fixup(const struct pci_id_table *table)
{ … }
static unsigned i7core_pci_lastbus(void)
{ … }
static int i7core_get_onedevice(struct pci_dev **prev,
const struct pci_id_table *table,
const unsigned devno,
const unsigned last_bus)
{ … }
static int i7core_get_all_devices(void)
{ … }
static int mci_bind_devs(struct mem_ctl_info *mci,
struct i7core_dev *i7core_dev)
{ … }
static void i7core_rdimm_update_ce_count(struct mem_ctl_info *mci,
const int chan,
const int new0,
const int new1,
const int new2)
{ … }
static void i7core_rdimm_check_mc_ecc_err(struct mem_ctl_info *mci)
{ … }
static void i7core_udimm_check_mc_ecc_err(struct mem_ctl_info *mci)
{ … }
static void i7core_mce_output_error(struct mem_ctl_info *mci,
const struct mce *m)
{ … }
static void i7core_check_error(struct mem_ctl_info *mci, struct mce *m)
{ … }
static int i7core_mce_check_error(struct notifier_block *nb, unsigned long val,
void *data)
{ … }
static struct notifier_block i7_mce_dec = …;
struct memdev_dmi_entry { … } __attribute__((packed));
static void decode_dclk(const struct dmi_header *dh, void *_dclk_freq)
{ … }
#define DEFAULT_DCLK_FREQ …
static int get_dclk_freq(void)
{ … }
static int set_sdram_scrub_rate(struct mem_ctl_info *mci, u32 new_bw)
{ … }
static int get_sdram_scrub_rate(struct mem_ctl_info *mci)
{ … }
static void enable_sdram_scrub_setting(struct mem_ctl_info *mci)
{ … }
static void disable_sdram_scrub_setting(struct mem_ctl_info *mci)
{ … }
static void i7core_pci_ctl_create(struct i7core_pvt *pvt)
{ … }
static void i7core_pci_ctl_release(struct i7core_pvt *pvt)
{ … }
static void i7core_unregister_mci(struct i7core_dev *i7core_dev)
{ … }
static int i7core_register_mci(struct i7core_dev *i7core_dev)
{ … }
static int i7core_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ … }
static void i7core_remove(struct pci_dev *pdev)
{ … }
MODULE_DEVICE_TABLE(pci, i7core_pci_tbl);
static struct pci_driver i7core_driver = …;
static int __init i7core_init(void)
{ … }
static void __exit i7core_exit(void)
{ … }
module_init(…) …;
module_exit(i7core_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
module_param(edac_op_state, int, 0444);
MODULE_PARM_DESC(…) …;