public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Len Brown <len.brown@intel.com>
Cc: Andrew Morton <akpm@osdl.org>,
	acpi-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] better encapsulate eisa_set_level_irq()
Date: Wed, 29 Sep 2004 11:51:01 -0600	[thread overview]
Message-ID: <1096480261.26691.12.camel@eeyore> (raw)

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

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

diff -u -ur 2.6.9-rc2-mm4/arch/i386/kernel/acpi/boot.c pic/arch/i386/kernel/acpi/boot.c
--- 2.6.9-rc2-mm4/arch/i386/kernel/acpi/boot.c	2004-09-27 10:12:15.000000000 -0600
+++ pic/arch/i386/kernel/acpi/boot.c	2004-09-28 16:06:37.000000000 -0600
@@ -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 -u -ur 2.6.9-rc2-mm4/arch/i386/pci/irq.c pic/arch/i386/pci/irq.c
--- 2.6.9-rc2-mm4/arch/i386/pci/irq.c	2004-09-27 10:12:15.000000000 -0600
+++ pic/arch/i386/pci/irq.c	2004-09-29 08:39:37.000000000 -0600
@@ -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);

                 reply	other threads:[~2004-09-29 17:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1096480261.26691.12.camel@eeyore \
    --to=bjorn.helgaas@hp.com \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=akpm@osdl.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox