diff options
Diffstat (limited to 'drivers/edac/octeon_edac-pci.c')
-rw-r--r-- | drivers/edac/octeon_edac-pci.c | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/drivers/edac/octeon_edac-pci.c b/drivers/edac/octeon_edac-pci.c index e72b96e3e4e0..758c1ef5fc9e 100644 --- a/drivers/edac/octeon_edac-pci.c +++ b/drivers/edac/octeon_edac-pci.c | |||
@@ -3,6 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 2012 Cavium, Inc. | ||
6 | * Copyright (C) 2009 Wind River Systems, | 7 | * Copyright (C) 2009 Wind River Systems, |
7 | * written by Ralf Baechle <ralf@linux-mips.org> | 8 | * written by Ralf Baechle <ralf@linux-mips.org> |
8 | */ | 9 | */ |
@@ -20,9 +21,7 @@ | |||
20 | #include "edac_core.h" | 21 | #include "edac_core.h" |
21 | #include "edac_module.h" | 22 | #include "edac_module.h" |
22 | 23 | ||
23 | #define EDAC_MOD_STR "octeon" | 24 | static void octeon_pci_poll(struct edac_pci_ctl_info *pci) |
24 | |||
25 | static void co_pci_poll(struct edac_pci_ctl_info *pci) | ||
26 | { | 25 | { |
27 | union cvmx_pci_cfg01 cfg01; | 26 | union cvmx_pci_cfg01 cfg01; |
28 | 27 | ||
@@ -57,14 +56,9 @@ static void co_pci_poll(struct edac_pci_ctl_info *pci) | |||
57 | cfg01.s.mdpe = 1; /* Reset */ | 56 | cfg01.s.mdpe = 1; /* Reset */ |
58 | octeon_npi_write32(CVMX_NPI_PCI_CFG01, cfg01.u32); | 57 | octeon_npi_write32(CVMX_NPI_PCI_CFG01, cfg01.u32); |
59 | } | 58 | } |
60 | if (cfg01.s.mdpe) { | ||
61 | edac_pci_handle_npe(pci, "Master Data Parity Error"); | ||
62 | cfg01.s.mdpe = 1; /* Reset */ | ||
63 | octeon_npi_write32(CVMX_NPI_PCI_CFG01, cfg01.u32); | ||
64 | } | ||
65 | } | 59 | } |
66 | 60 | ||
67 | static int __devinit co_pci_probe(struct platform_device *pdev) | 61 | static int __devinit octeon_pci_probe(struct platform_device *pdev) |
68 | { | 62 | { |
69 | struct edac_pci_ctl_info *pci; | 63 | struct edac_pci_ctl_info *pci; |
70 | int res = 0; | 64 | int res = 0; |
@@ -79,7 +73,7 @@ static int __devinit co_pci_probe(struct platform_device *pdev) | |||
79 | 73 | ||
80 | pci->mod_name = "octeon-pci"; | 74 | pci->mod_name = "octeon-pci"; |
81 | pci->ctl_name = "octeon_pci_err"; | 75 | pci->ctl_name = "octeon_pci_err"; |
82 | pci->edac_check = co_pci_poll; | 76 | pci->edac_check = octeon_pci_poll; |
83 | 77 | ||
84 | if (edac_pci_add_device(pci, 0) > 0) { | 78 | if (edac_pci_add_device(pci, 0) > 0) { |
85 | pr_err("%s: edac_pci_add_device() failed\n", __func__); | 79 | pr_err("%s: edac_pci_add_device() failed\n", __func__); |
@@ -94,7 +88,7 @@ err: | |||
94 | return res; | 88 | return res; |
95 | } | 89 | } |
96 | 90 | ||
97 | static int co_pci_remove(struct platform_device *pdev) | 91 | static int octeon_pci_remove(struct platform_device *pdev) |
98 | { | 92 | { |
99 | struct edac_pci_ctl_info *pci = platform_get_drvdata(pdev); | 93 | struct edac_pci_ctl_info *pci = platform_get_drvdata(pdev); |
100 | 94 | ||
@@ -104,32 +98,14 @@ static int co_pci_remove(struct platform_device *pdev) | |||
104 | return 0; | 98 | return 0; |
105 | } | 99 | } |
106 | 100 | ||
107 | static struct platform_driver co_pci_driver = { | 101 | static struct platform_driver octeon_pci_driver = { |
108 | .probe = co_pci_probe, | 102 | .probe = octeon_pci_probe, |
109 | .remove = co_pci_remove, | 103 | .remove = octeon_pci_remove, |
110 | .driver = { | 104 | .driver = { |
111 | .name = "co_pci_edac", | 105 | .name = "octeon_pci_edac", |
112 | } | 106 | } |
113 | }; | 107 | }; |
114 | 108 | module_platform_driver(octeon_pci_driver); | |
115 | static int __init co_edac_init(void) | ||
116 | { | ||
117 | int ret; | ||
118 | |||
119 | ret = platform_driver_register(&co_pci_driver); | ||
120 | if (ret) | ||
121 | pr_warning(EDAC_MOD_STR " PCI EDAC failed to register\n"); | ||
122 | |||
123 | return ret; | ||
124 | } | ||
125 | |||
126 | static void __exit co_edac_exit(void) | ||
127 | { | ||
128 | platform_driver_unregister(&co_pci_driver); | ||
129 | } | ||
130 | |||
131 | module_init(co_edac_init); | ||
132 | module_exit(co_edac_exit); | ||
133 | 109 | ||
134 | MODULE_LICENSE("GPL"); | 110 | MODULE_LICENSE("GPL"); |
135 | MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>"); | 111 | MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>"); |