Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FPGA Configuration Space
Commits
d5187fef
Commit
d5187fef
authored
Apr 29, 2016
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcie_wb: mutex no longer required, and sleeping in MSI routines is safe
parent
b1fd2e52
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
31 deletions
+0
-31
pcie_wb.c
pcie-wb/pcie_wb.c
+0
-11
pcie_wb.h
pcie-wb/pcie_wb.h
+0
-1
spec_wb.c
pcie-wb/spec_wb.c
+0
-5
spec_wb.h
pcie-wb/spec_wb.h
+0
-1
vme_wb_external.c
vme-wb/vme_wb_external.c
+0
-13
No files found.
pcie-wb/pcie_wb.c
View file @
d5187fef
...
...
@@ -60,14 +60,10 @@ static void wb_cycle(struct wishbone* wb, int on)
dev
=
container_of
(
wb
,
struct
pcie_wb_dev
,
wb
);
control
=
dev
->
pci_res
[
0
].
addr
;
if
(
on
)
mutex_lock
(
&
dev
->
mutex
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
PCIE_WB
": cycle(%d)
\n
"
,
on
);
iowrite32
((
on
?
0x80000000UL
:
0
)
+
0x40000000UL
,
control
+
CONTROL_REGISTER_HIGH
);
if
(
!
on
)
mutex_unlock
(
&
dev
->
mutex
);
}
static
void
wb_byteenable
(
struct
wishbone
*
wb
,
unsigned
char
be
)
...
...
@@ -216,8 +212,6 @@ static wb_data_t wb_read_cfg(struct wishbone *wb, wb_addr_t addr)
static
int
wb_request
(
struct
wishbone
*
wb
,
struct
wishbone_request
*
req
)
{
/* All forms of sleep are forbidden in this method (no printk/mutex/etc) */
struct
pcie_wb_dev
*
dev
;
unsigned
char
*
control
;
uint32_t
ctl
;
...
...
@@ -243,8 +237,6 @@ static int wb_request(struct wishbone *wb, struct wishbone_request *req)
static
void
wb_reply
(
struct
wishbone
*
wb
,
int
err
,
wb_data_t
data
)
{
/* All forms of sleep are forbidden in this method (no printk/mutex/etc) */
struct
pcie_wb_dev
*
dev
;
unsigned
char
*
control
;
...
...
@@ -268,8 +260,6 @@ static const struct wishbone_operations wb_ops = {
static
irqreturn_t
irq_handler
(
int
irq
,
void
*
dev_id
)
{
/* All forms of sleep are forbidden in this method (no printk/mutex/etc) */
struct
pcie_wb_dev
*
dev
=
dev_id
;
pcie_int_enable
(
dev
,
0
);
...
...
@@ -348,7 +338,6 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev
->
wb
.
wops
=
&
wb_ops
;
dev
->
wb
.
parent
=
&
pdev
->
dev
;
dev
->
wb
.
mask
=
0xffff
;
mutex_init
(
&
dev
->
mutex
);
dev
->
window_offset
=
0
;
dev
->
low_addr
=
0
;
dev
->
width
=
4
;
...
...
pcie-wb/pcie_wb.h
View file @
d5187fef
...
...
@@ -43,7 +43,6 @@ struct pcie_wb_dev {
int
msi
;
struct
wishbone
wb
;
struct
mutex
mutex
;
/* only one user can open a cycle at a time */
unsigned
int
window_offset
;
unsigned
int
low_addr
,
width
,
shift
;
};
...
...
pcie-wb/spec_wb.c
View file @
d5187fef
...
...
@@ -37,12 +37,8 @@ static void wb_cycle(struct wishbone* wb, int on)
dev
=
container_of
(
wb
,
struct
spec_wb_dev
,
wb
);
if
(
on
)
mutex_lock
(
&
dev
->
mutex
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
SPEC_WB
": cycle(%d)
\n
"
,
on
);
if
(
!
on
)
mutex_unlock
(
&
dev
->
mutex
);
}
static
void
wb_byteenable
(
struct
wishbone
*
wb
,
unsigned
char
be
)
...
...
@@ -270,7 +266,6 @@ static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev
->
wb
.
parent
=
&
pdev
->
dev
;
dev
->
wb
.
mask
=
0
;
// not MSI capable
dev
->
msi
=
1
;
mutex_init
(
&
dev
->
mutex
);
dev
->
window_offset
=
0
;
dev
->
low_addr
=
0
;
dev
->
width
=
4
;
...
...
pcie-wb/spec_wb.h
View file @
d5187fef
...
...
@@ -34,7 +34,6 @@ struct spec_wb_dev {
int
msi
;
struct
wishbone
wb
;
struct
mutex
mutex
;
/* only one user can open a cycle at a time */
unsigned
int
window_offset
;
unsigned
int
low_addr
,
width
,
shift
;
};
...
...
vme-wb/vme_wb_external.c
View file @
d5187fef
...
...
@@ -49,17 +49,11 @@ static void wb_cycle(struct wishbone *wb, int on)
ctrl_win
=
dev
->
vme_res
.
map
[
MAP_CTRL
]
->
kernel_va
;
if
(
on
)
mutex_lock
(
&
dev
->
mutex
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
": Cycle(%d)
\n
"
,
on
);
iowrite32
(
cpu_to_be32
((
on
?
0x80000000UL
:
0
)
+
0x40000000UL
),
ctrl_win
+
CTRL
);
if
(
!
on
)
mutex_unlock
(
&
dev
->
mutex
);
}
static
wb_data_t
wb_read_cfg
(
struct
wishbone
*
wb
,
wb_addr_t
addr
)
...
...
@@ -154,8 +148,6 @@ static wb_data_t wb_read(struct wishbone *wb, wb_addr_t addr)
static
int
wb_request
(
struct
wishbone
*
wb
,
struct
wishbone_request
*
req
)
{
/* All forms of sleep are forbidden in this method (no printk/mutex/etc) */
struct
vme_wb_dev
*
dev
;
unsigned
char
*
ctrl_win
;
uint32_t
ctrl
;
...
...
@@ -178,8 +170,6 @@ static int wb_request(struct wishbone *wb, struct wishbone_request *req)
static
void
wb_reply
(
struct
wishbone
*
wb
,
int
err
,
wb_data_t
data
)
{
/* All forms of sleep are forbidden in this method (no printk/mutex/etc) */
struct
vme_wb_dev
*
dev
;
unsigned
char
*
ctrl_win
;
...
...
@@ -229,8 +219,6 @@ static void init_ctrl_reg(struct vme_wb_dev *dev)
int
irq_handler
(
void
*
dev_id
)
{
/* All forms of sleep are forbidden in this method (no printk/mutex/etc) */
struct
vme_wb_dev
*
dev
=
dev_id
;
wishbone_slave_ready
(
&
dev
->
wb
);
...
...
@@ -443,7 +431,6 @@ static int vme_probe(struct device *pdev, unsigned int ndev)
dev
->
vme_res
.
vector
=
vector
[
ndev
];
dev
->
vme_res
.
level
=
level
[
ndev
];
/* Default value */
dev
->
vme_dev
=
pdev
;
mutex_init
(
&
dev
->
mutex
);
dev
->
wb
.
wops
=
&
wb_ops
;
dev
->
wb
.
parent
=
pdev
;
dev
->
wb
.
mask
=
0xffff
;
...
...
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