aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2013-08-10 07:54:48 -0400
committerBorislav Petkov <bp@suse.de>2013-08-12 10:01:56 -0400
commita4b4bedce880046feeb5b206392960f395ed02ad (patch)
treea6e812142387d468966287904bf22a413d899cb4
parent18b94f66f9537003cee30d475d79a57c58f1e1d8 (diff)
amd64_edac: Get rid of boot_cpu_data accesses
Now that we cache (family, model, stepping) locally, use them instead of boot_cpu_data. No functionality change. Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--drivers/edac/amd64_edac.c90
-rw-r--r--drivers/edac/amd64_edac.h4
2 files changed, 46 insertions, 48 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index a5d6348d591f..d6c0c6590607 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -203,13 +203,11 @@ static int amd64_set_scrub_rate(struct mem_ctl_info *mci, u32 bw)
203 struct amd64_pvt *pvt = mci->pvt_info; 203 struct amd64_pvt *pvt = mci->pvt_info;
204 u32 min_scrubrate = 0x5; 204 u32 min_scrubrate = 0x5;
205 205
206 if (boot_cpu_data.x86 == 0xf) 206 if (pvt->fam == 0xf)
207 min_scrubrate = 0x0; 207 min_scrubrate = 0x0;
208 208
209 /* Erratum #505 for F15h Model 0x00 - Model 0x01, Stepping 0 */ 209 /* Erratum #505 for F15h Model 0x00 - Model 0x01, Stepping 0 */
210 if (boot_cpu_data.x86 == 0x15 && 210 if (pvt->fam == 0x15 && pvt->model <= 0x01 && pvt->stepping < 0x1)
211 boot_cpu_data.x86_model <= 0x01 &&
212 boot_cpu_data.x86_mask < 0x1)
213 f15h_select_dct(pvt, 0); 211 f15h_select_dct(pvt, 0);
214 212
215 return __amd64_set_scrub_rate(pvt->F3, bw, min_scrubrate); 213 return __amd64_set_scrub_rate(pvt->F3, bw, min_scrubrate);
@@ -222,9 +220,7 @@ static int amd64_get_scrub_rate(struct mem_ctl_info *mci)
222 int i, retval = -EINVAL; 220 int i, retval = -EINVAL;
223 221
224 /* Erratum #505 for F15h Model 0x00 - Model 0x01, Stepping 0 */ 222 /* Erratum #505 for F15h Model 0x00 - Model 0x01, Stepping 0 */
225 if (boot_cpu_data.x86 == 0x15 && 223 if (pvt->fam == 0x15 && pvt->model <= 0x01 && pvt->stepping < 0x1)
226 boot_cpu_data.x86_model <= 0x01 &&
227 boot_cpu_data.x86_mask < 0x1)
228 f15h_select_dct(pvt, 0); 224 f15h_select_dct(pvt, 0);
229 225
230 amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval); 226 amd64_read_pci_cfg(pvt->F3, SCRCTRL, &scrubval);
@@ -373,7 +369,7 @@ static void get_cs_base_and_mask(struct amd64_pvt *pvt, int csrow, u8 dct,
373 csmask = pvt->csels[dct].csmasks[csrow >> 1]; 369 csmask = pvt->csels[dct].csmasks[csrow >> 1];
374 addr_shift = 8; 370 addr_shift = 8;
375 371
376 if (boot_cpu_data.x86 == 0x15) 372 if (pvt->fam == 0x15)
377 base_bits = mask_bits = GENMASK(19,30) | GENMASK(5,13); 373 base_bits = mask_bits = GENMASK(19,30) | GENMASK(5,13);
378 else 374 else
379 base_bits = mask_bits = GENMASK(19,28) | GENMASK(5,13); 375 base_bits = mask_bits = GENMASK(19,28) | GENMASK(5,13);
@@ -453,14 +449,14 @@ int amd64_get_dram_hole_info(struct mem_ctl_info *mci, u64 *hole_base,
453 struct amd64_pvt *pvt = mci->pvt_info; 449 struct amd64_pvt *pvt = mci->pvt_info;
454 450
455 /* only revE and later have the DRAM Hole Address Register */ 451 /* only revE and later have the DRAM Hole Address Register */
456 if (boot_cpu_data.x86 == 0xf && pvt->ext_model < K8_REV_E) { 452 if (pvt->fam == 0xf && pvt->ext_model < K8_REV_E) {
457 edac_dbg(1, " revision %d for node %d does not support DHAR\n", 453 edac_dbg(1, " revision %d for node %d does not support DHAR\n",
458 pvt->ext_model, pvt->mc_node_id); 454 pvt->ext_model, pvt->mc_node_id);
459 return 1; 455 return 1;
460 } 456 }
461 457
462 /* valid for Fam10h and above */ 458 /* valid for Fam10h and above */
463 if (boot_cpu_data.x86 >= 0x10 && !dhar_mem_hoist_valid(pvt)) { 459 if (pvt->fam >= 0x10 && !dhar_mem_hoist_valid(pvt)) {
464 edac_dbg(1, " Dram Memory Hoisting is DISABLED on this system\n"); 460 edac_dbg(1, " Dram Memory Hoisting is DISABLED on this system\n");
465 return 1; 461 return 1;
466 } 462 }
@@ -492,10 +488,8 @@ int amd64_get_dram_hole_info(struct mem_ctl_info *mci, u64 *hole_base,
492 *hole_base = dhar_base(pvt); 488 *hole_base = dhar_base(pvt);
493 *hole_size = (1ULL << 32) - *hole_base; 489 *hole_size = (1ULL << 32) - *hole_base;
494 490
495 if (boot_cpu_data.x86 > 0xf) 491 *hole_offset = (pvt->fam > 0xf) ? f10_dhar_offset(pvt)
496 *hole_offset = f10_dhar_offset(pvt); 492 : k8_dhar_offset(pvt);
497 else
498 *hole_offset = k8_dhar_offset(pvt);
499 493
500 edac_dbg(1, " DHAR info for node %d base 0x%lx offset 0x%lx size 0x%lx\n", 494 edac_dbg(1, " DHAR info for node %d base 0x%lx offset 0x%lx size 0x%lx\n",
501 pvt->mc_node_id, (unsigned long)*hole_base, 495 pvt->mc_node_id, (unsigned long)*hole_base,
@@ -669,7 +663,7 @@ static unsigned long amd64_determine_edac_cap(struct amd64_pvt *pvt)
669 u8 bit; 663 u8 bit;
670 unsigned long edac_cap = EDAC_FLAG_NONE; 664 unsigned long edac_cap = EDAC_FLAG_NONE;
671 665
672 bit = (boot_cpu_data.x86 > 0xf || pvt->ext_model >= K8_REV_F) 666 bit = (pvt->fam > 0xf || pvt->ext_model >= K8_REV_F)
673 ? 19 667 ? 19
674 : 17; 668 : 17;
675 669
@@ -681,7 +675,7 @@ static unsigned long amd64_determine_edac_cap(struct amd64_pvt *pvt)
681 675
682static void amd64_debug_display_dimm_sizes(struct amd64_pvt *, u8); 676static void amd64_debug_display_dimm_sizes(struct amd64_pvt *, u8);
683 677
684static void amd64_dump_dramcfg_low(u32 dclr, int chan) 678static void amd64_dump_dramcfg_low(struct amd64_pvt *pvt, u32 dclr, int chan)
685{ 679{
686 edac_dbg(1, "F2x%d90 (DRAM Cfg Low): 0x%08x\n", chan, dclr); 680 edac_dbg(1, "F2x%d90 (DRAM Cfg Low): 0x%08x\n", chan, dclr);
687 681
@@ -692,7 +686,7 @@ static void amd64_dump_dramcfg_low(u32 dclr, int chan)
692 edac_dbg(1, " PAR/ERR parity: %s\n", 686 edac_dbg(1, " PAR/ERR parity: %s\n",
693 (dclr & BIT(8)) ? "enabled" : "disabled"); 687 (dclr & BIT(8)) ? "enabled" : "disabled");
694 688
695 if (boot_cpu_data.x86 == 0x10) 689 if (pvt->fam == 0x10)
696 edac_dbg(1, " DCT 128bit mode width: %s\n", 690 edac_dbg(1, " DCT 128bit mode width: %s\n",
697 (dclr & BIT(11)) ? "128b" : "64b"); 691 (dclr & BIT(11)) ? "128b" : "64b");
698 692
@@ -715,21 +709,21 @@ static void dump_misc_regs(struct amd64_pvt *pvt)
715 (pvt->nbcap & NBCAP_SECDED) ? "yes" : "no", 709 (pvt->nbcap & NBCAP_SECDED) ? "yes" : "no",
716 (pvt->nbcap & NBCAP_CHIPKILL) ? "yes" : "no"); 710 (pvt->nbcap & NBCAP_CHIPKILL) ? "yes" : "no");
717 711
718 amd64_dump_dramcfg_low(pvt->dclr0, 0); 712 amd64_dump_dramcfg_low(pvt, pvt->dclr0, 0);
719 713
720 edac_dbg(1, "F3xB0 (Online Spare): 0x%08x\n", pvt->online_spare); 714 edac_dbg(1, "F3xB0 (Online Spare): 0x%08x\n", pvt->online_spare);
721 715
722 edac_dbg(1, "F1xF0 (DRAM Hole Address): 0x%08x, base: 0x%08x, offset: 0x%08x\n", 716 edac_dbg(1, "F1xF0 (DRAM Hole Address): 0x%08x, base: 0x%08x, offset: 0x%08x\n",
723 pvt->dhar, dhar_base(pvt), 717 pvt->dhar, dhar_base(pvt),
724 (boot_cpu_data.x86 == 0xf) ? k8_dhar_offset(pvt) 718 (pvt->fam == 0xf) ? k8_dhar_offset(pvt)
725 : f10_dhar_offset(pvt)); 719 : f10_dhar_offset(pvt));
726 720
727 edac_dbg(1, " DramHoleValid: %s\n", dhar_valid(pvt) ? "yes" : "no"); 721 edac_dbg(1, " DramHoleValid: %s\n", dhar_valid(pvt) ? "yes" : "no");
728 722
729 amd64_debug_display_dimm_sizes(pvt, 0); 723 amd64_debug_display_dimm_sizes(pvt, 0);
730 724
731 /* everything below this point is Fam10h and above */ 725 /* everything below this point is Fam10h and above */
732 if (boot_cpu_data.x86 == 0xf) 726 if (pvt->fam == 0xf)
733 return; 727 return;
734 728
735 amd64_debug_display_dimm_sizes(pvt, 1); 729 amd64_debug_display_dimm_sizes(pvt, 1);
@@ -738,7 +732,7 @@ static void dump_misc_regs(struct amd64_pvt *pvt)
738 732
739 /* Only if NOT ganged does dclr1 have valid info */ 733 /* Only if NOT ganged does dclr1 have valid info */
740 if (!dct_ganging_enabled(pvt)) 734 if (!dct_ganging_enabled(pvt))
741 amd64_dump_dramcfg_low(pvt->dclr1, 1); 735 amd64_dump_dramcfg_low(pvt, pvt->dclr1, 1);
742} 736}
743 737
744/* 738/*
@@ -777,7 +771,7 @@ static void read_dct_base_mask(struct amd64_pvt *pvt)
777 edac_dbg(0, " DCSB0[%d]=0x%08x reg: F2x%x\n", 771 edac_dbg(0, " DCSB0[%d]=0x%08x reg: F2x%x\n",
778 cs, *base0, reg0); 772 cs, *base0, reg0);
779 773
780 if (boot_cpu_data.x86 == 0xf || dct_ganging_enabled(pvt)) 774 if (pvt->fam == 0xf || dct_ganging_enabled(pvt))
781 continue; 775 continue;
782 776
783 if (!amd64_read_dct_pci_cfg(pvt, reg1, base1)) 777 if (!amd64_read_dct_pci_cfg(pvt, reg1, base1))
@@ -795,7 +789,7 @@ static void read_dct_base_mask(struct amd64_pvt *pvt)
795 edac_dbg(0, " DCSM0[%d]=0x%08x reg: F2x%x\n", 789 edac_dbg(0, " DCSM0[%d]=0x%08x reg: F2x%x\n",
796 cs, *mask0, reg0); 790 cs, *mask0, reg0);
797 791
798 if (boot_cpu_data.x86 == 0xf || dct_ganging_enabled(pvt)) 792 if (pvt->fam == 0xf || dct_ganging_enabled(pvt))
799 continue; 793 continue;
800 794
801 if (!amd64_read_dct_pci_cfg(pvt, reg1, mask1)) 795 if (!amd64_read_dct_pci_cfg(pvt, reg1, mask1))
@@ -809,9 +803,9 @@ static enum mem_type amd64_determine_memory_type(struct amd64_pvt *pvt, int cs)
809 enum mem_type type; 803 enum mem_type type;
810 804
811 /* F15h supports only DDR3 */ 805 /* F15h supports only DDR3 */
812 if (boot_cpu_data.x86 >= 0x15) 806 if (pvt->fam >= 0x15)
813 type = (pvt->dclr0 & BIT(16)) ? MEM_DDR3 : MEM_RDDR3; 807 type = (pvt->dclr0 & BIT(16)) ? MEM_DDR3 : MEM_RDDR3;
814 else if (boot_cpu_data.x86 == 0x10 || pvt->ext_model >= K8_REV_F) { 808 else if (pvt->fam == 0x10 || pvt->ext_model >= K8_REV_F) {
815 if (pvt->dchr0 & DDR3_MODE) 809 if (pvt->dchr0 & DDR3_MODE)
816 type = (pvt->dclr0 & BIT(16)) ? MEM_DDR3 : MEM_RDDR3; 810 type = (pvt->dclr0 & BIT(16)) ? MEM_DDR3 : MEM_RDDR3;
817 else 811 else
@@ -844,14 +838,13 @@ static int k8_early_channel_count(struct amd64_pvt *pvt)
844} 838}
845 839
846/* On F10h and later ErrAddr is MC4_ADDR[47:1] */ 840/* On F10h and later ErrAddr is MC4_ADDR[47:1] */
847static u64 get_error_address(struct mce *m) 841static u64 get_error_address(struct amd64_pvt *pvt, struct mce *m)
848{ 842{
849 struct cpuinfo_x86 *c = &boot_cpu_data;
850 u64 addr; 843 u64 addr;
851 u8 start_bit = 1; 844 u8 start_bit = 1;
852 u8 end_bit = 47; 845 u8 end_bit = 47;
853 846
854 if (c->x86 == 0xf) { 847 if (pvt->fam == 0xf) {
855 start_bit = 3; 848 start_bit = 3;
856 end_bit = 39; 849 end_bit = 39;
857 } 850 }
@@ -861,7 +854,7 @@ static u64 get_error_address(struct mce *m)
861 /* 854 /*
862 * Erratum 637 workaround 855 * Erratum 637 workaround
863 */ 856 */
864 if (c->x86 == 0x15) { 857 if (pvt->fam == 0x15) {
865 struct amd64_pvt *pvt; 858 struct amd64_pvt *pvt;
866 u64 cc6_base, tmp_addr; 859 u64 cc6_base, tmp_addr;
867 u32 tmp; 860 u32 tmp;
@@ -1100,7 +1093,7 @@ static int f1x_early_channel_count(struct amd64_pvt *pvt)
1100 int i, j, channels = 0; 1093 int i, j, channels = 0;
1101 1094
1102 /* On F10h, if we are in 128 bit mode, then we are using 2 channels */ 1095 /* On F10h, if we are in 128 bit mode, then we are using 2 channels */
1103 if (boot_cpu_data.x86 == 0x10 && (pvt->dclr0 & WIDTH_128)) 1096 if (pvt->fam == 0x10 && (pvt->dclr0 & WIDTH_128))
1104 return 2; 1097 return 2;
1105 1098
1106 /* 1099 /*
@@ -1201,7 +1194,7 @@ static int f16_dbam_to_chip_select(struct amd64_pvt *pvt, u8 dct,
1201static void read_dram_ctl_register(struct amd64_pvt *pvt) 1194static void read_dram_ctl_register(struct amd64_pvt *pvt)
1202{ 1195{
1203 1196
1204 if (boot_cpu_data.x86 == 0xf) 1197 if (pvt->fam == 0xf)
1205 return; 1198 return;
1206 1199
1207 if (!amd64_read_dct_pci_cfg(pvt, DCT_SEL_LO, &pvt->dct_sel_lo)) { 1200 if (!amd64_read_dct_pci_cfg(pvt, DCT_SEL_LO, &pvt->dct_sel_lo)) {
@@ -1422,11 +1415,9 @@ static u64 f1x_swap_interleaved_region(struct amd64_pvt *pvt, u64 sys_addr)
1422{ 1415{
1423 u32 swap_reg, swap_base, swap_limit, rgn_size, tmp_addr; 1416 u32 swap_reg, swap_base, swap_limit, rgn_size, tmp_addr;
1424 1417
1425 if (boot_cpu_data.x86 == 0x10) { 1418 if (pvt->fam == 0x10) {
1426 /* only revC3 and revE have that feature */ 1419 /* only revC3 and revE have that feature */
1427 if (boot_cpu_data.x86_model < 4 || 1420 if (pvt->model < 4 || (pvt->model < 0xa && pvt->stepping < 3))
1428 (boot_cpu_data.x86_model < 0xa &&
1429 boot_cpu_data.x86_mask < 3))
1430 return sys_addr; 1421 return sys_addr;
1431 } 1422 }
1432 1423
@@ -1714,7 +1705,7 @@ static void amd64_debug_display_dimm_sizes(struct amd64_pvt *pvt, u8 ctrl)
1714 u32 *dcsb = ctrl ? pvt->csels[1].csbases : pvt->csels[0].csbases; 1705 u32 *dcsb = ctrl ? pvt->csels[1].csbases : pvt->csels[0].csbases;
1715 u32 dbam = ctrl ? pvt->dbam1 : pvt->dbam0; 1706 u32 dbam = ctrl ? pvt->dbam1 : pvt->dbam0;
1716 1707
1717 if (boot_cpu_data.x86 == 0xf) { 1708 if (pvt->fam == 0xf) {
1718 /* K8 families < revF not supported yet */ 1709 /* K8 families < revF not supported yet */
1719 if (pvt->ext_model < K8_REV_F) 1710 if (pvt->ext_model < K8_REV_F)
1720 return; 1711 return;
@@ -2031,7 +2022,7 @@ static inline void __amd64_decode_bus_error(struct mem_ctl_info *mci,
2031 2022
2032 memset(&err, 0, sizeof(err)); 2023 memset(&err, 0, sizeof(err));
2033 2024
2034 sys_addr = get_error_address(m); 2025 sys_addr = get_error_address(pvt, m);
2035 2026
2036 if (ecc_type == 2) 2027 if (ecc_type == 2)
2037 err.syndrome = extract_syndrome(m->status); 2028 err.syndrome = extract_syndrome(m->status);
@@ -2092,10 +2083,9 @@ static void free_mc_sibling_devs(struct amd64_pvt *pvt)
2092 */ 2083 */
2093static void read_mc_regs(struct amd64_pvt *pvt) 2084static void read_mc_regs(struct amd64_pvt *pvt)
2094{ 2085{
2095 struct cpuinfo_x86 *c = &boot_cpu_data; 2086 unsigned range;
2096 u64 msr_val; 2087 u64 msr_val;
2097 u32 tmp; 2088 u32 tmp;
2098 unsigned range;
2099 2089
2100 /* 2090 /*
2101 * Retrieve TOP_MEM and TOP_MEM2; no masking off of reserved bits since 2091 * Retrieve TOP_MEM and TOP_MEM2; no masking off of reserved bits since
@@ -2156,14 +2146,14 @@ static void read_mc_regs(struct amd64_pvt *pvt)
2156 2146
2157 pvt->ecc_sym_sz = 4; 2147 pvt->ecc_sym_sz = 4;
2158 2148
2159 if (c->x86 >= 0x10) { 2149 if (pvt->fam >= 0x10) {
2160 amd64_read_pci_cfg(pvt->F3, EXT_NB_MCA_CFG, &tmp); 2150 amd64_read_pci_cfg(pvt->F3, EXT_NB_MCA_CFG, &tmp);
2161 if (c->x86 != 0x16) 2151 if (pvt->fam != 0x16)
2162 /* F16h has only DCT0 */ 2152 /* F16h has only DCT0 */
2163 amd64_read_dct_pci_cfg(pvt, DBAM1, &pvt->dbam1); 2153 amd64_read_dct_pci_cfg(pvt, DBAM1, &pvt->dbam1);
2164 2154
2165 /* F10h, revD and later can do x8 ECC too */ 2155 /* F10h, revD and later can do x8 ECC too */
2166 if ((c->x86 > 0x10 || c->x86_model > 7) && tmp & BIT(25)) 2156 if ((pvt->fam > 0x10 || pvt->model > 7) && tmp & BIT(25))
2167 pvt->ecc_sym_sz = 8; 2157 pvt->ecc_sym_sz = 8;
2168 } 2158 }
2169 dump_misc_regs(pvt); 2159 dump_misc_regs(pvt);
@@ -2257,7 +2247,7 @@ static int init_csrows(struct mem_ctl_info *mci)
2257 bool row_dct0 = !!csrow_enabled(i, 0, pvt); 2247 bool row_dct0 = !!csrow_enabled(i, 0, pvt);
2258 bool row_dct1 = false; 2248 bool row_dct1 = false;
2259 2249
2260 if (boot_cpu_data.x86 != 0xf) 2250 if (pvt->fam != 0xf)
2261 row_dct1 = !!csrow_enabled(i, 1, pvt); 2251 row_dct1 = !!csrow_enabled(i, 1, pvt);
2262 2252
2263 if (!row_dct0 && !row_dct1) 2253 if (!row_dct0 && !row_dct1)
@@ -2275,7 +2265,7 @@ static int init_csrows(struct mem_ctl_info *mci)
2275 } 2265 }
2276 2266
2277 /* K8 has only one DCT */ 2267 /* K8 has only one DCT */
2278 if (boot_cpu_data.x86 != 0xf && row_dct1) { 2268 if (pvt->fam != 0xf && row_dct1) {
2279 int row_dct1_pages = amd64_csrow_nr_pages(pvt, 1, i); 2269 int row_dct1_pages = amd64_csrow_nr_pages(pvt, 1, i);
2280 2270
2281 csrow->channels[1]->dimm->nr_pages = row_dct1_pages; 2271 csrow->channels[1]->dimm->nr_pages = row_dct1_pages;
@@ -2504,13 +2494,14 @@ static bool ecc_enabled(struct pci_dev *F3, u16 nid)
2504 2494
2505static int set_mc_sysfs_attrs(struct mem_ctl_info *mci) 2495static int set_mc_sysfs_attrs(struct mem_ctl_info *mci)
2506{ 2496{
2497 struct amd64_pvt *pvt = mci->pvt_info;
2507 int rc; 2498 int rc;
2508 2499
2509 rc = amd64_create_sysfs_dbg_files(mci); 2500 rc = amd64_create_sysfs_dbg_files(mci);
2510 if (rc < 0) 2501 if (rc < 0)
2511 return rc; 2502 return rc;
2512 2503
2513 if (boot_cpu_data.x86 >= 0x10) { 2504 if (pvt->fam >= 0x10) {
2514 rc = amd64_create_sysfs_inject_files(mci); 2505 rc = amd64_create_sysfs_inject_files(mci);
2515 if (rc < 0) 2506 if (rc < 0)
2516 return rc; 2507 return rc;
@@ -2521,9 +2512,11 @@ static int set_mc_sysfs_attrs(struct mem_ctl_info *mci)
2521 2512
2522static void del_mc_sysfs_attrs(struct mem_ctl_info *mci) 2513static void del_mc_sysfs_attrs(struct mem_ctl_info *mci)
2523{ 2514{
2515 struct amd64_pvt *pvt = mci->pvt_info;
2516
2524 amd64_remove_sysfs_dbg_files(mci); 2517 amd64_remove_sysfs_dbg_files(mci);
2525 2518
2526 if (boot_cpu_data.x86 >= 0x10) 2519 if (pvt->fam >= 0x10)
2527 amd64_remove_sysfs_inject_files(mci); 2520 amd64_remove_sysfs_inject_files(mci);
2528} 2521}
2529 2522
@@ -2561,6 +2554,7 @@ static struct amd64_family_type *amd64_per_family_init(struct amd64_pvt *pvt)
2561 struct amd64_family_type *fam_type = NULL; 2554 struct amd64_family_type *fam_type = NULL;
2562 2555
2563 pvt->ext_model = boot_cpu_data.x86_model >> 4; 2556 pvt->ext_model = boot_cpu_data.x86_model >> 4;
2557 pvt->stepping = boot_cpu_data.x86_mask;
2564 pvt->model = boot_cpu_data.x86_model; 2558 pvt->model = boot_cpu_data.x86_model;
2565 pvt->fam = boot_cpu_data.x86; 2559 pvt->fam = boot_cpu_data.x86;
2566 2560
@@ -2757,6 +2751,8 @@ static void amd64_remove_one_instance(struct pci_dev *pdev)
2757 struct ecc_settings *s = ecc_stngs[nid]; 2751 struct ecc_settings *s = ecc_stngs[nid];
2758 2752
2759 mci = find_mci_by_dev(&pdev->dev); 2753 mci = find_mci_by_dev(&pdev->dev);
2754 WARN_ON(!mci);
2755
2760 del_mc_sysfs_attrs(mci); 2756 del_mc_sysfs_attrs(mci);
2761 /* Remove from EDAC CORE tracking list */ 2757 /* Remove from EDAC CORE tracking list */
2762 mci = edac_mc_del_mc(&pdev->dev); 2758 mci = edac_mc_del_mc(&pdev->dev);
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
index 8fddad7b3b95..d2443cfa0698 100644
--- a/drivers/edac/amd64_edac.h
+++ b/drivers/edac/amd64_edac.h
@@ -348,7 +348,9 @@ struct amd64_pvt {
348 348
349 u16 mc_node_id; /* MC index of this MC node */ 349 u16 mc_node_id; /* MC index of this MC node */
350 u8 fam; /* CPU family */ 350 u8 fam; /* CPU family */
351 u8 model; /* CPU model */ 351 u8 model; /* ... model */
352 u8 stepping; /* ... stepping */
353
352 int ext_model; /* extended model value of this node */ 354 int ext_model; /* extended model value of this node */
353 int channel_count; 355 int channel_count;
354 356