aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/eisa
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-01-17 16:57:29 -0500
committerBjorn Helgaas <bhelgaas@google.com>2014-01-17 16:57:29 -0500
commit765ee51f9a3f652959b4c7297d198a28e37952b4 (patch)
tree2cfc7e0ad1a27128e1472e18a9dfb50ee59fc7fe /drivers/eisa
parentbea1b0b38439ea40b1a933ff8bc0b3c506958dd6 (diff)
Revert "EISA: Initialize device before its resources"
This reverts commit 26abfeed4341872364386c6a52b9acef8c81a81a. In the eisa_probe() force_probe path, if we were unable to request slot resources (e.g., [io 0x800-0x8ff]), we skipped the slot with "Cannot allocate resource for EISA slot %d" before reading the EISA signature in eisa_init_device(). Commit 26abfeed4341 moved eisa_init_device() earlier, so we tried to read the EISA signature before requesting the slot resources, and this caused hangs during boot. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1251816 Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> CC: stable@vger.kernel.org # v3.10+ a2080d0c561c: Revert "EISA: Log device resources in dmesg"
Diffstat (limited to 'drivers/eisa')
-rw-r--r--drivers/eisa/eisa-bus.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 1b86fe0c2e80..612afeaec3cb 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -277,11 +277,13 @@ static int __init eisa_request_resources(struct eisa_root_device *root,
277 } 277 }
278 278
279 if (slot) { 279 if (slot) {
280 edev->res[i].name = NULL;
280 edev->res[i].start = SLOT_ADDRESS(root, slot) 281 edev->res[i].start = SLOT_ADDRESS(root, slot)
281 + (i * 0x400); 282 + (i * 0x400);
282 edev->res[i].end = edev->res[i].start + 0xff; 283 edev->res[i].end = edev->res[i].start + 0xff;
283 edev->res[i].flags = IORESOURCE_IO; 284 edev->res[i].flags = IORESOURCE_IO;
284 } else { 285 } else {
286 edev->res[i].name = NULL;
285 edev->res[i].start = SLOT_ADDRESS(root, slot) 287 edev->res[i].start = SLOT_ADDRESS(root, slot)
286 + EISA_VENDOR_ID_OFFSET; 288 + EISA_VENDOR_ID_OFFSET;
287 edev->res[i].end = edev->res[i].start + 3; 289 edev->res[i].end = edev->res[i].start + 3;
@@ -327,19 +329,20 @@ static int __init eisa_probe(struct eisa_root_device *root)
327 return -ENOMEM; 329 return -ENOMEM;
328 } 330 }
329 331
330 if (eisa_init_device(root, edev, 0)) { 332 if (eisa_request_resources(root, edev, 0)) {
333 dev_warn(root->dev,
334 "EISA: Cannot allocate resource for mainboard\n");
331 kfree(edev); 335 kfree(edev);
332 if (!root->force_probe) 336 if (!root->force_probe)
333 return -ENODEV; 337 return -EBUSY;
334 goto force_probe; 338 goto force_probe;
335 } 339 }
336 340
337 if (eisa_request_resources(root, edev, 0)) { 341 if (eisa_init_device(root, edev, 0)) {
338 dev_warn(root->dev, 342 eisa_release_resources(edev);
339 "EISA: Cannot allocate resource for mainboard\n");
340 kfree(edev); 343 kfree(edev);
341 if (!root->force_probe) 344 if (!root->force_probe)
342 return -EBUSY; 345 return -ENODEV;
343 goto force_probe; 346 goto force_probe;
344 } 347 }
345 348
@@ -362,11 +365,6 @@ static int __init eisa_probe(struct eisa_root_device *root)
362 continue; 365 continue;
363 } 366 }
364 367
365 if (eisa_init_device(root, edev, i)) {
366 kfree(edev);
367 continue;
368 }
369
370 if (eisa_request_resources(root, edev, i)) { 368 if (eisa_request_resources(root, edev, i)) {
371 dev_warn(root->dev, 369 dev_warn(root->dev,
372 "Cannot allocate resource for EISA slot %d\n", 370 "Cannot allocate resource for EISA slot %d\n",
@@ -375,6 +373,12 @@ static int __init eisa_probe(struct eisa_root_device *root)
375 continue; 373 continue;
376 } 374 }
377 375
376 if (eisa_init_device(root, edev, i)) {
377 eisa_release_resources(edev);
378 kfree(edev);
379 continue;
380 }
381
378 if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED)) 382 if (edev->state == (EISA_CONFIG_ENABLED | EISA_CONFIG_FORCED))
379 enabled_str = " (forced enabled)"; 383 enabled_str = " (forced enabled)";
380 else if (edev->state == EISA_CONFIG_FORCED) 384 else if (edev->state == EISA_CONFIG_FORCED)