Bug 2611 - Add support sata lpm for Zhaoxin CPUs
Summary: Add support sata lpm for Zhaoxin CPUs
Status: NEW
Alias: None
Product: ANCK 4.19 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: LeoLiu-oc
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-27 16:28 UTC by LeoLiu-oc
Modified: 2023-08-17 18:13 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LeoLiu-oc zhaoxin_group 2022-10-27 16:28:10 UTC
Description of problem:
Link Power Management (LPM)是ahci controller link/phy的电源状态HIPM(partail/slubmer/devslp),是一种capability,不是强制要求支持的。AHCI spec规定,hotplug out与 LPM状态不共存,因此LPM driver在enable LPM时会disable hotplug out,但此时的LPM driver并不会去check ahci controller是否支持LPM,因此,势必存在一种情况:ahci controller不支持LPM,当用户在不知情的情况下操作了LPM相关的sys接口来“enable LPM“,结果就是导致LPM没有enable成功,hotplug out也被关掉了。因此,在LPM driver中,disable hotplug out前,增加对LPM capability的判断,仅在支持的情况下disable hotplug out(001)。
另外,上述三种电源状态不是都去支持的,可能仅支持其中的某一到两种,比如仅支持partial,而不支持slumber和devslp(实际上这种case不多,但也不排除会存在的可能),此时就会出现一种情况:当用户对LPM相关的sys接口传min_power参数,kernel会设置PxSCTC.LPM=0x0(),device支持DIPM slumber,kernel会enable DIPM slumber,但此时kernel又允许controller进slumber(controller并不支持它),势必会造成状态错误。因此,在LPM driver中,设置PxSCTL.LPM时,增加对LPM capability的判断,仅在支持的情况下enable transitions to the target state(002)。

Expected results:
1、plugout会有log提示,一段时间后,盘符消失,之后再plugin,盘可以正常识别,重复plugout/in多次,盘可以正常显示就算pass。
2、读对应的mmio offset 0x28,看到link状态是否正常,比如LPM status bit11~08是0x1,不是0x6。