public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew de Quincey <adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
To: Jeff Garzik <jgarzik-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
Cc: torvalds-3NddpPZAyC0@public.gmane.org,
	lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-acpi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: [PATCH] 2.6.0-test4 ACPI fixes series (2/4)
Date: Sat, 6 Sep 2003 01:57:32 +0100	[thread overview]
Message-ID: <200309060157.32802.adq_dvb@lidskialf.net> (raw)
In-Reply-To: <3F590E28.6090101-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>

This patch retries IRQ programming with an extended IRQ resource descriptor
if using a standard IRQ descriptor fails.


--- linux-2.6.0-test4.picmode/drivers/acpi/pci_link.c	2003-09-06 00:24:06.666213344 +0100
+++ linux-2.6.0-test4.extirq/drivers/acpi/pci_link.c	2003-09-06 00:26:18.912108912 +0100
@@ -293,7 +293,8 @@
 	struct acpi_buffer	buffer = {sizeof(resource)+1, &resource};
 	int			i = 0;
 	int			valid = 0;
-
+	int			resource_type = 0;
+   
 	ACPI_FUNCTION_TRACE("acpi_pci_link_set");
 
 	if (!link || !irq)
@@ -315,21 +316,33 @@
 			return_VALUE(-EINVAL);
 		}
 	}
+
+	/* If IRQ<=15, first try with a "normal" IRQ descriptor. If that fails, try with
+	 * an extended one */
+	if (irq <= 15) {
+		resource_type = ACPI_RSTYPE_IRQ;
+	} else {
+		resource_type = ACPI_RSTYPE_EXT_IRQ;
+	}
+
+retry_programming:
    
 	memset(&resource, 0, sizeof(resource));
 
 	/* NOTE: PCI interrupts are always level / active_low / shared. But not all
 	   interrupts > 15 are PCI interrupts. Rely on the ACPI IRQ definition for 
 	   parameters */
