Bug 102022

Summary: [HSW] i915: null pointer in intel_dp_max_link_rate+0x5/0x80
Product: DRI Reporter: sassmann
Component: DRM/IntelAssignee: Dhinakaran Pandiyan <dhinakaran.pandiyan>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium CC: dhinakaran.pandiyan, intel-gfx-bugs
Version: XOrg git   
Hardware: Other   
OS: All   
Whiteboard: ReadyForDev
i915 platform: HSW i915 features: power/suspend-resume
Attachments:
Description Flags
dmesg.txt
none
dmesg-drmdebug none

Description sassmann 2017-08-03 07:19:29 UTC
After switching display inputs on the monitor (Dell U3415W) the screen wouldn't come back from standby. Reproduced this with drm-tip (fcb630a80579faf6d12ee62cb49bd7a4acff41e6)
The following was in the log:

[34165.674696] BUG: unable to handle kernel NULL pointer dereference at 0000000000000088
[34165.674742] IP: intel_dp_max_link_rate+0x5/0x80 [i915]
[34165.674744] PGD 65f27f067·
[34165.674744] P4D 65f27f067·
[34165.674745] PUD 63c8d2067·
[34165.674746] PMD 0·

[34165.674748] Oops: 0000 [#1] SMP
[34165.674750] Modules linked in: rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache veth rfcomm fuse xt_CHECKSUM tun ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_addrtype br_netfilter ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack overlay ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack libcrc32c iptable_mangle iptable_raw iptable_security ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep rmi_smbus rmi_core vfat fat arc4 intel_rapl x86_pkg_temp_thermal intel_powerclamp uvcvideo coretemp videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core iTCO_wdt iTCO_vendor_support kvm_intel mei_wdt snd_hda_codec_realtek
[34165.674780]  kvm snd_hda_codec_generic snd_hda_codec_hdmi btusb videodev irqbypass btrtl iwlmvm btbcm intel_cstate btintel snd_hda_intel mac80211 snd_hda_codec intel_uncore bluetooth media snd_hda_core iwlwifi intel_rapl_perf snd_hwdep snd_seq ecdh_generic joydev pcspkr snd_seq_device cfg80211 snd_pcm thinkpad_acpi tpm_tis tpm_tis_core snd_timer tpm rfkill snd mei_me ie31200_edac soundcore mei i2c_i801 shpchp lpc_ich wmi_bmof target_core_mod binfmt_misc nfsd auth_rpcgss nfs_acl lockd grace sunrpc dm_crypt uas usb_storage i915 crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel serio_raw i2c_algo_bit sdhci_pci e1000e drm_kms_helper sdhci mmc_core drm ptp pps_core wmi video
[34165.674812] CPU: 1 PID: 6642 Comm: Xorg Not tainted 4.13.0-rc3+ #6
[34165.674814] Hardware name: LENOVO 20EGS0R60P/20EGS0R60P, BIOS GNET83WW (2.31 ) 05/03/2017
[34165.674815] task: ffff91f904a34c80 task.stack: ffffa80e48414000
[34165.674838] RIP: 0010:intel_dp_max_link_rate+0x5/0x80 [i915]
[34165.674840] RSP: 0018:ffffa80e48417bb8 EFLAGS: 00010286
[34165.674841] RAX: ffff91f91a658000 RBX: ffff91f91b887d00 RCX: 0000000000000303
[34165.674842] RDX: 000000000000000c RSI: ffff91f91b887d00 RDI: 0000000000000000
[34165.674843] RBP: ffffa80e48417be0 R08: 000000000001f900 R09: ffffffffc01cf1a6
[34165.674844] R10: ffffcfe94418c580 R11: 0000000000000039 R12: 0000000000000000
[34165.674844] R13: 0000000000083d60 R14: ffff91f91b887d00 R15: 0000000000000000
[34165.674846] FS:  00007f41b6b7f2c0(0000) GS:ffff91f93e240000(0000) knlGS:0000000000000000
[34165.674847] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[34165.674848] CR2: 0000000000000088 CR3: 00000006518f5000 CR4: 00000000001406e0
[34165.674849] Call Trace:
[34165.674849] Call Trace:
[34165.674871]  ? intel_dp_mst_mode_valid+0x2c/0xa0 [i915]
[34165.674878]  drm_helper_probe_single_connector_modes+0x460/0x780 [drm_kms_helper]
[34165.674892]  drm_mode_getconnector+0x153/0x330 [drm]
[34165.674900]  ? drm_mode_connector_property_set_ioctl+0x60/0x60 [drm]
[34165.674907]  drm_ioctl_kernel+0x5d/0xb0 [drm]
[34165.674913]  drm_ioctl+0x32a/0x400 [drm]
[34165.674920]  ? drm_mode_connector_property_set_ioctl+0x60/0x60 [drm]
[34165.674923]  do_vfs_ioctl+0xa5/0x600
[34165.674925]  ? __do_page_fault+0x267/0x4c0
[34165.674927]  SyS_ioctl+0x79/0x90
[34165.674930]  entry_SYSCALL_64_fastpath+0x1a/0xa5
[34165.674931] RIP: 0033:0x7f41b44025b7
[34165.674932] RSP: 002b:00007ffd266b5f18 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[34165.674934] RAX: ffffffffffffffda RBX: 0000000000c39d88 RCX: 00007f41b44025b7
[34165.674934] RDX: 00007ffd266b5f50 RSI: 00000000c05064a7 RDI: 000000000000000c
[34165.674935] RBP: 0000000000c39d60 R08: 0000000001720f30 R09: 00000000000000c0
[34165.674936] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000084e100
[34165.674937] R13: 000000000000000b R14: 0000000000000000 R15: 00000000008445a0
[34165.674938] Code: 00 00 00 83 e1 ef 66 81 f9 0e 0a 75 e8 80 ba 1d 06 00 00 08 0f 97 c0 eb dc 0f 1f 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 <8b> 8f 88 00 00 00 44 8b 87 b0 00 00 00 85 c9 7e 35 48 63 c1 44·
[34165.674979] RIP: intel_dp_max_link_rate+0x5/0x80 [i915] RSP: ffffa80e48417bb8
[34165.674980] CR2: 0000000000000088
[34165.674981] ---[ end trace 7cd7f2a9e04abe5e ]---
Comment 1 sassmann 2017-08-03 07:20:44 UTC
Created attachment 133220 [details]
dmesg.txt
Comment 2 Elizabeth 2017-08-08 20:26:45 UTC
Hello Sassmann,
Could you please add a dmesg with drm.debug=0 parameter on grub also?
Thanks.
Comment 3 sassmann 2017-08-10 05:34:47 UTC
Created attachment 133419 [details]
dmesg-drmdebug

I assume you meant drm.debug=14 as my last dmesg didn't have any drm.debug specified.
Comment 4 Elizabeth 2017-08-10 14:54:01 UTC
(In reply to sassmann from comment #3)
> Created attachment 133419 [details]
> dmesg-drmdebug
> 
> I assume you meant drm.debug=14 as my last dmesg didn't have any drm.debug
> specified.
Hello Sassmann,
Sorry for the typo, didn't notice it. Yes, thank you for the information.

Adding tag into "Whiteboard" field - ReadyForDev
*Status is correct
*Platform is included
*Feature is included
*Priority and Severity correctly set
*Logs included
Comment 5 Dhinakaran Pandiyan 2017-08-10 18:59:04 UTC
(In reply to sassmann from comment #0)
> After switching display inputs on the monitor (Dell U3415W) the screen
> wouldn't come back from standby. Reproduced this with drm-tip

Thanks for filing this bug.

Can you please describe this a bit more in detail?
What was the display input switch that caused this?
What was the DP mode in the monitor at that time?
How did you switch the display input?
Does this happen if you don't force the mode from cmdline?

Can you please try this hack?

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 76c8a0b..197db3d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2486,7 +2486,7 @@ void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)

        if (mode != DRM_MODE_DPMS_ON) {
                ret = drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER,
-                                        DP_SET_POWER_D3);
+                                        0x5);
        } else {
                struct intel_lspcon *lspcon = dp_to_lspcon(intel_dp);
Comment 6 sassmann 2017-08-11 05:18:34 UTC
(In reply to Dhinakaran Pandiyan from comment #5)
> (In reply to sassmann from comment #0)
> > After switching display inputs on the monitor (Dell U3415W) the screen
> > wouldn't come back from standby. Reproduced this with drm-tip
> 
> Thanks for filing this bug.
> 
> Can you please describe this a bit more in detail?

Sure, same setup as in bug #90963.
Lenovo w541 docked in ThinkPad Dock with lid close (permanently).
Dell U3415W display connected via DP as the only display.

> What was the display input switch that caused this?

The Monitor has 2 DP inputs. Switching input from the DP1, the w541 is connected to, to the other DP and back is sufficient to cause this problem.

> What was the DP mode in the monitor at that time?

Setting monitor to DP 1.1 and DP 1.2 both show the problem.

> How did you switch the display input?

Via monitor on-screen menu.

> Does this happen if you don't force the mode from cmdline?

That helps, I can switch DP inputs now without a crash! I had to force monitor input at some point as otherwise the external monitor wouldn't get detected. Now it seems to work better, so I probably can remove that quirk.
 
> Can you please try this hack?

Already tried the patch from bug #90963, didn't help with this.
Comment 7 Dhinakaran Pandiyan 2017-08-15 00:39:22 UTC
(In reply to sassmann from comment #6)
> (In reply to Dhinakaran Pandiyan from comment #5)
> > (In reply to sassmann from comment #0)
> > > After switching display inputs on the monitor (Dell U3415W) the screen
> > > wouldn't come back from standby. Reproduced this with drm-tip
> > 
> > Thanks for filing this bug.
> > 
> > Can you please describe this a bit more in detail?
> 
> Sure, same setup as in bug #90963.
> Lenovo w541 docked in ThinkPad Dock with lid close (permanently).
> Dell U3415W display connected via DP as the only display.
> 
> > What was the display input switch that caused this?
> 
> The Monitor has 2 DP inputs. Switching input from the DP1, the w541 is
> connected to, to the other DP and back is sufficient to cause this problem.
> 
> > What was the DP mode in the monitor at that time?
> 
> Setting monitor to DP 1.1 and DP 1.2 both show the problem.
> 
> > How did you switch the display input?
> 
> Via monitor on-screen menu.
> 
> > Does this happen if you don't force the mode from cmdline?
> 
> That helps, I can switch DP inputs now without a crash! I had to force
> monitor input at some point as otherwise the external monitor wouldn't get
> detected. Now it seems to work better, so I probably can remove that quirk.
>  

Great! I think the problem is with the user space forcing a mode non-sink connectors.


> > Can you please try this hack?
> 
> Already tried the patch from bug #90963, didn't help with this.
Comment 8 Dhinakaran Pandiyan 2017-09-06 18:15:22 UTC
(In reply to Dhinakaran Pandiyan from comment #7)
> (In reply to sassmann from comment #6)
> > (In reply to Dhinakaran Pandiyan from comment #5)
> > > (In reply to sassmann from comment #0)
> > > > After switching display inputs on the monitor (Dell U3415W) the screen
> > > > wouldn't come back from standby. Reproduced this with drm-tip
> > > 
> > > Thanks for filing this bug.
> > > 
> > > Can you please describe this a bit more in detail?
> > 
> > Sure, same setup as in bug #90963.
> > Lenovo w541 docked in ThinkPad Dock with lid close (permanently).
> > Dell U3415W display connected via DP as the only display.
> > 
> > > What was the display input switch that caused this?
> > 
> > The Monitor has 2 DP inputs. Switching input from the DP1, the w541 is
> > connected to, to the other DP and back is sufficient to cause this problem.
> > 
> > > What was the DP mode in the monitor at that time?
> > 
> > Setting monitor to DP 1.1 and DP 1.2 both show the problem.
> > 
> > > How did you switch the display input?
> > 
> > Via monitor on-screen menu.
> > 
> > > Does this happen if you don't force the mode from cmdline?
> > 
> > That helps, I can switch DP inputs now without a crash! I had to force
> > monitor input at some point as otherwise the external monitor wouldn't get
> > detected. Now it seems to work better, so I probably can remove that quirk.
> >  
> 
> Great! I think the problem is with the user space forcing a mode non-sink
> connectors.
> 
> 
> > > Can you please try this hack?
> > 
> > Already tried the patch from bug #90963, didn't help with this.

I think we can close this bug as Rodrigo fixed the kernel crash and the monitor switching issues are being dealt in https://bugs.freedesktop.org/show_bug.cgi?id=90963

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.