diff options
Diffstat (limited to 'drivers/acpi/pci_link.c')
-rw-r--r-- | drivers/acpi/pci_link.c | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 233c40c51684..fcfdef7b4fdd 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c | |||
@@ -113,20 +113,23 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) | |||
113 | 113 | ||
114 | switch (resource->type) { | 114 | switch (resource->type) { |
115 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: | 115 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: |
116 | case ACPI_RESOURCE_TYPE_END_TAG: | ||
116 | return AE_OK; | 117 | return AE_OK; |
117 | case ACPI_RESOURCE_TYPE_IRQ: | 118 | case ACPI_RESOURCE_TYPE_IRQ: |
118 | { | 119 | { |
119 | struct acpi_resource_irq *p = &resource->data.irq; | 120 | struct acpi_resource_irq *p = &resource->data.irq; |
120 | if (!p || !p->interrupt_count) { | 121 | if (!p || !p->interrupt_count) { |
121 | printk(KERN_WARNING PREFIX "Blank IRQ resource\n"); | 122 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
123 | "Blank _PRS IRQ resource\n")); | ||
122 | return AE_OK; | 124 | return AE_OK; |
123 | } | 125 | } |
124 | for (i = 0; | 126 | for (i = 0; |
125 | (i < p->interrupt_count | 127 | (i < p->interrupt_count |
126 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { | 128 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { |
127 | if (!p->interrupts[i]) { | 129 | if (!p->interrupts[i]) { |
128 | printk(KERN_WARNING PREFIX "Invalid IRQ %d\n", | 130 | printk(KERN_WARNING PREFIX |
129 | p->interrupts[i]); | 131 | "Invalid _PRS IRQ %d\n", |
132 | p->interrupts[i]); | ||
130 | continue; | 133 | continue; |
131 | } | 134 | } |
132 | link->irq.possible[i] = p->interrupts[i]; | 135 | link->irq.possible[i] = p->interrupts[i]; |
@@ -143,15 +146,16 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) | |||
143 | &resource->data.extended_irq; | 146 | &resource->data.extended_irq; |
144 | if (!p || !p->interrupt_count) { | 147 | if (!p || !p->interrupt_count) { |
145 | printk(KERN_WARNING PREFIX | 148 | printk(KERN_WARNING PREFIX |
146 | "Blank EXT IRQ resource\n"); | 149 | "Blank _PRS EXT IRQ resource\n"); |
147 | return AE_OK; | 150 | return AE_OK; |
148 | } | 151 | } |
149 | for (i = 0; | 152 | for (i = 0; |
150 | (i < p->interrupt_count | 153 | (i < p->interrupt_count |
151 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { | 154 | && i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) { |
152 | if (!p->interrupts[i]) { | 155 | if (!p->interrupts[i]) { |
153 | printk(KERN_WARNING PREFIX "Invalid IRQ %d\n", | 156 | printk(KERN_WARNING PREFIX |
154 | p->interrupts[i]); | 157 | "Invalid _PRS IRQ %d\n", |
158 | p->interrupts[i]); | ||
155 | continue; | 159 | continue; |
156 | } | 160 | } |
157 | link->irq.possible[i] = p->interrupts[i]; | 161 | link->irq.possible[i] = p->interrupts[i]; |
@@ -163,7 +167,8 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) | |||
163 | break; | 167 | break; |
164 | } | 168 | } |
165 | default: | 169 | default: |
166 | printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n"); | 170 | printk(KERN_ERR PREFIX "_PRS resource type 0x%x isn't an IRQ\n", |
171 | resource->type); | ||
167 | return AE_OK; | 172 | return AE_OK; |
168 | } | 173 | } |
169 | 174 | ||
@@ -199,6 +204,9 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
199 | 204 | ||
200 | 205 | ||
201 | switch (resource->type) { | 206 | switch (resource->type) { |
207 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: | ||
208 | case ACPI_RESOURCE_TYPE_END_TAG: | ||
209 | return AE_OK; | ||
202 | case ACPI_RESOURCE_TYPE_IRQ: | 210 | case ACPI_RESOURCE_TYPE_IRQ: |
203 | { | 211 | { |
204 | struct acpi_resource_irq *p = &resource->data.irq; | 212 | struct acpi_resource_irq *p = &resource->data.irq; |
@@ -208,7 +216,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
208 | * particularly those those w/ _STA disabled | 216 | * particularly those those w/ _STA disabled |
209 | */ | 217 | */ |
210 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 218 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
211 | "Blank IRQ resource\n")); | 219 | "Blank _CRS IRQ resource\n")); |
212 | return AE_OK; | 220 | return AE_OK; |
213 | } | 221 | } |
214 | *irq = p->interrupts[0]; | 222 | *irq = p->interrupts[0]; |
@@ -224,7 +232,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
224 | * return at least 1 IRQ | 232 | * return at least 1 IRQ |
225 | */ | 233 | */ |
226 | printk(KERN_WARNING PREFIX | 234 | printk(KERN_WARNING PREFIX |
227 | "Blank EXT IRQ resource\n"); | 235 | "Blank _CRS EXT IRQ resource\n"); |
228 | return AE_OK; | 236 | return AE_OK; |
229 | } | 237 | } |
230 | *irq = p->interrupts[0]; | 238 | *irq = p->interrupts[0]; |
@@ -232,10 +240,11 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) | |||
232 | } | 240 | } |
233 | break; | 241 | break; |
234 | default: | 242 | default: |
235 | printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type); | 243 | printk(KERN_ERR PREFIX "_CRS resource type 0x%x isn't an IRQ\n", |
236 | case ACPI_RESOURCE_TYPE_END_TAG: | 244 | resource->type); |
237 | return AE_OK; | 245 | return AE_OK; |
238 | } | 246 | } |
247 | |||
239 | return AE_CTRL_TERMINATE; | 248 | return AE_CTRL_TERMINATE; |
240 | } | 249 | } |
241 | 250 | ||
@@ -700,7 +709,7 @@ int acpi_pci_link_free_irq(acpi_handle handle) | |||
700 | acpi_device_bid(link->device))); | 709 | acpi_device_bid(link->device))); |
701 | 710 | ||
702 | if (link->refcnt == 0) { | 711 | if (link->refcnt == 0) { |
703 | acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL); | 712 | acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL); |
704 | } | 713 | } |
705 | mutex_unlock(&acpi_link_lock); | 714 | mutex_unlock(&acpi_link_lock); |
706 | return (link->irq.active); | 715 | return (link->irq.active); |
@@ -728,7 +737,7 @@ static int acpi_pci_link_add(struct acpi_device *device) | |||
728 | link->device = device; | 737 | link->device = device; |
729 | strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); | 738 | strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME); |
730 | strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); | 739 | strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS); |
731 | acpi_driver_data(device) = link; | 740 | device->driver_data = link; |
732 | 741 | ||
733 | mutex_lock(&acpi_link_lock); | 742 | mutex_lock(&acpi_link_lock); |
734 | result = acpi_pci_link_get_possible(link); | 743 | result = acpi_pci_link_get_possible(link); |
@@ -764,7 +773,7 @@ static int acpi_pci_link_add(struct acpi_device *device) | |||
764 | 773 | ||
765 | end: | 774 | end: |
766 | /* disable all links -- to be activated on use */ | 775 | /* disable all links -- to be activated on use */ |
767 | acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL); | 776 | acpi_evaluate_object(device->handle, "_DIS", NULL, NULL); |
768 | mutex_unlock(&acpi_link_lock); | 777 | mutex_unlock(&acpi_link_lock); |
769 | 778 | ||
770 | if (result) | 779 | if (result) |
@@ -840,7 +849,7 @@ static int __init acpi_irq_penalty_update(char *str, int used) | |||
840 | if (irq < 0) | 849 | if (irq < 0) |
841 | continue; | 850 | continue; |
842 | 851 | ||
843 | if (irq >= ACPI_MAX_IRQS) | 852 | if (irq >= ARRAY_SIZE(acpi_irq_penalty)) |
844 | continue; | 853 | continue; |
845 | 854 | ||
846 | if (used) | 855 | if (used) |
@@ -863,10 +872,12 @@ static int __init acpi_irq_penalty_update(char *str, int used) | |||
863 | */ | 872 | */ |
864 | void acpi_penalize_isa_irq(int irq, int active) | 873 | void acpi_penalize_isa_irq(int irq, int active) |
865 | { | 874 | { |
866 | if (active) | 875 | if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty)) { |
867 | acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED; | 876 | if (active) |
868 | else | 877 | acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED; |
869 | acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; | 878 | else |
879 | acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING; | ||
880 | } | ||
870 | } | 881 | } |
871 | 882 | ||
872 | /* | 883 | /* |