diff options
Diffstat (limited to 'drivers/edac/amd64_edac.c')
-rw-r--r-- | drivers/edac/amd64_edac.c | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index b9e84bc91766..c9b88d829701 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -750,7 +750,7 @@ static void find_csrow_limits(struct mem_ctl_info *mci, int csrow, | |||
750 | * specific. | 750 | * specific. |
751 | */ | 751 | */ |
752 | static u64 extract_error_address(struct mem_ctl_info *mci, | 752 | static u64 extract_error_address(struct mem_ctl_info *mci, |
753 | struct amd64_error_info_regs *info) | 753 | struct err_regs *info) |
754 | { | 754 | { |
755 | struct amd64_pvt *pvt = mci->pvt_info; | 755 | struct amd64_pvt *pvt = mci->pvt_info; |
756 | 756 | ||
@@ -1106,7 +1106,7 @@ static int k8_early_channel_count(struct amd64_pvt *pvt) | |||
1106 | 1106 | ||
1107 | /* extract the ERROR ADDRESS for the K8 CPUs */ | 1107 | /* extract the ERROR ADDRESS for the K8 CPUs */ |
1108 | static u64 k8_get_error_address(struct mem_ctl_info *mci, | 1108 | static u64 k8_get_error_address(struct mem_ctl_info *mci, |
1109 | struct amd64_error_info_regs *info) | 1109 | struct err_regs *info) |
1110 | { | 1110 | { |
1111 | return (((u64) (info->nbeah & 0xff)) << 32) + | 1111 | return (((u64) (info->nbeah & 0xff)) << 32) + |
1112 | (info->nbeal & ~0x03); | 1112 | (info->nbeal & ~0x03); |
@@ -1149,7 +1149,7 @@ static void k8_read_dram_base_limit(struct amd64_pvt *pvt, int dram) | |||
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | static void k8_map_sysaddr_to_csrow(struct mem_ctl_info *mci, | 1151 | static void k8_map_sysaddr_to_csrow(struct mem_ctl_info *mci, |
1152 | struct amd64_error_info_regs *info, | 1152 | struct err_regs *info, |
1153 | u64 SystemAddress) | 1153 | u64 SystemAddress) |
1154 | { | 1154 | { |
1155 | struct mem_ctl_info *src_mci; | 1155 | struct mem_ctl_info *src_mci; |
@@ -1368,7 +1368,7 @@ static void amd64_teardown(struct amd64_pvt *pvt) | |||
1368 | } | 1368 | } |
1369 | 1369 | ||
1370 | static u64 f10_get_error_address(struct mem_ctl_info *mci, | 1370 | static u64 f10_get_error_address(struct mem_ctl_info *mci, |
1371 | struct amd64_error_info_regs *info) | 1371 | struct err_regs *info) |
1372 | { | 1372 | { |
1373 | return (((u64) (info->nbeah & 0xffff)) << 32) + | 1373 | return (((u64) (info->nbeah & 0xffff)) << 32) + |
1374 | (info->nbeal & ~0x01); | 1374 | (info->nbeal & ~0x01); |
@@ -1745,7 +1745,7 @@ static int f10_translate_sysaddr_to_cs(struct amd64_pvt *pvt, u64 sys_addr, | |||
1745 | * The @sys_addr is usually an error address received from the hardware. | 1745 | * The @sys_addr is usually an error address received from the hardware. |
1746 | */ | 1746 | */ |
1747 | static void f10_map_sysaddr_to_csrow(struct mem_ctl_info *mci, | 1747 | static void f10_map_sysaddr_to_csrow(struct mem_ctl_info *mci, |
1748 | struct amd64_error_info_regs *info, | 1748 | struct err_regs *info, |
1749 | u64 sys_addr) | 1749 | u64 sys_addr) |
1750 | { | 1750 | { |
1751 | struct amd64_pvt *pvt = mci->pvt_info; | 1751 | struct amd64_pvt *pvt = mci->pvt_info; |
@@ -2102,7 +2102,7 @@ static int get_channel_from_ecc_syndrome(unsigned short syndrome) | |||
2102 | * - 0: if no valid error is indicated | 2102 | * - 0: if no valid error is indicated |
2103 | */ | 2103 | */ |
2104 | static int amd64_get_error_info_regs(struct mem_ctl_info *mci, | 2104 | static int amd64_get_error_info_regs(struct mem_ctl_info *mci, |
2105 | struct amd64_error_info_regs *regs) | 2105 | struct err_regs *regs) |
2106 | { | 2106 | { |
2107 | struct amd64_pvt *pvt; | 2107 | struct amd64_pvt *pvt; |
2108 | struct pci_dev *misc_f3_ctl; | 2108 | struct pci_dev *misc_f3_ctl; |
@@ -2151,10 +2151,10 @@ err_reg: | |||
2151 | * - 0: if no error is found | 2151 | * - 0: if no error is found |
2152 | */ | 2152 | */ |
2153 | static int amd64_get_error_info(struct mem_ctl_info *mci, | 2153 | static int amd64_get_error_info(struct mem_ctl_info *mci, |
2154 | struct amd64_error_info_regs *info) | 2154 | struct err_regs *info) |
2155 | { | 2155 | { |
2156 | struct amd64_pvt *pvt; | 2156 | struct amd64_pvt *pvt; |
2157 | struct amd64_error_info_regs regs; | 2157 | struct err_regs regs; |
2158 | 2158 | ||
2159 | pvt = mci->pvt_info; | 2159 | pvt = mci->pvt_info; |
2160 | 2160 | ||
@@ -2210,7 +2210,7 @@ static int amd64_get_error_info(struct mem_ctl_info *mci, | |||
2210 | } | 2210 | } |
2211 | 2211 | ||
2212 | static inline void amd64_decode_gart_tlb_error(struct mem_ctl_info *mci, | 2212 | static inline void amd64_decode_gart_tlb_error(struct mem_ctl_info *mci, |
2213 | struct amd64_error_info_regs *info) | 2213 | struct err_regs *info) |
2214 | { | 2214 | { |
2215 | u32 ec = ERROR_CODE(info->nbsl); | 2215 | u32 ec = ERROR_CODE(info->nbsl); |
2216 | 2216 | ||
@@ -2220,7 +2220,7 @@ static inline void amd64_decode_gart_tlb_error(struct mem_ctl_info *mci, | |||
2220 | } | 2220 | } |
2221 | 2221 | ||
2222 | static inline void amd64_decode_mem_cache_error(struct mem_ctl_info *mci, | 2222 | static inline void amd64_decode_mem_cache_error(struct mem_ctl_info *mci, |
2223 | struct amd64_error_info_regs *info) | 2223 | struct err_regs *info) |
2224 | { | 2224 | { |
2225 | u32 ec = ERROR_CODE(info->nbsl); | 2225 | u32 ec = ERROR_CODE(info->nbsl); |
2226 | 2226 | ||
@@ -2236,7 +2236,7 @@ static inline void amd64_decode_mem_cache_error(struct mem_ctl_info *mci, | |||
2236 | * ADDRESS and process. | 2236 | * ADDRESS and process. |
2237 | */ | 2237 | */ |
2238 | static void amd64_handle_ce(struct mem_ctl_info *mci, | 2238 | static void amd64_handle_ce(struct mem_ctl_info *mci, |
2239 | struct amd64_error_info_regs *info) | 2239 | struct err_regs *info) |
2240 | { | 2240 | { |
2241 | struct amd64_pvt *pvt = mci->pvt_info; | 2241 | struct amd64_pvt *pvt = mci->pvt_info; |
2242 | u64 SystemAddress; | 2242 | u64 SystemAddress; |
@@ -2259,7 +2259,7 @@ static void amd64_handle_ce(struct mem_ctl_info *mci, | |||
2259 | 2259 | ||
2260 | /* Handle any Un-correctable Errors (UEs) */ | 2260 | /* Handle any Un-correctable Errors (UEs) */ |
2261 | static void amd64_handle_ue(struct mem_ctl_info *mci, | 2261 | static void amd64_handle_ue(struct mem_ctl_info *mci, |
2262 | struct amd64_error_info_regs *info) | 2262 | struct err_regs *info) |
2263 | { | 2263 | { |
2264 | int csrow; | 2264 | int csrow; |
2265 | u64 SystemAddress; | 2265 | u64 SystemAddress; |
@@ -2305,7 +2305,7 @@ static void amd64_handle_ue(struct mem_ctl_info *mci, | |||
2305 | } | 2305 | } |
2306 | 2306 | ||
2307 | static void amd64_decode_bus_error(struct mem_ctl_info *mci, | 2307 | static void amd64_decode_bus_error(struct mem_ctl_info *mci, |
2308 | struct amd64_error_info_regs *info) | 2308 | struct err_regs *info) |
2309 | { | 2309 | { |
2310 | u32 ec = ERROR_CODE(info->nbsl); | 2310 | u32 ec = ERROR_CODE(info->nbsl); |
2311 | u32 xec = EXT_ERROR_CODE(info->nbsl); | 2311 | u32 xec = EXT_ERROR_CODE(info->nbsl); |
@@ -2356,22 +2356,18 @@ static void amd64_decode_bus_error(struct mem_ctl_info *mci, | |||
2356 | } | 2356 | } |
2357 | 2357 | ||
2358 | int amd64_process_error_info(struct mem_ctl_info *mci, | 2358 | int amd64_process_error_info(struct mem_ctl_info *mci, |
2359 | struct amd64_error_info_regs *info, | 2359 | struct err_regs *regs, |
2360 | int handle_errors) | 2360 | int handle_errors) |
2361 | { | 2361 | { |
2362 | struct amd64_pvt *pvt; | 2362 | struct amd64_pvt *pvt; |
2363 | struct amd64_error_info_regs *regs; | ||
2364 | u32 err_code, ext_ec; | 2363 | u32 err_code, ext_ec; |
2365 | int gart_tlb_error = 0; | 2364 | int gart_tlb_error = 0; |
2366 | 2365 | ||
2367 | pvt = mci->pvt_info; | 2366 | pvt = mci->pvt_info; |
2368 | 2367 | ||
2369 | /* If caller doesn't want us to process the error, return */ | ||
2370 | if (!handle_errors) | 2368 | if (!handle_errors) |
2371 | return 1; | 2369 | return 1; |
2372 | 2370 | ||
2373 | regs = info; | ||
2374 | |||
2375 | debugf1("NorthBridge ERROR: mci(0x%p)\n", mci); | 2371 | debugf1("NorthBridge ERROR: mci(0x%p)\n", mci); |
2376 | debugf1(" MC node(%d) Error-Address(0x%.8x-%.8x)\n", | 2372 | debugf1(" MC node(%d) Error-Address(0x%.8x-%.8x)\n", |
2377 | pvt->mc_node_id, regs->nbeah, regs->nbeal); | 2373 | pvt->mc_node_id, regs->nbeah, regs->nbeal); |
@@ -2437,13 +2433,13 @@ int amd64_process_error_info(struct mem_ctl_info *mci, | |||
2437 | gart_tlb_error = 1; | 2433 | gart_tlb_error = 1; |
2438 | 2434 | ||
2439 | debugf1("GART TLB error\n"); | 2435 | debugf1("GART TLB error\n"); |
2440 | amd64_decode_gart_tlb_error(mci, info); | 2436 | amd64_decode_gart_tlb_error(mci, regs); |
2441 | } else if (MEM_ERROR(err_code)) { | 2437 | } else if (MEM_ERROR(err_code)) { |
2442 | debugf1("Memory/Cache error\n"); | 2438 | debugf1("Memory/Cache error\n"); |
2443 | amd64_decode_mem_cache_error(mci, info); | 2439 | amd64_decode_mem_cache_error(mci, regs); |
2444 | } else if (BUS_ERROR(err_code)) { | 2440 | } else if (BUS_ERROR(err_code)) { |
2445 | debugf1("Bus (Link/DRAM) error\n"); | 2441 | debugf1("Bus (Link/DRAM) error\n"); |
2446 | amd64_decode_bus_error(mci, info); | 2442 | amd64_decode_bus_error(mci, regs); |
2447 | } else { | 2443 | } else { |
2448 | /* shouldn't reach here! */ | 2444 | /* shouldn't reach here! */ |
2449 | amd64_mc_printk(mci, KERN_WARNING, | 2445 | amd64_mc_printk(mci, KERN_WARNING, |
@@ -2480,10 +2476,10 @@ EXPORT_SYMBOL_GPL(amd64_process_error_info); | |||
2480 | */ | 2476 | */ |
2481 | static void amd64_check(struct mem_ctl_info *mci) | 2477 | static void amd64_check(struct mem_ctl_info *mci) |
2482 | { | 2478 | { |
2483 | struct amd64_error_info_regs info; | 2479 | struct err_regs regs; |
2484 | 2480 | ||
2485 | if (amd64_get_error_info(mci, &info)) | 2481 | if (amd64_get_error_info(mci, ®s)) |
2486 | amd64_process_error_info(mci, &info, 1); | 2482 | amd64_process_error_info(mci, ®s, 1); |
2487 | } | 2483 | } |
2488 | 2484 | ||
2489 | /* | 2485 | /* |