Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
9fb3c5ca
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
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看板
提交
9fb3c5ca
编写于
10月 25, 2008
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'i7300_idle' into release
上级
438f8de4
f371be63
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
114 addition
and
92 deletion
+114
-92
drivers/dma/ioat_dma.c
drivers/dma/ioat_dma.c
+5
-2
drivers/idle/Kconfig
drivers/idle/Kconfig
+6
-5
drivers/idle/i7300_idle.c
drivers/idle/i7300_idle.c
+20
-85
include/linux/i7300_idle.h
include/linux/i7300_idle.h
+83
-0
未找到文件。
drivers/dma/ioat_dma.c
浏览文件 @
9fb3c5ca
...
...
@@ -33,6 +33,7 @@
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/workqueue.h>
#include <linux/i7300_idle.h>
#include "ioatdma.h"
#include "ioatdma_registers.h"
#include "ioatdma_hw.h"
...
...
@@ -171,8 +172,10 @@ static int ioat_dma_enumerate_channels(struct ioatdma_device *device)
xfercap_scale
=
readb
(
device
->
reg_base
+
IOAT_XFERCAP_OFFSET
);
xfercap
=
(
xfercap_scale
==
0
?
-
1
:
(
1UL
<<
xfercap_scale
));
#if CONFIG_I7300_IDLE_IOAT_CHANNEL
device
->
common
.
chancnt
--
;
#ifdef CONFIG_I7300_IDLE_IOAT_CHANNEL
if
(
i7300_idle_platform_probe
(
NULL
,
NULL
)
==
0
)
{
device
->
common
.
chancnt
--
;
}
#endif
for
(
i
=
0
;
i
<
device
->
common
.
chancnt
;
i
++
)
{
ioat_chan
=
kzalloc
(
sizeof
(
*
ioat_chan
),
GFP_KERNEL
);
...
...
drivers/idle/Kconfig
浏览文件 @
9fb3c5ca
...
...
@@ -5,12 +5,13 @@ config I7300_IDLE_IOAT_CHANNEL
bool
config I7300_IDLE
tristate "Intel chipset idle power saving driver"
tristate "Intel chipset idle
memory
power saving driver"
select I7300_IDLE_IOAT_CHANNEL
depends on X86_64
depends on X86_64
&& EXPERIMENTAL
help
Enable idle power savings with certain Intel server chipsets.
The chipset must have I/O AT support, such as the Intel 7300.
The power savings depends on the type and quantity of DRAM devices.
Enable memory power savings when idle with certain Intel server
chipsets. The chipset must have I/O AT support, such as the
Intel 7300. The power savings depends on the type and quantity of
DRAM devices.
endmenu
drivers/idle/i7300_idle.c
浏览文件 @
9fb3c5ca
...
...
@@ -25,6 +25,7 @@
#include <linux/delay.h>
#include <linux/debugfs.h>
#include <linux/stop_machine.h>
#include <linux/i7300_idle.h>
#include <asm/idle.h>
...
...
@@ -34,6 +35,8 @@
#define I7300_IDLE_DRIVER_VERSION "1.55"
#define I7300_PRINT "i7300_idle:"
#define MAX_STOP_RETRIES 10
static
int
debug
;
module_param_named
(
debug
,
debug
,
uint
,
0644
);
MODULE_PARM_DESC
(
debug
,
"Enable debug printks in this driver"
);
...
...
@@ -46,12 +49,12 @@ MODULE_PARM_DESC(debug, "Enable debug printks in this driver");
* 0 = No throttling
* 1 = Throttle when > 4 activations per eval window (Maximum throttling)
* 2 = Throttle when > 8 activations
* 168 = Throttle when >
168
activations (Minimum throttling)
* 168 = Throttle when >
672
activations (Minimum throttling)
*/
#define MAX_THR
TLW
LIMIT 168
static
uint
i7300_idle_thrtlowlm
=
1
;
module_param_named
(
thr
tlwlimit
,
i7300_idle_thrtlowlm
,
uint
,
0644
);
MODULE_PARM_DESC
(
thr
tlw
limit
,
#define MAX_THR
OTTLE_LOW_
LIMIT 168
static
uint
throttle_low_limit
=
1
;
module_param_named
(
thr
ottle_low_limit
,
throttle_low_limit
,
uint
,
0644
);
MODULE_PARM_DESC
(
thr
ottle_low_
limit
,
"Value for THRTLOWLM activation field "
"(0 = disable throttle, 1 = Max throttle, 168 = Min throttle)"
);
...
...
@@ -110,9 +113,9 @@ static int i7300_idle_ioat_start(void)
static
void
i7300_idle_ioat_stop
(
void
)
{
int
i
;
u
8
sts
;
u
64
sts
;
for
(
i
=
0
;
i
<
5
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_STOP_RETRIES
;
i
++
)
{
writeb
(
IOAT_CHANCMD_RESET
,
ioat_chanbase
+
IOAT1_CHANCMD_OFFSET
);
...
...
@@ -126,9 +129,10 @@ static void i7300_idle_ioat_stop(void)
}
if
(
i
==
5
)
dprintk
(
"failed to suspend+reset I/O AT after 5 retries
\n
"
);
if
(
i
==
MAX_STOP_RETRIES
)
{
dprintk
(
"failed to stop I/O AT after %d retries
\n
"
,
MAX_STOP_RETRIES
);
}
}
/* Test I/O AT by copying 1024 byte from 2k to 1k */
...
...
@@ -275,7 +279,7 @@ static void __exit i7300_idle_ioat_exit(void)
i7300_idle_ioat_stop
();
/* Wait for a while for the channel to halt before releasing */
for
(
i
=
0
;
i
<
10
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_STOP_RETRIES
;
i
++
)
{
writeb
(
IOAT_CHANCMD_RESET
,
ioat_chanbase
+
IOAT1_CHANCMD_OFFSET
);
...
...
@@ -389,9 +393,9 @@ static void i7300_idle_start(void)
new_ctl
=
i7300_idle_thrtctl_saved
&
~
DIMM_THRTCTL_THRMHUNT
;
pci_write_config_byte
(
fbd_dev
,
DIMM_THRTCTL
,
new_ctl
);
limit
=
i7300_idle_thrtlowlm
;
if
(
unlikely
(
limit
>
MAX_THR
TLW
LIMIT
))
limit
=
MAX_THR
TLW
LIMIT
;
limit
=
throttle_low_limit
;
if
(
unlikely
(
limit
>
MAX_THR
OTTLE_LOW_
LIMIT
))
limit
=
MAX_THR
OTTLE_LOW_
LIMIT
;
pci_write_config_byte
(
fbd_dev
,
DIMM_THRTLOW
,
limit
);
...
...
@@ -440,7 +444,7 @@ static int i7300_idle_notifier(struct notifier_block *nb, unsigned long val,
static
ktime_t
idle_begin_time
;
static
int
time_init
=
1
;
if
(
!
i7300_idle_thrtlowlm
)
if
(
!
throttle_low_limit
)
return
0
;
if
(
unlikely
(
time_init
))
{
...
...
@@ -505,77 +509,8 @@ static struct notifier_block i7300_idle_nb = {
.
notifier_call
=
i7300_idle_notifier
,
};
/*
* I/O AT controls (PCI bus 0 device 8 function 0)
* DIMM controls (PCI bus 0 device 16 function 1)
*/
#define IOAT_BUS 0
#define IOAT_DEVFN PCI_DEVFN(8, 0)
#define MEMCTL_BUS 0
#define MEMCTL_DEVFN PCI_DEVFN(16, 1)
struct
fbd_ioat
{
unsigned
int
vendor
;
unsigned
int
ioat_dev
;
};
/*
* The i5000 chip-set has the same hooks as the i7300
* but support is disabled by default because this driver
* has not been validated on that platform.
*/
#define SUPPORT_I5000 0
static
const
struct
fbd_ioat
fbd_ioat_list
[]
=
{
{
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_IOAT_CNB
},
#if SUPPORT_I5000
{
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_IOAT
},
#endif
{
0
,
0
}
};
/* table of devices that work with this driver */
static
const
struct
pci_device_id
pci_tbl
[]
=
{
{
PCI_DEVICE
(
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_FBD_CNB
)
},
#if SUPPORT_I5000
{
PCI_DEVICE
(
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_5000_ERR
)
},
#endif
{
}
/* Terminating entry */
};
MODULE_DEVICE_TABLE
(
pci
,
pci_tbl
);
/* Check for known platforms with I/O-AT */
static
int
__init
i7300_idle_platform_probe
(
void
)
{
int
i
;
fbd_dev
=
pci_get_bus_and_slot
(
MEMCTL_BUS
,
MEMCTL_DEVFN
);
if
(
!
fbd_dev
)
return
-
ENODEV
;
for
(
i
=
0
;
pci_tbl
[
i
].
vendor
!=
0
;
i
++
)
{
if
(
fbd_dev
->
vendor
==
pci_tbl
[
i
].
vendor
&&
fbd_dev
->
device
==
pci_tbl
[
i
].
device
)
{
break
;
}
}
if
(
pci_tbl
[
i
].
vendor
==
0
)
return
-
ENODEV
;
ioat_dev
=
pci_get_bus_and_slot
(
IOAT_BUS
,
IOAT_DEVFN
);
if
(
!
ioat_dev
)
return
-
ENODEV
;
for
(
i
=
0
;
fbd_ioat_list
[
i
].
vendor
!=
0
;
i
++
)
{
if
(
ioat_dev
->
vendor
==
fbd_ioat_list
[
i
].
vendor
&&
ioat_dev
->
device
==
fbd_ioat_list
[
i
].
ioat_dev
)
{
return
0
;
}
}
return
-
ENODEV
;
}
int
stats_open_generic
(
struct
inode
*
inode
,
struct
file
*
fp
)
{
fp
->
private_data
=
inode
->
i_private
;
...
...
@@ -617,7 +552,7 @@ static int __init i7300_idle_init(void)
cpus_clear
(
idle_cpumask
);
total_us
=
0
;
if
(
i7300_idle_platform_probe
())
if
(
i7300_idle_platform_probe
(
&
fbd_dev
,
&
ioat_dev
))
return
-
ENODEV
;
if
(
i7300_idle_thrt_save
())
...
...
include/linux/i7300_idle.h
0 → 100644
浏览文件 @
9fb3c5ca
#ifndef I7300_IDLE_H
#define I7300_IDLE_H
#include <linux/pci.h>
/*
* I/O AT controls (PCI bus 0 device 8 function 0)
* DIMM controls (PCI bus 0 device 16 function 1)
*/
#define IOAT_BUS 0
#define IOAT_DEVFN PCI_DEVFN(8, 0)
#define MEMCTL_BUS 0
#define MEMCTL_DEVFN PCI_DEVFN(16, 1)
struct
fbd_ioat
{
unsigned
int
vendor
;
unsigned
int
ioat_dev
;
};
/*
* The i5000 chip-set has the same hooks as the i7300
* but support is disabled by default because this driver
* has not been validated on that platform.
*/
#define SUPPORT_I5000 0
static
const
struct
fbd_ioat
fbd_ioat_list
[]
=
{
{
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_IOAT_CNB
},
#if SUPPORT_I5000
{
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_IOAT
},
#endif
{
0
,
0
}
};
/* table of devices that work with this driver */
static
const
struct
pci_device_id
pci_tbl
[]
=
{
{
PCI_DEVICE
(
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_FBD_CNB
)
},
#if SUPPORT_I5000
{
PCI_DEVICE
(
PCI_VENDOR_ID_INTEL
,
PCI_DEVICE_ID_INTEL_5000_ERR
)
},
#endif
{
}
/* Terminating entry */
};
/* Check for known platforms with I/O-AT */
static
inline
int
i7300_idle_platform_probe
(
struct
pci_dev
**
fbd_dev
,
struct
pci_dev
**
ioat_dev
)
{
int
i
;
struct
pci_dev
*
memdev
,
*
dmadev
;
memdev
=
pci_get_bus_and_slot
(
MEMCTL_BUS
,
MEMCTL_DEVFN
);
if
(
!
memdev
)
return
-
ENODEV
;
for
(
i
=
0
;
pci_tbl
[
i
].
vendor
!=
0
;
i
++
)
{
if
(
memdev
->
vendor
==
pci_tbl
[
i
].
vendor
&&
memdev
->
device
==
pci_tbl
[
i
].
device
)
{
break
;
}
}
if
(
pci_tbl
[
i
].
vendor
==
0
)
return
-
ENODEV
;
dmadev
=
pci_get_bus_and_slot
(
IOAT_BUS
,
IOAT_DEVFN
);
if
(
!
dmadev
)
return
-
ENODEV
;
for
(
i
=
0
;
fbd_ioat_list
[
i
].
vendor
!=
0
;
i
++
)
{
if
(
dmadev
->
vendor
==
fbd_ioat_list
[
i
].
vendor
&&
dmadev
->
device
==
fbd_ioat_list
[
i
].
ioat_dev
)
{
if
(
fbd_dev
)
*
fbd_dev
=
memdev
;
if
(
ioat_dev
)
*
ioat_dev
=
dmadev
;
return
0
;
}
}
return
-
ENODEV
;
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录