Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f116cc56
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f116cc56
编写于
5月 07, 2008
作者:
T
Thomas Hellstrom
提交者:
Dave Airlie
5月 07, 2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm: disable tasklets not IRQs when taking the drm lock spinlock
Signed-off-by:
N
Dave Airlie
<
airlied@redhat.com
>
上级
af6061af
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
25 deletion
+17
-25
drivers/char/drm/drm_fops.c
drivers/char/drm/drm_fops.c
+2
-5
drivers/char/drm/drm_lock.c
drivers/char/drm/drm_lock.c
+15
-20
未找到文件。
drivers/char/drm/drm_fops.c
浏览文件 @
f116cc56
...
...
@@ -323,7 +323,6 @@ int drm_release(struct inode *inode, struct file *filp)
struct
drm_file
*
file_priv
=
filp
->
private_data
;
struct
drm_device
*
dev
=
file_priv
->
minor
->
dev
;
int
retcode
=
0
;
unsigned
long
irqflags
;
lock_kernel
();
...
...
@@ -355,11 +354,9 @@ int drm_release(struct inode *inode, struct file *filp)
*/
do
{
spin_lock_irqsave
(
&
dev
->
lock
.
spinlock
,
irqflags
);
spin_lock_bh
(
&
dev
->
lock
.
spinlock
);
locked
=
dev
->
lock
.
idle_has_lock
;
spin_unlock_irqrestore
(
&
dev
->
lock
.
spinlock
,
irqflags
);
spin_unlock_bh
(
&
dev
->
lock
.
spinlock
);
if
(
locked
)
break
;
schedule
();
...
...
drivers/char/drm/drm_lock.c
浏览文件 @
f116cc56
...
...
@@ -53,7 +53,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
DECLARE_WAITQUEUE
(
entry
,
current
);
struct
drm_lock
*
lock
=
data
;
int
ret
=
0
;
unsigned
long
irqflags
;
++
file_priv
->
lock_count
;
...
...
@@ -72,9 +71,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
return
-
EINVAL
;
add_wait_queue
(
&
dev
->
lock
.
lock_queue
,
&
entry
);
spin_lock_
irqsave
(
&
dev
->
lock
.
spinlock
,
irqflags
);
spin_lock_
bh
(
&
dev
->
lock
.
spinlock
);
dev
->
lock
.
user_waiters
++
;
spin_unlock_
irqrestore
(
&
dev
->
lock
.
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
dev
->
lock
.
spinlock
);
for
(;;)
{
__set_current_state
(
TASK_INTERRUPTIBLE
);
if
(
!
dev
->
lock
.
hw_lock
)
{
...
...
@@ -96,9 +95,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
break
;
}
}
spin_lock_
irqsave
(
&
dev
->
lock
.
spinlock
,
irqflags
);
spin_lock_
bh
(
&
dev
->
lock
.
spinlock
);
dev
->
lock
.
user_waiters
--
;
spin_unlock_
irqrestore
(
&
dev
->
lock
.
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
dev
->
lock
.
spinlock
);
__set_current_state
(
TASK_RUNNING
);
remove_wait_queue
(
&
dev
->
lock
.
lock_queue
,
&
entry
);
...
...
@@ -199,9 +198,8 @@ int drm_lock_take(struct drm_lock_data *lock_data,
{
unsigned
int
old
,
new
,
prev
;
volatile
unsigned
int
*
lock
=
&
lock_data
->
hw_lock
->
lock
;
unsigned
long
irqflags
;
spin_lock_
irqsave
(
&
lock_data
->
spinlock
,
irqflags
);
spin_lock_
bh
(
&
lock_data
->
spinlock
);
do
{
old
=
*
lock
;
if
(
old
&
_DRM_LOCK_HELD
)
...
...
@@ -213,7 +211,7 @@ int drm_lock_take(struct drm_lock_data *lock_data,
}
prev
=
cmpxchg
(
lock
,
old
,
new
);
}
while
(
prev
!=
old
);
spin_unlock_
irqrestore
(
&
lock_data
->
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
lock_data
->
spinlock
);
if
(
_DRM_LOCKING_CONTEXT
(
old
)
==
context
)
{
if
(
old
&
_DRM_LOCK_HELD
)
{
...
...
@@ -274,16 +272,15 @@ int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context)
{
unsigned
int
old
,
new
,
prev
;
volatile
unsigned
int
*
lock
=
&
lock_data
->
hw_lock
->
lock
;
unsigned
long
irqflags
;
spin_lock_
irqsave
(
&
lock_data
->
spinlock
,
irqflags
);
spin_lock_
bh
(
&
lock_data
->
spinlock
);
if
(
lock_data
->
kernel_waiters
!=
0
)
{
drm_lock_transfer
(
lock_data
,
0
);
lock_data
->
idle_has_lock
=
1
;
spin_unlock_
irqrestore
(
&
lock_data
->
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
lock_data
->
spinlock
);
return
1
;
}
spin_unlock_
irqrestore
(
&
lock_data
->
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
lock_data
->
spinlock
);
do
{
old
=
*
lock
;
...
...
@@ -347,20 +344,19 @@ static int drm_notifier(void *priv)
void
drm_idlelock_take
(
struct
drm_lock_data
*
lock_data
)
{
int
ret
=
0
;
unsigned
long
irqflags
;
spin_lock_
irqsave
(
&
lock_data
->
spinlock
,
irqflags
);
spin_lock_
bh
(
&
lock_data
->
spinlock
);
lock_data
->
kernel_waiters
++
;
if
(
!
lock_data
->
idle_has_lock
)
{
spin_unlock_
irqrestore
(
&
lock_data
->
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
lock_data
->
spinlock
);
ret
=
drm_lock_take
(
lock_data
,
DRM_KERNEL_CONTEXT
);
spin_lock_
irqsave
(
&
lock_data
->
spinlock
,
irqflags
);
spin_lock_
bh
(
&
lock_data
->
spinlock
);
if
(
ret
==
1
)
lock_data
->
idle_has_lock
=
1
;
}
spin_unlock_
irqrestore
(
&
lock_data
->
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
lock_data
->
spinlock
);
}
EXPORT_SYMBOL
(
drm_idlelock_take
);
...
...
@@ -368,9 +364,8 @@ void drm_idlelock_release(struct drm_lock_data *lock_data)
{
unsigned
int
old
,
prev
;
volatile
unsigned
int
*
lock
=
&
lock_data
->
hw_lock
->
lock
;
unsigned
long
irqflags
;
spin_lock_
irqsave
(
&
lock_data
->
spinlock
,
irqflags
);
spin_lock_
bh
(
&
lock_data
->
spinlock
);
if
(
--
lock_data
->
kernel_waiters
==
0
)
{
if
(
lock_data
->
idle_has_lock
)
{
do
{
...
...
@@ -381,7 +376,7 @@ void drm_idlelock_release(struct drm_lock_data *lock_data)
lock_data
->
idle_has_lock
=
0
;
}
}
spin_unlock_
irqrestore
(
&
lock_data
->
spinlock
,
irqflags
);
spin_unlock_
bh
(
&
lock_data
->
spinlock
);
}
EXPORT_SYMBOL
(
drm_idlelock_release
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录