Bug 2609 - Add patch to fix some device identify fail when enable xHCI runtime suspend
Summary: Add patch to fix some device identify fail when enable xHCI runtime suspend
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 15:34 UTC by LeoLiu-oc
Modified: 2024-06-20 14:01 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 15:34:00 UTC
Description of problem:
If plug out device form xhci with runtime suspend enabled. On the one hand, driver will disconnect this device and send disabled slot command to xhci. On the other hand, without no device connect to xhci, PM core will call xhci suspend function to let xhci go to D3 to save power. However there is a temporal competition to get xhci lock between disable slot command interrupt and xhci suspend. If xhci suspend function get xhci lock first, then this function will clear xhci command ring. It will get error command trb when driver to handle disable slot command interrupt. This is a serious error for driver and driver will cleanup xhci. So,any device connect to this xhci port again will not be recognized.

In order to fix this issues, we let disable slot command interrupt ISR to get xhci lock first. So, add a delay in xhci suspend function before to get xhci lock.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1 插拔测试:
1)Enable xHCI RTD3 (以xHCI的BDF为00:12.0为例:echo auto >/sys/bus/pci/devices/0000:00:12.0/power/control)
2)拔掉接入的device,2s后再插入,查看device是否可以被识别到

2  Sx state测试
让系统进出Sx, 然后插入device是否可以识别


Actual results:


Expected results:
在各种测试case下面,device都可以正识别,能够进行读写即认为pass

Additional info:
Comment 1 小龙 admin 2024-01-15 17:07:30 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2599
Comment 2 小龙 admin 2024-06-20 14:01:10 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/3371