Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FPGA Configuration Space
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
FPGA Configuration Space
Commits
79cd4396
Commit
79cd4396
authored
12 years ago
by
Wesley W. Terpstra
Browse files
Options
Downloads
Patches
Plain Diff
pcie-wb: support systems without MSI interrupts
parent
b4e9419e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pcie-wb/pcie_wb.c
+17
-8
17 additions, 8 deletions
pcie-wb/pcie_wb.c
with
17 additions
and
8 deletions
pcie-wb/pcie_wb.c
+
17
−
8
View file @
79cd4396
...
...
@@ -330,6 +330,7 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
/* Initialize structure */
dev
->
pci_dev
=
pdev
;
dev
->
msi
=
1
;
dev
->
wb
.
wops
=
&
wb_ops
;
dev
->
wb
.
parent
=
&
pdev
->
dev
;
mutex_init
(
&
dev
->
mutex
);
...
...
@@ -352,11 +353,14 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
/* enable message signaled interrupts */
if
(
pci_enable_msi
(
pdev
)
!=
0
)
{
/* resort to legacy interrupts */
printk
(
KERN_ALERT
PCIE_WB
": could not enable MSI interrupting
\n
"
);
goto
fail_master
;
printk
(
KERN_ALERT
PCIE_WB
": could not enable MSI interrupting
(using legacy)
\n
"
);
dev
->
msi
=
0
;
}
pci_intx
(
pdev
,
0
);
/* disable legacy interrupts */
if
(
dev
->
msi
)
{
/* disable legacy interrupts when using MSI */
pci_intx
(
pdev
,
0
);
}
if
(
request_irq
(
pdev
->
irq
,
irq_handler
,
0
,
"pcie_wb"
,
dev
)
<
0
)
{
printk
(
KERN_ALERT
PCIE_WB
": could not register interrupt handler
\n
"
);
...
...
@@ -373,10 +377,13 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
fail_irq:
free_irq
(
dev
->
pci_dev
->
irq
,
dev
);
fail_msi:
pci_intx
(
pdev
,
1
);
pci_disable_msi
(
pdev
);
fail_master:
if
(
dev
->
msi
)
{
pci_intx
(
pdev
,
1
);
pci_disable_msi
(
pdev
);
}
/*fail_master:*/
pci_clear_master
(
pdev
);
/*fail_bar1:*/
destroy_bar
(
&
dev
->
pci_res
[
1
]);
fail_bar0:
destroy_bar
(
&
dev
->
pci_res
[
0
]);
...
...
@@ -396,8 +403,10 @@ static void remove(struct pci_dev *pdev)
wishbone_unregister
(
&
dev
->
wb
);
free_irq
(
dev
->
pci_dev
->
irq
,
dev
);
pci_intx
(
pdev
,
1
);
pci_disable_msi
(
pdev
);
if
(
dev
->
msi
)
{
pci_intx
(
pdev
,
1
);
pci_disable_msi
(
pdev
);
}
pci_clear_master
(
pdev
);
destroy_bar
(
&
dev
->
pci_res
[
1
]);
destroy_bar
(
&
dev
->
pci_res
[
0
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment