Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
6a1c1d55
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
6a1c1d55
编写于
7月 02, 2017
作者:
B
Bjorn Helgaas
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'pci/msi' into next
* pci/msi: PCI/MSI: Ignore affinity if pre/post vector count is more than min_vecs
上级
91bbec65
6f9a22bc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
15 deletion
+16
-15
drivers/pci/msi.c
drivers/pci/msi.c
+2
-12
include/linux/interrupt.h
include/linux/interrupt.h
+2
-2
kernel/irq/affinity.c
kernel/irq/affinity.c
+12
-1
未找到文件。
drivers/pci/msi.c
浏览文件 @
6a1c1d55
...
@@ -1058,7 +1058,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
...
@@ -1058,7 +1058,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
for
(;;)
{
for
(;;)
{
if
(
affd
)
{
if
(
affd
)
{
nvec
=
irq_calc_affinity_vectors
(
nvec
,
affd
);
nvec
=
irq_calc_affinity_vectors
(
minvec
,
nvec
,
affd
);
if
(
nvec
<
minvec
)
if
(
nvec
<
minvec
)
return
-
ENOSPC
;
return
-
ENOSPC
;
}
}
...
@@ -1097,7 +1097,7 @@ static int __pci_enable_msix_range(struct pci_dev *dev,
...
@@ -1097,7 +1097,7 @@ static int __pci_enable_msix_range(struct pci_dev *dev,
for
(;;)
{
for
(;;)
{
if
(
affd
)
{
if
(
affd
)
{
nvec
=
irq_calc_affinity_vectors
(
nvec
,
affd
);
nvec
=
irq_calc_affinity_vectors
(
minvec
,
nvec
,
affd
);
if
(
nvec
<
minvec
)
if
(
nvec
<
minvec
)
return
-
ENOSPC
;
return
-
ENOSPC
;
}
}
...
@@ -1165,16 +1165,6 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
...
@@ -1165,16 +1165,6 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
if
(
flags
&
PCI_IRQ_AFFINITY
)
{
if
(
flags
&
PCI_IRQ_AFFINITY
)
{
if
(
!
affd
)
if
(
!
affd
)
affd
=
&
msi_default_affd
;
affd
=
&
msi_default_affd
;
if
(
affd
->
pre_vectors
+
affd
->
post_vectors
>
min_vecs
)
return
-
EINVAL
;
/*
* If there aren't any vectors left after applying the pre/post
* vectors don't bother with assigning affinity.
*/
if
(
affd
->
pre_vectors
+
affd
->
post_vectors
==
min_vecs
)
affd
=
NULL
;
}
else
{
}
else
{
if
(
WARN_ON
(
affd
))
if
(
WARN_ON
(
affd
))
affd
=
NULL
;
affd
=
NULL
;
...
...
include/linux/interrupt.h
浏览文件 @
6a1c1d55
...
@@ -291,7 +291,7 @@ extern int
...
@@ -291,7 +291,7 @@ extern int
irq_set_affinity_notifier
(
unsigned
int
irq
,
struct
irq_affinity_notify
*
notify
);
irq_set_affinity_notifier
(
unsigned
int
irq
,
struct
irq_affinity_notify
*
notify
);
struct
cpumask
*
irq_create_affinity_masks
(
int
nvec
,
const
struct
irq_affinity
*
affd
);
struct
cpumask
*
irq_create_affinity_masks
(
int
nvec
,
const
struct
irq_affinity
*
affd
);
int
irq_calc_affinity_vectors
(
int
maxvec
,
const
struct
irq_affinity
*
affd
);
int
irq_calc_affinity_vectors
(
int
m
invec
,
int
m
axvec
,
const
struct
irq_affinity
*
affd
);
#else
/* CONFIG_SMP */
#else
/* CONFIG_SMP */
...
@@ -331,7 +331,7 @@ irq_create_affinity_masks(int nvec, const struct irq_affinity *affd)
...
@@ -331,7 +331,7 @@ irq_create_affinity_masks(int nvec, const struct irq_affinity *affd)
}
}
static
inline
int
static
inline
int
irq_calc_affinity_vectors
(
int
maxvec
,
const
struct
irq_affinity
*
affd
)
irq_calc_affinity_vectors
(
int
m
invec
,
int
m
axvec
,
const
struct
irq_affinity
*
affd
)
{
{
return
maxvec
;
return
maxvec
;
}
}
...
...
kernel/irq/affinity.c
浏览文件 @
6a1c1d55
...
@@ -66,6 +66,13 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
...
@@ -66,6 +66,13 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
struct
cpumask
*
masks
;
struct
cpumask
*
masks
;
cpumask_var_t
nmsk
;
cpumask_var_t
nmsk
;
/*
* If there aren't any vectors left after applying the pre/post
* vectors don't bother with assigning affinity.
*/
if
(
!
affv
)
return
NULL
;
if
(
!
zalloc_cpumask_var
(
&
nmsk
,
GFP_KERNEL
))
if
(
!
zalloc_cpumask_var
(
&
nmsk
,
GFP_KERNEL
))
return
NULL
;
return
NULL
;
...
@@ -140,15 +147,19 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
...
@@ -140,15 +147,19 @@ irq_create_affinity_masks(int nvecs, const struct irq_affinity *affd)
/**
/**
* irq_calc_affinity_vectors - Calculate the optimal number of vectors
* irq_calc_affinity_vectors - Calculate the optimal number of vectors
* @minvec: The minimum number of vectors available
* @maxvec: The maximum number of vectors available
* @maxvec: The maximum number of vectors available
* @affd: Description of the affinity requirements
* @affd: Description of the affinity requirements
*/
*/
int
irq_calc_affinity_vectors
(
int
maxvec
,
const
struct
irq_affinity
*
affd
)
int
irq_calc_affinity_vectors
(
int
m
invec
,
int
m
axvec
,
const
struct
irq_affinity
*
affd
)
{
{
int
resv
=
affd
->
pre_vectors
+
affd
->
post_vectors
;
int
resv
=
affd
->
pre_vectors
+
affd
->
post_vectors
;
int
vecs
=
maxvec
-
resv
;
int
vecs
=
maxvec
-
resv
;
int
cpus
;
int
cpus
;
if
(
resv
>
minvec
)
return
0
;
/* Stabilize the cpumasks */
/* Stabilize the cpumasks */
get_online_cpus
();
get_online_cpus
();
cpus
=
cpumask_weight
(
cpu_online_mask
);
cpus
=
cpumask_weight
(
cpu_online_mask
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录