You are not logged in.

#26 2016-12-13 21:35:32

teresi
Member
Registered: 2016-10-26
Posts: 10

Re: kernel error in drm_kms_helper, flip_done timed out

Downgraded the kernel to 4.7 and it now works, though many packages are now broken. Would love to know when this is fixed.

Offline

#27 2016-12-13 23:13:17

loqs
Member
Registered: 2014-03-06
Posts: 18,006

Re: kernel error in drm_kms_helper, flip_done timed out

teresi wrote:

Would love to know when this is fixed.

If an arch user affected by the issue could replicate the work from the two upstream bug reports noted in post #19 of this thread it should indicate at least if the issue is reported upstream even if a fix will not be available in the arch kernels in the foreseeable future.

Offline

#28 2016-12-15 03:02:55

teresi
Member
Registered: 2016-10-26
Posts: 10

Re: kernel error in drm_kms_helper, flip_done timed out

Quick question (I'm a noob) - since downgrading my linux kernel to 4.7 I've had a lot of issues with broken packages and packages that won't update to the latest version. Would further downgrading my kernel to linux-lts fix this issue, or make it worse?

Offline

#29 2016-12-15 08:36:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,074

Re: kernel error in drm_kms_helper, flip_done timed out

Since linux-lts is an official and maintained package, you wouldn't have the same kind of breakage since you aren't performing a partial upgrade like you do now. Most/all of the out-of-tree kernel modules have a corresponding -lts variant which can be used with the LTS kernel. However unless you specify with logs and pacman output (in a new thread) what exactly it is that is failing, it isn't really given if that would fix your issues.

Last edited by V1del (2016-12-15 08:38:04)

Offline

#30 2016-12-17 19:49:07

arti74
Member
From: Poland
Registered: 2009-10-21
Posts: 27

Re: kernel error in drm_kms_helper, flip_done timed out

I have the same problem on my Dell Latitude d630... This issue is related to the same/similar hardware as I've noticed..
What to do?

Offline

#31 2016-12-18 12:06:53

tuxayo
Member
Registered: 2013-02-26
Posts: 28

Re: kernel error in drm_kms_helper, flip_done timed out

arti74 wrote:

I have the same problem on my Dell Latitude d630... This issue is related to the same/similar hardware as I've noticed..
What to do?

By reading the previous messages, one can see that using linux-lts kernel solves the issue while waiting for a fix on mainline kernel. Have your tried that?

Offline

#32 2016-12-18 12:32:39

arti74
Member
From: Poland
Registered: 2009-10-21
Posts: 27

Re: kernel error in drm_kms_helper, flip_done timed out

Thank you for your answer. I wasn't sure about this solution, but I'll try it right after work. Thanks!

Offline

#33 2016-12-18 22:52:54

arti74
Member
From: Poland
Registered: 2009-10-21
Posts: 27

Re: kernel error in drm_kms_helper, flip_done timed out

This is a part of my dmesg after changing for 4.4.39-1-lts kernel:

[    1.770015] ------------[ cut here ]------------
[    1.770030] WARNING: CPU: 0 PID: 79 at drivers/gpu/drm/drm_irq.c:1326 drm_wait_one_vblank+0x1b0/0x1c0 [drm]()
[    1.770032] vblank wait timed out on crtc 1
[    1.770033] Modules linked in: sd_mod i915 video button i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm intel_agp intel_gtt ahci libahci libata scsi_mod
[    1.770049] CPU: 0 PID: 79 Comm: kworker/u4:2 Not tainted 4.4.39-1-lts #1
[    1.770050] Hardware name: Dell Inc. Latitude D630                   /0KU184, BIOS A17 01/04/2010
[    1.770056] Workqueue: events_unbound async_run_entry_fn
[    1.770058]  0000000000000286 00000000c44595c3 ffff88019723ba08 ffffffff812c478f
[    1.770061]  ffff88019723ba50 ffffffffa00d4272 ffff88019723ba40 ffffffff81076f82
[    1.770063]  ffff8800da165000 0000000000000001 0000000000000000 0000000000000003
[    1.770066] Call Trace:
[    1.770071]  [<ffffffff812c478f>] dump_stack+0x63/0x84
[    1.770074]  [<ffffffff81076f82>] warn_slowpath_common+0x82/0xc0
[    1.770077]  [<ffffffff8107701c>] warn_slowpath_fmt+0x5c/0x80
[    1.770080]  [<ffffffff810b6e55>] ? finish_wait+0x55/0x70
[    1.770086]  [<ffffffffa00a77c0>] drm_wait_one_vblank+0x1b0/0x1c0 [drm]
[    1.770088]  [<ffffffff810b72f0>] ? wake_atomic_t_function+0x60/0x60
[    1.770149]  [<ffffffffa01d2721>] intel_get_load_detect_pipe+0x541/0x550 [i915]
[    1.770182]  [<ffffffffa020cb71>] intel_tv_detect+0x141/0x5e0 [i915]
[    1.770188]  [<ffffffffa010bc1a>] drm_helper_probe_single_connector_modes_merge_bits+0x23a/0x4c0 [drm_kms_helper]
[    1.770192]  [<ffffffffa010beb3>] drm_helper_probe_single_connector_modes+0x13/0x20 [drm_kms_helper]
[    1.770195]  [<ffffffffa011852e>] drm_fb_helper_initial_config+0xae/0xb80 [drm_kms_helper]
[    1.770226]  [<ffffffffa01e3b4b>] intel_fbdev_initial_config+0x1b/0x20 [i915]
[    1.770229]  [<ffffffff81096fd8>] async_run_entry_fn+0x48/0x150
[    1.770232]  [<ffffffff8108ebb8>] process_one_work+0x1e8/0x440
[    1.770234]  [<ffffffff8108ee5b>] worker_thread+0x4b/0x4b0
[    1.770236]  [<ffffffff8108ee10>] ? process_one_work+0x440/0x440
[    1.770238]  [<ffffffff81094988>] kthread+0xd8/0xf0
[    1.770241]  [<ffffffff810948b0>] ? kthread_worker_fn+0x160/0x160
[    1.770244]  [<ffffffff8158f5ff>] ret_from_fork+0x3f/0x70
[    1.770246]  [<ffffffff810948b0>] ? kthread_worker_fn+0x160/0x160
[    1.770248] ---[ end trace f28705a54a8d4dc8 ]---
[    1.910015] ------------[ cut here ]------------
[    1.910022] WARNING: CPU: 0 PID: 79 at drivers/gpu/drm/drm_irq.c:1326 drm_wait_one_vblank+0x1b0/0x1c0 [drm]()
[    1.910023] vblank wait timed out on crtc 1
[    1.910024] Modules linked in: sd_mod i915 video button i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm intel_agp intel_gtt ahci libahci libata scsi_mod
[    1.910035] CPU: 0 PID: 79 Comm: kworker/u4:2 Tainted: G        W       4.4.39-1-lts #1
[    1.910037] Hardware name: Dell Inc. Latitude D630                   /0KU184, BIOS A17 01/04/2010
[    1.910039] Workqueue: events_unbound async_run_entry_fn
[    1.910041]  0000000000000286 00000000c44595c3 ffff88019723b8e0 ffffffff812c478f
[    1.910043]  ffff88019723b928 ffffffffa00d4272 ffff88019723b918 ffffffff81076f82
[    1.910046]  ffff8800da165000 0000000000000001 0000000000000000 0000000000000005
[    1.910048] Call Trace:
[    1.910051]  [<ffffffff812c478f>] dump_stack+0x63/0x84
[    1.910053]  [<ffffffff81076f82>] warn_slowpath_common+0x82/0xc0
[    1.910055]  [<ffffffff8107701c>] warn_slowpath_fmt+0x5c/0x80
[    1.910058]  [<ffffffff810b6e55>] ? finish_wait+0x55/0x70
[    1.910064]  [<ffffffffa00a77c0>] drm_wait_one_vblank+0x1b0/0x1c0 [drm]
[    1.910066]  [<ffffffff810b72f0>] ? wake_atomic_t_function+0x60/0x60
[    1.910097]  [<ffffffffa01cb8a2>] intel_pre_disable_primary+0x52/0x80 [i915]
[    1.910129]  [<ffffffffa01cbad7>] intel_pre_plane_update+0x107/0x140 [i915]
[    1.910160]  [<ffffffffa01cc068>] intel_atomic_commit+0x108/0x1430 [i915]
[    1.910163]  [<ffffffff811c1421>] ? __kmalloc_track_caller+0x31/0x230
[    1.910169]  [<ffffffffa00c0892>] ? drm_atomic_check_only+0x192/0x570 [drm]
[    1.910174]  [<ffffffffa00c0d50>] ? drm_atomic_set_fb_for_plane+0x20/0x90 [drm]
[    1.910180]  [<ffffffffa00c0ca7>] drm_atomic_commit+0x37/0x60 [drm]
[    1.910211]  [<ffffffffa01d2850>] intel_release_load_detect_pipe+0x120/0x160 [i915]
[    1.910244]  [<ffffffffa020cd84>] intel_tv_detect+0x354/0x5e0 [i915]
[    1.910248]  [<ffffffffa010bc1a>] drm_helper_probe_single_connector_modes_merge_bits+0x23a/0x4c0 [drm_kms_helper]
[    1.910252]  [<ffffffffa010beb3>] drm_helper_probe_single_connector_modes+0x13/0x20 [drm_kms_helper]
[    1.910255]  [<ffffffffa011852e>] drm_fb_helper_initial_config+0xae/0xb80 [drm_kms_helper]
[    1.910286]  [<ffffffffa01e3b4b>] intel_fbdev_initial_config+0x1b/0x20 [i915]
[    1.910289]  [<ffffffff81096fd8>] async_run_entry_fn+0x48/0x150
[    1.910291]  [<ffffffff8108ebb8>] process_one_work+0x1e8/0x440
[    1.910293]  [<ffffffff8108ee5b>] worker_thread+0x4b/0x4b0
[    1.910296]  [<ffffffff8108ee10>] ? process_one_work+0x440/0x440
[    1.910298]  [<ffffffff81094988>] kthread+0xd8/0xf0
[    1.910300]  [<ffffffff810948b0>] ? kthread_worker_fn+0x160/0x160
[    1.910302]  [<ffffffff8158f5ff>] ret_from_fork+0x3f/0x70
[    1.910304]  [<ffffffff810948b0>] ? kthread_worker_fn+0x160/0x160
[    1.910306] ---[ end trace f28705a54a8d4dc9 ]---
[    2.010015] ------------[ cut here ]------------
[    2.010022] WARNING: CPU: 0 PID: 79 at drivers/gpu/drm/drm_irq.c:1326 drm_wait_one_vblank+0x1b0/0x1c0 [drm]()
[    2.010023] vblank wait timed out on crtc 1
[    2.010024] Modules linked in: sd_mod i915 video button i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm intel_agp intel_gtt ahci libahci libata scsi_mod
[    2.010035] CPU: 0 PID: 79 Comm: kworker/u4:2 Tainted: G        W       4.4.39-1-lts #1
[    2.010036] Hardware name: Dell Inc. Latitude D630                   /0KU184, BIOS A17 01/04/2010
[    2.010039] Workqueue: events_unbound async_run_entry_fn
[    2.010040]  0000000000000286 00000000c44595c3 ffff88019723b900 ffffffff812c478f
[    2.010043]  ffff88019723b948 ffffffffa00d4272 ffff88019723b938 ffffffff81076f82
[    2.010045]  ffff8800da165000 0000000000000001 0000000000000000 0000000000000005
[    2.010048] Call Trace:
[    2.010050]  [<ffffffff812c478f>] dump_stack+0x63/0x84
[    2.010052]  [<ffffffff81076f82>] warn_slowpath_common+0x82/0xc0
[    2.010055]  [<ffffffff8107701c>] warn_slowpath_fmt+0x5c/0x80
[    2.010057]  [<ffffffff810b6e55>] ? finish_wait+0x55/0x70
[    2.010063]  [<ffffffffa00a77c0>] drm_wait_one_vblank+0x1b0/0x1c0 [drm]
[    2.010065]  [<ffffffff810b72f0>] ? wake_atomic_t_function+0x60/0x60
[    2.010096]  [<ffffffffa01c664f>] i9xx_crtc_disable+0x3f/0x450 [i915]
[    2.010127]  [<ffffffffa01c046c>] ? intel_crtc_disable_planes+0xdc/0xf0 [i915]
[    2.010158]  [<ffffffffa01cc3f3>] intel_atomic_commit+0x493/0x1430 [i915]
[    2.010161]  [<ffffffff811c1421>] ? __kmalloc_track_caller+0x31/0x230
[    2.010166]  [<ffffffffa00c0892>] ? drm_atomic_check_only+0x192/0x570 [drm]
[    2.010172]  [<ffffffffa00c0d50>] ? drm_atomic_set_fb_for_plane+0x20/0x90 [drm]
[    2.010177]  [<ffffffffa00c0ca7>] drm_atomic_commit+0x37/0x60 [drm]
[    2.010209]  [<ffffffffa01d2850>] intel_release_load_detect_pipe+0x120/0x160 [i915]
[    2.010241]  [<ffffffffa020cd84>] intel_tv_detect+0x354/0x5e0 [i915]
[    2.010245]  [<ffffffffa010bc1a>] drm_helper_probe_single_connector_modes_merge_bits+0x23a/0x4c0 [drm_kms_helper]
[    2.010249]  [<ffffffffa010beb3>] drm_helper_probe_single_connector_modes+0x13/0x20 [drm_kms_helper]
[    2.010252]  [<ffffffffa011852e>] drm_fb_helper_initial_config+0xae/0xb80 [drm_kms_helper]
[    2.010283]  [<ffffffffa01e3b4b>] intel_fbdev_initial_config+0x1b/0x20 [i915]
[    2.010286]  [<ffffffff81096fd8>] async_run_entry_fn+0x48/0x150
[    2.010288]  [<ffffffff8108ebb8>] process_one_work+0x1e8/0x440
[    2.010290]  [<ffffffff8108ee5b>] worker_thread+0x4b/0x4b0
[    2.010293]  [<ffffffff8108ee10>] ? process_one_work+0x440/0x440
[    2.010295]  [<ffffffff81094988>] kthread+0xd8/0xf0
[    2.010297]  [<ffffffff810948b0>] ? kthread_worker_fn+0x160/0x160
[    2.010299]  [<ffffffff8158f5ff>] ret_from_fork+0x3f/0x70
[    2.010301]  [<ffffffff810948b0>] ? kthread_worker_fn+0x160/0x160
[    2.010303] ---[ end trace f28705a54a8d4dca ]---

It actually looks worse than before (more call traces). Next I'll paste the output on the generic linux kernel..

Offline

#34 2016-12-18 23:08:59

arti74
Member
From: Poland
Registered: 2009-10-21
Posts: 27

Re: kernel error in drm_kms_helper, flip_done timed out

As I promised, this is the part of my dsmeg on the generic kernel (4.8.13-1-ARCH):

[   11.570263] [drm:drm_atomic_helper_commit_cleanup_done [drm_kms_helper]] *ERROR* [CRTC:29:pipe B] flip_done timed out
[   11.670430] ------------[ cut here ]------------
[   11.670447] WARNING: CPU: 0 PID: 83 at drivers/gpu/drm/drm_irq.c:1224 drm_wait_one_vblank+0x1b1/0x1c0 [drm]
[   11.670449] vblank wait timed out on crtc 1
[   11.670450] Modules linked in: i915 video button i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm intel_agp sd_mod intel_gtt ahci libahci libata scsi_mod
[   11.670476] CPU: 0 PID: 83 Comm: kworker/u4:2 Not tainted 4.8.13-1-ARCH #1
[   11.670478] Hardware name: Dell Inc. Latitude D630                   /0KU184, BIOS A17 01/04/2010
[   11.670485] Workqueue: events_unbound async_run_entry_fn
[   11.670488]  0000000000000286 0000000029a52b9f ffff8801967e39d8 ffffffff812fddc0
[   11.670494]  ffff8801967e3a28 0000000000000000 ffff8801967e3a18 ffffffff8107c85b
[   11.670500]  000004c800000000 ffff8801962f0000 0000000000000001 0000000000000000
[   11.670510] Call Trace:
[   11.670515]  [<ffffffff812fddc0>] dump_stack+0x63/0x83
[   11.670517]  [<ffffffff8107c85b>] __warn+0xcb/0xf0
[   11.670518]  [<ffffffff8107c8df>] warn_slowpath_fmt+0x5f/0x80
[   11.670521]  [<ffffffff810bffb5>] ? finish_wait+0x55/0x70
[   11.670527]  [<ffffffffa00acca1>] drm_wait_one_vblank+0x1b1/0x1c0 [drm]
[   11.670528]  [<ffffffff810c0450>] ? wake_atomic_t_function+0x60/0x60
[   11.670590]  [<ffffffffa01f8ed2>] intel_get_load_detect_pipe+0x662/0x680 [i915]
[   11.670625]  [<ffffffffa023638f>] intel_tv_detect+0x13f/0x5c0 [i915]
[   11.670629]  [<ffffffffa0121edb>] drm_helper_probe_single_connector_modes+0x27b/0x520 [drm_kms_helper]
[   11.670632]  [<ffffffffa0130a4e>] drm_fb_helper_initial_config+0xae/0x430 [drm_kms_helper]
[   11.670666]  [<ffffffffa020fa48>] intel_fbdev_initial_config+0x18/0x30 [i915]
[   11.670667]  [<ffffffff8109e647>] async_run_entry_fn+0x37/0x150
[   11.670670]  [<ffffffff81095ef5>] process_one_work+0x1e5/0x470
[   11.670671]  [<ffffffff810961c8>] worker_thread+0x48/0x4e0
[   11.670673]  [<ffffffff81096180>] ? process_one_work+0x470/0x470
[   11.670675]  [<ffffffff8109be38>] kthread+0xd8/0xf0
[   11.670677]  [<ffffffff8102c782>] ? __switch_to+0x2d2/0x630
[   11.670679]  [<ffffffff815f823f>] ret_from_fork+0x1f/0x40
[   11.670681]  [<ffffffff8109bd60>] ? kthread_worker_fn+0x170/0x170
[   11.670683] ---[ end trace d9a9d99bb88435ac ]---
[   11.855512] ------------[ cut here ]------------
[   11.855526] WARNING: CPU: 0 PID: 83 at drivers/gpu/drm/drm_irq.c:1224 drm_wait_one_vblank+0x1b1/0x1c0 [drm]
[   11.855527] vblank wait timed out on crtc 1
[   11.855529] Modules linked in: i915 video button i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm intel_agp sd_mod intel_gtt ahci libahci libata scsi_mod
[   11.855549] CPU: 0 PID: 83 Comm: kworker/u4:2 Tainted: G        W       4.8.13-1-ARCH #1
[   11.855551] Hardware name: Dell Inc. Latitude D630                   /0KU184, BIOS A17 01/04/2010
[   11.855555] Workqueue: events_unbound async_run_entry_fn
[   11.855557]  0000000000000286 0000000029a52b9f ffff8801967e3888 ffffffff812fddc0
[   11.855563]  ffff8801967e38d8 0000000000000000 ffff8801967e38c8 ffffffff8107c85b
[   11.855568]  000004c800000000 ffff8801962f0000 0000000000000001 0000000000000000
[   11.855573] Call Trace:
[   11.855578]  [<ffffffff812fddc0>] dump_stack+0x63/0x83
[   11.855581]  [<ffffffff8107c85b>] __warn+0xcb/0xf0
[   11.855585]  [<ffffffff8107c8df>] warn_slowpath_fmt+0x5f/0x80
[   11.855588]  [<ffffffff810bffb5>] ? finish_wait+0x55/0x70
[   11.855600]  [<ffffffffa00acca1>] drm_wait_one_vblank+0x1b1/0x1c0 [drm]
[   11.855608]  [<ffffffff810c0450>] ? wake_atomic_t_function+0x60/0x60
[   11.855642]  [<ffffffffa01f254f>] intel_pre_plane_update+0x15f/0x170 [i915]
[   11.855676]  [<ffffffffa01f2bc3>] intel_atomic_commit_tail+0x153/0x1050 [i915]
[   11.855679]  [<ffffffff811e245c>] ? kmem_cache_alloc_trace+0x19c/0x1b0
[   11.855712]  [<ffffffffa01fb5dd>] ? intel_prepare_plane_fb+0x16d/0x2b0 [i915]
[   11.855746]  [<ffffffffa01f3ef1>] intel_atomic_commit+0x431/0x540 [i915]
[   11.855751]  [<ffffffffa00c57b7>] ? drm_atomic_check_only+0x187/0x610 [drm]
[   11.855753]  [<ffffffff810bffb5>] ? finish_wait+0x55/0x70
[   11.855758]  [<ffffffffa00c5c77>] drm_atomic_commit+0x37/0x60 [drm]
[   11.855791]  [<ffffffffa01f8f13>] intel_release_load_detect_pipe+0x23/0x80 [i915]
[   11.855826]  [<ffffffffa023658a>] intel_tv_detect+0x33a/0x5c0 [i915]
[   11.855830]  [<ffffffffa0121edb>] drm_helper_probe_single_connector_modes+0x27b/0x520 [drm_kms_helper]
[   11.855833]  [<ffffffffa0130a4e>] drm_fb_helper_initial_config+0xae/0x430 [drm_kms_helper]
[   11.855866]  [<ffffffffa020fa48>] intel_fbdev_initial_config+0x18/0x30 [i915]
[   11.855868]  [<ffffffff8109e647>] async_run_entry_fn+0x37/0x150
[   11.855869]  [<ffffffff81095ef5>] process_one_work+0x1e5/0x470
[   11.855871]  [<ffffffff810961c8>] worker_thread+0x48/0x4e0
[   11.855872]  [<ffffffff81096180>] ? process_one_work+0x470/0x470
[   11.855874]  [<ffffffff8109be38>] kthread+0xd8/0xf0
[   11.855876]  [<ffffffff8102c782>] ? __switch_to+0x2d2/0x630
[   11.855878]  [<ffffffff815f823f>] ret_from_fork+0x1f/0x40
[   11.855879]  [<ffffffff8109bd60>] ? kthread_worker_fn+0x170/0x170
[   11.855881] ---[ end trace d9a9d99bb88435ad ]---

I have to admit, that the boot on the lts is faster, and yes - without this error on the first line..

Offline

#35 2016-12-19 22:06:54

koen.bulcke
Member
Registered: 2016-12-19
Posts: 1

Re: kernel error in drm_kms_helper, flip_done timed out

Hi,

Here a Ubuntu 16.10 user with exactly the same problem on my Dell D630 laptop (problem indeed started since the 16.10 release).

I've tried to find a temporal work-around by commenting some lines in intel_display.c , rebuilding my kernel and install it. Since then the problem seems to be gone.

See modified lines (based on input from: https://bugs.freedesktop.org/show_bug.cgi?id=96781#c8 ):

koen@beite-m1:~/ubuntukernel/ubuntu-yakkety$ find drivers -name "intel_display.c" | xargs grep -Hn "//.*KBU"
drivers/gpu/drm/i915/intel_display.c:13849:    // KBU drm_atomic_helper_wait_for_dependencies(state);
drivers/gpu/drm/i915/intel_display.c:13973:    // KBU drm_atomic_helper_commit_hw_done(state);
drivers/gpu/drm/i915/intel_display.c:13982:    // KBU drm_atomic_helper_commit_cleanup_done(state);
drivers/gpu/drm/i915/intel_display.c:14056:    // KBU ret = drm_atomic_helper_setup_commit(state, nonblock);
drivers/gpu/drm/i915/intel_display.c:14057:    // KBU if (ret)
drivers/gpu/drm/i915/intel_display.c:14058:    // KBU     return ret;
koen@beite-m1:~/ubuntukernel/ubuntu-yakkety$

get the source with:  git clone git://kernel.ubuntu.com/ubuntu/ubuntu-yakkety.git ; it (currently) downloads kernel 4.8.0-30 .

Maybe somebody can download "your" Arch kernel source, apply same work-around and build your kernel again from source and see if that works as work-around.

Just my two cents,

Br,  Koen.

Last edited by koen.bulcke (2016-12-19 22:22:39)

Offline

#36 2016-12-21 08:40:54

scottrix
Member
Registered: 2016-12-21
Posts: 1

Re: kernel error in drm_kms_helper, flip_done timed out

Just upgraded to 4.8.13-1 and everything (as far as I can tell) is fine.

Offline

#37 2016-12-21 20:29:39

step
Member
Registered: 2016-05-09
Posts: 56

Re: kernel error in drm_kms_helper, flip_done timed out

Someone resolve without downgrade kernel?

Offline

#38 2016-12-22 00:11:23

ludenticus
Member
Registered: 2013-05-14
Posts: 20

Re: kernel error in drm_kms_helper, flip_done timed out

A Dell Inspiron 1525 running a Pentium T4300 @ 2.1 GHz & i965GM (Mesa 13.0.2) shows still the same drm_kms_helper problem with latest kernel (4.8.13-1). Using the LTS (4.4.39-1-lts) solves the issue.

Last edited by ludenticus (2016-12-22 00:15:47)

Offline

#39 2016-12-24 18:56:46

sofiasmith
Member
Registered: 2016-02-02
Posts: 7

Re: kernel error in drm_kms_helper, flip_done timed out

On my old laptop Acer 2008 I have Arch + Mint + Centos + Fedora + Debian + Slackware.

This bug occurs with kernel 4.8.x (Fedora & Arch). On others distros with older (slack & mint 4.4.x) and very older (centos and debian 3.x) kernels does not have this problem.

My solution for arch was: Or downgrade to 4.7.6 or install linux-lts.

And, also, I think the folks from kernel.org must solve this issue. On linux 5.0?

PS.: Issue with 4.8.x: Boot takes 30 seconds more than lts. Message kernel eror in drm.... and some applications frozed during 10 seconds. It is NOT a serious problem.

Offline

#40 2016-12-24 19:27:07

loqs
Member
Registered: 2014-03-06
Posts: 18,006

Re: kernel error in drm_kms_helper, flip_done timed out

sofiasmith wrote:

And, also, I think the folks from kernel.org must solve this issue. On linux 5.0?

https://bugs.freedesktop.org/show_bug.cgi?id=96781#c22
Upstream is waiting for someone with the relevant hardware to confirm that at least that part of the issue is fixed by the proposed patch.
Until someone affected confirms it improves the situation upstream will not commit the patch.
https://bugs.freedesktop.org/show_bug.cgi?id=97529#c34 contains the patch for the other upstream bug report mentioned in post #19 of this thread that bug report is now marked as fixed but again it appears no affected arch user has tested it.
As 97529 was marked as fixed that means its patch was accepted upstream but the patch does not make the 4.10 merge window so possibly 4.11 or possibly an earlier stable series.

Offline

#41 2016-12-26 03:19:59

sofiasmith
Member
Registered: 2016-02-02
Posts: 7

Re: kernel error in drm_kms_helper, flip_done timed out

To loqs:

I'll test on my laptop if anybody builds the patch to a binary for install with pacman -U *

My email is: sofiasmith at usa dot com

As soon as I'll receive the binary I'll test and I'll reply the result.

Offline

#42 2016-12-26 11:46:45

loqs
Member
Registered: 2014-03-06
Posts: 18,006

Re: kernel error in drm_kms_helper, flip_done timed out

$ sudo pacman -S abs base-devel
$ mkdir builds
$ cd builds
$ sudo abs core/linux
$ cp -r /var/abs/core/linux .
$ cd linux

replace the PKGBUILD with

# Id: PKGBUILD 277473 2016-09-30 19:28:40Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Maintainer: Thomas Baechler <thomas@archlinux.org>

pkgbase=linux               # Build stock -ARCH kernel
#pkgbase=linux-custom       # Build kernel with a different name
_srcname=linux-4.8
pkgver=4.8.13
pkgrel=1.5
arch=('i686' 'x86_64')
url="https://www.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'libelf')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz"
        "https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign"
        "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz"
        "https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign"
        # the main kernel config files
        'config' 'config.x86_64'
        # pacman hook for initramfs regeneration
        '99-linux.hook'
        # standard config files for mkinitcpio ramdisk
        'linux.preset'
        'change-default-console-loglevel.patch'
        fix_race_condition_in_packet_set_ring.diff
        net_handle_no_dst_on_skb_in_icmp6_send.patch
        1-2-drm-refernce-count-event--completion.patch::https://patchwork.freedesktop.org/patch/128918/raw/
        )

sha256sums=('3e9150065f193d3d94bcf46a1fe9f033c7ef7122ab71d75a7fb5a2f0c9a7e11a'
            'SKIP'
            'f0e2f7f738e1a639956e01ba7ef8d3df40ecb5c7586eb366bcd4af70049a7a3c'
            'SKIP'
            '2ac8818414beb7dbacbd3ad450c516e6ada804827132a7132f63b8189e5f5151'
            '41b9a64542befd2fea170776e8ec22a7d158dd3273633afc9b91662c448cd90a'
            '834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0'
            'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
            '1256b241cd477b265a3c2d64bdc19ffe3c9bbcee82ea3994c590c2c76e767d99'
            'ad1ee95f906f88d31fcdb9273cd08e02e8eda177449f0c98dc1bff8cbf1483c2'
            'b595a1588bafb3d732841cd1b73633970706914f57f2d215c9f1494212d13989'
            '1b343ba8e4e3b186271f4ec74b0ab693d89ec9bb9554a6f339d4f76532c91c9d')
validpgpkeys=(
              'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
              '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
             )

_kernelname=${pkgbase#linux}

prepare() {
  cd "${srcdir}/${_srcname}"

  # add upstream patch
  patch -p1 -i "${srcdir}/patch-${pkgver}"

  # fix a race condition that allows to gain root
  # https://marc.info/?l=linux-netdev&m=148054660230570&w=2
  patch -p1 -i "${srcdir}/fix_race_condition_in_packet_set_ring.diff"

  # https://bugzilla.kernel.org/show_bug.cgi?id=189851
  patch -p1 -i "${srcdir}/net_handle_no_dst_on_skb_in_icmp6_send.patch"
  
  patch -p1 -i "${srcdir}/1-2-drm-refernce-count-event--completion.patch"

  # add latest fixes from stable queue, if needed
  # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git

  # set DEFAULT_CONSOLE_LOGLEVEL to 4 (same value as the 'quiet' kernel param)
  # remove this when a Kconfig knob is made available by upstream
  # (relevant patch sent upstream: https://lkml.org/lkml/2011/7/26/227)
  patch -p1 -i "${srcdir}/change-default-console-loglevel.patch"

  if [ "${CARCH}" = "x86_64" ]; then
    cat "${srcdir}/config.x86_64" > ./.config
  else
    cat "${srcdir}/config" > ./.config
  fi

  if [ "${_kernelname}" != "" ]; then
    sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
    sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
  fi

  # set extraversion to pkgrel
  sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile

  # don't run depmod on 'make install'. We'll do this ourselves in packaging
  sed -i '2iexit 0' scripts/depmod.sh

  # get kernel version
  make prepare

  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  #make menuconfig # CLI menu for configuration
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  # ... or manually edit .config

  # rewrite configuration
  yes "" | make config >/dev/null
}

build() {
  cd "${srcdir}/${_srcname}"

  make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}

_package() {
  pkgdesc="The ${pkgbase/linux/Linux} kernel and modules"
  [ "${pkgbase}" = "linux" ] && groups=('base')
  depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
  optdepends=('crda: to set the correct wireless channels of your country')
  backup=("etc/mkinitcpio.d/${pkgbase}.preset")
  install=linux.install

  cd "${srcdir}/${_srcname}"

  KARCH=x86

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"
  _basekernel=${_kernver%%-*}
  _basekernel=${_basekernel%.*}

  mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
  cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"

  # set correct depmod command for install
  sed -e "s|%PKGBASE%|${pkgbase}|g;s|%KERNVER%|${_kernver}|g" \
    "${startdir}/${install}" > "${startdir}/${install}.pkg"
  true && install=${install}.pkg

  # install mkinitcpio preset file for kernel
  sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/linux.preset" |
    install -D -m644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"

  # install pacman hook for initramfs regeneration
  sed "s|%PKGBASE%|${pkgbase}|g" "${srcdir}/99-linux.hook" |
    install -D -m644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/99-${pkgbase}.hook"

  # remove build and source links
  rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
  # remove the firmware
  rm -rf "${pkgdir}/lib/firmware"
  # make room for external modules
  ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
  # add real version for building modules and running depmod from post_install/upgrade
  mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
  echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"

  # Now we call depmod...
  depmod -b "${pkgdir}" -F System.map "${_kernver}"

  # move module tree /lib -> /usr/lib
  mkdir -p "${pkgdir}/usr"
  mv "${pkgdir}/lib" "${pkgdir}/usr/"

  # add vmlinux
  install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
}

_package-headers() {
  pkgdesc="Header files and scripts for building modules for ${pkgbase/linux/Linux} kernel"

  install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"

  cd "${srcdir}/${_srcname}"
  install -D -m644 Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
  install -D -m644 kernel/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
  install -D -m644 .config \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/.config"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"

  for i in acpi asm-generic config crypto drm generated keys linux math-emu \
    media net pcmcia scsi soc sound trace uapi video xen; do
    cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
  done

  # copy arch includes for external modules
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
  cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"

  # copy files necessary for later builds, like nvidia and vmware
  cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
  cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"

  # fix permissions on scripts dir
  chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"

  cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"

  if [ "${CARCH}" = "i686" ]; then
    cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
  fi

  cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"

  # add docbook makefile
  install -D -m644 Documentation/DocBook/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"

  # add dm headers
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
  cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"

  # add inotify.h
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
  cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"

  # add wireless headers
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
  cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"

  # add dvb headers for external modules
  # in reference to:
  # http://bugs.archlinux.org/task/9912
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
  cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
  # and...
  # http://bugs.archlinux.org/task/11194
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
  cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"

  # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  # in reference to:
  # http://bugs.archlinux.org/task/13146
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
  cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"

  # add dvb headers
  # in reference to:
  # http://bugs.archlinux.org/task/20402
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
  cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
  cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
  cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"

  # add xfs and shmem for aufs building
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
  # removed in 3.17 series
  # cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"

  # copy in Kconfig files
  for i in $(find . -name "Kconfig*"); do
    mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
    cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
  done

  # add objtool for external module building and enabled VALIDATION_STACK option
  if [ -f tools/objtool/objtool ];  then
      mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/tools/objtool"
      cp -a tools/objtool/objtool ${pkgdir}/usr/lib/modules/${_kernver}/build/tools/objtool/
  fi

  chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
  find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;

  # strip scripts directory
  find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
    case "$(file -bi "${binary}")" in
      *application/x-sharedlib*) # Libraries (.so)
        /usr/bin/strip ${STRIP_SHARED} "${binary}";;
      *application/x-archive*) # Libraries (.a)
        /usr/bin/strip ${STRIP_STATIC} "${binary}";;
      *application/x-executable*) # Binaries
        /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
    esac
  done

  # remove unneeded architectures
  rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}

  # remove a files already in linux-docs package
  rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild/Kconfig.recursion-issue-01"
  rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild/Kconfig.recursion-issue-02"
  rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild/Kconfig.select-break"
}

_package-docs() {
  pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase/linux/Linux} kernel"

  cd "${srcdir}/${_srcname}"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
  cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
  find "${pkgdir}" -type f -exec chmod 444 {} \;
  find "${pkgdir}" -type d -exec chmod 755 {} \;

  # remove a file already in linux package
  rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
}

pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
for _p in ${pkgname[@]}; do
  eval "package_${_p}() {
    $(declare -f "_package${_p#${pkgbase}}")
    _package${_p#${pkgbase}}
  }"
done

# vim:set ts=8 sts=2 sw=2 et:

This PKGBUILD has been modified to download and apply the patch

$ makepkg -s --skippgpcheck

This should build a patched kernel you can install with pacman -U
edit:
added -s option to makepkg

Last edited by loqs (2016-12-26 11:49:26)

Offline

#43 2016-12-27 02:00:23

sofiasmith
Member
Registered: 2016-02-02
Posts: 7

Re: kernel error in drm_kms_helper, flip_done timed out

After seven hours compiling, I've installed the patched kernel, and the "... atomic helper ..." ERROR still appears at booting.

My boot time in linux-lts = 30 sec.

In linux 4.8.15 = 65 sec.

In linux 4.8.15 "patched" = 45 sec.

Thanks for all loqs, but I've lost a lot of time with compiling patch, and I'll continue with linux-lts.

Offline

#44 2016-12-27 02:22:30

loqs
Member
Registered: 2014-03-06
Posts: 18,006

Re: kernel error in drm_kms_helper, flip_done timed out

https://bugs.freedesktop.org/show_bug.cgi?id=96781#c19

Typed up a patch to avoid the oops and make the nonblocking helpers more robust:

https://patchwork.freedesktop.org/patch/128918/

There will still be warnings in dmesg (and timeouts), but the driver should at least survive.

For the vblank timeout issue itself I think the best approach is to bisect what fixed it, and then backport that.

If it did that much please let upstream know,  if it did not please let them know that as well.
Please also attach a dmesg from a run of the patched kernel for upstream to examine.
Otherwise upstream will just keep waiting until someone else affected by the issue provides the information.
Edit:
Addressing why I did not provide you with a prebuilt package:
How would you personally then be able to verify that the patch you were meant to be testing was present in the supplied built package?
Life_is_a_two-way_street  and the link http://slash7.com/2006/12/22/vampires/ I do not wish to face sanction for enabling behavior.

Last edited by loqs (2016-12-27 02:38:06)

Offline

#45 2016-12-27 14:19:59

Erroneous
Member
Registered: 2006-08-28
Posts: 35

Re: kernel error in drm_kms_helper, flip_done timed out

According to the last comment in the bug thread:

https://bugs.freedesktop.org/show_bug.cgi?id=96781#c22 wrote:

Yeah, as soon as that has a tested-by (and note that it only fixes the hard crash/oops, there wills till be timeouts) I can apply it and stuff it into the stable kernel queue.

(emphasis mine)

So even if the patch works you'll still get timeouts, but it shouldn't crash. I'm building the patched kernel loqs provided and should be able to test in the next day or so and send feedback. Has anyone tried drm-tip as suggested in https://bugs.freedesktop.org/show_bug.cgi?id=96781#c17? How about the linux-drm-intel-nightly AUR package? I'm in the process of building linux-drm-intel-nightly and the patched 4.8.13 PKGBUILD loqs provided. I should be able to test within a couple of days.

Offline

#46 2016-12-27 18:28:57

loqs
Member
Registered: 2014-03-06
Posts: 18,006

Re: kernel error in drm_kms_helper, flip_done timed out

This should help build drm-tip using the configs, preset and install file for linux 4.9 currently in testing

$ sudo abs testing/linux
$ mkdir -p builds/linux-tip
$ cd builds/linux-tip/
$ cp /var/abs/testing/linux/linux.preset linux-tip.preset
$ cp /var/abs/testing/linux/linux.install .
$ cp /var/abs/testing/linux/config .
$ cp /var/abs/testing/linux/config.x86_64 .

