diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 17:24:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 17:24:40 -0400 |
commit | f0f3680e50352c57b6cfc5b0d44d63bb0aa20f80 (patch) | |
tree | 2005ec90f9d90f25ceeba147dfe09db8c8036fa6 /drivers/edac | |
parent | 61e5191c9d96268746bd57ed55d035678a1a2cf9 (diff) | |
parent | a4b4be3fd7a76021f67380b03d8bccebf067db72 (diff) |
Merge branch 'linux_next' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac
Pull EDAC fixes from Mauro Carvalho Chehab:
"A series of EDAC driver fixes. It also has one core fix at the
documentation, and a rename patch, fixing the name of the struct that
contains the rank information."
* 'linux_next' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac:
edac: rename channel_info to rank_info
i5400_edac: Avoid calling pci_put_device() twice
edac: i5100 ack error detection register after each read
edac: i5100 fix erroneous define for M1Err
edac: sb_edac: Fix a wrong value setting for the previous value
edac: sb_edac: Fix a INTERLEAVE_MODE() misuse
edac: sb_edac: Let the driver depend on PCI_MMCONFIG
edac: Improve the comments to better describe the memory concepts
edac/ppc4xx_edac: Fix compilation
Fix sb_edac compilation with 32 bits kernels
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/Kconfig | 2 | ||||
-rw-r--r-- | drivers/edac/edac_mc.c | 6 | ||||
-rw-r--r-- | drivers/edac/i5100_edac.c | 13 | ||||
-rw-r--r-- | drivers/edac/i5400_edac.c | 54 | ||||
-rw-r--r-- | drivers/edac/ppc4xx_edac.c | 4 | ||||
-rw-r--r-- | drivers/edac/sb_edac.c | 52 |
6 files changed, 80 insertions, 51 deletions
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 5948a2194f50..fdffa1beca17 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig | |||
@@ -215,7 +215,7 @@ config EDAC_I7300 | |||
215 | config EDAC_SBRIDGE | 215 | config EDAC_SBRIDGE |
216 | tristate "Intel Sandy-Bridge Integrated MC" | 216 | tristate "Intel Sandy-Bridge Integrated MC" |
217 | depends on EDAC_MM_EDAC && PCI && X86_64 && X86_MCE_INTEL | 217 | depends on EDAC_MM_EDAC && PCI && X86_64 && X86_MCE_INTEL |
218 | depends on EXPERIMENTAL | 218 | depends on PCI_MMCONFIG && EXPERIMENTAL |
219 | help | 219 | help |
220 | Support for error detection and correction the Intel | 220 | Support for error detection and correction the Intel |
221 | Sandy Bridge Integrated Memory Controller. | 221 | Sandy Bridge Integrated Memory Controller. |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index da09cd74bc5b..feef7733fae7 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -39,7 +39,7 @@ static LIST_HEAD(mc_devices); | |||
39 | 39 | ||
40 | #ifdef CONFIG_EDAC_DEBUG | 40 | #ifdef CONFIG_EDAC_DEBUG |
41 | 41 | ||
42 | static void edac_mc_dump_channel(struct channel_info *chan) | 42 | static void edac_mc_dump_channel(struct rank_info *chan) |
43 | { | 43 | { |
44 | debugf4("\tchannel = %p\n", chan); | 44 | debugf4("\tchannel = %p\n", chan); |
45 | debugf4("\tchannel->chan_idx = %d\n", chan->chan_idx); | 45 | debugf4("\tchannel->chan_idx = %d\n", chan->chan_idx); |
@@ -156,7 +156,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows, | |||
156 | { | 156 | { |
157 | struct mem_ctl_info *mci; | 157 | struct mem_ctl_info *mci; |
158 | struct csrow_info *csi, *csrow; | 158 | struct csrow_info *csi, *csrow; |
159 | struct channel_info *chi, *chp, *chan; | 159 | struct rank_info *chi, *chp, *chan; |
160 | void *pvt; | 160 | void *pvt; |
161 | unsigned size; | 161 | unsigned size; |
162 | int row, chn; | 162 | int row, chn; |
@@ -181,7 +181,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows, | |||
181 | * rather than an imaginary chunk of memory located at address 0. | 181 | * rather than an imaginary chunk of memory located at address 0. |
182 | */ | 182 | */ |
183 | csi = (struct csrow_info *)(((char *)mci) + ((unsigned long)csi)); | 183 | csi = (struct csrow_info *)(((char *)mci) + ((unsigned long)csi)); |
184 | chi = (struct channel_info *)(((char *)mci) + ((unsigned long)chi)); | 184 | chi = (struct rank_info *)(((char *)mci) + ((unsigned long)chi)); |
185 | pvt = sz_pvt ? (((char *)mci) + ((unsigned long)pvt)) : NULL; | 185 | pvt = sz_pvt ? (((char *)mci) + ((unsigned long)pvt)) : NULL; |
186 | 186 | ||
187 | /* setup index and various internal pointers */ | 187 | /* setup index and various internal pointers */ |
diff --git a/drivers/edac/i5100_edac.c b/drivers/edac/i5100_edac.c index 2e23547b2f24..d500749464ea 100644 --- a/drivers/edac/i5100_edac.c +++ b/drivers/edac/i5100_edac.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #define I5100_FERR_NF_MEM_M6ERR_MASK (1 << 6) | 49 | #define I5100_FERR_NF_MEM_M6ERR_MASK (1 << 6) |
50 | #define I5100_FERR_NF_MEM_M5ERR_MASK (1 << 5) | 50 | #define I5100_FERR_NF_MEM_M5ERR_MASK (1 << 5) |
51 | #define I5100_FERR_NF_MEM_M4ERR_MASK (1 << 4) | 51 | #define I5100_FERR_NF_MEM_M4ERR_MASK (1 << 4) |
52 | #define I5100_FERR_NF_MEM_M1ERR_MASK 1 | 52 | #define I5100_FERR_NF_MEM_M1ERR_MASK (1 << 1) |
53 | #define I5100_FERR_NF_MEM_ANY_MASK \ | 53 | #define I5100_FERR_NF_MEM_ANY_MASK \ |
54 | (I5100_FERR_NF_MEM_M16ERR_MASK | \ | 54 | (I5100_FERR_NF_MEM_M16ERR_MASK | \ |
55 | I5100_FERR_NF_MEM_M15ERR_MASK | \ | 55 | I5100_FERR_NF_MEM_M15ERR_MASK | \ |
@@ -535,23 +535,20 @@ static void i5100_read_log(struct mem_ctl_info *mci, int chan, | |||
535 | static void i5100_check_error(struct mem_ctl_info *mci) | 535 | static void i5100_check_error(struct mem_ctl_info *mci) |
536 | { | 536 | { |
537 | struct i5100_priv *priv = mci->pvt_info; | 537 | struct i5100_priv *priv = mci->pvt_info; |
538 | u32 dw; | 538 | u32 dw, dw2; |
539 | |||
540 | 539 | ||
541 | pci_read_config_dword(priv->mc, I5100_FERR_NF_MEM, &dw); | 540 | pci_read_config_dword(priv->mc, I5100_FERR_NF_MEM, &dw); |
542 | if (i5100_ferr_nf_mem_any(dw)) { | 541 | if (i5100_ferr_nf_mem_any(dw)) { |
543 | u32 dw2; | ||
544 | 542 | ||
545 | pci_read_config_dword(priv->mc, I5100_NERR_NF_MEM, &dw2); | 543 | pci_read_config_dword(priv->mc, I5100_NERR_NF_MEM, &dw2); |
546 | if (dw2) | ||
547 | pci_write_config_dword(priv->mc, I5100_NERR_NF_MEM, | ||
548 | dw2); | ||
549 | pci_write_config_dword(priv->mc, I5100_FERR_NF_MEM, dw); | ||
550 | 544 | ||
551 | i5100_read_log(mci, i5100_ferr_nf_mem_chan_indx(dw), | 545 | i5100_read_log(mci, i5100_ferr_nf_mem_chan_indx(dw), |
552 | i5100_ferr_nf_mem_any(dw), | 546 | i5100_ferr_nf_mem_any(dw), |
553 | i5100_nerr_nf_mem_any(dw2)); | 547 | i5100_nerr_nf_mem_any(dw2)); |
548 | |||
549 | pci_write_config_dword(priv->mc, I5100_NERR_NF_MEM, dw2); | ||
554 | } | 550 | } |
551 | pci_write_config_dword(priv->mc, I5100_FERR_NF_MEM, dw); | ||
555 | } | 552 | } |
556 | 553 | ||
557 | /* The i5100 chipset will scrub the entire memory once, then | 554 | /* The i5100 chipset will scrub the entire memory once, then |
diff --git a/drivers/edac/i5400_edac.c b/drivers/edac/i5400_edac.c index 67ec9626a330..1869a1018fb5 100644 --- a/drivers/edac/i5400_edac.c +++ b/drivers/edac/i5400_edac.c | |||
@@ -735,7 +735,7 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
735 | 735 | ||
736 | /* Attempt to 'get' the MCH register we want */ | 736 | /* Attempt to 'get' the MCH register we want */ |
737 | pdev = NULL; | 737 | pdev = NULL; |
738 | while (!pvt->branchmap_werrors || !pvt->fsb_error_regs) { | 738 | while (1) { |
739 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | 739 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, |
740 | PCI_DEVICE_ID_INTEL_5400_ERR, pdev); | 740 | PCI_DEVICE_ID_INTEL_5400_ERR, pdev); |
741 | if (!pdev) { | 741 | if (!pdev) { |
@@ -743,23 +743,42 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
743 | i5400_printk(KERN_ERR, | 743 | i5400_printk(KERN_ERR, |
744 | "'system address,Process Bus' " | 744 | "'system address,Process Bus' " |
745 | "device not found:" | 745 | "device not found:" |
746 | "vendor 0x%x device 0x%x ERR funcs " | 746 | "vendor 0x%x device 0x%x ERR func 1 " |
747 | "(broken BIOS?)\n", | 747 | "(broken BIOS?)\n", |
748 | PCI_VENDOR_ID_INTEL, | 748 | PCI_VENDOR_ID_INTEL, |
749 | PCI_DEVICE_ID_INTEL_5400_ERR); | 749 | PCI_DEVICE_ID_INTEL_5400_ERR); |
750 | goto error; | 750 | return -ENODEV; |
751 | } | 751 | } |
752 | 752 | ||
753 | /* Store device 16 funcs 1 and 2 */ | 753 | /* Store device 16 func 1 */ |
754 | switch (PCI_FUNC(pdev->devfn)) { | 754 | if (PCI_FUNC(pdev->devfn) == 1) |
755 | case 1: | ||
756 | pvt->branchmap_werrors = pdev; | ||
757 | break; | ||
758 | case 2: | ||
759 | pvt->fsb_error_regs = pdev; | ||
760 | break; | 755 | break; |
756 | } | ||
757 | pvt->branchmap_werrors = pdev; | ||
758 | |||
759 | pdev = NULL; | ||
760 | while (1) { | ||
761 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | ||
762 | PCI_DEVICE_ID_INTEL_5400_ERR, pdev); | ||
763 | if (!pdev) { | ||
764 | /* End of list, leave */ | ||
765 | i5400_printk(KERN_ERR, | ||
766 | "'system address,Process Bus' " | ||
767 | "device not found:" | ||
768 | "vendor 0x%x device 0x%x ERR func 2 " | ||
769 | "(broken BIOS?)\n", | ||
770 | PCI_VENDOR_ID_INTEL, | ||
771 | PCI_DEVICE_ID_INTEL_5400_ERR); | ||
772 | |||
773 | pci_dev_put(pvt->branchmap_werrors); | ||
774 | return -ENODEV; | ||
761 | } | 775 | } |
776 | |||
777 | /* Store device 16 func 2 */ | ||
778 | if (PCI_FUNC(pdev->devfn) == 2) | ||
779 | break; | ||
762 | } | 780 | } |
781 | pvt->fsb_error_regs = pdev; | ||
763 | 782 | ||
764 | debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", | 783 | debugf1("System Address, processor bus- PCI Bus ID: %s %x:%x\n", |
765 | pci_name(pvt->system_address), | 784 | pci_name(pvt->system_address), |
@@ -778,7 +797,10 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
778 | "MC: 'BRANCH 0' device not found:" | 797 | "MC: 'BRANCH 0' device not found:" |
779 | "vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n", | 798 | "vendor 0x%x device 0x%x Func 0 (broken BIOS?)\n", |
780 | PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_FBD0); | 799 | PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_FBD0); |
781 | goto error; | 800 | |
801 | pci_dev_put(pvt->fsb_error_regs); | ||
802 | pci_dev_put(pvt->branchmap_werrors); | ||
803 | return -ENODEV; | ||
782 | } | 804 | } |
783 | 805 | ||
784 | /* If this device claims to have more than 2 channels then | 806 | /* If this device claims to have more than 2 channels then |
@@ -796,14 +818,14 @@ static int i5400_get_devices(struct mem_ctl_info *mci, int dev_idx) | |||
796 | "(broken BIOS?)\n", | 818 | "(broken BIOS?)\n", |
797 | PCI_VENDOR_ID_INTEL, | 819 | PCI_VENDOR_ID_INTEL, |
798 | PCI_DEVICE_ID_INTEL_5400_FBD1); | 820 | PCI_DEVICE_ID_INTEL_5400_FBD1); |
799 | goto error; | 821 | |
822 | pci_dev_put(pvt->branch_0); | ||
823 | pci_dev_put(pvt->fsb_error_regs); | ||
824 | pci_dev_put(pvt->branchmap_werrors); | ||
825 | return -ENODEV; | ||
800 | } | 826 | } |
801 | 827 | ||
802 | return 0; | 828 | return 0; |
803 | |||
804 | error: | ||
805 | i5400_put_devices(mci); | ||
806 | return -ENODEV; | ||
807 | } | 829 | } |
808 | 830 | ||
809 | /* | 831 | /* |
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index fc757069c6af..d427c69bb8b1 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c | |||
@@ -184,7 +184,7 @@ struct ppc4xx_ecc_status { | |||
184 | 184 | ||
185 | /* Function Prototypes */ | 185 | /* Function Prototypes */ |
186 | 186 | ||
187 | static int ppc4xx_edac_probe(struct platform_device *device) | 187 | static int ppc4xx_edac_probe(struct platform_device *device); |
188 | static int ppc4xx_edac_remove(struct platform_device *device); | 188 | static int ppc4xx_edac_remove(struct platform_device *device); |
189 | 189 | ||
190 | /* Global Variables */ | 190 | /* Global Variables */ |
@@ -1068,7 +1068,7 @@ ppc4xx_edac_mc_init(struct mem_ctl_info *mci, | |||
1068 | 1068 | ||
1069 | mci->mod_name = PPC4XX_EDAC_MODULE_NAME; | 1069 | mci->mod_name = PPC4XX_EDAC_MODULE_NAME; |
1070 | mci->mod_ver = PPC4XX_EDAC_MODULE_REVISION; | 1070 | mci->mod_ver = PPC4XX_EDAC_MODULE_REVISION; |
1071 | mci->ctl_name = match->compatible, | 1071 | mci->ctl_name = ppc4xx_edac_match->compatible, |
1072 | mci->dev_name = np->full_name; | 1072 | mci->dev_name = np->full_name; |
1073 | 1073 | ||
1074 | /* Initialize callbacks */ | 1074 | /* Initialize callbacks */ |
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 3a605f777712..a203536d90dd 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/mmzone.h> | 20 | #include <linux/mmzone.h> |
21 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
22 | #include <linux/bitmap.h> | 22 | #include <linux/bitmap.h> |
23 | #include <linux/math64.h> | ||
23 | #include <asm/processor.h> | 24 | #include <asm/processor.h> |
24 | #include <asm/mce.h> | 25 | #include <asm/mce.h> |
25 | 26 | ||
@@ -670,6 +671,7 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
670 | u32 reg; | 671 | u32 reg; |
671 | u64 limit, prv = 0; | 672 | u64 limit, prv = 0; |
672 | u64 tmp_mb; | 673 | u64 tmp_mb; |
674 | u32 mb, kb; | ||
673 | u32 rir_way; | 675 | u32 rir_way; |
674 | 676 | ||
675 | /* | 677 | /* |
@@ -682,8 +684,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
682 | pvt->tolm = GET_TOLM(reg); | 684 | pvt->tolm = GET_TOLM(reg); |
683 | tmp_mb = (1 + pvt->tolm) >> 20; | 685 | tmp_mb = (1 + pvt->tolm) >> 20; |
684 | 686 | ||
685 | debugf0("TOLM: %Lu.%03Lu GB (0x%016Lx)\n", | 687 | mb = div_u64_rem(tmp_mb, 1000, &kb); |
686 | tmp_mb / 1000, tmp_mb % 1000, (u64)pvt->tolm); | 688 | debugf0("TOLM: %u.%03u GB (0x%016Lx)\n", |
689 | mb, kb, (u64)pvt->tolm); | ||
687 | 690 | ||
688 | /* Address range is already 45:25 */ | 691 | /* Address range is already 45:25 */ |
689 | pci_read_config_dword(pvt->pci_sad1, TOHM, | 692 | pci_read_config_dword(pvt->pci_sad1, TOHM, |
@@ -691,8 +694,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
691 | pvt->tohm = GET_TOHM(reg); | 694 | pvt->tohm = GET_TOHM(reg); |
692 | tmp_mb = (1 + pvt->tohm) >> 20; | 695 | tmp_mb = (1 + pvt->tohm) >> 20; |
693 | 696 | ||
694 | debugf0("TOHM: %Lu.%03Lu GB (0x%016Lx)", | 697 | mb = div_u64_rem(tmp_mb, 1000, &kb); |
695 | tmp_mb / 1000, tmp_mb % 1000, (u64)pvt->tohm); | 698 | debugf0("TOHM: %u.%03u GB (0x%016Lx)", |
699 | mb, kb, (u64)pvt->tohm); | ||
696 | 700 | ||
697 | /* | 701 | /* |
698 | * Step 2) Get SAD range and SAD Interleave list | 702 | * Step 2) Get SAD range and SAD Interleave list |
@@ -714,10 +718,11 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
714 | break; | 718 | break; |
715 | 719 | ||
716 | tmp_mb = (limit + 1) >> 20; | 720 | tmp_mb = (limit + 1) >> 20; |
717 | debugf0("SAD#%d %s up to %Lu.%03Lu GB (0x%016Lx) %s reg=0x%08x\n", | 721 | mb = div_u64_rem(tmp_mb, 1000, &kb); |
722 | debugf0("SAD#%d %s up to %u.%03u GB (0x%016Lx) %s reg=0x%08x\n", | ||
718 | n_sads, | 723 | n_sads, |
719 | get_dram_attr(reg), | 724 | get_dram_attr(reg), |
720 | tmp_mb / 1000, tmp_mb % 1000, | 725 | mb, kb, |
721 | ((u64)tmp_mb) << 20L, | 726 | ((u64)tmp_mb) << 20L, |
722 | INTERLEAVE_MODE(reg) ? "Interleave: 8:6" : "Interleave: [8:6]XOR[18:16]", | 727 | INTERLEAVE_MODE(reg) ? "Interleave: 8:6" : "Interleave: [8:6]XOR[18:16]", |
723 | reg); | 728 | reg); |
@@ -747,8 +752,9 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
747 | break; | 752 | break; |
748 | tmp_mb = (limit + 1) >> 20; | 753 | tmp_mb = (limit + 1) >> 20; |
749 | 754 | ||
750 | debugf0("TAD#%d: up to %Lu.%03Lu GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n", | 755 | mb = div_u64_rem(tmp_mb, 1000, &kb); |
751 | n_tads, tmp_mb / 1000, tmp_mb % 1000, | 756 | debugf0("TAD#%d: up to %u.%03u GB (0x%016Lx), socket interleave %d, memory interleave %d, TGT: %d, %d, %d, %d, reg=0x%08x\n", |
757 | n_tads, mb, kb, | ||
752 | ((u64)tmp_mb) << 20L, | 758 | ((u64)tmp_mb) << 20L, |
753 | (u32)TAD_SOCK(reg), | 759 | (u32)TAD_SOCK(reg), |
754 | (u32)TAD_CH(reg), | 760 | (u32)TAD_CH(reg), |
@@ -757,7 +763,7 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
757 | (u32)TAD_TGT2(reg), | 763 | (u32)TAD_TGT2(reg), |
758 | (u32)TAD_TGT3(reg), | 764 | (u32)TAD_TGT3(reg), |
759 | reg); | 765 | reg); |
760 | prv = tmp_mb; | 766 | prv = limit; |
761 | } | 767 | } |
762 | 768 | ||
763 | /* | 769 | /* |
@@ -771,9 +777,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
771 | tad_ch_nilv_offset[j], | 777 | tad_ch_nilv_offset[j], |
772 | ®); | 778 | ®); |
773 | tmp_mb = TAD_OFFSET(reg) >> 20; | 779 | tmp_mb = TAD_OFFSET(reg) >> 20; |
774 | debugf0("TAD CH#%d, offset #%d: %Lu.%03Lu GB (0x%016Lx), reg=0x%08x\n", | 780 | mb = div_u64_rem(tmp_mb, 1000, &kb); |
781 | debugf0("TAD CH#%d, offset #%d: %u.%03u GB (0x%016Lx), reg=0x%08x\n", | ||
775 | i, j, | 782 | i, j, |
776 | tmp_mb / 1000, tmp_mb % 1000, | 783 | mb, kb, |
777 | ((u64)tmp_mb) << 20L, | 784 | ((u64)tmp_mb) << 20L, |
778 | reg); | 785 | reg); |
779 | } | 786 | } |
@@ -795,9 +802,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
795 | 802 | ||
796 | tmp_mb = RIR_LIMIT(reg) >> 20; | 803 | tmp_mb = RIR_LIMIT(reg) >> 20; |
797 | rir_way = 1 << RIR_WAY(reg); | 804 | rir_way = 1 << RIR_WAY(reg); |
798 | debugf0("CH#%d RIR#%d, limit: %Lu.%03Lu GB (0x%016Lx), way: %d, reg=0x%08x\n", | 805 | mb = div_u64_rem(tmp_mb, 1000, &kb); |
806 | debugf0("CH#%d RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d, reg=0x%08x\n", | ||
799 | i, j, | 807 | i, j, |
800 | tmp_mb / 1000, tmp_mb % 1000, | 808 | mb, kb, |
801 | ((u64)tmp_mb) << 20L, | 809 | ((u64)tmp_mb) << 20L, |
802 | rir_way, | 810 | rir_way, |
803 | reg); | 811 | reg); |
@@ -808,9 +816,10 @@ static void get_memory_layout(const struct mem_ctl_info *mci) | |||
808 | ®); | 816 | ®); |
809 | tmp_mb = RIR_OFFSET(reg) << 6; | 817 | tmp_mb = RIR_OFFSET(reg) << 6; |
810 | 818 | ||
811 | debugf0("CH#%d RIR#%d INTL#%d, offset %Lu.%03Lu GB (0x%016Lx), tgt: %d, reg=0x%08x\n", | 819 | mb = div_u64_rem(tmp_mb, 1000, &kb); |
820 | debugf0("CH#%d RIR#%d INTL#%d, offset %u.%03u GB (0x%016Lx), tgt: %d, reg=0x%08x\n", | ||
812 | i, j, k, | 821 | i, j, k, |
813 | tmp_mb / 1000, tmp_mb % 1000, | 822 | mb, kb, |
814 | ((u64)tmp_mb) << 20L, | 823 | ((u64)tmp_mb) << 20L, |
815 | (u32)RIR_RNK_TGT(reg), | 824 | (u32)RIR_RNK_TGT(reg), |
816 | reg); | 825 | reg); |
@@ -848,6 +857,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, | |||
848 | u8 ch_way,sck_way; | 857 | u8 ch_way,sck_way; |
849 | u32 tad_offset; | 858 | u32 tad_offset; |
850 | u32 rir_way; | 859 | u32 rir_way; |
860 | u32 mb, kb; | ||
851 | u64 ch_addr, offset, limit, prv = 0; | 861 | u64 ch_addr, offset, limit, prv = 0; |
852 | 862 | ||
853 | 863 | ||
@@ -858,7 +868,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, | |||
858 | * range (e. g. VGA addresses). It is unlikely, however, that the | 868 | * range (e. g. VGA addresses). It is unlikely, however, that the |
859 | * memory controller would generate an error on that range. | 869 | * memory controller would generate an error on that range. |
860 | */ | 870 | */ |
861 | if ((addr > (u64) pvt->tolm) && (addr < (1L << 32))) { | 871 | if ((addr > (u64) pvt->tolm) && (addr < (1LL << 32))) { |
862 | sprintf(msg, "Error at TOLM area, on addr 0x%08Lx", addr); | 872 | sprintf(msg, "Error at TOLM area, on addr 0x%08Lx", addr); |
863 | edac_mc_handle_ce_no_info(mci, msg); | 873 | edac_mc_handle_ce_no_info(mci, msg); |
864 | return -EINVAL; | 874 | return -EINVAL; |
@@ -913,7 +923,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, | |||
913 | addr, | 923 | addr, |
914 | limit, | 924 | limit, |
915 | sad_way + 7, | 925 | sad_way + 7, |
916 | INTERLEAVE_MODE(reg) ? "" : "XOR[18:16]"); | 926 | interleave_mode ? "" : "XOR[18:16]"); |
917 | if (interleave_mode) | 927 | if (interleave_mode) |
918 | idx = ((addr >> 6) ^ (addr >> 16)) & 7; | 928 | idx = ((addr >> 6) ^ (addr >> 16)) & 7; |
919 | else | 929 | else |
@@ -1053,7 +1063,7 @@ static int get_memory_error_data(struct mem_ctl_info *mci, | |||
1053 | ch_addr = addr & 0x7f; | 1063 | ch_addr = addr & 0x7f; |
1054 | /* Remove socket wayness and remove 6 bits */ | 1064 | /* Remove socket wayness and remove 6 bits */ |
1055 | addr >>= 6; | 1065 | addr >>= 6; |
1056 | addr /= sck_xch; | 1066 | addr = div_u64(addr, sck_xch); |
1057 | #if 0 | 1067 | #if 0 |
1058 | /* Divide by channel way */ | 1068 | /* Divide by channel way */ |
1059 | addr = addr / ch_way; | 1069 | addr = addr / ch_way; |
@@ -1073,10 +1083,10 @@ static int get_memory_error_data(struct mem_ctl_info *mci, | |||
1073 | continue; | 1083 | continue; |
1074 | 1084 | ||
1075 | limit = RIR_LIMIT(reg); | 1085 | limit = RIR_LIMIT(reg); |
1076 | 1086 | mb = div_u64_rem(limit >> 20, 1000, &kb); | |
1077 | debugf0("RIR#%d, limit: %Lu.%03Lu GB (0x%016Lx), way: %d\n", | 1087 | debugf0("RIR#%d, limit: %u.%03u GB (0x%016Lx), way: %d\n", |
1078 | n_rir, | 1088 | n_rir, |
1079 | (limit >> 20) / 1000, (limit >> 20) % 1000, | 1089 | mb, kb, |
1080 | limit, | 1090 | limit, |
1081 | 1 << RIR_WAY(reg)); | 1091 | 1 << RIR_WAY(reg)); |
1082 | if (ch_addr <= limit) | 1092 | if (ch_addr <= limit) |