Bug 70523

Summary: [ALL] race in tty register/deregister
Product: DRI Reporter: fangxun <xunx.fang>
Component: DRM/IntelAssignee: Imre Deak <imre.deak>
Status: CLOSED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: major    
Priority: high CC: christophe.prigent, intel-gfx-bugs
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg
none
fix tty unregistering lockdep
none
fix i915 i2c cleanup order
none
dmesg wiht drm.debug=14 none

Description fangxun 2013-10-16 09:04:50 UTC
Created attachment 87716 [details]
dmesg

System Environment:
--------------------------
Platform: Ivybridge
Kernel:         (drm-intel-fixes) cd66407810869709e0d6764409137d48c6812cfc

Bug detailed description:
-----------------------------
Start system with next-queued or next-fixed debug_build kernel, then run module_reload, you will see "[ INFO: possible circular locking dependency detected ]" in dmesg. It happens on next-queued and next-fixed branch.
I try to bisect, but find it also exists in kernel 3.9.0-rc6.

Reproduce steps:
---------------------------
1. start system with debug kernel
2  ./module_reload
2. see dmesg
Comment 1 Ben Widawsky 2014-01-15 00:32:46 UTC
The sysfs stuff should be fixed. Please retest.
Comment 2 Imre Deak 2014-01-15 11:43:54 UTC
Created attachment 92135 [details] [review]
fix tty unregistering lockdep

I just looked at this yesterday and could still reproduce it.

I saw two issues, a tty vt unregistering lockdep warning (also in the reporter's dmesg) and a second warning of a i915 i2c cleanup ordering issue. Attaching two patches to fix those.
Comment 3 Imre Deak 2014-01-15 11:45:37 UTC
Created attachment 92136 [details] [review]
fix i915 i2c cleanup order
Comment 4 Imre Deak 2014-01-21 12:51:38 UTC
Could you retest if the two attached patch applied on -nightly fixes the problem?
Comment 5 fangxun 2014-01-22 06:11:04 UTC
Verify the patches applied on -nightly fixes the problem.
Comment 6 Jani Nikula 2014-08-14 13:24:54 UTC
Presumed fixed with Imre's commits. Please reopen if the problem persists with recent kernels.
Comment 7 fangxun 2014-10-09 07:19:01 UTC
It still happens with recent kernels.
Comment 8 Jani Nikula 2014-10-09 08:46:36 UTC
(In reply to fangxun from comment #7)
> It still happens with recent kernels.

This is not very helpful. Please specify kernel version and attach dmesg with drm.debug=14 module parameter set on the latest kernel version tried.
Comment 9 fangxun 2014-10-09 09:11:57 UTC
Created attachment 107602 [details]
dmesg wiht drm.debug=14

I test it on ivybridge with kernel drm-intel-fixes(91e564).
Comment 10 Jesse Barnes 2014-12-10 20:46:38 UTC
Imre, any update on your fixes?
Comment 11 Imre Deak 2014-12-16 07:18:04 UTC
(In reply to Jesse Barnes from comment #10)
> Imre, any update on your fixes?

I posted an updated patchset, it's waiting for review:
https://lkml.org/lkml/2014/12/15/847
Comment 12 Jesse Barnes 2015-03-26 19:38:12 UTC
Patches are merged, even with all the discussion about how to fix the "let's deprecate it instead" fbdev etc subsystem. Yay!

commit 2cf30f752c8f73713f58796eb218cafa242d66fe
Author: Imre Deak <imre.deak@intel.com>
Date:   Tue Dec 16 00:15:59 2014 +0200

    vt: fix check for system/busy console drivers when unregistering them
Comment 13 Jesse Barnes 2015-03-26 19:52:03 UTC
Oh, the last patch still isn't merged.  Will follow up on lkml.
Comment 14 Jani Nikula 2015-10-07 12:28:10 UTC
All three merged, closing.

commit 2cf30f752c8f73713f58796eb218cafa242d66fe
Author: Imre Deak <imre.deak@intel.com>
Date:   Tue Dec 16 00:15:59 2014 +0200

    vt: fix check for system/busy console drivers when unregistering them

commit 4c215fe8e288c87b34c3d5bc910c77af586859d2
Author: Imre Deak <imre.deak@intel.com>
Date:   Tue Dec 16 00:16:00 2014 +0200

    vt: fix locking around vt_bind/vt_unbind

commit d364b5c3e446bbf9892edbb000bf4c358f86bd8b
Author: Imre Deak <imre.deak@intel.com>
Date:   Wed Apr 1 21:06:16 2015 +0300

    vt: fix console lock vs. kernfs s_active lock order

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.