contents of PKGBUILD based on the linux-git PKGBUILD below tested  only as far as successfully building the package

# Maintainer: Boohbah <boohbah at gmail.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Jonathan Chan <jyc@fastmail.fm>
# Contributor: misc <tastky@gmail.com>
# Contributor: NextHendrix <cjones12 at sheffield.ac.uk>

pkgbase=linux-tip
_srcname=drm-tip
pkgver=r648211.5ef04beec703
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'libelf')
options=('!strip')
source=('git+https://anongit.freedesktop.org/git/drm-tip.git'
        # the main kernel config files
        'config' 'config.x86_64'
        # standard config files for mkinitcpio ramdisk
        "${pkgbase}.preset")
sha256sums=('SKIP'
            '42e99e3f9f09a18d333352dfc01f12380cfdaf83ad14a1ba8fc83d1db9001343'
            'faff71d141ede8cd29713035cd504b96d2edc8c85e413dc19da15762973f6905'
            'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')

_kernelname=${pkgbase#linux}

pkgver() {
  cd "${_srcname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${_srcname}"

  if [ "${CARCH}" = "x86_64" ]; then
    cat "${srcdir}/config.x86_64" > ./.config
  else
    cat "${srcdir}/config" > ./.config
  fi

  # set localversion to git commit
  sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-${pkgver##*.}\"|g" ./.config
  sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config

  # don't run depmod on 'make install'. We'll do this ourselves in packaging
  sed -i '2iexit 0' scripts/depmod.sh

  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  #make menuconfig # CLI menu for configuration
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  make olddefconfig # old config from previous kernel, defaults for new options
  # ... or manually edit .config

  # get kernel version
  make prepare

  # rewrite configuration
  yes "" | make config >/dev/null
}

build() {
  cd "${_srcname}"

  make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}

_package() {
  pkgdesc="The Linux kernel and modules (git version)"
  depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
  optdepends=('crda: to set the correct wireless channels of your country')
  provides=('linux')
  backup=("etc/mkinitcpio.d/${pkgbase}.preset")
  install=linux.install

  cd "${_srcname}"

  KARCH=x86

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"
  _basekernel=${_kernver%%-*}
  _basekernel=${_basekernel%.*}

  mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
  cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"

  # set correct depmod command for install
  cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
  true && install=${install}.pkg
  sed \
    -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
    -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
    -i "${startdir}/${install}"

  # install mkinitcpio preset file for kernel
  install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
  sed \
    -e "1s|'linux.*'|'${pkgbase}'|" \
    -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
    -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
    -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"

  # remove build and source links
  rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
  # remove the firmware
  rm -rf "${pkgdir}/lib/firmware"
  # make room for external modules
  ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
  # add real version for building modules and running depmod from post_install/upgrade
  mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
  echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"

  # Now we call depmod...
  depmod -b "${pkgdir}" -F System.map "${_kernver}"

  # move module tree /lib -> /usr/lib
  mkdir -p "${pkgdir}/usr"
  mv "${pkgdir}/lib" "${pkgdir}/usr/"

  # add vmlinux
  install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux" 

  # add System.map
  install -D -m644 System.map "${pkgdir}/boot/System.map-${_kernver}"
}

_package-headers() {
  pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"
  provides=('linux-headers')

  install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"

  cd "${_srcname}"
  install -D -m644 Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
  install -D -m644 kernel/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
  install -D -m644 .config \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/.config"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"

  for i in acpi asm-generic config crypto drm generated keys linux math-emu \
    media net pcmcia scsi sound trace uapi video xen; do
    cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
  done

  # copy arch includes for external modules
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
  cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"

  # copy files necessary for later builds, like nvidia and vmware
  cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
  cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"

  # fix permissions on scripts dir
  chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"

  cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"

  if [ "${CARCH}" = "i686" ]; then
    cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
  fi

  cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"

  # add docbook makefile
  install -D -m644 Documentation/DocBook/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"

  # add dm headers
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
  cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"

  # add inotify.h
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
  cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"

  # add wireless headers
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
  cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"

  # add dvb headers for external modules
  # in reference to:
  # http://bugs.archlinux.org/task/9912
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
  cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
  # and...
  # http://bugs.archlinux.org/task/11194
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
  cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"

  # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  # in reference to:
  # http://bugs.archlinux.org/task/13146
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
  cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"

  # add dvb headers
  # in reference to:
  # http://bugs.archlinux.org/task/20402
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
  cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
  cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
  cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"

  # add xfs and shmem for aufs building
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
  # removed in 3.17 series
  # cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"

  # copy in Kconfig files
  for i in $(find . -name "Kconfig*"); do
    mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
    cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
  done

  # Fix file conflict with -doc package
  rm "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild"/Kconfig.*-*

  # Add objtool for CONFIG_STACK_VALIDATION
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/tools"
  cp -a tools/objtool "${pkgdir}/usr/lib/modules/${_kernver}/build/tools"

  chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
  find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;

  # strip scripts directory
  find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
    case "$(file -bi "${binary}")" in
      *application/x-sharedlib*) # Libraries (.so)
        /usr/bin/strip ${STRIP_SHARED} "${binary}";;
      *application/x-archive*) # Libraries (.a)
        /usr/bin/strip ${STRIP_STATIC} "${binary}";;
      *application/x-executable*) # Binaries
        /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
    esac
  done

  # remove unneeded architectures
  rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
}

