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
73adbe28
Commit
73adbe28
authored
8 years ago
by
Wesley W. Terpstra
Browse files
Options
Downloads
Patches
Plain Diff
wishbone: get serious about sleeping in interrupt context
parent
6d608660
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pcie-wb/pcie_wb.c
+6
-4
6 additions, 4 deletions
pcie-wb/pcie_wb.c
pcie-wb/wishbone.h
+1
-1
1 addition, 1 deletion
pcie-wb/wishbone.h
vme-wb/vme_wb_external.c
+6
-13
6 additions, 13 deletions
vme-wb/vme_wb_external.c
with
13 additions
and
18 deletions
pcie-wb/pcie_wb.c
+
6
−
4
View file @
73adbe28
...
...
@@ -216,6 +216,8 @@ 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
;
...
...
@@ -230,7 +232,6 @@ static int wb_request(struct wishbone *wb, struct wishbone_request *req)
req
->
mask
=
ctl
&
0xf
;
req
->
write
=
(
ctl
&
0x40000000
)
!=
0
;
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
"request %x
\n
"
,
ctl
);
out
=
(
ctl
&
0x80000000
)
!=
0
;
if
(
out
)
iowrite32
(
1
,
control
+
MASTER_CTL_HIGH
);
/* dequeue operation */
...
...
@@ -242,13 +243,14 @@ 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
;
dev
=
container_of
(
wb
,
struct
pcie_wb_dev
,
wb
);
control
=
dev
->
pci_res
[
0
].
addr
;
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
"pushing reply
\n
"
);
iowrite32
(
data
,
control
+
MASTER_DAT_LOW
);
iowrite32
(
err
+
2
,
control
+
MASTER_CTL_HIGH
);
}
...
...
@@ -266,9 +268,9 @@ static const struct wishbone_operations wb_ops = {
static
irqreturn_t
irq_handler
(
int
irq
,
void
*
dev_id
)
{
struct
pcie_wb_dev
*
dev
=
dev_id
;
/* All forms of sleep are forbidden in this method (no printk/mutex/etc) */
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
"posting MSI
\n
"
)
;
struct
pcie_wb_dev
*
dev
=
dev_id
;
pcie_int_enable
(
dev
,
0
);
wishbone_slave_ready
(
&
dev
->
wb
);
...
...
This diff is collapsed.
Click to expand it.
pcie-wb/wishbone.h
+
1
−
1
View file @
73adbe28
...
...
@@ -46,7 +46,7 @@ struct wishbone_operations
wb_data_t
(
*
read
)(
struct
wishbone
*
wb
,
wb_addr_t
addr
);
wb_data_t
(
*
read_cfg
)(
struct
wishbone
*
wb
,
wb_addr_t
addr
);
/* slave operations */
/* slave operations
, run from interrupt context => MUST NOT SLEEP (no printk/mutex/etc)
*/
int
(
*
request
)(
struct
wishbone
*
wb
,
struct
wishbone_request
*
);
/* 1=record filled, 0=none pending. re-enable non-MSI interrupts. */
void
(
*
reply
)(
struct
wishbone
*
wb
,
int
err
,
wb_data_t
dat
);
};
...
...
This diff is collapsed.
Click to expand it.
vme-wb/vme_wb_external.c
+
6
−
13
View file @
73adbe28
...
...
@@ -154,6 +154,8 @@ 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
;
...
...
@@ -171,17 +173,13 @@ static int wb_request(struct wishbone *wb, struct wishbone_request *req)
out
=
(
ctrl
&
0x80000000
)
!=
0
;
if
(
out
)
iowrite32
(
cpu_to_be32
(
1
),
ctrl_win
+
MASTER_CTRL
);
/* dequeue operation */
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
"WB REQUEST:Request ctrl %x addr %x data %x mask %x return %x
\n
"
,
ctrl
,
req
->
addr
,
req
->
data
,
req
->
mask
,
(
ctrl
&
0x80000000
)
!=
0
);
return
out
;
}
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
;
...
...
@@ -190,10 +188,6 @@ static void wb_reply(struct wishbone *wb, int err, wb_data_t data)
iowrite32
(
cpu_to_be32
(
data
),
ctrl_win
+
MASTER_DATA
);
iowrite32
(
cpu_to_be32
(
err
+
2
),
ctrl_win
+
MASTER_CTRL
);
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
"WB REPLY: pushing data %x reply %x
\n
"
,
data
,
err
+
2
);
}
static
void
wb_byteenable
(
struct
wishbone
*
wb
,
unsigned
char
be
)
...
...
@@ -235,11 +229,10 @@ 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
;
if
(
unlikely
(
debug
))
printk
(
KERN_ALERT
VME_WB
": IRQ!!
\n
"
);
wishbone_slave_ready
(
&
dev
->
wb
);
return
IRQ_HANDLED
;
...
...
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