2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* pci_link.c - ACPI PCI Interrupt Link Device Driver ($Revision: 34 $)
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
|
|
|
|
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
|
|
|
* Copyright (C) 2002 Dominik Brodowski <devel@brodo.de>
|
|
|
|
*
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
|
|
|
|
*
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
*
|
|
|
|
* TBD:
|
|
|
|
* 1. Support more than one IRQ resource entry per link device (index).
|
|
|
|
* 2. Implement start/stop mechanism and use ACPI Bus Driver facilities
|
|
|
|
* for IRQ management (e.g. start()->_SRS).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/sysdev.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/proc_fs.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
#include <linux/pm.h>
|
|
|
|
#include <linux/pci.h>
|
2006-04-27 09:25:00 +00:00
|
|
|
#include <linux/mutex.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#include <acpi/acpi_bus.h>
|
|
|
|
#include <acpi/acpi_drivers.h>
|
|
|
|
|
|
|
|
#define _COMPONENT ACPI_PCI_COMPONENT
|
2007-02-13 03:42:12 +00:00
|
|
|
ACPI_MODULE_NAME("pci_link");
|
2005-04-16 22:20:36 +00:00
|
|
|
#define ACPI_PCI_LINK_CLASS "pci_irq_routing"
|
|
|
|
#define ACPI_PCI_LINK_DEVICE_NAME "PCI Interrupt Link"
|
|
|
|
#define ACPI_PCI_LINK_FILE_INFO "info"
|
|
|
|
#define ACPI_PCI_LINK_FILE_STATUS "state"
|
|
|
|
#define ACPI_PCI_LINK_MAX_POSSIBLE 16
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_add(struct acpi_device *device);
|
|
|
|
static int acpi_pci_link_remove(struct acpi_device *device, int type);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-07-23 12:44:41 +00:00
|
|
|
static struct acpi_device_id link_device_ids[] = {
|
|
|
|
{"PNP0C0F", 0},
|
|
|
|
{"", 0},
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(acpi, link_device_ids);
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
static struct acpi_driver acpi_pci_link_driver = {
|
2007-02-13 04:33:40 +00:00
|
|
|
.name = "pci_link",
|
2005-08-05 04:44:28 +00:00
|
|
|
.class = ACPI_PCI_LINK_CLASS,
|
2007-07-23 12:44:41 +00:00
|
|
|
.ids = link_device_ids,
|
2005-08-05 04:44:28 +00:00
|
|
|
.ops = {
|
|
|
|
.add = acpi_pci_link_add,
|
|
|
|
.remove = acpi_pci_link_remove,
|
|
|
|
},
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
2005-07-28 03:02:00 +00:00
|
|
|
/*
|
|
|
|
* If a link is initialized, we never change its active and initialized
|
|
|
|
* later even the link is disable. Instead, we just repick the active irq
|
|
|
|
*/
|
2005-04-16 22:20:36 +00:00
|
|
|
struct acpi_pci_link_irq {
|
2005-08-05 04:44:28 +00:00
|
|
|
u8 active; /* Current IRQ */
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
u8 triggering; /* All IRQs */
|
|
|
|
u8 polarity; /* All IRQs */
|
2005-08-05 04:44:28 +00:00
|
|
|
u8 resource_type;
|
|
|
|
u8 possible_count;
|
|
|
|
u8 possible[ACPI_PCI_LINK_MAX_POSSIBLE];
|
|
|
|
u8 initialized:1;
|
|
|
|
u8 reserved:7;
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct acpi_pci_link {
|
2005-08-05 04:44:28 +00:00
|
|
|
struct list_head node;
|
|
|
|
struct acpi_device *device;
|
2005-04-16 22:20:36 +00:00
|
|
|
struct acpi_pci_link_irq irq;
|
2005-08-05 04:44:28 +00:00
|
|
|
int refcnt;
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct {
|
2005-08-05 04:44:28 +00:00
|
|
|
int count;
|
|
|
|
struct list_head entries;
|
|
|
|
} acpi_link;
|
2007-10-24 16:24:42 +00:00
|
|
|
static DEFINE_MUTEX(acpi_link_lock);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------
|
|
|
|
PCI Link Device Management
|
|
|
|
-------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* set context (link) possible list from resource list
|
|
|
|
*/
|
|
|
|
static acpi_status
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2006-09-30 22:28:50 +00:00
|
|
|
struct acpi_pci_link *link = context;
|
2005-08-05 04:44:28 +00:00
|
|
|
u32 i = 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
2005-09-22 04:25:18 +00:00
|
|
|
switch (resource->type) {
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_START_DEPENDENT:
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_OK;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_IRQ:
|
2005-08-05 04:44:28 +00:00
|
|
|
{
|
|
|
|
struct acpi_resource_irq *p = &resource->data.irq;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
if (!p || !p->interrupt_count) {
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX "Blank IRQ resource\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_OK;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
for (i = 0;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
(i < p->interrupt_count
|
2005-08-05 04:44:28 +00:00
|
|
|
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
|
|
|
if (!p->interrupts[i]) {
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
|
|
|
|
p->interrupts[i]);
|
2005-08-05 04:44:28 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
link->irq.possible[i] = p->interrupts[i];
|
|
|
|
link->irq.possible_count++;
|
|
|
|
}
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
link->irq.triggering = p->triggering;
|
|
|
|
link->irq.polarity = p->polarity;
|
|
|
|
link->irq.resource_type = ACPI_RESOURCE_TYPE_IRQ;
|
2005-08-05 04:44:28 +00:00
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
2005-08-05 04:44:28 +00:00
|
|
|
{
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
struct acpi_resource_extended_irq *p =
|
2005-08-05 04:44:28 +00:00
|
|
|
&resource->data.extended_irq;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
if (!p || !p->interrupt_count) {
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX
|
|
|
|
"Blank EXT IRQ resource\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_OK;
|
2005-08-05 04:44:28 +00:00
|
|
|
}
|
|
|
|
for (i = 0;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
(i < p->interrupt_count
|
2005-08-05 04:44:28 +00:00
|
|
|
&& i < ACPI_PCI_LINK_MAX_POSSIBLE); i++) {
|
|
|
|
if (!p->interrupts[i]) {
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX "Invalid IRQ %d\n",
|
|
|
|
p->interrupts[i]);
|
2005-08-05 04:44:28 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
link->irq.possible[i] = p->interrupts[i];
|
|
|
|
link->irq.possible_count++;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
link->irq.triggering = p->triggering;
|
|
|
|
link->irq.polarity = p->polarity;
|
|
|
|
link->irq.resource_type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
|
2005-08-05 04:44:28 +00:00
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
default:
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_OK;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_CTRL_TERMINATE;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_get_possible(struct acpi_pci_link *link)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_status status;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!link)
|
2006-06-27 04:41:40 +00:00
|
|
|
return -EINVAL;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-05-19 20:54:42 +00:00
|
|
|
status = acpi_walk_resources(link->device->handle, METHOD_NAME__PRS,
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_pci_link_check_possible, link);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-06-27 03:58:43 +00:00
|
|
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));
|
2006-06-27 04:41:40 +00:00
|
|
|
return -ENODEV;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
|
|
|
"Found %d possible IRQs\n",
|
|
|
|
link->irq.possible_count));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static acpi_status
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
int *irq = (int *)context;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
2005-09-22 04:25:18 +00:00
|
|
|
switch (resource->type) {
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_IRQ:
|
2005-08-05 04:44:28 +00:00
|
|
|
{
|
|
|
|
struct acpi_resource_irq *p = &resource->data.irq;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
if (!p || !p->interrupt_count) {
|
2005-08-05 04:44:28 +00:00
|
|
|
/*
|
|
|
|
* IRQ descriptors may have no IRQ# bits set,
|
|
|
|
* particularly those those w/ _STA disabled
|
|
|
|
*/
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
|
|
|
"Blank IRQ resource\n"));
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_OK;
|
2005-08-05 04:44:28 +00:00
|
|
|
}
|
|
|
|
*irq = p->interrupts[0];
|
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
2005-08-05 04:44:28 +00:00
|
|
|
{
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
struct acpi_resource_extended_irq *p =
|
2005-08-05 04:44:28 +00:00
|
|
|
&resource->data.extended_irq;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
if (!p || !p->interrupt_count) {
|
2005-08-05 04:44:28 +00:00
|
|
|
/*
|
|
|
|
* extended IRQ descriptors must
|
|
|
|
* return at least 1 IRQ
|
|
|
|
*/
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX
|
|
|
|
"Blank EXT IRQ resource\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_OK;
|
2005-08-05 04:44:28 +00:00
|
|
|
}
|
|
|
|
*irq = p->interrupts[0];
|
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2006-01-26 22:23:38 +00:00
|
|
|
break;
|
2005-04-16 22:20:36 +00:00
|
|
|
default:
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type);
|
2006-01-26 22:23:38 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_END_TAG:
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_OK;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2006-06-27 04:41:40 +00:00
|
|
|
return AE_CTRL_TERMINATE;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Run _CRS and set link->irq.active
|
|
|
|
*
|
|
|
|
* return value:
|
|
|
|
* 0 - success
|
|
|
|
* !0 - failure
|
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_get_current(struct acpi_pci_link *link)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
int result = 0;
|
|
|
|
acpi_status status = AE_OK;
|
|
|
|
int irq = 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-05-19 20:54:50 +00:00
|
|
|
if (!link)
|
2006-06-27 04:41:40 +00:00
|
|
|
return -EINVAL;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
link->irq.active = 0;
|
|
|
|
|
|
|
|
/* in practice, status disabled is meaningless, ignore it */
|
|
|
|
if (acpi_strict) {
|
|
|
|
/* Query _STA, set link->device->status */
|
|
|
|
result = acpi_bus_get_status(link->device);
|
|
|
|
if (result) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Unable to read status\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!link->device->status.enabled) {
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n"));
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Query and parse _CRS to get the current IRQ assignment.
|
|
|
|
*/
|
|
|
|
|
2006-05-19 20:54:42 +00:00
|
|
|
status = acpi_walk_resources(link->device->handle, METHOD_NAME__CRS,
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_pci_link_check_current, &irq);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-06-27 03:58:43 +00:00
|
|
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _CRS"));
|
2005-04-16 22:20:36 +00:00
|
|
|
result = -ENODEV;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (acpi_strict && !irq) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "_CRS returned 0\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
result = -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
link->irq.active = irq;
|
|
|
|
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active));
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
end:
|
2006-06-27 04:41:40 +00:00
|
|
|
return result;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
int result = 0;
|
|
|
|
acpi_status status = AE_OK;
|
2005-04-16 22:20:36 +00:00
|
|
|
struct {
|
2005-08-05 04:44:28 +00:00
|
|
|
struct acpi_resource res;
|
|
|
|
struct acpi_resource end;
|
|
|
|
} *resource;
|
|
|
|
struct acpi_buffer buffer = { 0, NULL };
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!link || !irq)
|
2006-06-27 04:41:40 +00:00
|
|
|
return -EINVAL;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-12-19 20:56:11 +00:00
|
|
|
resource = kzalloc(sizeof(*resource) + 1, irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
|
2005-08-05 04:44:28 +00:00
|
|
|
if (!resource)
|
2006-06-27 04:41:40 +00:00
|
|
|
return -ENOMEM;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
buffer.length = sizeof(*resource) + 1;
|
2005-04-16 22:20:36 +00:00
|
|
|
buffer.pointer = resource;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
switch (link->irq.resource_type) {
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_IRQ:
|
|
|
|
resource->res.type = ACPI_RESOURCE_TYPE_IRQ;
|
2005-04-16 22:20:36 +00:00
|
|
|
resource->res.length = sizeof(struct acpi_resource);
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
resource->res.data.irq.triggering = link->irq.triggering;
|
|
|
|
resource->res.data.irq.polarity =
|
|
|
|
link->irq.polarity;
|
|
|
|
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
|
|
|
|
resource->res.data.irq.sharable =
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXCLUSIVE;
|
2005-04-16 22:20:36 +00:00
|
|
|
else
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
resource->res.data.irq.sharable = ACPI_SHARED;
|
|
|
|
resource->res.data.irq.interrupt_count = 1;
|
2005-04-16 22:20:36 +00:00
|
|
|
resource->res.data.irq.interrupts[0] = irq;
|
|
|
|
break;
|
2005-08-05 04:44:28 +00:00
|
|
|
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
|
|
|
|
resource->res.type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
|
2005-04-16 22:20:36 +00:00
|
|
|
resource->res.length = sizeof(struct acpi_resource);
|
2005-08-05 04:44:28 +00:00
|
|
|
resource->res.data.extended_irq.producer_consumer =
|
|
|
|
ACPI_CONSUMER;
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
resource->res.data.extended_irq.triggering =
|
|
|
|
link->irq.triggering;
|
|
|
|
resource->res.data.extended_irq.polarity =
|
|
|
|
link->irq.polarity;
|
|
|
|
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
|
|
|
|
resource->res.data.irq.sharable =
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_EXCLUSIVE;
|
2005-04-16 22:20:36 +00:00
|
|
|
else
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
resource->res.data.irq.sharable = ACPI_SHARED;
|
|
|
|
resource->res.data.extended_irq.interrupt_count = 1;
|
2005-04-16 22:20:36 +00:00
|
|
|
resource->res.data.extended_irq.interrupts[0] = irq;
|
|
|
|
/* ignore resource_source, it's optional */
|
|
|
|
break;
|
|
|
|
default:
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid Resource_type %d\n", link->irq.resource_type);
|
2005-04-16 22:20:36 +00:00
|
|
|
result = -EINVAL;
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
}
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
resource->end.type = ACPI_RESOURCE_TYPE_END_TAG;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Attempt to set the resource */
|
2006-05-19 20:54:42 +00:00
|
|
|
status = acpi_set_current_resources(link->device->handle, &buffer);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* check for total failure */
|
|
|
|
if (ACPI_FAILURE(status)) {
|
2006-06-27 03:58:43 +00:00
|
|
|
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SRS"));
|
2005-04-16 22:20:36 +00:00
|
|
|
result = -ENODEV;
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Query _STA, set device->status */
|
|
|
|
result = acpi_bus_get_status(link->device);
|
|
|
|
if (result) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Unable to read status\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
if (!link->device->status.enabled) {
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX
|
|
|
|
"%s [%s] disabled and referenced, BIOS bug\n",
|
2006-06-27 03:58:43 +00:00
|
|
|
acpi_device_name(link->device),
|
2006-06-27 03:04:31 +00:00
|
|
|
acpi_device_bid(link->device));
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Query _CRS, set link->irq.active */
|
|
|
|
result = acpi_pci_link_get_current(link);
|
|
|
|
if (result) {
|
|
|
|
goto end;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Is current setting not what we set?
|
|
|
|
* set link->irq.active
|
|
|
|
*/
|
|
|
|
if (link->irq.active != irq) {
|
|
|
|
/*
|
|
|
|
* policy: when _CRS doesn't return what we just _SRS
|
|
|
|
* assume _SRS worked and override _CRS value.
|
|
|
|
*/
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX
|
|
|
|
"%s [%s] BIOS reported IRQ %d, using IRQ %d\n",
|
2006-06-27 03:58:43 +00:00
|
|
|
acpi_device_name(link->device),
|
2006-06-27 03:04:31 +00:00
|
|
|
acpi_device_bid(link->device), link->irq.active, irq);
|
2005-04-16 22:20:36 +00:00
|
|
|
link->irq.active = irq;
|
|
|
|
}
|
|
|
|
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active));
|
2005-08-05 04:44:28 +00:00
|
|
|
|
|
|
|
end:
|
2005-04-16 22:20:36 +00:00
|
|
|
kfree(resource);
|
2006-06-27 04:41:40 +00:00
|
|
|
return result;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* --------------------------------------------------------------------------
|
|
|
|
PCI Link IRQ Management
|
|
|
|
-------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* "acpi_irq_balance" (default in APIC mode) enables ACPI to use PIC Interrupt
|
|
|
|
* Link Devices to move the PIRQs around to minimize sharing.
|
|
|
|
*
|
|
|
|
* "acpi_irq_nobalance" (default in PIC mode) tells ACPI not to move any PIC IRQs
|
|
|
|
* that the BIOS has already set to active. This is necessary because
|
|
|
|
* ACPI has no automatic means of knowing what ISA IRQs are used. Note that
|
|
|
|
* if the BIOS doesn't set a Link Device active, ACPI needs to program it
|
|
|
|
* even if acpi_irq_nobalance is set.
|
|
|
|
*
|
|
|
|
* A tables of penalties avoids directing PCI interrupts to well known
|
|
|
|
* ISA IRQs. Boot params are available to over-ride the default table:
|
|
|
|
*
|
|
|
|
* List interrupts that are free for PCI use.
|
|
|
|
* acpi_irq_pci=n[,m]
|
|
|
|
*
|
|
|
|
* List interrupts that should not be used for PCI:
|
|
|
|
* acpi_irq_isa=n[,m]
|
|
|
|
*
|
|
|
|
* Note that PCI IRQ routers have a list of possible IRQs,
|
|
|
|
* which may not include the IRQs this table says are available.
|
|
|
|
*
|
|
|
|
* Since this heuristic can't tell the difference between a link
|
|
|
|
* that no device will attach to, vs. a link which may be shared
|
|
|
|
* by multiple active devices -- it is not optimal.
|
|
|
|
*
|
|
|
|
* If interrupt performance is that important, get an IO-APIC system
|
|
|
|
* with a pin dedicated to each device. Or for that matter, an MSI
|
|
|
|
* enabled system.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define ACPI_MAX_IRQS 256
|
|
|
|
#define ACPI_MAX_ISA_IRQ 16
|
|
|
|
|
|
|
|
#define PIRQ_PENALTY_PCI_AVAILABLE (0)
|
|
|
|
#define PIRQ_PENALTY_PCI_POSSIBLE (16*16)
|
|
|
|
#define PIRQ_PENALTY_PCI_USING (16*16*16)
|
|
|
|
#define PIRQ_PENALTY_ISA_TYPICAL (16*16*16*16)
|
|
|
|
#define PIRQ_PENALTY_ISA_USED (16*16*16*16*16)
|
|
|
|
#define PIRQ_PENALTY_ISA_ALWAYS (16*16*16*16*16*16)
|
|
|
|
|
|
|
|
static int acpi_irq_penalty[ACPI_MAX_IRQS] = {
|
|
|
|
PIRQ_PENALTY_ISA_ALWAYS, /* IRQ0 timer */
|
|
|
|
PIRQ_PENALTY_ISA_ALWAYS, /* IRQ1 keyboard */
|
|
|
|
PIRQ_PENALTY_ISA_ALWAYS, /* IRQ2 cascade */
|
2005-08-05 04:44:28 +00:00
|
|
|
PIRQ_PENALTY_ISA_TYPICAL, /* IRQ3 serial */
|
|
|
|
PIRQ_PENALTY_ISA_TYPICAL, /* IRQ4 serial */
|
2005-04-16 22:20:36 +00:00
|
|
|
PIRQ_PENALTY_ISA_TYPICAL, /* IRQ5 sometimes SoundBlaster */
|
|
|
|
PIRQ_PENALTY_ISA_TYPICAL, /* IRQ6 */
|
|
|
|
PIRQ_PENALTY_ISA_TYPICAL, /* IRQ7 parallel, spurious */
|
|
|
|
PIRQ_PENALTY_ISA_TYPICAL, /* IRQ8 rtc, sometimes */
|
|
|
|
PIRQ_PENALTY_PCI_AVAILABLE, /* IRQ9 PCI, often acpi */
|
|
|
|
PIRQ_PENALTY_PCI_AVAILABLE, /* IRQ10 PCI */
|
|
|
|
PIRQ_PENALTY_PCI_AVAILABLE, /* IRQ11 PCI */
|
|
|
|
PIRQ_PENALTY_ISA_USED, /* IRQ12 mouse */
|
|
|
|
PIRQ_PENALTY_ISA_USED, /* IRQ13 fpe, sometimes */
|
|
|
|
PIRQ_PENALTY_ISA_USED, /* IRQ14 ide0 */
|
|
|
|
PIRQ_PENALTY_ISA_USED, /* IRQ15 ide1 */
|
2005-08-05 04:44:28 +00:00
|
|
|
/* >IRQ15 */
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
int __init acpi_irq_penalty_init(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
struct list_head *node = NULL;
|
|
|
|
struct acpi_pci_link *link = NULL;
|
|
|
|
int i = 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Update penalties to facilitate IRQ balancing.
|
|
|
|
*/
|
|
|
|
list_for_each(node, &acpi_link.entries) {
|
|
|
|
|
|
|
|
link = list_entry(node, struct acpi_pci_link, node);
|
|
|
|
if (!link) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid link context\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* reflect the possible and active irqs in the penalty table --
|
|
|
|
* useful for breaking ties.
|
|
|
|
*/
|
|
|
|
if (link->irq.possible_count) {
|
2005-08-05 04:44:28 +00:00
|
|
|
int penalty =
|
|
|
|
PIRQ_PENALTY_PCI_POSSIBLE /
|
|
|
|
link->irq.possible_count;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
for (i = 0; i < link->irq.possible_count; i++) {
|
|
|
|
if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ)
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_irq_penalty[link->irq.
|
|
|
|
possible[i]] +=
|
|
|
|
penalty;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} else if (link->irq.active) {
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_irq_penalty[link->irq.active] +=
|
|
|
|
PIRQ_PENALTY_PCI_POSSIBLE;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Add a penalty for the SCI */
|
2007-02-02 16:48:22 +00:00
|
|
|
acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += PIRQ_PENALTY_PCI_USING;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int acpi_irq_balance; /* 0: static, 1: balance */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_allocate(struct acpi_pci_link *link)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
int irq;
|
|
|
|
int i;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
2005-07-28 03:02:00 +00:00
|
|
|
if (link->irq.initialized) {
|
|
|
|
if (link->refcnt == 0)
|
|
|
|
/* This means the link is disabled but initialized */
|
|
|
|
acpi_pci_link_set(link, link->irq.active);
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-07-28 03:02:00 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* search for active IRQ in list of possible IRQs.
|
|
|
|
*/
|
|
|
|
for (i = 0; i < link->irq.possible_count; ++i) {
|
|
|
|
if (link->irq.active == link->irq.possible[i])
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* forget active IRQ that is not in possible list
|
|
|
|
*/
|
|
|
|
if (i == link->irq.possible_count) {
|
|
|
|
if (acpi_strict)
|
2006-06-27 03:04:31 +00:00
|
|
|
printk(KERN_WARNING PREFIX "_CRS %d not found"
|
|
|
|
" in _PRS\n", link->irq.active);
|
2005-04-16 22:20:36 +00:00
|
|
|
link->irq.active = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* if active found, use it; else pick entry from end of possible list.
|
|
|
|
*/
|
|
|
|
if (link->irq.active) {
|
|
|
|
irq = link->irq.active;
|
|
|
|
} else {
|
|
|
|
irq = link->irq.possible[link->irq.possible_count - 1];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (acpi_irq_balance || !link->irq.active) {
|
|
|
|
/*
|
|
|
|
* Select the best IRQ. This is done in reverse to promote
|
|
|
|
* the use of IRQs 9, 10, 11, and >15.
|
|
|
|
*/
|
|
|
|
for (i = (link->irq.possible_count - 1); i >= 0; i--) {
|
2005-08-05 04:44:28 +00:00
|
|
|
if (acpi_irq_penalty[irq] >
|
|
|
|
acpi_irq_penalty[link->irq.possible[i]])
|
2005-04-16 22:20:36 +00:00
|
|
|
irq = link->irq.possible[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Attempt to enable the link device at this IRQ. */
|
|
|
|
if (acpi_pci_link_set(link, irq)) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Unable to set IRQ for %s [%s]. "
|
|
|
|
"Try pci=noacpi or acpi=off\n",
|
2006-06-27 03:58:43 +00:00
|
|
|
acpi_device_name(link->device),
|
2006-06-27 03:41:38 +00:00
|
|
|
acpi_device_bid(link->device));
|
2006-06-27 04:41:40 +00:00
|
|
|
return -ENODEV;
|
2005-04-16 22:20:36 +00:00
|
|
|
} else {
|
|
|
|
acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
|
2005-08-05 04:44:28 +00:00
|
|
|
printk(PREFIX "%s [%s] enabled at IRQ %d\n",
|
|
|
|
acpi_device_name(link->device),
|
|
|
|
acpi_device_bid(link->device), link->irq.active);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
link->irq.initialized = 1;
|
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2005-07-28 03:02:00 +00:00
|
|
|
* acpi_pci_link_allocate_irq
|
2005-04-16 22:20:36 +00:00
|
|
|
* success: return IRQ >= 0
|
|
|
|
* failure: return -1
|
|
|
|
*/
|
|
|
|
|
|
|
|
int
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_pci_link_allocate_irq(acpi_handle handle,
|
|
|
|
int index,
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
int *triggering, int *polarity, char **name)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
int result = 0;
|
|
|
|
struct acpi_device *device = NULL;
|
|
|
|
struct acpi_pci_link *link = NULL;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
result = acpi_bus_get_device(handle, &device);
|
|
|
|
if (result) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid link device\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-09-30 22:28:50 +00:00
|
|
|
link = acpi_driver_data(device);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (!link) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid link context\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* TBD: Support multiple index (IRQ) entries per Link Device */
|
|
|
|
if (index) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid index %d\n", index);
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_lock(&acpi_link_lock);
|
2005-07-28 03:02:00 +00:00
|
|
|
if (acpi_pci_link_allocate(link)) {
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_unlock(&acpi_link_lock);
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-07-28 03:02:00 +00:00
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
if (!link->irq.active) {
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_unlock(&acpi_link_lock);
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Link active IRQ is 0!\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
link->refcnt++;
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_unlock(&acpi_link_lock);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
[ACPI] ACPICA 20050930
Completed a major overhaul of the Resource Manager code -
specifically, optimizations in the area of the AML/internal
resource conversion code. The code has been optimized to
simplify and eliminate duplicated code, CPU stack use has
been decreased by optimizing function parameters and local
variables, and naming conventions across the manager have
been standardized for clarity and ease of maintenance (this
includes function, parameter, variable, and struct/typedef
names.)
All Resource Manager dispatch and information tables have
been moved to a single location for clarity and ease of
maintenance. One new file was created, named "rsinfo.c".
The ACPI return macros (return_ACPI_STATUS, etc.) have
been modified to guarantee that the argument is
not evaluated twice, making them less prone to macro
side-effects. However, since there exists the possibility
of additional stack use if a particular compiler cannot
optimize them (such as in the debug generation case),
the original macros are optionally available. Note that
some invocations of the return_VALUE macro may now cause
size mismatch warnings; the return_UINT8 and return_UINT32
macros are provided to eliminate these. (From Randy Dunlap)
Implemented a new mechanism to enable debug tracing for
individual control methods. A new external interface,
acpi_debug_trace(), is provided to enable this mechanism. The
intent is to allow the host OS to easily enable and disable
tracing for problematic control methods. This interface
can be easily exposed to a user or debugger interface if
desired. See the file psxface.c for details.
acpi_ut_callocate() will now return a valid pointer if a
length of zero is specified - a length of one is used
and a warning is issued. This matches the behavior of
acpi_ut_allocate().
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2005-09-30 23:03:00 +00:00
|
|
|
if (triggering)
|
|
|
|
*triggering = link->irq.triggering;
|
|
|
|
if (polarity)
|
|
|
|
*polarity = link->irq.polarity;
|
2005-08-05 04:44:28 +00:00
|
|
|
if (name)
|
|
|
|
*name = acpi_device_bid(link->device);
|
2005-07-28 03:02:00 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
2005-08-05 04:44:28 +00:00
|
|
|
"Link %s is referenced\n",
|
|
|
|
acpi_device_bid(link->device)));
|
2006-06-27 04:41:40 +00:00
|
|
|
return (link->irq.active);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-07-28 03:02:00 +00:00
|
|
|
/*
|
|
|
|
* We don't change link's irq information here. After it is reenabled, we
|
|
|
|
* continue use the info
|
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
int acpi_pci_link_free_irq(acpi_handle handle)
|
2005-07-28 03:02:00 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
struct acpi_device *device = NULL;
|
|
|
|
struct acpi_pci_link *link = NULL;
|
|
|
|
acpi_status result;
|
2005-07-28 03:02:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
result = acpi_bus_get_device(handle, &device);
|
|
|
|
if (result) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid link device\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-07-28 03:02:00 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-09-30 22:28:50 +00:00
|
|
|
link = acpi_driver_data(device);
|
2005-07-28 03:02:00 +00:00
|
|
|
if (!link) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid link context\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-07-28 03:02:00 +00:00
|
|
|
}
|
|
|
|
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_lock(&acpi_link_lock);
|
2005-07-28 03:02:00 +00:00
|
|
|
if (!link->irq.initialized) {
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_unlock(&acpi_link_lock);
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Link isn't initialized\n");
|
2006-06-27 04:41:40 +00:00
|
|
|
return -1;
|
2005-07-28 03:02:00 +00:00
|
|
|
}
|
2005-08-03 15:00:11 +00:00
|
|
|
#ifdef FUTURE_USE
|
|
|
|
/*
|
|
|
|
* The Link reference count allows us to _DISable an unused link
|
|
|
|
* and suspend time, and set it again on resume.
|
|
|
|
* However, 2.6.12 still has irq_router.resume
|
|
|
|
* which blindly restores the link state.
|
|
|
|
* So we disable the reference count method
|
|
|
|
* to prevent duplicate acpi_pci_link_set()
|
|
|
|
* which would harm some systems
|
|
|
|
*/
|
2005-08-05 04:44:28 +00:00
|
|
|
link->refcnt--;
|
2005-08-03 15:00:11 +00:00
|
|
|
#endif
|
2005-07-28 03:02:00 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
2005-08-05 04:44:28 +00:00
|
|
|
"Link %s is dereferenced\n",
|
|
|
|
acpi_device_bid(link->device)));
|
2005-07-28 03:02:00 +00:00
|
|
|
|
|
|
|
if (link->refcnt == 0) {
|
2006-05-19 20:54:42 +00:00
|
|
|
acpi_ut_evaluate_object(link->device->handle, "_DIS", 0, NULL);
|
2005-07-28 03:02:00 +00:00
|
|
|
}
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_unlock(&acpi_link_lock);
|
2006-06-27 04:41:40 +00:00
|
|
|
return (link->irq.active);
|
2005-07-28 03:02:00 +00:00
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* --------------------------------------------------------------------------
|
|
|
|
Driver Interface
|
|
|
|
-------------------------------------------------------------------------- */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_add(struct acpi_device *device)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
int result = 0;
|
|
|
|
struct acpi_pci_link *link = NULL;
|
|
|
|
int i = 0;
|
|
|
|
int found = 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!device)
|
2006-06-27 04:41:40 +00:00
|
|
|
return -EINVAL;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-12-19 20:56:11 +00:00
|
|
|
link = kzalloc(sizeof(struct acpi_pci_link), GFP_KERNEL);
|
2005-04-16 22:20:36 +00:00
|
|
|
if (!link)
|
2006-06-27 04:41:40 +00:00
|
|
|
return -ENOMEM;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
link->device = device;
|
|
|
|
strcpy(acpi_device_name(device), ACPI_PCI_LINK_DEVICE_NAME);
|
|
|
|
strcpy(acpi_device_class(device), ACPI_PCI_LINK_CLASS);
|
|
|
|
acpi_driver_data(device) = link;
|
|
|
|
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_lock(&acpi_link_lock);
|
2005-04-16 22:20:36 +00:00
|
|
|
result = acpi_pci_link_get_possible(link);
|
|
|
|
if (result)
|
|
|
|
goto end;
|
|
|
|
|
|
|
|
/* query and set link->irq.active */
|
|
|
|
acpi_pci_link_get_current(link);
|
|
|
|
|
2007-07-09 18:33:18 +00:00
|
|
|
printk(KERN_INFO PREFIX "%s [%s] (IRQs", acpi_device_name(device),
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_device_bid(device));
|
2005-04-16 22:20:36 +00:00
|
|
|
for (i = 0; i < link->irq.possible_count; i++) {
|
|
|
|
if (link->irq.active == link->irq.possible[i]) {
|
|
|
|
printk(" *%d", link->irq.possible[i]);
|
|
|
|
found = 1;
|
2005-08-05 04:44:28 +00:00
|
|
|
} else
|
2005-04-16 22:20:36 +00:00
|
|
|
printk(" %d", link->irq.possible[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
printk(")");
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
printk(" *%d", link->irq.active);
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
if (!link->device->status.enabled)
|
2005-04-16 22:20:36 +00:00
|
|
|
printk(", disabled.");
|
|
|
|
|
|
|
|
printk("\n");
|
|
|
|
|
|
|
|
/* TBD: Acquire/release lock */
|
|
|
|
list_add_tail(&link->node, &acpi_link.entries);
|
|
|
|
acpi_link.count++;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
end:
|
2005-04-16 22:20:36 +00:00
|
|
|
/* disable all links -- to be activated on use */
|
2006-05-19 20:54:42 +00:00
|
|
|
acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL);
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_unlock(&acpi_link_lock);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (result)
|
|
|
|
kfree(link);
|
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return result;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_resume(struct acpi_pci_link *link)
|
2005-08-01 19:37:54 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
if (link->refcnt && link->irq.active && link->irq.initialized)
|
2006-06-27 04:41:40 +00:00
|
|
|
return (acpi_pci_link_set(link, link->irq.active));
|
2005-08-01 19:37:54 +00:00
|
|
|
else
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-08-01 19:37:54 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int irqrouter_resume(struct sys_device *dev)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
struct list_head *node = NULL;
|
|
|
|
struct acpi_pci_link *link = NULL;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
|
2006-06-20 01:05:09 +00:00
|
|
|
/* Make sure SCI is enabled again (Apple firmware bug?) */
|
2007-02-02 16:48:21 +00:00
|
|
|
acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1);
|
2006-06-20 01:05:09 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
list_for_each(node, &acpi_link.entries) {
|
|
|
|
link = list_entry(node, struct acpi_pci_link, node);
|
|
|
|
if (!link) {
|
2006-06-27 03:41:38 +00:00
|
|
|
printk(KERN_ERR PREFIX "Invalid link context\n");
|
2005-04-16 22:20:36 +00:00
|
|
|
continue;
|
|
|
|
}
|
2005-08-01 19:37:54 +00:00
|
|
|
acpi_pci_link_resume(link);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int acpi_pci_link_remove(struct acpi_device *device, int type)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
struct acpi_pci_link *link = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (!device || !acpi_driver_data(device))
|
2006-06-27 04:41:40 +00:00
|
|
|
return -EINVAL;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-09-30 22:28:50 +00:00
|
|
|
link = acpi_driver_data(device);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_lock(&acpi_link_lock);
|
2005-04-16 22:20:36 +00:00
|
|
|
list_del(&link->node);
|
2006-04-27 09:25:00 +00:00
|
|
|
mutex_unlock(&acpi_link_lock);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
kfree(link);
|
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* modify acpi_irq_penalty[] from cmdline
|
|
|
|
*/
|
|
|
|
static int __init acpi_irq_penalty_update(char *str, int used)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
int retval;
|
|
|
|
int irq;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
retval = get_option(&str, &irq);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (!retval)
|
|
|
|
break; /* no number found */
|
|
|
|
|
|
|
|
if (irq < 0)
|
|
|
|
continue;
|
2005-08-05 04:44:28 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
if (irq >= ACPI_MAX_IRQS)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (used)
|
|
|
|
acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
|
|
|
|
else
|
|
|
|
acpi_irq_penalty[irq] = PIRQ_PENALTY_PCI_AVAILABLE;
|
|
|
|
|
|
|
|
if (retval != 2) /* no next number */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We'd like PNP to call this routine for the
|
|
|
|
* single ISA_USED value for each legacy device.
|
|
|
|
* But instead it calls us with each POSSIBLE setting.
|
|
|
|
* There is no ISA_POSSIBLE weight, so we simply use
|
|
|
|
* the (small) PCI_USING penalty.
|
|
|
|
*/
|
2005-04-01 05:07:31 +00:00
|
|
|
void acpi_penalize_isa_irq(int irq, int active)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-04-01 05:07:31 +00:00
|
|
|
if (active)
|
|
|
|
acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
|
|
|
|
else
|
|
|
|
acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Over-ride default table to reserve additional IRQs for use by ISA
|
|
|
|
* e.g. acpi_irq_isa=5
|
|
|
|
* Useful for telling ACPI how not to interfere with your ISA sound card.
|
|
|
|
*/
|
|
|
|
static int __init acpi_irq_isa(char *str)
|
|
|
|
{
|
|
|
|
return acpi_irq_penalty_update(str, 1);
|
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
__setup("acpi_irq_isa=", acpi_irq_isa);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Over-ride default table to free additional IRQs for use by PCI
|
|
|
|
* e.g. acpi_irq_pci=7,15
|
|
|
|
* Used for acpi_irq_balance to free up IRQs to reduce PCI IRQ sharing.
|
|
|
|
*/
|
|
|
|
static int __init acpi_irq_pci(char *str)
|
|
|
|
{
|
|
|
|
return acpi_irq_penalty_update(str, 0);
|
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
__setup("acpi_irq_pci=", acpi_irq_pci);
|
|
|
|
|
|
|
|
static int __init acpi_irq_nobalance_set(char *str)
|
|
|
|
{
|
|
|
|
acpi_irq_balance = 0;
|
|
|
|
return 1;
|
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
__setup("acpi_irq_nobalance", acpi_irq_nobalance_set);
|
|
|
|
|
|
|
|
int __init acpi_irq_balance_set(char *str)
|
|
|
|
{
|
|
|
|
acpi_irq_balance = 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
__setup("acpi_irq_balance", acpi_irq_balance_set);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-07-28 03:02:00 +00:00
|
|
|
/* FIXME: we will remove this interface after all drivers call pci_disable_device */
|
2005-04-16 22:20:36 +00:00
|
|
|
static struct sysdev_class irqrouter_sysdev_class = {
|
2007-12-20 01:09:39 +00:00
|
|
|
.name = "irqrouter",
|
2005-08-05 04:44:28 +00:00
|
|
|
.resume = irqrouter_resume,
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct sys_device device_irqrouter = {
|
2005-08-05 04:44:28 +00:00
|
|
|
.id = 0,
|
|
|
|
.cls = &irqrouter_sysdev_class,
|
2005-04-16 22:20:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int __init irqrouter_init_sysfs(void)
|
|
|
|
{
|
|
|
|
int error;
|
|
|
|
|
|
|
|
|
|
|
|
if (acpi_disabled || acpi_noirq)
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
error = sysdev_class_register(&irqrouter_sysdev_class);
|
|
|
|
if (!error)
|
|
|
|
error = sysdev_register(&device_irqrouter);
|
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return error;
|
2005-08-05 04:44:28 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
device_initcall(irqrouter_init_sysfs);
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
static int __init acpi_pci_link_init(void)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
if (acpi_noirq)
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
acpi_link.count = 0;
|
|
|
|
INIT_LIST_HEAD(&acpi_link.entries);
|
|
|
|
|
|
|
|
if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0)
|
2006-06-27 04:41:40 +00:00
|
|
|
return -ENODEV;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-06-27 04:41:40 +00:00
|
|
|
return 0;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
subsys_initcall(acpi_pci_link_init);
|