13 #include <linux/module.h>
15 #include <linux/pci.h>
17 #include <linux/slab.h>
22 #include <linux/bitmap.h>
24 #include <asm/processor.h>
37 #define SBRIDGE_REVISION " Ver: 1.0.0 "
38 #define EDAC_MOD_STR "sbridge_edac"
43 #define sbridge_printk(level, fmt, arg...) \
44 edac_printk(level, "sbridge", fmt, ##arg)
46 #define sbridge_mc_printk(mci, level, fmt, arg...) \
47 edac_mc_chipset_printk(mci, level, "sbridge", fmt, ##arg)
52 #define GET_BITFIELD(v, lo, hi) \
53 (((v) & ((1ULL << ((hi) - (lo) + 1)) - 1) << (lo)) >> (lo))
64 #define PCI_DEVICE_ID_INTEL_SBRIDGE_SAD0 0x3cf4
65 #define PCI_DEVICE_ID_INTEL_SBRIDGE_SAD1 0x3cf6
66 #define PCI_DEVICE_ID_INTEL_SBRIDGE_BR 0x3cf5
67 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_HA0 0x3ca0
68 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TA 0x3ca8
69 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_RAS 0x3c71
70 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD0 0x3caa
71 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD1 0x3cab
72 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD2 0x3cac
73 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_TAD3 0x3cad
74 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_DDRIO 0x3cb8
80 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_ERR0 0x3c72
81 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_ERR1 0x3c73
82 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_ERR2 0x3c76
83 #define PCI_DEVICE_ID_INTEL_SBRIDGE_IMC_ERR3 0x3c77
86 static const u32 dram_rule[] = {
87 0x80, 0x88, 0x90, 0x98, 0xa0,
88 0xa8, 0xb0, 0xb8, 0xc0, 0xc8,
90 #define MAX_SAD ARRAY_SIZE(dram_rule)
92 #define SAD_LIMIT(reg) ((GET_BITFIELD(reg, 6, 25) << 26) | 0x3ffffff)
93 #define DRAM_ATTR(reg) GET_BITFIELD(reg, 2, 3)
94 #define INTERLEAVE_MODE(reg) GET_BITFIELD(reg, 1, 1)
95 #define DRAM_RULE_ENABLE(reg) GET_BITFIELD(reg, 0, 0)
97 static char *get_dram_attr(
u32 reg)
111 static const u32 interleave_list[] = {
112 0x84, 0x8c, 0x94, 0x9c, 0xa4,
113 0xac, 0xb4, 0xbc, 0xc4, 0xcc,
115 #define MAX_INTERLEAVE ARRAY_SIZE(interleave_list)
117 #define SAD_PKG0(reg) GET_BITFIELD(reg, 0, 2)
118 #define SAD_PKG1(reg) GET_BITFIELD(reg, 3, 5)
119 #define SAD_PKG2(reg) GET_BITFIELD(reg, 8, 10)
120 #define SAD_PKG3(reg) GET_BITFIELD(reg, 11, 13)
121 #define SAD_PKG4(reg) GET_BITFIELD(reg, 16, 18)
122 #define SAD_PKG5(reg) GET_BITFIELD(reg, 19, 21)
123 #define SAD_PKG6(reg) GET_BITFIELD(reg, 24, 26)
124 #define SAD_PKG7(reg) GET_BITFIELD(reg, 27, 29)
128 switch (interleave) {
155 #define GET_TOLM(reg) ((GET_BITFIELD(reg, 0, 3) << 28) | 0x3ffffff)
156 #define GET_TOHM(reg) ((GET_BITFIELD(reg, 0, 20) << 25) | 0x3ffffff)
160 #define SAD_TARGET 0xf0
162 #define SOURCE_ID(reg) GET_BITFIELD(reg, 9, 11)
164 #define SAD_CONTROL 0xf4
166 #define NODE_ID(reg) GET_BITFIELD(reg, 0, 2)
170 static const u32 tad_dram_rule[] = {
171 0x40, 0x44, 0x48, 0x4c,
172 0x50, 0x54, 0x58, 0x5c,
173 0x60, 0x64, 0x68, 0x6c,
175 #define MAX_TAD ARRAY_SIZE(tad_dram_rule)
177 #define TAD_LIMIT(reg) ((GET_BITFIELD(reg, 12, 31) << 26) | 0x3ffffff)
178 #define TAD_SOCK(reg) GET_BITFIELD(reg, 10, 11)
179 #define TAD_CH(reg) GET_BITFIELD(reg, 8, 9)
180 #define TAD_TGT3(reg) GET_BITFIELD(reg, 6, 7)
181 #define TAD_TGT2(reg) GET_BITFIELD(reg, 4, 5)
182 #define TAD_TGT1(reg) GET_BITFIELD(reg, 2, 3)
183 #define TAD_TGT0(reg) GET_BITFIELD(reg, 0, 1)
189 #define IS_ECC_ENABLED(mcmtr) GET_BITFIELD(mcmtr, 2, 2)
190 #define IS_LOCKSTEP_ENABLED(mcmtr) GET_BITFIELD(mcmtr, 1, 1)
191 #define IS_CLOSE_PG(mcmtr) GET_BITFIELD(mcmtr, 0, 0)
195 #define RASENABLES 0xac
196 #define IS_MIRROR_ENABLED(reg) GET_BITFIELD(reg, 0, 0)
200 static const int mtr_regs[] = {
204 #define RANK_DISABLE(mtr) GET_BITFIELD(mtr, 16, 19)
205 #define IS_DIMM_PRESENT(mtr) GET_BITFIELD(mtr, 14, 14)
206 #define RANK_CNT_BITS(mtr) GET_BITFIELD(mtr, 12, 13)
207 #define RANK_WIDTH_BITS(mtr) GET_BITFIELD(mtr, 2, 4)
208 #define COL_WIDTH_BITS(mtr) GET_BITFIELD(mtr, 0, 1)
210 static const u32 tad_ch_nilv_offset[] = {
211 0x90, 0x94, 0x98, 0x9c,
212 0xa0, 0xa4, 0xa8, 0xac,
213 0xb0, 0xb4, 0xb8, 0xbc,
215 #define CHN_IDX_OFFSET(reg) GET_BITFIELD(reg, 28, 29)
216 #define TAD_OFFSET(reg) (GET_BITFIELD(reg, 6, 25) << 26)
218 static const u32 rir_way_limit[] = {
219 0x108, 0x10c, 0x110, 0x114, 0x118,
221 #define MAX_RIR_RANGES ARRAY_SIZE(rir_way_limit)
223 #define IS_RIR_VALID(reg) GET_BITFIELD(reg, 31, 31)
224 #define RIR_WAY(reg) GET_BITFIELD(reg, 28, 29)
225 #define RIR_LIMIT(reg) ((GET_BITFIELD(reg, 1, 10) << 29)| 0x1fffffff)
227 #define MAX_RIR_WAY 8
230 { 0x120, 0x124, 0x128, 0x12c, 0x130, 0x134, 0x138, 0x13c },
231 { 0x140, 0x144, 0x148, 0x14c, 0x150, 0x154, 0x158, 0x15c },
232 { 0x160, 0x164, 0x168, 0x16c, 0x170, 0x174, 0x178, 0x17c },
233 { 0x180, 0x184, 0x188, 0x18c, 0x190, 0x194, 0x198, 0x19c },
234 { 0x1a0, 0x1a4, 0x1a8, 0x1ac, 0x1b0, 0x1b4, 0x1b8, 0x1bc },
237 #define RIR_RNK_TGT(reg) GET_BITFIELD(reg, 16, 19)
238 #define RIR_OFFSET(reg) GET_BITFIELD(reg, 2, 14)
246 static const u32 correrrcnt[] = {
247 0x104, 0x108, 0x10c, 0x110,
250 #define RANK_ODD_OV(reg) GET_BITFIELD(reg, 31, 31)
251 #define RANK_ODD_ERR_CNT(reg) GET_BITFIELD(reg, 16, 30)
252 #define RANK_EVEN_OV(reg) GET_BITFIELD(reg, 15, 15)
253 #define RANK_EVEN_ERR_CNT(reg) GET_BITFIELD(reg, 0, 14)
255 static const u32 correrrthrsld[] = {
256 0x11c, 0x120, 0x124, 0x128,
259 #define RANK_ODD_ERR_THRSLD(reg) GET_BITFIELD(reg, 16, 30)
260 #define RANK_EVEN_ERR_THRSLD(reg) GET_BITFIELD(reg, 0, 14)
265 #define RANK_CFG_A 0x0328
267 #define IS_RDIMM_ENABLED(reg) GET_BITFIELD(reg, 11, 11)
273 #define NUM_CHANNELS 4
334 #define PCI_DESCR(device, function, device_id) \
336 .func = (function), \
337 .dev_id = (device_id)
339 static const struct pci_id_descr pci_dev_descr_sbridge[] = {
360 #define PCI_ID_TABLE_ENTRY(A) { .descr=A, .n_devs = ARRAY_SIZE(A) }
361 static const struct pci_id_table pci_dev_descr_sbridge_table[] = {
379 static inline int numrank(
u32 mtr)
384 edac_dbg(0,
"Invalid number of ranks: %d (max = 4) raw value = %x (%04x)\n",
392 static inline int numrow(
u32 mtr)
396 if (rows < 13 || rows > 18) {
397 edac_dbg(0,
"Invalid number of rows: %d (should be between 14 and 17) raw value = %x (%04x)\n",
405 static inline int numcol(
u32 mtr)
410 edac_dbg(0,
"Invalid number of cols: %d (max = 4) raw value = %x (%04x)\n",
423 if (sbridge_dev->
bus == bus)
430 static struct sbridge_dev *alloc_sbridge_dev(
u8 bus,
433 struct sbridge_dev *sbridge_dev;
435 sbridge_dev = kzalloc(
sizeof(*sbridge_dev),
GFP_KERNEL);
439 sbridge_dev->
pdev = kzalloc(
sizeof(*sbridge_dev->
pdev) * table->
n_devs,
441 if (!sbridge_dev->
pdev) {
453 static void free_sbridge_dev(
struct sbridge_dev *sbridge_dev)
463 static struct pci_dev *get_pdev_slot_func(
u8 bus,
unsigned slot,
466 struct sbridge_dev *sbridge_dev = get_sbridge_dev(bus);
472 for (i = 0; i < sbridge_dev->
n_devs; i++) {
473 if (!sbridge_dev->
pdev[i])
478 edac_dbg(1,
"Associated %02x.%02x.%d with %p\n",
479 bus, slot, func, sbridge_dev->
pdev[i]);
480 return sbridge_dev->
pdev[
i];
491 static int check_if_ecc_is_active(
const u8 bus)
496 pdev = get_pdev_slot_func(bus, 15, 0);
504 pci_read_config_dword(pdev,
MCMTR, &mcmtr);
527 edac_dbg(0,
"mc#%d: Node ID: %d, source ID: %d\n",
534 edac_dbg(0,
"Memory mirror is enabled\n");
537 edac_dbg(0,
"Memory mirror is disabled\n");
543 edac_dbg(0,
"Lockstep is enabled\n");
547 edac_dbg(0,
"Lockstep is disabled\n");
552 edac_dbg(0,
"address map is on closed page mode\n");
555 edac_dbg(0,
"address map is on open page mode\n");
562 edac_dbg(0,
"Memory is registered\n");
565 edac_dbg(0,
"Memory is unregistered\n");
578 pci_read_config_dword(pvt->
pci_tad[i],
580 edac_dbg(4,
"Channel #%d MTR%d = %x\n", i, j, mtr);
584 ranks = numrank(mtr);
589 size = ((
u64)rows * cols * banks * ranks) >> (20 - 3);
592 edac_dbg(0,
"mc#%d: channel %d, dimm %d, %Ld Mb (%d pages) bank: %d, rank: %d, row: %#x, col: %#x\n",
595 banks, ranks, rows, cols);
603 "CPU_SrcID#%u_Channel#%u_DIMM#%u",
612 static void get_memory_layout(
const struct mem_ctl_info *mci)
615 int i,
j,
k, n_sads, n_tads, sad_interl;
630 tmp_mb = (1 + pvt->
tolm) >> 20;
632 mb = div_u64_rem(tmp_mb, 1000, &kb);
639 tmp_mb = (1 + pvt->
tohm) >> 20;
641 mb = div_u64_rem(tmp_mb, 1000, &kb);
651 for (n_sads = 0; n_sads <
MAX_SAD; n_sads++) {
653 pci_read_config_dword(pvt->
pci_sad0, dram_rule[n_sads],
663 tmp_mb = (limit + 1) >> 20;
664 mb = div_u64_rem(tmp_mb, 1000, &kb);
665 edac_dbg(0,
"SAD#%d %s up to %u.%03u GB (0x%016Lx) Interleave: %s reg=0x%08x\n",
669 ((
u64)tmp_mb) << 20L,
674 pci_read_config_dword(pvt->
pci_sad0, interleave_list[n_sads],
676 sad_interl = sad_pkg(reg, 0);
677 for (j = 0; j < 8; j++) {
678 if (j > 0 && sad_interl == sad_pkg(reg, j))
681 edac_dbg(0,
"SAD#%d, interleave #%d: %d\n",
682 n_sads, j, sad_pkg(reg, j));
690 for (n_tads = 0; n_tads <
MAX_TAD; n_tads++) {
691 pci_read_config_dword(pvt->
pci_ha0, tad_dram_rule[n_tads],
696 tmp_mb = (limit + 1) >> 20;
698 mb = div_u64_rem(tmp_mb, 1000, &kb);
699 edac_dbg(0,
"TAD#%d: up to %u.%03u GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n",
701 ((
u64)tmp_mb) << 20L,
718 for (j = 0; j < n_tads; j++) {
719 pci_read_config_dword(pvt->
pci_tad[i],
720 tad_ch_nilv_offset[j],
723 mb = div_u64_rem(tmp_mb, 1000, &kb);
724 edac_dbg(0,
"TAD CH#%d, offset #%d: %u.%03u GB (0x%016Lx), reg=0x%08x\n",
727 ((
u64)tmp_mb) << 20L,
739 pci_read_config_dword(pvt->
pci_tad[i],
748 mb = div_u64_rem(tmp_mb, 1000, &kb);
749 edac_dbg(0,
"CH#%d RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d, reg=0x%08x\n",
752 ((
u64)tmp_mb) << 20L,
756 for (k = 0; k < rir_way; k++) {
757 pci_read_config_dword(pvt->
pci_tad[i],
762 mb = div_u64_rem(tmp_mb, 1000, &kb);
763 edac_dbg(0,
"CH#%d RIR#%d INTL#%d, offset %u.%03u GB (0x%016Lx), tgt: %d, reg=0x%08x\n",
766 ((
u64)tmp_mb) << 20L,
776 struct sbridge_dev *sbridge_dev;
779 if (sbridge_dev->
node_id == node_id)
780 return sbridge_dev->
mci;
785 static int get_memory_error_data(
struct mem_ctl_info *mci,
790 char **area_type,
char *
msg)
794 int n_rir, n_sads, n_tads, sad_way, sck_xch;
795 int sad_interl,
idx, base_ch;
813 if ((addr > (
u64) pvt->
tolm) && (addr < (1
LL << 32))) {
814 sprintf(msg,
"Error at TOLM area, on addr 0x%08Lx", addr);
818 sprintf(msg,
"Error at MMIOH area, on addr 0x%016Lx", addr);
825 for (n_sads = 0; n_sads <
MAX_SAD; n_sads++) {
826 pci_read_config_dword(pvt->
pci_sad0, dram_rule[n_sads],
834 sprintf(msg,
"Can't discover the memory socket");
841 if (n_sads == MAX_SAD) {
842 sprintf(msg,
"Can't discover the memory socket");
845 *area_type = get_dram_attr(reg);
848 pci_read_config_dword(pvt->
pci_sad0, interleave_list[n_sads],
850 sad_interl = sad_pkg(reg, 0);
851 for (sad_way = 0; sad_way < 8; sad_way++) {
852 if (sad_way > 0 && sad_interl == sad_pkg(reg, sad_way))
854 sad_interleave[sad_way] = sad_pkg(reg, sad_way);
855 edac_dbg(0,
"SAD interleave #%d: %d\n",
856 sad_way, sad_interleave[sad_way]);
858 edac_dbg(0,
"mc#%d: Error detected on SAD#%d: address 0x%016Lx < 0x%016Lx, Interleave [%d:6]%s\n",
864 interleave_mode ?
"" :
"XOR[18:16]");
866 idx = ((addr >> 6) ^ (addr >> 16)) & 7;
868 idx = (addr >> 6) & 7;
882 sprintf(msg,
"Can't discover socket interleave");
885 *socket = sad_interleave[
idx];
886 edac_dbg(0,
"SAD interleave index: %d (wayness %d) = CPU socket %d\n",
887 idx, sad_way, *socket);
895 sprintf(msg,
"Struct for socket #%u wasn't initialized",
906 for (n_tads = 0; n_tads <
MAX_TAD; n_tads++) {
907 pci_read_config_dword(pvt->
pci_ha0, tad_dram_rule[n_tads],
911 sprintf(msg,
"Can't discover the memory channel");
923 pci_read_config_dword(pvt->
pci_tad[0],
924 tad_ch_nilv_offset[n_tads],
930 idx = addr >> (6 + sck_way);
950 sprintf(msg,
"Can't discover the TAD target");
953 *channel_mask = 1 << base_ch;
956 *channel_mask |= 1 << ((base_ch + 2) % 4);
960 sck_xch = 1 << sck_way * (ch_way >> 1);
963 sprintf(msg,
"Invalid mirror set. Can't decode addr");
967 sck_xch = (1 << sck_way) * ch_way;
970 *channel_mask |= 1 << ((base_ch + 1) % 4);
974 edac_dbg(0,
"TAD#%d: address 0x%016Lx < 0x%016Lx, socket interleave %d, channel interleave %d (offset 0x%08Lx), index %d, base ch: %d, ch mask: 0x%02lx\n",
989 sprintf(msg,
"Can't calculate ch addr: TAD offset 0x%08Lx is too high for addr 0x%08Lx!",
995 ch_addr = addr & 0x7f;
998 addr = div_u64(addr, sck_xch);
1001 addr = addr / ch_way;
1004 ch_addr |= addr << 6;
1010 pci_read_config_dword(pvt->
pci_tad[base_ch],
1011 rir_way_limit[n_rir],
1018 mb = div_u64_rem(limit >> 20, 1000, &kb);
1019 edac_dbg(0,
"RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d\n",
1024 if (ch_addr <= limit)
1027 if (n_rir == MAX_RIR_RANGES) {
1028 sprintf(msg,
"Can't discover the memory rank for ch addr 0x%08Lx",
1034 idx = (ch_addr >> 6);
1036 idx = (ch_addr >> 13);
1037 idx %= 1 << rir_way;
1039 pci_read_config_dword(pvt->
pci_tad[base_ch],
1040 rir_offset[n_rir][idx],
1044 edac_dbg(0,
"RIR#%d: channel address 0x%08Lx < 0x%08Lx, RIR interleave %d, index %d\n",
1062 static void sbridge_put_devices(
struct sbridge_dev *sbridge_dev)
1067 for (i = 0; i < sbridge_dev->
n_devs; i++) {
1071 edac_dbg(0,
"Removing dev %02x:%02x.%d\n",
1078 static void sbridge_put_all_devices(
void)
1080 struct sbridge_dev *sbridge_dev, *
tmp;
1083 sbridge_put_devices(sbridge_dev);
1084 free_sbridge_dev(sbridge_dev);
1094 static int sbridge_get_onedevice(
struct pci_dev **
prev,
1097 const unsigned devno)
1099 struct sbridge_dev *sbridge_dev;
1106 "Seeking for: dev %02x.%d PCI ID %04x:%04x\n",
1107 dev_descr->
dev, dev_descr->
func,
1111 dev_descr->
dev_id, *prev);
1126 "Device not found: dev %02x.%d PCI ID %04x:%04x\n",
1127 dev_descr->
dev, dev_descr->
func,
1133 bus = pdev->
bus->number;
1135 sbridge_dev = get_sbridge_dev(bus);
1137 sbridge_dev = alloc_sbridge_dev(bus, table);
1145 if (sbridge_dev->
pdev[devno]) {
1147 "Duplicated device for "
1148 "dev %02x:%d.%d PCI ID %04x:%04x\n",
1149 bus, dev_descr->
dev, dev_descr->
func,
1161 "Device PCI ID %04x:%04x "
1162 "has dev %02x:%d.%d instead of dev %02x:%02x.%d\n",
1165 bus, dev_descr->
dev, dev_descr->
func);
1173 "dev %02x:%d.%d PCI ID %04x:%04x\n",
1174 bus, dev_descr->
dev, dev_descr->
func,
1179 edac_dbg(0,
"Detected dev %02x:%d.%d PCI ID %04x:%04x\n",
1180 bus, dev_descr->
dev, dev_descr->
func,
1195 static int sbridge_get_all_devices(
u8 *num_mc)
1199 const struct pci_id_table *table = pci_dev_descr_sbridge_table;
1201 while (table && table->
descr) {
1202 for (i = 0; i < table->
n_devs; i++) {
1205 rc = sbridge_get_onedevice(&pdev, num_mc,
1212 sbridge_put_all_devices();
1224 struct sbridge_dev *sbridge_dev)
1230 for (i = 0; i < sbridge_dev->
n_devs; i++) {
1231 pdev = sbridge_dev->
pdev[
i];
1279 pvt->
pci_tad[func - 2] = pdev;
1298 edac_dbg(0,
"Associated PCI %02x.%02d.%d with dev = %p\n",
1322 "is out of the expected range\n",
1337 static void sbridge_mce_output_error(
struct mem_ctl_info *mci,
1338 const struct mce *
m)
1343 char *
type, *optype, msg[256];
1356 char *area_type =
NULL;
1358 if (uncorrected_error) {
1382 if (! ((errcode & 0xef80) == 0x80)) {
1383 optype =
"Can't parse: it is not a mem";
1385 switch (optypenum) {
1387 optype =
"generic undef request error";
1390 optype =
"memory read error";
1393 optype =
"memory write error";
1396 optype =
"addr/cmd error";
1399 optype =
"memory scrubbing error";
1402 optype =
"reserved";
1407 rc = get_memory_error_data(mci, m->
addr, &socket,
1408 &channel_mask, &rank, &area_type, msg);
1413 strcpy(msg,
"Error: socket got corrupted!");
1436 "%s%s area:%s err_code:%04x:%04x socket:%d channel_mask:%ld rank:%d",
1437 overflow ?
" OVERFLOW" :
"",
1438 (uncorrected_error && recoverable) ?
" recoverable" :
"",
1466 static void sbridge_check_error(
struct mem_ctl_info *mci)
1509 for (i = 0; i <
count; i++)
1521 static int sbridge_mce_check_error(
struct notifier_block *nb,
unsigned long val,
1524 struct mce *
mce = (
struct mce *)data;
1539 if ((mce->
status & 0xefff) >> 7 != 1)
1542 printk(
"sbridge: HANDLING MCE MEMORY ERROR\n");
1544 printk(
"CPU %d: Machine Check Exception: %Lx Bank %d: %016Lx\n",
1550 printk(
"PROCESSOR %u:%x TIME %llu SOCKET %u APIC %x\n",
1572 sbridge_check_error(mci);
1579 .notifier_call = sbridge_mce_check_error,
1586 static void sbridge_unregister_mci(
struct sbridge_dev *sbridge_dev)
1592 edac_dbg(0,
"MC: dev = %p\n", &sbridge_dev->
pdev[0]->dev);
1600 edac_dbg(0,
"MC: mci = %p, dev = %p\n",
1601 mci, &sbridge_dev->
pdev[0]->dev);
1612 static int sbridge_register_mci(
struct sbridge_dev *sbridge_dev)
1620 rc = check_if_ecc_is_active(sbridge_dev->
bus);
1627 layers[0].is_virt_csrow =
false;
1630 layers[1].is_virt_csrow =
true;
1637 edac_dbg(0,
"MC: mci = %p, dev = %p\n",
1638 mci, &sbridge_dev->
pdev[0]->dev);
1641 memset(pvt, 0,
sizeof(*pvt));
1645 sbridge_dev->
mci = mci;
1660 rc = mci_bind_devs(mci, sbridge_dev);
1665 get_dimm_config(mci);
1666 get_memory_layout(mci);
1669 mci->
pdev = &sbridge_dev->
pdev[0]->dev;
1673 edac_dbg(0,
"MC: failed edac_mc_add_mc()\n");
1700 struct sbridge_dev *sbridge_dev;
1714 rc = sbridge_get_all_devices(&num_mc);
1720 edac_dbg(0,
"Registering MC#%d (%d of %d)\n",
1721 mc, mc + 1, num_mc);
1722 sbridge_dev->
mc = mc++;
1723 rc = sbridge_register_mci(sbridge_dev);
1735 sbridge_unregister_mci(sbridge_dev);
1737 sbridge_put_all_devices();
1749 struct sbridge_dev *sbridge_dev;
1769 sbridge_unregister_mci(sbridge_dev);
1772 sbridge_put_all_devices();
1786 .
name =
"sbridge_edac",
1787 .probe = sbridge_probe,
1789 .id_table = sbridge_pci_tbl,
1796 static int __init sbridge_init(
void)
1805 pci_rc = pci_register_driver(&sbridge_driver);
1822 static void __exit sbridge_exit(
void)