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
73adbe28
Commit
73adbe28
authored
Apr 28, 2016
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wishbone: get serious about sleeping in interrupt context
parent
6d608660
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
18 deletions
+13
-18
pcie_wb.c
pcie-wb/pcie_wb.c
+6
-4
wishbone.h
pcie-wb/wishbone.h
+1
-1
vme_wb_external.c
vme-wb/vme_wb_external.c
+6
-13
No files found.
pcie-wb/pcie_wb.c
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
);
...
...
pcie-wb/wishbone.h
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
);
};
...
...
vme-wb/vme_wb_external.c
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
;
...
...
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