aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorZhang, Yanmin <yanmin_zhang@linux.intel.com>2009-06-16 01:34:38 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-16 17:30:13 -0400
commit70298c6e6c1ba68346336b4ea54bd5c0abbf73c8 (patch)
tree363d0a784d8a28688c0fda006279563a7fd3629b /arch/powerpc
parenta6c0d5c6ebb3d988b1f18a1612b5188f3f555637 (diff)
PCI AER: support Multiple Error Received and no error source id
Based on PCI Express AER specs, a root port might receive multiple TLP errors while it could only save a correctable error source id and an uncorrectable error source id at the same time. In addition, some root port hardware might be unable to provide a correct source id, i.e., the source id, or the bus id part of the source id provided by root port might be equal to 0. The patchset implements the support in kernel by searching the device tree under the root port. Patch 1 changes parameter cb of function pci_walk_bus to return a value. When cb return non-zero, pci_walk_bus stops more searching on the device tree. Reviewed-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/eeh_driver.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index 9a2a6e32f00f..0e8db6771252 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -122,7 +122,7 @@ static void eeh_enable_irq(struct pci_dev *dev)
122 * passed back in "userdata". 122 * passed back in "userdata".
123 */ 123 */
124 124
125static void eeh_report_error(struct pci_dev *dev, void *userdata) 125static int eeh_report_error(struct pci_dev *dev, void *userdata)
126{ 126{
127 enum pci_ers_result rc, *res = userdata; 127 enum pci_ers_result rc, *res = userdata;
128 struct pci_driver *driver = dev->driver; 128 struct pci_driver *driver = dev->driver;
@@ -130,19 +130,21 @@ static void eeh_report_error(struct pci_dev *dev, void *userdata)
130 dev->error_state = pci_channel_io_frozen; 130 dev->error_state = pci_channel_io_frozen;
131 131
132 if (!driver) 132 if (!driver)
133 return; 133 return 0;
134 134
135 eeh_disable_irq(dev); 135 eeh_disable_irq(dev);
136 136
137 if (!driver->err_handler || 137 if (!driver->err_handler ||
138 !driver->err_handler->error_detected) 138 !driver->err_handler->error_detected)
139 return; 139 return 0;
140 140
141 rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen); 141 rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen);
142 142
143 /* A driver that needs a reset trumps all others */ 143 /* A driver that needs a reset trumps all others */
144 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; 144 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
145 if (*res == PCI_ERS_RESULT_NONE) *res = rc; 145 if (*res == PCI_ERS_RESULT_NONE) *res = rc;
146
147 return 0;
146} 148}
147 149
148/** 150/**
@@ -153,7 +155,7 @@ static void eeh_report_error(struct pci_dev *dev, void *userdata)
153 * Cumulative response passed back in "userdata". 155 * Cumulative response passed back in "userdata".
154 */ 156 */
155 157
156static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) 158static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
157{ 159{
158 enum pci_ers_result rc, *res = userdata; 160 enum pci_ers_result rc, *res = userdata;
159 struct pci_driver *driver = dev->driver; 161 struct pci_driver *driver = dev->driver;
@@ -161,26 +163,28 @@ static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
161 if (!driver || 163 if (!driver ||
162 !driver->err_handler || 164 !driver->err_handler ||
163 !driver->err_handler->mmio_enabled) 165 !driver->err_handler->mmio_enabled)
164 return; 166 return 0;
165 167
166 rc = driver->err_handler->mmio_enabled (dev); 168 rc = driver->err_handler->mmio_enabled (dev);
167 169
168 /* A driver that needs a reset trumps all others */ 170 /* A driver that needs a reset trumps all others */
169 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; 171 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
170 if (*res == PCI_ERS_RESULT_NONE) *res = rc; 172 if (*res == PCI_ERS_RESULT_NONE) *res = rc;
173
174 return 0;
171} 175}
172 176
173/** 177/**
174 * eeh_report_reset - tell device that slot has been reset 178 * eeh_report_reset - tell device that slot has been reset
175 */ 179 */
176 180
177static void eeh_report_reset(struct pci_dev *dev, void *userdata) 181static int eeh_report_reset(struct pci_dev *dev, void *userdata)
178{ 182{
179 enum pci_ers_result rc, *res = userdata; 183 enum pci_ers_result rc, *res = userdata;
180 struct pci_driver *driver = dev->driver; 184 struct pci_driver *driver = dev->driver;
181 185
182 if (!driver) 186 if (!driver)
183 return; 187 return 0;
184 188
185 dev->error_state = pci_channel_io_normal; 189 dev->error_state = pci_channel_io_normal;
186 190
@@ -188,35 +192,39 @@ static void eeh_report_reset(struct pci_dev *dev, void *userdata)
188 192
189 if (!driver->err_handler || 193 if (!driver->err_handler ||
190 !driver->err_handler->slot_reset) 194 !driver->err_handler->slot_reset)
191 return; 195 return 0;
192 196
193 rc = driver->err_handler->slot_reset(dev); 197 rc = driver->err_handler->slot_reset(dev);
194 if ((*res == PCI_ERS_RESULT_NONE) || 198 if ((*res == PCI_ERS_RESULT_NONE) ||
195 (*res == PCI_ERS_RESULT_RECOVERED)) *res = rc; 199 (*res == PCI_ERS_RESULT_RECOVERED)) *res = rc;
196 if (*res == PCI_ERS_RESULT_DISCONNECT && 200 if (*res == PCI_ERS_RESULT_DISCONNECT &&
197 rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; 201 rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
202
203 return 0;
198} 204}
199 205
200/** 206/**
201 * eeh_report_resume - tell device to resume normal operations 207 * eeh_report_resume - tell device to resume normal operations
202 */ 208 */
203 209
204static void eeh_report_resume(struct pci_dev *dev, void *userdata) 210static int eeh_report_resume(struct pci_dev *dev, void *userdata)
205{ 211{
206 struct pci_driver *driver = dev->driver; 212 struct pci_driver *driver = dev->driver;
207 213
208 dev->error_state = pci_channel_io_normal; 214 dev->error_state = pci_channel_io_normal;
209 215
210 if (!driver) 216 if (!driver)
211 return; 217 return 0;
212 218
213 eeh_enable_irq(dev); 219 eeh_enable_irq(dev);
214 220
215 if (!driver->err_handler || 221 if (!driver->err_handler ||
216 !driver->err_handler->resume) 222 !driver->err_handler->resume)
217 return; 223 return 0;
218 224
219 driver->err_handler->resume(dev); 225 driver->err_handler->resume(dev);
226
227 return 0;
220} 228}
221 229
222/** 230/**
@@ -226,22 +234,24 @@ static void eeh_report_resume(struct pci_dev *dev, void *userdata)
226 * dead, and that no further recovery attempts will be made on it. 234 * dead, and that no further recovery attempts will be made on it.
227 */ 235 */
228 236
229static void eeh_report_failure(struct pci_dev *dev, void *userdata) 237static int eeh_report_failure(struct pci_dev *dev, void *userdata)
230{ 238{
231 struct pci_driver *driver = dev->driver; 239 struct pci_driver *driver = dev->driver;
232 240
233 dev->error_state = pci_channel_io_perm_failure; 241 dev->error_state = pci_channel_io_perm_failure;
234 242
235 if (!driver) 243 if (!driver)
236 return; 244 return 0;
237 245
238 eeh_disable_irq(dev); 246 eeh_disable_irq(dev);
239 247
240 if (!driver->err_handler || 248 if (!driver->err_handler ||
241 !driver->err_handler->error_detected) 249 !driver->err_handler->error_detected)
242 return; 250 return 0;
243 251
244 driver->err_handler->error_detected(dev, pci_channel_io_perm_failure); 252 driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
253
254 return 0;
245} 255}
246 256
247/* ------------------------------------------------------- */ 257/* ------------------------------------------------------- */