_package-docs() {
  pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel (git version)"
  provides=('linux-docs')

  cd "${_srcname}"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
  cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
  find "${pkgdir}" -type f -exec chmod 444 {} \;
  find "${pkgdir}" -type d -exec chmod 755 {} \;

  # remove a file already in linux package
  rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
}

pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
for _p in ${pkgname[@]}; do
  eval "package_${_p}() {
    $(declare -f "_package${_p#${pkgbase}}")
    _package${_p#${pkgbase}}
  }"
done

# vim:set ts=8 sts=2 sw=2 et:

Edit:
See Makepkg#MAKEFLAGS to reduce build times by running jobs in parallel.

Last edited by loqs (2016-12-27 19:03:34)

Offline

#47 2016-12-29 14:53:39

Erroneous
Member
Registered: 2006-08-28
Posts: 35

Re: kernel error in drm_kms_helper, flip_done timed out

I slightly modified the PKGBUILD for drm-tip provided by loqs to include the patch and still get crashes. Here's my PKGBUILD:

# Maintainer: Boohbah <boohbah at gmail.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Jonathan Chan <jyc@fastmail.fm>
# Contributor: misc <tastky@gmail.com>
# Contributor: NextHendrix <cjones12 at sheffield.ac.uk>

pkgbase=linux-tip
_srcname=drm-tip
pkgver=r648225.584adc8f6687
pkgrel=1
arch=('i686' 'x86_64')
url="http://www.kernel.org/"
license=('GPL2')
makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'libelf')
options=('!strip')
source=('git+https://anongit.freedesktop.org/git/drm-tip.git'
        # the main kernel config files
        'config' 'config.x86_64'
        # standard config files for mkinitcpio ramdisk
        "${pkgbase}.preset"
        1-2-drm-refernce-count-event--completion.patch::https://patchwork.freedesktop.org/patch/128918/raw/
        )
