diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2010-04-15 00:16:52 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-05-11 15:01:33 -0400 |
commit | 17e21854bd59862f4ee47d1c7e828549f782711b (patch) | |
tree | b1d7db096b4fa24e0522aa33de2710d2039924d0 /drivers/pci | |
parent | 88da13bfabbffb8f89574eb168b9da9a0abc693f (diff) |
PCI: aerdrv: rework do_recovery
Move dev_printks for debug into do_recovery().
This allows do_recovery() to return void.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 210e53c2fdc1..9dcd3aeeafb6 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -465,8 +465,7 @@ static pci_ers_result_t reset_link(struct pcie_device *aerdev, | |||
465 | * error detected message to all downstream drivers within a hierarchy in | 465 | * error detected message to all downstream drivers within a hierarchy in |
466 | * question and return the returned code. | 466 | * question and return the returned code. |
467 | */ | 467 | */ |
468 | static pci_ers_result_t do_recovery(struct pcie_device *aerdev, | 468 | static void do_recovery(struct pcie_device *aerdev, struct pci_dev *dev, |
469 | struct pci_dev *dev, | ||
470 | int severity) | 469 | int severity) |
471 | { | 470 | { |
472 | pci_ers_result_t status, result = PCI_ERS_RESULT_RECOVERED; | 471 | pci_ers_result_t status, result = PCI_ERS_RESULT_RECOVERED; |
@@ -484,10 +483,8 @@ static pci_ers_result_t do_recovery(struct pcie_device *aerdev, | |||
484 | 483 | ||
485 | if (severity == AER_FATAL) { | 484 | if (severity == AER_FATAL) { |
486 | result = reset_link(aerdev, dev); | 485 | result = reset_link(aerdev, dev); |
487 | if (result != PCI_ERS_RESULT_RECOVERED) { | 486 | if (result != PCI_ERS_RESULT_RECOVERED) |
488 | /* TODO: Should panic here? */ | 487 | goto failed; |
489 | return result; | ||
490 | } | ||
491 | } | 488 | } |
492 | 489 | ||
493 | if (status == PCI_ERS_RESULT_CAN_RECOVER) | 490 | if (status == PCI_ERS_RESULT_CAN_RECOVER) |
@@ -508,13 +505,22 @@ static pci_ers_result_t do_recovery(struct pcie_device *aerdev, | |||
508 | report_slot_reset); | 505 | report_slot_reset); |
509 | } | 506 | } |
510 | 507 | ||
511 | if (status == PCI_ERS_RESULT_RECOVERED) | 508 | if (status != PCI_ERS_RESULT_RECOVERED) |
512 | broadcast_error_message(dev, | 509 | goto failed; |
510 | |||
511 | broadcast_error_message(dev, | ||
513 | state, | 512 | state, |
514 | "resume", | 513 | "resume", |
515 | report_resume); | 514 | report_resume); |
516 | 515 | ||
517 | return status; | 516 | dev_printk(KERN_DEBUG, &dev->dev, |
517 | "AER driver successfully recovered\n"); | ||
518 | return; | ||
519 | |||
520 | failed: | ||
521 | /* TODO: Should kernel panic here? */ | ||
522 | dev_printk(KERN_DEBUG, &dev->dev, | ||
523 | "AER driver didn't recover\n"); | ||
518 | } | 524 | } |
519 | 525 | ||
520 | /** | 526 | /** |
@@ -529,7 +535,6 @@ static void handle_error_source(struct pcie_device *aerdev, | |||
529 | struct pci_dev *dev, | 535 | struct pci_dev *dev, |
530 | struct aer_err_info *info) | 536 | struct aer_err_info *info) |
531 | { | 537 | { |
532 | pci_ers_result_t status = 0; | ||
533 | int pos; | 538 | int pos; |
534 | 539 | ||
535 | if (info->severity == AER_CORRECTABLE) { | 540 | if (info->severity == AER_CORRECTABLE) { |
@@ -541,17 +546,8 @@ static void handle_error_source(struct pcie_device *aerdev, | |||
541 | if (pos) | 546 | if (pos) |
542 | pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, | 547 | pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, |
543 | info->status); | 548 | info->status); |
544 | } else { | 549 | } else |
545 | status = do_recovery(aerdev, dev, info->severity); | 550 | do_recovery(aerdev, dev, info->severity); |
546 | if (status == PCI_ERS_RESULT_RECOVERED) { | ||
547 | dev_printk(KERN_DEBUG, &dev->dev, "AER driver " | ||
548 | "successfully recovered\n"); | ||
549 | } else { | ||
550 | /* TODO: Should kernel panic here? */ | ||
551 | dev_printk(KERN_DEBUG, &dev->dev, "AER driver didn't " | ||
552 | "recover\n"); | ||
553 | } | ||
554 | } | ||
555 | } | 551 | } |
556 | 552 | ||
557 | /** | 553 | /** |