Bug 204183 - [i915 bisected] Spontaneous freezing
Summary: [i915 bisected] Spontaneous freezing
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Video(Other) (show other bugs)
Hardware: All Linux
: P1 high
Assignee: drivers_video-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-16 01:17 UTC by Aliaksei Urbanski
Modified: 2019-08-21 09:52 UTC (History)
5 users (show)

See Also:
Kernel Version: 5.2.0, 5.2.1, master
Subsystem:
Regression: No
Bisected commit-id:


Attachments
kernel.config (136.37 KB, text/plain)
2019-07-16 01:17 UTC, Aliaksei Urbanski
Details
emerge --info (5.79 KB, text/plain)
2019-07-16 01:19 UTC, Aliaksei Urbanski
Details
cat /proc/cpuinfo (9.55 KB, text/plain)
2019-07-16 01:20 UTC, Aliaksei Urbanski
Details
lspci -vv (43.60 KB, text/plain)
2019-07-16 01:22 UTC, Aliaksei Urbanski
Details
drm/i915/vbt: Fix VBT parsing for the PSR section (2.15 KB, patch)
2019-07-16 22:14 UTC, dhinakaran.pandiyan
Details | Diff

Description Aliaksei Urbanski 2019-07-16 01:17:41 UTC
Created attachment 283719 [details]
kernel.config

Hello,


I use Gentoo Linux on my Acer Aspire V Nitro VN7-592G laptop.
Recently, I've updated my kernel to 5.2.0 and faced the following issue:
each minute the screen freezes from a few to tens of seconds making my laptop unusable.

Thanks to git bisect, I've found the exact commit that causes the issue:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=88a0d9606aff09d2b1c5dbe95a9df9dac44e79b6

Unfortunately, I'm not sure what's wrong with these changes, but reverting them (on fec88ab0af97) fixes the issue for me completely.

You can find some useful info about my setup in attachments.


Best regards,
Aliaksei Urbanski
Comment 1 Aliaksei Urbanski 2019-07-16 01:19:45 UTC
Created attachment 283721 [details]
emerge --info
Comment 2 Aliaksei Urbanski 2019-07-16 01:20:55 UTC
Created attachment 283723 [details]
cat /proc/cpuinfo
Comment 3 Aliaksei Urbanski 2019-07-16 01:22:22 UTC
Created attachment 283725 [details]
lspci -vv
Comment 4 Aliaksei Urbanski 2019-07-16 01:23:19 UTC
Please let me know if you need any additional info.
Thanks!
Comment 5 José Roberto de Souza 2019-07-16 02:53:38 UTC
Hi

Thanks for bisecting this, could you also share the output of /sys/kernel/debug/dri/0/i915_edp_psr_status before and after the issue happens?

Thanks
Comment 6 Aliaksei Urbanski 2019-07-16 07:40:54 UTC
Hi,

Sure, here are some results for patched kernel (with no issue):
irma-sun ~ # cat /sys/kernel/debug/dri/0/i915_edp_psr_status 
Sink support: yes [0x01]
PSR mode: PSR1 enabled
Source PSR ctl: enabled [0x81f00e26]
Source PSR status: SRDOFFACK [0xc4060016]
Busy frontbuffer bits: 0x00000000
irma-sun ~ # cat /sys/kernel/debug/dri/0/i915_edp_psr_status 
Sink support: yes [0x01]
PSR mode: PSR1 enabled
Source PSR ctl: enabled [0x81f00e26]
Source PSR status: SRDENT [0x40050006]
Busy frontbuffer bits: 0x00000000
irma-sun ~ # cat /sys/kernel/debug/dri/0/i915_edp_psr_status 
Sink support: yes [0x01]
PSR mode: PSR1 enabled
Source PSR ctl: enabled [0x81f00e26]
Source PSR status: SRDENT [0x40020006]
Busy frontbuffer bits: 0x00000000
irma-sun ~ # cat /sys/kernel/debug/dri/0/i915_edp_psr_status 
Sink support: yes [0x01]
PSR mode: PSR1 enabled
Source PSR ctl: enabled [0x81f00e26]
Source PSR status: IDLE [0x04010000]
Busy frontbuffer bits: 0x00000000

