惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Vulnerabilities – Threatpost
GbyAI
GbyAI
P
Proofpoint News Feed
L
LINUX DO - 热门话题
P
Palo Alto Networks Blog
A
About on SuperTechFans
T
Tenable Blog
M
MIT News - Artificial intelligence
IT之家
IT之家
I
Intezer
D
DataBreaches.Net
爱范儿
爱范儿
T
Threatpost
C
CERT Recently Published Vulnerability Notes
云风的 BLOG
云风的 BLOG
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
K
Kaspersky official blog
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Y
Y Combinator Blog
Cyberwarzone
Cyberwarzone
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Darknet – Hacking Tools, Hacker News & Cyber Security
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
Spread Privacy
Spread Privacy
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
AWS News Blog
AWS News Blog
博客园 - 聂微东
C
Check Point Blog
S
Securelist
有赞技术团队
有赞技术团队
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
Last Week in AI
Last Week in AI
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
D
Docker
G
GRAHAM CLULEY
T
The Exploit Database - CXSecurity.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tailwind CSS Blog
L
Lohrmann on Cybersecurity
G
Google Developers Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog

博客园 - yooooooo

【ARM CoreLink 系列 5 -- CI-700 控制器介绍 】 ARM CoreLink 系列 4.3 -- NI-700 Component and interface identifiers ARM CCI-500 与 NI0700 的关系. ARM NIC-400 与 NI-700 的区别 claude code命令使用 【ARM Trace32(劳特巴赫) 使用介绍 2.2 -- TRACE32 进阶命令之 DIAG 弹框命令】 trace32 .cmm脚本和.t32文件的区别 【ARM Trace32(劳特巴赫) 使用介绍 2.1 -- TRACE32 Practice 脚本 cmm 脚本学习】 【ARM Trace32(劳特巴赫) 使用介绍 1.1 - Veloce 环境中使用trace32 连接 Cortex-M33】 fw_devlink 功能 I3C协议详解 UART 协议规范 BPF 调度器 sched_ext 实现机制、调度流程及样例 Android Camera性能分析 录像Buffer Path详解 【UEFI基础】Protocol介绍 【UEFI实战】在库中使用全局变量 sched feature TTWU_QUEUE 【ARM CoreLink 系列 4.2 -- NI-700 Function units 详细介绍】 edk2构建编译流程 UEFI:FDF文件及FD、FV、FFS EDK II PCD的概念、类型、使用 PELT算法浅析 load_balance函数代码详解 - yooooooo UEFI Boot Manager Linux misfit task Linux 内核中sched_prio_to_weight转换关系 CFS任务放置代码详解 CFS任务的负载均衡(load balance)
PCIe 总线的 ASPM 和 链路状态机制总结
yooooooo · 2026-04-17 · via 博客园 - yooooooo

1. 基本概念区分

1.1 PCIe 电源状态(Device Power State, D-States)

PCI Power Management(PM) 定义,作用对象是 Function / Device 本身

  • D0
    • 全功能工作态
    • 配置空间和 BAR 可访问
  • D1 / D2
    • 可选状态(多数 Root Port/Endpoint 不支持)
    • 部分功能关闭
  • D3hot
    • 逻辑上仍供电
    • 配置空间仍可访问
  • D3cold
    • 功能与配置空间全部不可访问
    • 物理断电(retention 视平台实现)

PCIe Link Layer / PHY + ASPM 定义,作用对象是 Link 本身(Root Port ↔ Endpoint)

  • L0
    • 正常数据传输
  • L0s
    • 单向低功耗(快速恢复)
  • L1
    • 双向低功耗
  • L1 Substates
    • L1.1 / L1.2(更深度的 PHY 省电)
  • L2 / L3 Ready
    • 用于链路关闭(配合 D3)
  • Detect / Disabled
    • 链路不活动或被禁用

2. 电源状态与链路状态的核心关系

2.1 核心原则(规范级)

电源状态决定“设备是否可用”
链路状态决定“物理传输是否活跃”

两者是正交(Orthogonal)*关系,但存在*强约束依赖


3. 各 D-State 对链路状态的要求与影响

Device Power State 允许的 Link State
D0 L0 / L0s / L1 / L1.x

说明:

  • 设备处于 D0 时:
    • 链路可以动态进入 ASPM(L0s/L1/L1.x)
    • 由 OS policy + hardware 能力决定
  • ASPM 仅在 D0 有意义

3.2 D1 / D2(可选)

Device Power State Link 行为
D1 / D2 仍在 L0/L1 范围

说明:

  • 很少在 SoC / 手机平台使用
  • 不涉及链路关闭

Device Power State Link State
D3hot L1 / L2 Prepared

关键点:

  • 进入 D3hot 前:
    • 必须停止正常 link traffic
  • 常见流程: L0 → L1 → L2 (Ready)
  • 链路仍可能保持 逻辑存在
  • 配置空间仍可访问(PCI config read/write)

Device Power State Link State
D3cold L2 / Disabled / Detect

这是最重要的强约束关系:

  • 进入 D3cold 的前提:
    • Link 必须先进入 L2 或 Disabled
  • 进入 D3cold 后:
    • PHY 可能被完全断电
    • LTSSM 回到 Detect
    • 配置空间不可访问

4. 关系总结(一句话)

浅电源态(D0/D3hot) → 链路仍存在
深电源态(D3cold) → 链路必须关闭


5. 实际系统中的典型对应关系(Linux / Android / SoC)

5.1 Runtime PM(pm_runtime)常见组合

Runtime PM 状态 Device D-State Link State
active D0 L0/L1
runtime suspend D3hot 或 D3cold L1/L2/Detect
  • 是否进 D3cold:
    • 取决于:
      • supports D3cold
      • 平台电源域
      • bridge_d3 是否允许

5.2 Root Port 的特殊点

  • Root Port 本身也有 D-States
  • 常见 SoC 行为:
    • Endpoint → D3cold
    • Root Port → clock gated + link down
  • Root Port 进入 D3cold:
    • 必然导致整个 link down

6. ASPM 与电源状态的关系

6.1 ASPM 不等于设备低功耗

  • ASPM(L0s/L1/L1.x):
    • 只降低 Link PHY 功耗
    • 不改变 Device D-State
  • 设备仍然是 D0

6.2 进入 D3 必然影响链路,但反之不成立

  • ✅ D3cold → Link down
  • ❌ Link L1/L1.2 ≠ Device 不可用

7. 状态转换流程示例

7.1 正常 Suspend 流程(Endpoint)

D0 / L0
  ↓ (ASPM)
D0 / L1
  ↓ (system suspend / runtime suspend)
D3hot / L1
  ↓ (platform power off)
D3cold / L2 → Detect

7.2 Resume 流程

Power on
  ↓
Link Detect → Polling → L0
  ↓
Device enters D0
  ↓
Config Restore + Driver Resume