diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-16 14:10:31 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 18:13:43 -0400 |
commit | 84c3a684087a257c6d702272771709fe025823f6 (patch) | |
tree | 132455327281f8468fa74691e7bcf8abbee6619d /drivers/edac | |
parent | 40f562b1915937c146ffe3597b0bc627b5a996da (diff) |
i82860_edac: convert driver to use the new edac ABI
The legacy edac ABI is going to be removed. Port the driver to use
and benefit from the new API functionality.
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/i82860_edac.c | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/drivers/edac/i82860_edac.c b/drivers/edac/i82860_edac.c index 8485bbf4379f..8834e4ed9802 100644 --- a/drivers/edac/i82860_edac.c +++ b/drivers/edac/i82860_edac.c | |||
@@ -99,6 +99,7 @@ static int i82860_process_error_info(struct mem_ctl_info *mci, | |||
99 | struct i82860_error_info *info, | 99 | struct i82860_error_info *info, |
100 | int handle_errors) | 100 | int handle_errors) |
101 | { | 101 | { |
102 | struct dimm_info *dimm; | ||
102 | int row; | 103 | int row; |
103 | 104 | ||
104 | if (!(info->errsts2 & 0x0003)) | 105 | if (!(info->errsts2 & 0x0003)) |
@@ -108,18 +109,25 @@ static int i82860_process_error_info(struct mem_ctl_info *mci, | |||
108 | return 1; | 109 | return 1; |
109 | 110 | ||
110 | if ((info->errsts ^ info->errsts2) & 0x0003) { | 111 | if ((info->errsts ^ info->errsts2) & 0x0003) { |
111 | edac_mc_handle_ce_no_info(mci, "UE overwrote CE"); | 112 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, 0, 0, 0, |
113 | -1, -1, -1, "UE overwrote CE", "", NULL); | ||
112 | info->errsts = info->errsts2; | 114 | info->errsts = info->errsts2; |
113 | } | 115 | } |
114 | 116 | ||
115 | info->eap >>= PAGE_SHIFT; | 117 | info->eap >>= PAGE_SHIFT; |
116 | row = edac_mc_find_csrow_by_page(mci, info->eap); | 118 | row = edac_mc_find_csrow_by_page(mci, info->eap); |
119 | dimm = mci->csrows[row].channels[0].dimm; | ||
117 | 120 | ||
118 | if (info->errsts & 0x0002) | 121 | if (info->errsts & 0x0002) |
119 | edac_mc_handle_ue(mci, info->eap, 0, row, "i82860 UE"); | 122 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
123 | info->eap, 0, 0, | ||
124 | dimm->location[0], dimm->location[1], -1, | ||
125 | "i82860 UE", "", NULL); | ||
120 | else | 126 | else |
121 | edac_mc_handle_ce(mci, info->eap, 0, info->derrsyn, row, 0, | 127 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
122 | "i82860 UE"); | 128 | info->eap, 0, info->derrsyn, |
129 | dimm->location[0], dimm->location[1], -1, | ||
130 | "i82860 CE", "", NULL); | ||
123 | 131 | ||
124 | return 1; | 132 | return 1; |
125 | } | 133 | } |
@@ -179,18 +187,26 @@ static void i82860_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev) | |||
179 | static int i82860_probe1(struct pci_dev *pdev, int dev_idx) | 187 | static int i82860_probe1(struct pci_dev *pdev, int dev_idx) |
180 | { | 188 | { |
181 | struct mem_ctl_info *mci; | 189 | struct mem_ctl_info *mci; |
190 | struct edac_mc_layer layers[2]; | ||
182 | struct i82860_error_info discard; | 191 | struct i82860_error_info discard; |
183 | 192 | ||
184 | /* RDRAM has channels but these don't map onto the abstractions that | 193 | /* |
185 | edac uses. | 194 | * RDRAM has channels but these don't map onto the csrow abstraction. |
186 | The device groups from the GRA registers seem to map reasonably | 195 | * According with the datasheet, there are 2 Rambus channels, supporting |
187 | well onto the notion of a chip select row. | 196 | * up to 16 direct RDRAM devices. |
188 | There are 16 GRA registers and since the name is associated with | 197 | * The device groups from the GRA registers seem to map reasonably |
189 | the channel and the GRA registers map to physical devices so we are | 198 | * well onto the notion of a chip select row. |
190 | going to make 1 channel for group. | 199 | * There are 16 GRA registers and since the name is associated with |
200 | * the channel and the GRA registers map to physical devices so we are | ||
201 | * going to make 1 channel for group. | ||
191 | */ | 202 | */ |
192 | mci = edac_mc_alloc(0, 16, 1, 0); | 203 | layers[0].type = EDAC_MC_LAYER_CHANNEL; |
193 | 204 | layers[0].size = 2; | |
205 | layers[0].is_virt_csrow = true; | ||
206 | layers[1].type = EDAC_MC_LAYER_SLOT; | ||
207 | layers[1].size = 8; | ||
208 | layers[1].is_virt_csrow = true; | ||
209 | mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0); | ||
194 | if (!mci) | 210 | if (!mci) |
195 | return -ENOMEM; | 211 | return -ENOMEM; |
196 | 212 | ||