Re: [PATCH] PCI fixes for 2.6.10-rc1

Greg KH
2004-11-12T23:25:58Z

ChangeSet 1.2026.35.2, 2004/10/28 15:14:02-05:00, akpm@osdl.org

[PATCH] acpi: better encapsulate eisa_set_level_irq()

From: Bjorn Helgaas <bjorn.helgaas@hp.com>

Move the "only do this once" stuff from acpi_register_gsi() into
eisa_set_level().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>

arch/i386/kernel/acpi/boot.c | 8 +-------
arch/i386/pci/irq.c | 9 ++++++++-
2 files changed, 9 insertions(+), 8 deletions(-)

diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c 2004-11-12 15:14:43 -08:00
+++ b/arch/i386/kernel/acpi/boot.c 2004-11-12 15:14:43 -08:00
@@ -457,16 +457,10 @@
* Make sure all (legacy) PCI IRQs are set as level-triggered.
*/
if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
- static u16 irq_mask;
extern void eisa_set_level_irq(unsigned int irq);

- if (edge_level == ACPI_LEVEL_SENSITIVE) {
- if ((gsi < 16) && !((1 << gsi) & irq_mask)) {
- Dprintk(KERN_DEBUG PREFIX "Setting GSI %u as level-triggered\n", gsi);
- irq_mask |= (1 << gsi);
+ if (edge_level == ACPI_LEVEL_SENSITIVE)
eisa_set_level_irq(gsi);
- }
- }
}
#endif

diff -Nru a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c
--- a/arch/i386/pci/irq.c 2004-11-12 15:14:43 -08:00
+++ b/arch/i386/pci/irq.c 2004-11-12 15:14:43 -08:00
@@ -127,8 +127,15 @@
{
unsigned char mask = 1 << (irq & 7);
unsigned int port = 0x4d0 + (irq >> 3);
- unsigned char val = inb(port);
+ unsigned char val;
+ static u16 eisa_irq_mask;

+ if (irq >= 16 || (1 << irq) & eisa_irq_mask)
+ return;
+
+ eisa_irq_mask |= (1 << irq);
+ printk("PCI: setting IRQ %u as level-triggered\n", irq);
+ val = inb(port);
if (!(val & mask)) {
DBG(" -> edge");
outb(val | mask, port);