Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
36ac829e
Commit
36ac829e
authored
Sep 28, 2009
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MIPS: Sibyte: Get rid of BKL.
Signed-off-by:
Ralf Baechle
<
ralf@linux-mips.org
>
parent
553d6d5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
18 deletions
+15
-18
arch/mips/sibyte/common/sb_tbprof.c
arch/mips/sibyte/common/sb_tbprof.c
+15
-18
No files found.
arch/mips/sibyte/common/sb_tbprof.c
View file @
36ac829e
...
@@ -403,36 +403,31 @@ static int sbprof_zbprof_stop(void)
...
@@ -403,36 +403,31 @@ static int sbprof_zbprof_stop(void)
static
int
sbprof_tb_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
sbprof_tb_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
{
{
int
minor
;
int
minor
;
int
err
=
0
;
lock_kernel
();
minor
=
iminor
(
inode
);
minor
=
iminor
(
inode
);
if
(
minor
!=
0
)
{
if
(
minor
!=
0
)
err
=
-
ENODEV
;
return
-
ENODEV
;
goto
out
;
}
if
(
xchg
(
&
sbp
.
open
,
SB_OPENING
)
!=
SB_CLOSED
)
{
if
(
xchg
(
&
sbp
.
open
,
SB_OPENING
)
!=
SB_CLOSED
)
err
=
-
EBUSY
;
return
-
EBUSY
;
goto
out
;
}
memset
(
&
sbp
,
0
,
sizeof
(
struct
sbprof_tb
));
memset
(
&
sbp
,
0
,
sizeof
(
struct
sbprof_tb
));
sbp
.
sbprof_tbbuf
=
vmalloc
(
MAX_TBSAMPLE_BYTES
);
sbp
.
sbprof_tbbuf
=
vmalloc
(
MAX_TBSAMPLE_BYTES
);
if
(
!
sbp
.
sbprof_tbbuf
)
{
if
(
!
sbp
.
sbprof_tbbuf
)
{
err
=
-
ENOMEM
;
sbp
.
open
=
SB_CLOSED
;
goto
out
;
wmb
();
return
-
ENOMEM
;
}
}
memset
(
sbp
.
sbprof_tbbuf
,
0
,
MAX_TBSAMPLE_BYTES
);
memset
(
sbp
.
sbprof_tbbuf
,
0
,
MAX_TBSAMPLE_BYTES
);
init_waitqueue_head
(
&
sbp
.
tb_sync
);
init_waitqueue_head
(
&
sbp
.
tb_sync
);
init_waitqueue_head
(
&
sbp
.
tb_read
);
init_waitqueue_head
(
&
sbp
.
tb_read
);
mutex_init
(
&
sbp
.
lock
);
mutex_init
(
&
sbp
.
lock
);
sbp
.
open
=
SB_OPEN
;
sbp
.
open
=
SB_OPEN
;
wmb
();
out:
return
0
;
unlock_kernel
();
return
err
;
}
}
static
int
sbprof_tb_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
sbprof_tb_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
...
@@ -440,7 +435,7 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp)
...
@@ -440,7 +435,7 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp)
int
minor
;
int
minor
;
minor
=
iminor
(
inode
);
minor
=
iminor
(
inode
);
if
(
minor
!=
0
||
!
sbp
.
open
)
if
(
minor
!=
0
||
sbp
.
open
!=
SB_CLOSED
)
return
-
ENODEV
;
return
-
ENODEV
;
mutex_lock
(
&
sbp
.
lock
);
mutex_lock
(
&
sbp
.
lock
);
...
@@ -449,7 +444,8 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp)
...
@@ -449,7 +444,8 @@ static int sbprof_tb_release(struct inode *inode, struct file *filp)
sbprof_zbprof_stop
();
sbprof_zbprof_stop
();
vfree
(
sbp
.
sbprof_tbbuf
);
vfree
(
sbp
.
sbprof_tbbuf
);
sbp
.
open
=
0
;
sbp
.
open
=
SB_CLOSED
;
wmb
();
mutex_unlock
(
&
sbp
.
lock
);
mutex_unlock
(
&
sbp
.
lock
);
...
@@ -583,7 +579,8 @@ static int __init sbprof_tb_init(void)
...
@@ -583,7 +579,8 @@ static int __init sbprof_tb_init(void)
}
}
tb_dev
=
dev
;
tb_dev
=
dev
;
sbp
.
open
=
0
;
sbp
.
open
=
SB_CLOSED
;
wmb
();
tb_period
=
zbbus_mhz
*
10000LL
;
tb_period
=
zbbus_mhz
*
10000LL
;
pr_info
(
DEVNAME
": initialized - tb_period = %lld
\n
"
,
pr_info
(
DEVNAME
": initialized - tb_period = %lld
\n
"
,
(
long
long
)
tb_period
);
(
long
long
)
tb_period
);
...
...
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