sha256sums=('SKIP'
            '42e99e3f9f09a18d333352dfc01f12380cfdaf83ad14a1ba8fc83d1db9001343'
            'faff71d141ede8cd29713035cd504b96d2edc8c85e413dc19da15762973f6905'
            'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
            '1b343ba8e4e3b186271f4ec74b0ab693d89ec9bb9554a6f339d4f76532c91c9d'
            )

_kernelname=${pkgbase#linux}

pkgver() {
  cd "${_srcname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${_srcname}"

   patch -p1 -i "${srcdir}/1-2-drm-refernce-count-event--completion.patch"

  if [ "${CARCH}" = "x86_64" ]; then
    cat "${srcdir}/config.x86_64" > ./.config
  else
    cat "${srcdir}/config" > ./.config
  fi

  # set localversion to git commit
  sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-${pkgver##*.}\"|g" ./.config
  sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config

  # don't run depmod on 'make install'. We'll do this ourselves in packaging
  sed -i '2iexit 0' scripts/depmod.sh

  # load configuration
  # Configure the kernel. Replace the line below with one of your choice.
  #make menuconfig # CLI menu for configuration
  #make nconfig # new CLI menu for configuration
  #make xconfig # X-based configuration
  #make oldconfig # using old config from previous kernel version
  make olddefconfig # old config from previous kernel, defaults for new options
  # ... or manually edit .config

  # get kernel version
  make prepare

  # rewrite configuration
  yes "" | make config >/dev/null
}

build() {
  cd "${_srcname}"

  make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}

_package() {
  pkgdesc="The Linux kernel and modules (git version)"
  depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
  optdepends=('crda: to set the correct wireless channels of your country')
  provides=('linux')
  backup=("etc/mkinitcpio.d/${pkgbase}.preset")
  install=linux.install

  cd "${_srcname}"

  KARCH=x86

  # get kernel version
  _kernver="$(make LOCALVERSION= kernelrelease)"
  _basekernel=${_kernver%%-*}
  _basekernel=${_basekernel%.*}

  mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
  make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
  cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"

  # set correct depmod command for install
  cp -f "${startdir}/${install}" "${startdir}/${install}.pkg"
  true && install=${install}.pkg
  sed \
    -e  "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
    -e  "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \
    -i "${startdir}/${install}"

  # install mkinitcpio preset file for kernel
  install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
  sed \
    -e "1s|'linux.*'|'${pkgbase}'|" \
    -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \
    -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \
    -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \
    -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"

  # remove build and source links
  rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build}
  # remove the firmware
  rm -rf "${pkgdir}/lib/firmware"
  # make room for external modules
  ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
  # add real version for building modules and running depmod from post_install/upgrade
  mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}"
  echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"

  # Now we call depmod...
  depmod -b "${pkgdir}" -F System.map "${_kernver}"

  # move module tree /lib -> /usr/lib
  mkdir -p "${pkgdir}/usr"
  mv "${pkgdir}/lib" "${pkgdir}/usr/"

  # add vmlinux
  install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux" 

  # add System.map
  install -D -m644 System.map "${pkgdir}/boot/System.map-${_kernver}"
}

