Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f961b5f3
Commit
f961b5f3
authored
Sep 17, 2003
by
Len Brown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended IRQ resource type for nForce (Andrew de Quincey)
parent
7f3257ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
drivers/acpi/pci_link.c
drivers/acpi/pci_link.c
+34
-11
No files found.
drivers/acpi/pci_link.c
View file @
f961b5f3
...
...
@@ -315,6 +315,7 @@ acpi_pci_link_set (
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"
);
...
...
@@ -338,20 +339,32 @@ acpi_pci_link_set (
}
}
/* 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
;
...
...
@@ -360,11 +373,21 @@ acpi_pci_link_set (
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
);
...
...
@@ -479,14 +502,14 @@ static int acpi_pci_link_allocate(struct acpi_pci_link* link) {
irq
=
link
->
irq
.
possible
[
0
];
}
/*
* 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
--
)
{
if
(
acpi_irq_penalty
[
irq
]
>
acpi_irq_penalty
[
link
->
irq
.
possible
[
i
]])
irq
=
link
->
irq
.
possible
[
i
];
}
/*
* 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
--
)
{
if
(
acpi_irq_penalty
[
irq
]
>
acpi_irq_penalty
[
link
->
irq
.
possible
[
i
]])
irq
=
link
->
irq
.
possible
[
i
];
}
/* Attempt to enable the link device at this IRQ. */
if
(
acpi_pci_link_set
(
link
,
irq
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment