Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dma_ip_drivers
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
dma_ip_drivers
Commits
cf2efd16
Unverified
Commit
cf2efd16
authored
Oct 07, 2020
by
Karen Xie
Committed by
GitHub
Oct 07, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #69 from jberaud/pr/various-fixes
Various fixes
parents
b6d8ace8
9ea8e3e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
XDMA/linux-kernel/libxdma/libxdma.c
XDMA/linux-kernel/libxdma/libxdma.c
+13
-10
XDMA/linux-kernel/xdma/xdma_mod.c
XDMA/linux-kernel/xdma/xdma_mod.c
+4
-0
No files found.
XDMA/linux-kernel/libxdma/libxdma.c
View file @
cf2efd16
...
...
@@ -40,7 +40,7 @@ MODULE_PARM_DESC(poll_mode, "Set 1 for hw polling, default is 0 (interrupts)");
static
unsigned
int
interrupt_mode
;
module_param
(
interrupt_mode
,
uint
,
0644
);
MODULE_PARM_DESC
(
interrupt_mode
,
"0 -
MSI-x , 1 - MSI, 2 - Legacy
"
);
MODULE_PARM_DESC
(
interrupt_mode
,
"0 -
Auto , 1 - MSI, 2 - Legacy, 3 - MSI-x
"
);
static
unsigned
int
enable_credit_mp
=
1
;
module_param
(
enable_credit_mp
,
uint
,
0644
);
...
...
@@ -1992,7 +1992,7 @@ static int enable_msi_msix(struct xdma_dev *xdev, struct pci_dev *pdev)
return
-
EINVAL
;
}
if
(
!
interrupt_mode
&&
msi_msix_capable
(
pdev
,
PCI_CAP_ID_MSIX
))
{
if
(
(
interrupt_mode
==
3
||
!
interrupt_mode
)
&&
msi_msix_capable
(
pdev
,
PCI_CAP_ID_MSIX
))
{
int
req_nvec
=
xdev
->
c2h_channel_max
+
xdev
->
h2c_channel_max
+
xdev
->
user_max
;
...
...
@@ -2014,7 +2014,7 @@ static int enable_msi_msix(struct xdma_dev *xdev, struct pci_dev *pdev)
xdev
->
msix_enabled
=
1
;
}
else
if
(
interrupt_mode
==
1
&&
}
else
if
(
(
interrupt_mode
==
1
||
!
interrupt_mode
)
&&
msi_msix_capable
(
pdev
,
PCI_CAP_ID_MSI
))
{
/* enable message signalled interrupts */
dbg_init
(
"pci_enable_msi()
\n
"
);
...
...
@@ -2296,11 +2296,16 @@ static int irq_legacy_setup(struct xdma_dev *xdev, struct pci_dev *pdev)
int
rv
;
pci_read_config_byte
(
pdev
,
PCI_INTERRUPT_PIN
,
&
val
);
if
(
val
==
0
)
{
dbg_init
(
"Legacy interrupt not supported
\n
"
);
return
-
EINVAL
;
}
dbg_init
(
"Legacy Interrupt register value = %d
\n
"
,
val
);
if
(
val
>
1
)
{
val
--
;
w
=
(
val
<<
24
)
|
(
val
<<
16
)
|
(
val
<<
8
)
|
val
;
/* Program IRQ Block Channel v
a
ctor and IRQ Block User vector
/* Program IRQ Block Channel v
e
ctor and IRQ Block User vector
* with Legacy interrupt value
*/
reg
=
xdev
->
bar
[
xdev
->
config_bar_idx
]
+
0x2080
;
// IRQ user
...
...
@@ -4400,15 +4405,15 @@ void *xdma_device_open(const char *mname, struct pci_dev *pdev, int *user_max,
rv
=
probe_engines
(
xdev
);
if
(
rv
)
goto
err_
engines
;
goto
err_
mask
;
rv
=
enable_msi_msix
(
xdev
,
pdev
);
if
(
rv
<
0
)
goto
err_en
able_msix
;
goto
err_en
gines
;
rv
=
irq_setup
(
xdev
,
pdev
);
if
(
rv
<
0
)
goto
err_
interrupts
;
goto
err_
msix
;
if
(
!
poll_mode
)
channel_interrupts_enable
(
xdev
,
~
0
);
...
...
@@ -4423,9 +4428,7 @@ void *xdma_device_open(const char *mname, struct pci_dev *pdev, int *user_max,
xdma_device_flag_clear
(
xdev
,
XDEV_FLAG_OFFLINE
);
return
(
void
*
)
xdev
;
err_interrupts:
irq_teardown
(
xdev
);
err_enable_msix:
err_msix:
disable_msi_msix
(
xdev
,
pdev
);
err_engines:
remove_engines
(
xdev
);
...
...
XDMA/linux-kernel/xdma/xdma_mod.c
View file @
cf2efd16
...
...
@@ -293,7 +293,11 @@ static void xdma_error_resume(struct pci_dev *pdev)
struct
xdma_pci_dev
*
xpdev
=
dev_get_drvdata
(
&
pdev
->
dev
);
pr_info
(
"dev 0x%p,0x%p.
\n
"
,
pdev
,
xpdev
);
#if KERNEL_VERSION(5, 7, 0) <= LINUX_VERSION_CODE
pci_aer_clear_nonfatal_status
(
pdev
);
#else
pci_cleanup_aer_uncorrect_error_status
(
pdev
);
#endif
}
#if KERNEL_VERSION(4, 13, 0) <= LINUX_VERSION_CODE
...
...
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