And here are for affected kernel:
irma-sun ~ # cat /sys/kernel/debug/dri/0/i915_edp_psr_status 
Sink support: yes [0x01]
PSR mode: PSR1 enabled
Source PSR ctl: enabled [0x81f00f26]
Source PSR status: IDLE [0x04010010]
Busy frontbuffer bits: 0x00000000
irma-sun ~ # cat /sys/kernel/debug/dri/0/i915_edp_psr_status 
Sink support: yes [0x01]
PSR mode: PSR1 enabled
Source PSR ctl: enabled [0x81f00f26]
Source PSR status: SRDOFFACK [0xc4030216]
Busy frontbuffer bits: 0x00000000

I see that "Source PSR ctl" was changed from "enabled [0x81f00e26]" (for the unaffected system) to "enabled [0x81f00f26]" (for the affected one).
And "Source PSR status" is changing from time to time for both.
Comment 7 José Roberto de Souza 2019-07-16 18:32:19 UTC
Hi Aliaksei

Thanks for the data, I'm asking people with the same problem to try the revert if that works I'm going to send it to stable tree.

Thanks again
Comment 8 dhinakaran.pandiyan 2019-07-16 22:14:34 UTC
Created attachment 283755 [details]
drm/i915/vbt: Fix VBT parsing for the PSR section

Can you please try if this fix works?
Comment 9 Aliaksei Urbanski 2019-07-17 05:07:47 UTC
Hello,

I confirm that suggested fix works.
Thank you!


By the way, I've failed to apply the patch as is.

mim@irma-sun /usr/src/linux $ git --version
git version 2.22.0

mim@irma-sun /usr/src/linux $ git --no-pager log --oneline -1
0a8ad0ffa4d8 (HEAD -> fix/bug-204183, origin/master, master) Merge tag 'for-linus-5.3-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux

mim@irma-sun /usr/src/linux $ patch -p1 < ~/downloads/file_204183.txt 
(Stripping trailing CRs from patch; use --binary to disable.)
patching file drivers/gpu/drm/i915/display/intel_bios.c
Hunk #1 FAILED at 766.
1 out of 1 hunk FAILED -- saving rejects to file drivers/gpu/drm/i915/display/intel_bios.c.rej
(Stripping trailing CRs from patch; use --binary to disable.)
patching file drivers/gpu/drm/i915/display/intel_vbt_defs.h
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 481.
1 out of 1 hunk FAILED -- saving rejects to file drivers/gpu/drm/i915/display/intel_vbt_defs.h.rej

mim@irma-sun /usr/src/linux $ git apply ~/downloads/file_204183.txt 
error: corrupt patch at line 51

mim@irma-sun /usr/src/linux $ git am < ~/downloads/file_204183.txt 
Applying:     drm/i915/vbt: Fix VBT parsing for the PSR section
error: corrupt patch at line 34
Patch failed at 0001     drm/i915/vbt: Fix VBT parsing for the PSR section
hint: Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


I've downloaded the diff from https://bugzilla.kernel.org/attachment.cgi?id=283755&action=diff&collapsed=&headers=1&format=raw and modified it manually in order to replace spaces with tabs where necessary.
After that I've applied the resulting file with "git apply".

I'm just curious, was there a way to apply the patch with no modification?
Comment 10 Aliaksei Urbanski 2019-07-24 21:18:46 UTC
Hello Dhinakaran,

Do you have some estimation on when the fix will be pushed to the upstream?
Comment 11 dhinakaran.pandiyan 2019-07-24 21:26:05 UTC
Sorry, I missed CC'ing you. Please see this 
https://lists.freedesktop.org/archives/intel-gfx/2019-July/206463.html

To answer your previous question, the patch most likely did not apply because your kernel (5.2.0) is missing two patches that we have on drm-tip. I have a 5.2 version of the patch posted here - https://patchwork.freedesktop.org/series/63774/#rev4
You should be able to download this version and use git-am .
Comment 12 dhinakaran.pandiyan 2019-07-24 21:27:48 UTC
And thanks a lot for the bisect, definitely made it easy to come up with a fix.
Comment 13 Jani Nikula 2019-08-21 09:52:46 UTC
Fixed upstream, on its way to stable kernels, closing.

Please note that we DO NOT look at drm/i915 bugs at https://bugzilla.kernel.org/. Please file all drm/i915 bugs at [1].

One of the clues should be that there is no "Video(Intel)" component any longer.

DK, please also close all drm/i915 bugs filed here as RESOLVED INVALID and ask bugs to be filed at fdo instead. Please don't debug them here.

[1] https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=DRM/Intel

Note You need to log in before you can comment on or make changes to this bug.