diff options
Diffstat (limited to 'drivers/acpi/pci_link.c')
| -rw-r--r-- | drivers/acpi/pci_link.c | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 520b28ad0740..6ad0e77df9b3 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
| @@ -72,10 +72,12 @@ struct acpi_pci_link_irq { | |||
| 72 | u8 active; /* Current IRQ */ | 72 | u8 active; /* Current IRQ */ |
| 73 | u8 edge_level; /* All IRQs */ | 73 | u8 edge_level; /* All IRQs */ |
| 74 | u8 active_high_low; /* All IRQs */ | 74 | u8 active_high_low; /* All IRQs */ |
| 75 | u8 initialized; | ||
| 76 | u8 resource_type; | 75 | u8 resource_type; |
| 77 | u8 possible_count; | 76 | u8 possible_count; |
| 78 | u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE]; | 77 | u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE]; |
| 78 | u8 initialized:1; | ||
| 79 | u8 suspend_resume:1; | ||
| 80 | u8 reserved:6; | ||
| 79 | }; | 81 | }; |
| 80 | 82 | ||
| 81 | struct acpi_pci_link { | 83 | struct acpi_pci_link { |
| @@ -530,6 +532,10 @@ static int acpi_pci_link_allocate( | |||
| 530 | 532 | ||
| 531 | ACPI_FUNCTION_TRACE("acpi_pci_link_allocate"); | 533 | ACPI_FUNCTION_TRACE("acpi_pci_link_allocate"); |
| 532 | 534 | ||
| 535 | if (link->irq.suspend_resume) { | ||
| 536 | acpi_pci_link_set(link, link->irq.active); | ||
| 537 | link->irq.suspend_resume = 0; | ||
| 538 | } | ||
| 533 | if (link->irq.initialized) | 539 | if (link->irq.initialized) |
| 534 | return_VALUE(0); | 540 | return_VALUE(0); |
| 535 | 541 | ||
| @@ -713,38 +719,24 @@ end: | |||
| 713 | return_VALUE(result); | 719 | return_VALUE(result); |
| 714 | } | 720 | } |
| 715 | 721 | ||
| 716 | |||
| 717 | static int | ||
| 718 | acpi_pci_link_resume ( | ||
| 719 | struct acpi_pci_link *link) | ||
| 720 | { | ||
| 721 | ACPI_FUNCTION_TRACE("acpi_pci_link_resume"); | ||
| 722 | |||
| 723 | if (link->irq.active && link->irq.initialized) | ||
| 724 | return_VALUE(acpi_pci_link_set(link, link->irq.active)); | ||
| 725 | else | ||
| 726 | return_VALUE(0); | ||
| 727 | } | ||
| 728 | |||
| 729 | |||
| 730 | static int | 722 | static int |
| 731 | irqrouter_resume( | 723 | irqrouter_suspend( |
| 732 | struct sys_device *dev) | 724 | struct sys_device *dev, |
| 725 | u32 state) | ||
| 733 | { | 726 | { |
| 734 | struct list_head *node = NULL; | 727 | struct list_head *node = NULL; |
| 735 | struct acpi_pci_link *link = NULL; | 728 | struct acpi_pci_link *link = NULL; |
| 736 | 729 | ||
| 737 | ACPI_FUNCTION_TRACE("irqrouter_resume"); | 730 | ACPI_FUNCTION_TRACE("irqrouter_suspend"); |
| 738 | 731 | ||
| 739 | list_for_each(node, &acpi_link.entries) { | 732 | list_for_each(node, &acpi_link.entries) { |
| 740 | |||
| 741 | link = list_entry(node, struct acpi_pci_link, node); | 733 | link = list_entry(node, struct acpi_pci_link, node); |
| 742 | if (!link) { | 734 | if (!link) { |
| 743 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); | 735 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid link context\n")); |
| 744 | continue; | 736 | continue; |
| 745 | } | 737 | } |
| 746 | 738 | if (link->irq.active && link->irq.initialized) | |
| 747 | acpi_pci_link_resume(link); | 739 | link->irq.suspend_resume = 1; |
| 748 | } | 740 | } |
| 749 | return_VALUE(0); | 741 | return_VALUE(0); |
| 750 | } | 742 | } |
| @@ -812,9 +804,12 @@ static int __init acpi_irq_penalty_update(char *str, int used) | |||
| 812 | * There is no ISA_POSSIBLE weight, so we simply use | 804 | * There is no ISA_POSSIBLE weight, so we simply use |
| 813 | * the (small) PCI_USING penalty. | 805 | * the (small) PCI_USING penalty. |
| 814 | */ | 806 | */ |
| 815 | void acpi_penalize_isa_irq(int irq) | 807 | void acpi_penalize_isa_irq(int irq, int active) |
| 816 | { | 808 | { |
| 817 | acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; | 809 | if (active) |
| 810 | acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED; | ||
| 811 | else | ||
| 812 | acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; | ||
| 818 | } | 813 | } |
| 819 | 814 | ||
| 820 | /* | 815 | /* |
| @@ -856,7 +851,7 @@ __setup("acpi_irq_balance", acpi_irq_balance_set); | |||
| 856 | 851 | ||
| 857 | static struct sysdev_class irqrouter_sysdev_class = { | 852 | static struct sysdev_class irqrouter_sysdev_class = { |
| 858 | set_kset_name("irqrouter"), | 853 | set_kset_name("irqrouter"), |
| 859 | .resume = irqrouter_resume, | 854 | .suspend = irqrouter_suspend, |
| 860 | }; | 855 | }; |
| 861 | 856 | ||
| 862 | 857 | ||