_package-headers() {
  pkgdesc="Header files and scripts for building modules for Linux kernel (git version)"
  provides=('linux-headers')

  install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}"

  cd "${_srcname}"
  install -D -m644 Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile"
  install -D -m644 kernel/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/kernel/Makefile"
  install -D -m644 .config \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/.config"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include"

  for i in acpi asm-generic config crypto drm generated keys linux math-emu \
    media net pcmcia scsi sound trace uapi video xen; do
    cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/"
  done

  # copy arch includes for external modules
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86"
  cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/"

  # copy files necessary for later builds, like nvidia and vmware
  cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build"
  cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build"

  # fix permissions on scripts dir
  chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel"

  cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"

  if [ "${CARCH}" = "i686" ]; then
    cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/"
  fi

  cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/"

  # add docbook makefile
  install -D -m644 Documentation/DocBook/Makefile \
    "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"

  # add dm headers
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"
  cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md"

  # add inotify.h
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux"
  cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/"

  # add wireless headers
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"
  cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/"

  # add dvb headers for external modules
  # in reference to:
  # http://bugs.archlinux.org/task/9912
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core"
  cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/"
  # and...
  # http://bugs.archlinux.org/task/11194
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"
  cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/"

  # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
  # in reference to:
  # http://bugs.archlinux.org/task/13146
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  cp drivers/media/dvb-frontends/lgdt330x.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"
  cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/"

  # add dvb headers
  # in reference to:
  # http://bugs.archlinux.org/task/20402
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb"
  cp drivers/media/usb/dvb-usb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends"
  cp drivers/media/dvb-frontends/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners"
  cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/"

  # add xfs and shmem for aufs building
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs"
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm"
  # removed in 3.17 series
  # cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h"

  # copy in Kconfig files
  for i in $(find . -name "Kconfig*"); do
    mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'`
    cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}"
  done

  # Fix file conflict with -doc package
  rm "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/kbuild"/Kconfig.*-*

  # Add objtool for CONFIG_STACK_VALIDATION
  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/tools"
  cp -a tools/objtool "${pkgdir}/usr/lib/modules/${_kernver}/build/tools"

  chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build"
  find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \;

  # strip scripts directory
  find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do
    case "$(file -bi "${binary}")" in
      *application/x-sharedlib*) # Libraries (.so)
        /usr/bin/strip ${STRIP_SHARED} "${binary}";;
      *application/x-archive*) # Libraries (.a)
        /usr/bin/strip ${STRIP_STATIC} "${binary}";;
      *application/x-executable*) # Binaries
        /usr/bin/strip ${STRIP_BINARIES} "${binary}";;
    esac
  done

  # remove unneeded architectures
  rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa}
}

_package-docs() {
  pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel (git version)"
  provides=('linux-docs')

  cd "${_srcname}"

  mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build"
  cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build"
  find "${pkgdir}" -type f -exec chmod 444 {} \;
  find "${pkgdir}" -type d -exec chmod 755 {} \;

  # remove a file already in linux package
  rm -f "${pkgdir}/usr/lib/modules/${_kernver}/build/Documentation/DocBook/Makefile"
}

pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
for _p in ${pkgname[@]}; do
  eval "package_${_p}() {
    $(declare -f "_package${_p#${pkgbase}}")
    _package${_p#${pkgbase}}
  }"
done

# vim:set ts=8 sts=2 sw=2 et:

Steps to reproduce:

$ sudo abs testing/linux
$ mkdir -p builds/linux-tip
$ cd builds/linux-tip/
$ cp /var/abs/testing/linux/linux.preset linux-tip.preset
$ cp /var/abs/testing/linux/linux.install .
$ cp /var/abs/testing/linux/config .
$ cp /var/abs/testing/linux/config.x86_64 .
$ cat > PKGBUILD
(paste PKGBUILD contents, hit ctrl+c)
$ makepkg -s --skippgpcheck
# pacman -U linux-tip-r648225.584adc8f6687-1-x86_64.pkg.tar.xz
# depmod 4.10.0-rc1-5ef04beec703
# mkinitcpio -p linux-tip
(edit boot manager to be able to reboot to it, add drm.enable=0x1e log_buf_len=1M to kernel command line)
(reboot)

Offline

#48 2016-12-29 16:19:05

loqs
Member
Registered: 2014-03-06
Posts: 18,006

Re: kernel error in drm_kms_helper, flip_done timed out

Try adding the patch from 97529#c34 to drm-tip?
source section

128453.patch::https://bugs.freedesktop.org/attachment.cgi?id=128453

sha256sums section

'62905a366d2f74a60b276df5a74c5d68fad7b7740a21e44ac6d8e093d73df5c5'

prepare section

patch -p1 -i "${srcdir}/128453.patch"

Edit would also send upstream the dmesg's from a run with and without 1-2-drm-refernce-count-event--completion.patch applied to 4.8.13 or 4.9 perhaps they will see something in it.

Last edited by loqs (2016-12-29 16:29:20)

Offline

#49 2017-01-19 07:57:16

gandalf3
Member
From: ~/
Registered: 2013-05-18
Posts: 34

Re: kernel error in drm_kms_helper, flip_done timed out

I ran into this on an old dell laptop with kernel 4.8.13.

Applying the patch from 96781#c20 to 4.8.13 got rid of the "flip done" timeout for me, which seemed to be the main cause of the hangs. I still get the warning tracebacks though, accompanied by a visible, but far shorter hang (<1 second).

Last edited by gandalf3 (2017-01-19 07:58:31)

Offline

#50 2017-02-08 15:04:49

cdown
Member
From: London, England
Registered: 2013-02-09
Posts: 55
Website

Re: kernel error in drm_kms_helper, flip_done timed out

I've now released linux-zen-flipdone on the AUR with an updated version of the patch at https://bugs.freedesktop.org/show_bug.cgi?id=96781#c20. I will maintain this until a proper fix enters mainline.

Offline

Board footer

Powered by FluxBB