Bug 216697

Summary: Resume from suspend stopped working
Product: Drivers Reporter: Denis (speranskiy)
Component: USBAssignee: Default virtual assignee for Drivers/USB (drivers_usb)
Status: NEW ---    
Severity: high CC: alchernaev, darlor, fancieux, heikki.krogerus, maniette, morten242, oliver, roman.sstu
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 6.0.7 and on Subsystem:
Regression: No Bisected commit-id:
Attachments: photo of errors on resume
screenshot of error with patch
Test fix

Description Denis 2022-11-17 08:04:28 UTC
Created attachment 303190 [details]
photo of errors on resume

It seems like changes made here [1] breake resume from suspend on my laptop. 
Archlinux kernel 6.0.6: resumes fine
Archlinux kernel 6.0.7 - 6.1.0-rc5-1-mainline: hangs on resume, laptop appears to stuck, nothing works except GUI displayed but not updated and I get errors saying something like
RIP: 0010:ucsi_resume+0x2a/0x70
see attached photo

Lenovo ThinkBook 13s-IML

If it's inappropriate to report such issue here, could you please guide me how to report, I'm totally new to kernel issue reporting.

1. - https://bugzilla.kernel.org/show_bug.cgi?id=210425
Comment 1 Heikki Krogerus 2022-11-17 09:06:38 UTC
Can you blacklist typec_ucsi and ucsi_acpi modules to confirm that it really is a ucsi problem?
Comment 2 Denis 2022-11-17 10:36:04 UTC
Yep, blacklisting these modules fix the problem.
Comment 3 Roman Belikin 2022-11-19 03:02:17 UTC
Hi, I got the similar issue, that I've explained here - https://bbs.archlinux.org/viewtopic.php?id=281375
Blacklisting this module also helps me
Comment 4 Heikki Krogerus 2022-11-21 10:45:41 UTC
(In reply to Roman Belikin from comment #3)
> Hi, I got the similar issue, that I've explained here -
> https://bbs.archlinux.org/viewtopic.php?id=281375
> Blacklisting this module also helps me

I think that problem is related to bug 216706 (maybe). I'll figure out a fix for that first. Let's see if it helps with this problem as well.
Comment 5 The Linux kernel's regression tracker (Thorsten Leemhuis) 2022-12-01 10:48:23 UTC
(In reply to Heikki Krogerus from comment #4)

> I think that problem is related to bug 216706 (maybe). I'll figure out a fix
> for that first. Let's see if it helps with this problem as well.

What the status here? was this ever resolved?
Comment 6 Heikki Krogerus 2022-12-01 12:57:29 UTC
There is a fix for bug 216706, but it hasn't made it into the mainline nor the stable kernels yet. Can somebody test that fix separately, if it helps with this bug as well?
https://bugzilla.kernel.org/attachment.cgi?id=303247
Comment 7 The Linux kernel's regression tracker (Thorsten Leemhuis) 2022-12-10 10:59:42 UTC
(In reply to Heikki Krogerus from comment #6)
> There is a fix for bug 216706, but it hasn't made it into the mainline nor
> the stable kernels yet. Can somebody test that fix separately, if it helps
> with this bug as well?
> https://bugzilla.kernel.org/attachment.cgi?id=303247

Denis, Roman, did you try?

Heikki, just btw, there was another issue (bug 216788) where that patch helped.
Comment 8 Denis 2022-12-11 10:36:44 UTC
I would love to try, but I'm afraid I'm not experienced enough to build the kernel.
Comment 9 Alexander Chernaev 2022-12-21 20:32:37 UTC
Created attachment 303449 [details]
screenshot of error with patch

Tested with mentioned patch applied to kernel 6.1.0, unfortunately the issue is not resolved.
Patch tested: https://bugzilla.kernel.org/attachment.cgi?id=303247
Comment 10 Heikki Krogerus 2023-01-02 09:41:25 UTC
Thanks for checking that. I'll try to figure out what's happening.
Comment 11 Fan Chengwei 2023-01-24 16:02:24 UTC
I also got a similar issue, I've explained here. <https://bbs.archlinux.org/viewtopic.php?pid=2081073>.

In https://bugzilla.kernel.org/show_bug.cgi?id=216706, it has been reported that USBC resume callback takes far too long, between 650ms and 1200ms. However, after the same commit mentioned there, my laptop just freezes instead of taking a long time to resume.

Noticed you merged a patch in 6.2-rc5, but I just tried 6.2-rc5 and it didn't work.
Comment 12 Heikki Krogerus 2023-01-25 08:44:09 UTC
Created attachment 303643 [details]
Test fix

I got a bit more information related to this from Fan Chengwei on the linux-usb ml. I now have here a potential fix for the problem. Can anybody test does it work?

Thanks!
Comment 13 Oliver Reeh 2023-01-28 09:23:53 UTC
Is this fix suitable for kernel 6.1.x?
If yes then I'm willing to test it.
Comment 14 Heikki Krogerus 2023-01-30 09:17:46 UTC
(In reply to Oliver Reeh from comment #13)
> Is this fix suitable for kernel 6.1.x?
> If yes then I'm willing to test it.

Great, thanks! The patch should apply just fine on top of 6.1.x.
Comment 15 Oliver Reeh 2023-01-30 19:14:04 UTC
I figured that already ...

I'm running a patched kernel 6.1.8 for two days with lots of USB-C/Thunderbolt plugging and unplugging without any issues.
No more lockups after suspend and no more kernel oops in the logs.
Comment 16 Oliver Reeh 2023-02-02 09:07:49 UTC
The fix in kernel 6.1.9 doesn't work.

02.02.23 09:59	darkstar	kernel	RIP: 0010:ucsi_resume_work+0x2e/0x80 [typec_ucsi]

The system hangs after resuming from suspend.
Comment 17 Heikki Krogerus 2023-02-02 09:17:45 UTC
The patch for this bug has not been applied to any tree yet.
Comment 18 Oliver Reeh 2023-02-02 09:31:21 UTC
That explains it ... I thought commit 3d7f77e55da3455c8844b651e37779c90e201f48 included this fix.
Comment 19 Oliver Reeh 2023-02-03 18:39:12 UTC
No issues with kernel 6.1.9.
Comment 20 Denis 2023-02-08 07:24:29 UTC
Yep, can't reproduce with kernel 6.1.9 too.
Comment 21 Oliver Reeh 2023-02-08 08:45:00 UTC
No problems with the patch and kernel 6.1.10