When the kernel is compiled with CONFIG_PREEMPT x11-drivers/ati-drivers-14.12-r3 floods my syslog with the error message shown bellow. I did not notice any other symptoms except (and this may be unrelated) that on a few occasions KDE froze when rebooting. I tested with kernel 3.18.8 and ati-drivers-14.12-r3. I'm unable to test with an earlier ati-drivers package at this time. To reproduce: Compile a kernel with CONFIG_PREEMPT, build ati-drivers, start xorg, and check your syslog. Workaround: Rebuild the kernel with CONFIG_PREEMPT_VOLUNTARY or CONFIG_PREEMPT_NONE and rebuild ati-drivers. Syslog messages: Mar 5 21:07:33 navi kernel: [ 1209.717173] BUG: using smp_processor_id() in preemptible [00000000] code: firegl/3657 Mar 5 21:07:33 navi kernel: [ 1209.717286] caller is KAS_GetExecutionLevel+0xd/0x20 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.717298] CPU: 1 PID: 3657 Comm: firegl Tainted: P O 3.18.8 #1 Mar 5 21:07:33 navi kernel: [ 1209.717303] Hardware name: Acer Aspire V5-122P/Aspire V5-122P, BIOS V2.12 01/20/2014 Mar 5 21:07:33 navi kernel: [ 1209.717309] 0000000000000000 ffffffff81a02448 ffffffff817e0d9f 0000000000000001 Mar 5 21:07:33 navi kernel: [ 1209.717319] ffffffff81322ea0 0000000000000000 ffffffff819db08e 00000000000123c0 Mar 5 21:07:33 navi kernel: [ 1209.717328] ffff8800bdb80000 ffffffffa011f680 ffffffffa00137bd ffff8800bdb80000 Mar 5 21:07:33 navi kernel: [ 1209.717336] Call Trace: Mar 5 21:07:33 navi kernel: [ 1209.717354] [<ffffffff817e0d9f>] ? dump_stack+0x4a/0x75 Mar 5 21:07:33 navi kernel: [ 1209.717366] [<ffffffff81322ea0>] ? check_preemption_disabled+0xf0/0x100 Mar 5 21:07:33 navi kernel: [ 1209.717541] [<ffffffffa011f680>] ? UnregisterTimerInterval_Worker+0xd0/0xd0 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.717710] [<ffffffffa00137bd>] ? KAS_GetExecutionLevel+0xd/0x20 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.717804] [<ffffffffa0032c09>] ? MCIL_GetExecutionLevel+0x39/0x80 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.717977] [<ffffffffa012d105>] ? IRQMGR_SynchronizeExecution+0x25/0x80 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718149] [<ffffffffa011d951>] ? PassiveRing_WorkerThreadRoutine+0x281/0x2d0 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718316] [<ffffffffa00eb700>] ? _ZN25ExecutableUnitsVI_Iceland9assertPM4Eb+0xf0/0xf0 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718508] [<ffffffffa012e1f9>] ? IRQMGR_WorkerThreadRoutine+0x19/0x40 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718587] [<ffffffffa000f250>] ? ip_firegl_unlocked_ioctl+0xd0/0x150 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718681] [<ffffffffa0034f7c>] ? IRQMGR_CallbackWrapper+0xc/0x20 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718758] [<ffffffffa000f2a3>] ? ip_firegl_unlocked_ioctl+0x123/0x150 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718928] [<ffffffffa012e1e0>] ? IRQMGR_QueueDpc+0x20/0x20 [fglrx] Mar 5 21:07:33 navi kernel: [ 1209.718940] [<ffffffff81063d2c>] ? kthread+0xbc/0xe0 Mar 5 21:07:33 navi kernel: [ 1209.718948] [<ffffffff81060000>] ? alloc_unbound_pwq+0x220/0x420 Mar 5 21:07:33 navi kernel: [ 1209.718957] [<ffffffff81063c70>] ? kthread_create_on_node+0x1d0/0x1d0 Mar 5 21:07:33 navi kernel: [ 1209.718966] [<ffffffff817e7eec>] ? ret_from_fork+0x7c/0xb0 Mar 5 21:07:33 navi kernel: [ 1209.718974] [<ffffffff81063c70>] ? kthread_create_on_node+0x1d0/0x1d0
I was also able to reproduce with kernel 3.18.2 with the kernel module from ati-drivers-14.12-r2.
Created attachment 398404 [details] emerge --info
Created attachment 410658 [details, diff] ati-drivers-15.7-preempt.patch Here's a patch to fix this issue. I've been using it for almost 2 months without issues. It may not cover all the cases where this may happen but at least the most common ones. I don't know if preempt.h is on earlier kernel versions (I think it was added recently since the patched file already defines it as a dummy macro when it's not found which indicates that it was defined somewhere else before), so it may be a good idea to check when it was introduced and include it only for later versions but this works for me.
The Proxy maintainer has not added comment on this, nor Gentoo X packagers. Despite the kernel 3.18 being somewhat dated now, the patch to firegl_public.c would be generic in its action. If no further contributions in following days, I shall plan to commit this patch to the package
I should add that in order to compile against the latest kernel on the 3.18 line (I've tested up to 3.18.20) you'll need two more patches. The controversial license patch[1] and the read_cr4/write_cr4 one[2]. [1] https://github.com/fernando-rodriguez/portage-overlay/blob/master/x11-drivers/ati-drivers/files/ati-drivers-license.patch [2] https://github.com/fernando-rodriguez/portage-overlay/blob/master/x11-drivers/ati-drivers/files/ati-drivers-cr4.patch
In that case the kernel team ought review and act on these. Licenses combined with kernels is above my 'pay grade' however I see the kernel team is already CC'd and appeart not to have contributed / commented. How closely is this related to bug 548118? Does it warrant being added to See Also: (add) ??
(In reply to Ian Delaney from comment #6) > In that case the kernel team ought review and act on these. Licenses > combined with kernels is above my 'pay grade' however I see the kernel team > is already CC'd and appeart not to have contributed / commented. How closely > is this related to bug 548118? Does it warrant being added to See Also: > (add) ?? Yes, that's the bug that covers those issues (my CR4 patch is cleaner so it should be easier to maintain). They started on the 4.0 kernel and where eventually backported to the long term release. I'm not sure if the other longterm kernels are affected. I think the solution would be to apply the patch and add the bindist flag to the package to disble it as was suggested on bug #548118. At least until upstream fixes the problem for good.
I posted a new patch and comments on bug #548118. It fixes the problem by not using GPL'd symbols so no need to forge the license. Maybe you can look at it.
commit 3ee13140db47e37adf0a0c7fb88c094a39cf1a83 Author: Ian Delaney <idella4@gentoo.org> Date: Wed Sep 23 17:20:32 2015 +0800 x11-drivers/ati-drivers: revbump required to ati-drivers-15.9-r1 of the ati-drivers-15.9.ebuild prepared by fernando-rodriguez in /gentoo/pull/98 Package-Manager: portage-2.2.20.1 commit 6913a35966d89d28ed6208ab9a58c20fd8a80396 Author: Fernando Rodriguez <frodriguez.developer@outlook.com> Date: Wed Sep 16 18:24:47 2015 -0400 x11-drivers/ati-drivers: Fix compile errors and preemption bug Ebuild cleanup and patches to compile against recent kernels by replacing calls that use GPL'd kernel symbols with our own implementation and several others to fix compile errors caused by API changes on recent kernels. Also adds patch to disable preemption before calling certain kernel functions that trigger the following error: BUG: using smp_processor_id() in preemptible [00000000] code:firegl/3657 Gentoo-Bug: 548118 Gentoo-Bug: 542320