View | Details | Raw Unified | Return to bug 213353
Collapse All | Expand All

(-)a/drivers/acpi/pci_link.c (+22 lines)
Lines 56-61 struct acpi_pci_link_irq { Link Here
56
	u32 active;		/* Current IRQ */
56
	u32 active;		/* Current IRQ */
57
	u8 triggering;		/* All IRQs */
57
	u8 triggering;		/* All IRQs */
58
	u8 polarity;		/* All IRQs */
58
	u8 polarity;		/* All IRQs */
59
	u8 shareable;		/* All IRQs */
59
	u8 resource_type;
60
	u8 resource_type;
60
	u8 possible_count;
61
	u8 possible_count;
61
	u32 possible[ACPI_PCI_LINK_MAX_POSSIBLE];
62
	u32 possible[ACPI_PCI_LINK_MAX_POSSIBLE];
Lines 113-118 static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource, Link Here
113
			}
114
			}
114
			link->irq.triggering = p->triggering;
115
			link->irq.triggering = p->triggering;
115
			link->irq.polarity = p->polarity;
116
			link->irq.polarity = p->polarity;
117
			link->irq.shareable = p->shareable;
116
			link->irq.resource_type = ACPI_RESOURCE_TYPE_IRQ;
118
			link->irq.resource_type = ACPI_RESOURCE_TYPE_IRQ;
117
			break;
119
			break;
118
		}
120
		}
Lines 713-718 int acpi_pci_link_free_irq(acpi_handle handle) Link Here
713
	return link->irq.active;
715
	return link->irq.active;
714
}
716
}
715
717
718
int acpi_pci_link_get_irq_flags(int irq, u8 *triggering, u8 *polarity, u8 *shareable) {
719
	struct acpi_pci_link *link;
720
	int i;
721
722
	list_for_each_entry(link, &acpi_link_list, list) {
723
		for (i = 0; i < link->irq.possible_count; i++)
724
			if (link->irq.possible[i] == irq) {
725
				if (triggering)
726
					*triggering = link->irq.triggering;
727
				if (polarity)
728
					*polarity = link->irq.polarity;
729
				if (shareable)
730
					*shareable = link->irq.shareable;
731
				return 0;
732
			}
733
	}
734
735
	return -1;
736
}
737
716
/* --------------------------------------------------------------------------
738
/* --------------------------------------------------------------------------
717
                                 Driver Interface
739
                                 Driver Interface
718
   -------------------------------------------------------------------------- */
740
   -------------------------------------------------------------------------- */
(-)a/drivers/acpi/resource.c (-10 / +31 lines)
Lines 411-426 static void acpi_dev_get_irqresource(struct resource *res, u32 gsi, Link Here
411
	 * using extended IRQ descriptors we take the IRQ configuration
411
	 * using extended IRQ descriptors we take the IRQ configuration
412
	 * from _CRS directly.
412
	 * from _CRS directly.
413
	 */
413
	 */
414
	if (acpi_dev_irq_empty_or_noflags(legacy, triggering, polarity, shareable)
414
	if (acpi_dev_irq_empty_or_noflags(legacy, triggering, polarity, shareable)) {
415
	    && !acpi_get_override_irq(gsi, &t, &p)) {
415
		u8 trig;
416
		u8 trig = t ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
416
		u8 pol;
417
		u8 pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
417
		u8 shar;
418
418
419
		if (triggering != trig || polarity != pol) {
419
		if (!acpi_get_override_irq(gsi, &t, &p)) {
420
			pr_warn("ACPI: IRQ %d override to %s, %s\n", gsi,
420
			trig = t ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE;
421
				t ? "level" : "edge", p ? "low" : "high");
421
			pol = p ? ACPI_ACTIVE_LOW : ACPI_ACTIVE_HIGH;
422
			triggering = trig;
422
423
			polarity = pol;
423
			if (triggering != trig || polarity != pol) {
424
				pr_warn("ACPI: IRQ %d override to %s, %s\n", gsi,
425
					t ? "level" : "edge", p ? "low" : "high");
426
				triggering = trig;
427
				polarity = pol;
428
			}
429
		}
430
		if (!acpi_pci_link_get_irq_flags(gsi, &trig, &pol, &shar)) {
431
			/*
432
			 * For legacy IRQs, consider the IRQ settings
433
			 * from the PCI Interrupt Link devices.
434
			 * The IRQ must also be reprogrammed in the APIC to make it work.
435
			 */
436
			if (triggering != trig || polarity != pol) {
437
				irq_set_irq_type(gsi, acpi_dev_get_irq_type(trig, pol));
438
				pr_info("ACPI: IRQ %d used from PCI Interrupt Link device: %s, %s\n", gsi,
439
					trig == ACPI_LEVEL_SENSITIVE ? "level" : "edge",
440
					pol == ACPI_ACTIVE_LOW ? "low" : "high");
441
				triggering = trig;
442
				polarity = pol;
443
				shareable = shar;
444
			}
424
		}
445
		}
425
	}
446
	}
426
447
(-)a/include/acpi/acpi_drivers.h (+1 lines)
Lines 63-68 int acpi_irq_penalty_init(void); Link Here
63
int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
63
int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
64
			       int *polarity, char **name);
64
			       int *polarity, char **name);
65
int acpi_pci_link_free_irq(acpi_handle handle);
65
int acpi_pci_link_free_irq(acpi_handle handle);
66
int acpi_pci_link_get_irq_flags(int irq, u8 *triggering, u8 *polarity, u8 *shareable);
66
67
67
/* ACPI PCI Device Binding */
68
/* ACPI PCI Device Binding */
68
69

Return to bug 213353