-	if (irq <= 15) {	
+	switch(resource_type) {
+	case ACPI_RSTYPE_IRQ:
 		resource.res.id = ACPI_RSTYPE_IRQ;
 		resource.res.length = sizeof(struct acpi_resource);
 		resource.res.data.irq.edge_level = link->irq.edge_level;
 		resource.res.data.irq.active_high_low = link->irq.active_high_low;
 		resource.res.data.irq.number_of_interrupts = 1;
 		resource.res.data.irq.interrupts[0] = irq;
-	}
-	else {
+		break;
+	   
+	case ACPI_RSTYPE_EXT_IRQ:
 		resource.res.id = ACPI_RSTYPE_EXT_IRQ;
 		resource.res.length = sizeof(struct acpi_resource);
 		resource.res.data.extended_irq.producer_consumer = ACPI_CONSUMER;
@@ -338,11 +351,22 @@
 		resource.res.data.extended_irq.number_of_interrupts = 1;
 		resource.res.data.extended_irq.interrupts[0] = irq;
 		/* ignore resource_source, it's optional */
+		break;
 	}
 	resource.end.id = ACPI_RSTYPE_END_TAG;
 
 	/* Attempt to set the resource */
 	status = acpi_set_current_resources(link->handle, &buffer);
+   
+
+	/* if we failed and IRQ <= 15, try again with an extended descriptor */
+	if (ACPI_FAILURE(status) && (resource_type == ACPI_RSTYPE_IRQ)) {
+                resource_type = ACPI_RSTYPE_EXT_IRQ;
+                printk(PREFIX "Retrying with extended IRQ descriptor\n");
+                goto retry_programming;
+	}
+  
+	/* check for total failure */
 	if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SRS\n"));
 		return_VALUE(-ENODEV);



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  parent reply	other threads:[~2003-09-06  0:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-05 18:58 [PATCH] Next round of ACPI IRQ fixes (VIA ACPI fixed) Andrew de Quincey
     [not found] ` <200309051958.02818.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-05 21:35   ` Jeff Garzik
     [not found]     ` <3F59018E.5060604-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2003-09-05 23:16       ` [ACPI] " Andrew de Quincey
     [not found]         ` <200309060016.16545.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-05 22:28           ` Jeff Garzik
     [not found]             ` <3F590E28.6090101-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2003-09-05 22:28               ` Andrew Morton
     [not found]                 ` <20030905152805.521281b6.akpm-3NddpPZAyC0@public.gmane.org>
2003-09-05 22:56                   ` Randy.Dunlap
2003-09-06  0:15               ` [PATCH] 2.4.23-pre3 ACPI fixes series (1/3) Andrew de Quincey
     [not found]                 ` <200309060115.24340.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-10 11:45                   ` Bernhard Rosenkraenzer
     [not found]                     ` <Pine.LNX.4.56.0309101344420.20323-CpmL+rkjyb1AfugRpC6u6w@public.gmane.org>
2003-09-10 21:27                       ` Andrew de Quincey
2003-09-10 15:31                   ` Daniel Egger
2003-09-06  0:15               ` [PATCH] 2.4.23-pre3 ACPI fixes series (2/3) Andrew de Quincey
2003-09-06  0:15               ` [PATCH] 2.4.23-pre3 ACPI fixes series (3/3) Andrew de Quincey
2003-09-06  0:57               ` [PATCH] 2.6.0-test4 ACPI fixes series (1/4) Andrew de Quincey
2003-09-06  0:57               ` Andrew de Quincey [this message]
2003-09-06  0:57               ` [PATCH] 2.6.0-test4 ACPI fixes series (3/4) Andrew de Quincey
2003-09-06  0:57               ` [PATCH] 2.6.0-test4 ACPI fixes series (4/4) Andrew de Quincey
     [not found]                 ` <200309060157.47121.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-06  1:22                   ` Jeff Garzik
     [not found]                     ` <3F5936D2.3060502-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2003-09-06 12:27                       ` [ACPI] " Andrew de Quincey
     [not found]                         ` <200309061327.16347.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-06 13:45                           ` Andi Kleen
2003-09-08 19:46                       ` Mikael Pettersson
2003-09-06 15:47                   ` [ACPI] " Alan Cox
     [not found]                     ` <1062863230.2795.1.camel-Z+iYsftfazAXoXS6vNje7nviChZXdy279dF7HbQ/qKg@public.gmane.org>
2003-09-07 14:54                       ` Andrew de Quincey
     [not found]                         ` <200309071554.57500.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-07 17:59                           ` Alan Cox
     [not found]                             ` <1062957575.16972.39.camel-Z+iYsftfazAXoXS6vNje7nviChZXdy279dF7HbQ/qKg@public.gmane.org>
2003-09-07 20:19                               ` Andrew de Quincey
2003-09-06  0:02           ` [ACPI] Re: [PATCH] Next round of ACPI IRQ fixes (VIA ACPI fixed) Chris Wright
     [not found]             ` <20030905170224.A16217-BI/OLcgY7/cyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
2003-09-06  1:21               ` Andrew de Quincey
     [not found]                 ` <200309060221.30741.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-06  0:30                   ` Jeff Garzik
     [not found]                     ` <3F592AA7.7020700-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2003-09-06  2:03                       ` Chris Wright
     [not found]                         ` <20030905190338.W16228-BI/OLcgY7/cyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
2003-09-06 12:32                           ` Andrew de Quincey
     [not found]                             ` <200309061332.39489.adq_dvb-fmPXVN3awWJAJAzL26g0SA@public.gmane.org>
2003-09-11  1:36                               ` Chris Wright

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=200309060157.32802.adq_dvb@lidskialf.net \
    --to=adq_dvb-fmpxvn3awwjajazl26g0sa@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=jgarzik-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org \
    --cc=linux-acpi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=torvalds-3NddpPZAyC0@public.gmane.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