From patchwork Tue Mar 8 02:54:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Nicolai_H=C3=A4hnle?= X-Patchwork-Id: 8529471 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F0386C0553 for ; Tue, 8 Mar 2016 03:47:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B9B12015E for ; Tue, 8 Mar 2016 03:47:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8516220155 for ; Tue, 8 Mar 2016 03:47:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B31626E5D4; Tue, 8 Mar 2016 03:47:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1908 seconds by postgrey-1.35 at gabe; Tue, 08 Mar 2016 03:26:44 UTC Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0084.outbound.protection.outlook.com [207.46.100.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 752906E5D1 for ; Tue, 8 Mar 2016 03:26:44 +0000 (UTC) Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from [192.168.1.109] (186.133.48.183) by CY1PR12MB0743.namprd12.prod.outlook.com (10.164.69.25) with Microsoft SMTP Server (TLS) id 15.1.427.16; Tue, 8 Mar 2016 02:54:50 +0000 Subject: Re: Oops (NULL pointer dereference) in radeon_fence_ref in 3.14.63 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Lutz Euler , References: <22235.5238.984067.269760@localhost.localdomain> <56DB3285.7050704@amd.com> From: =?UTF-8?Q?Nicolai_H=c3=a4hnle?= Message-ID: <56DE3EF2.7070609@amd.com> Date: Mon, 7 Mar 2016 23:54:42 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56DB3285.7050704@amd.com> X-Originating-IP: [186.133.48.183] X-ClientProxiedBy: CY1PR15CA0031.namprd15.prod.outlook.com (25.163.14.41) To CY1PR12MB0743.namprd12.prod.outlook.com (25.164.69.25) X-MS-Office365-Filtering-Correlation-Id: 65ea472b-1311-45c2-d22c-08d346fd0593 X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0743; 2:iaOkgW/ozyvPljjJQGVwVD7FqQlXy+lddHm/0G0j22w0lFwk79dOSHTI8uMZcZy0Ahr9C5aWnDuLp7SsjTMMvadoXXe39ph1GQ3Tu0DzXSxI0xEg2HtkQzkiaYt5WH9l4Vr9BxOttF41ytDm9aa79Xf4kGlrBB+oaX1ZZKrHM0ogtyfFXNPQxqpmnOhyLd6o; 3:Mn1hAxK1SoZtW9ozqO23NGgfk/w6FvWbmaN5mLblwfc0BuWoo054dKp78m6RGVERSYsJEDhdLXt+ZU/GTeUzp0gtcbzikDKCZEYFqeX+WbgZ/I5cXx9Zi0Z5i/2wkUPd; 25:gj4PkpSwqpSyBwGsfrMEBbpz3GmvHkyrxLKpXTHbewMPKmmoTQHqmoXiRpx/L8lxmv5myjmcCH6Bpi9pRDcjcvH6XkkWWub4hOVMMlKKAoUHqIr1W4HhaBctOJTbHPBJ8d7X1Mgd/miocwBNEH1CC7UPKmVhZw/7v0WVaOYAkD7F79ENasangHyVcZLbDwK7yJgDDrhkeDnQDf+YLfB9BUnRL2lYz0HROIKE1nOz6segSGzlVUD0/QnydBX9IsQRrSPizWZmyUhASnuQ/39FDESJ0AwbdNeE0muk7T1SmuXujGPr+V1Y+leT7Enibma4C2JmrH3C/ZGPZROJnVwNwg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0743; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0743; 20:8cVKIXpcMicO/1gPptQOemVnOD76E1+sZ2o21WuH/JUtwrkjS7mUTHZYQXvDMxUrRUwYlrS/PtiaFbou5b1VFROwshn+vFZHeFs4dp+1ctVPghH2WQUmpP/DH7Ikfk08YYOR20YBgcq6SL7x+6rA1Cv8R8hHHM+MytLV5SYwvIiDcDR2EP8+D56bL1inXcmVpIvK7DCTL9O3UnQblK37cLjFmYt/LSoWFHx0ETI1tanDhOjcLes64hI0iNgPUQ72NvzxkVgXCtTCQqN7YsYGPsVHln1YUbqiUO9AUnwyfQB/3QuToT6EWoctmlKpZ+xmIJF6O6qAOuxizyyONaLP+yb+GjH+Ox1QDo3LZYfsTBBFs4aRpkiKSxgU93Cu6ttOATb2Pzz9rFPxhUIXIGqvDH20K0YRdWc/JhTamvR86eO5xJLlORMpwCu8NGIMcVQBsu+/G1s80hOconT9/U33nFlZNo3HgKzqQTtY2U8HybnVeZJ7Tfg6izta4bT8KalT; 4:wfUnUkIlTJeiVTCEq2/UIyz2ORfWoh0BZW4i2etN5+yluzrim++nq/FJpMpZ7RisCmczSxGBEnf0pXtXYcBr8hxKk7HeYNhYwB+wnIIRBpQ+9qJijS3HsPX8FySDfY/pSvrgymlZ1rZbnaKmqJkXDsohRf+PiJlRQceU13erxHkUn5VHRDSVz+v+u16cFuOWrrwNVfSI6sORA4n9OeqptAUSwU+se4Jc50wQn9THLhQxXaGn52PNKqsSdda7xcI0JVBKKZBRGwn9y8S71xCaIB/wgiAu4QlVEIxwg54NmgOah4GK1qnUkiEeLbhrnqqBQivxBt6YRzpQGgRIu19VxI/Fc0JRQ2OL9YrfhvieZsWJIeIGJfApF57dfGXCwpcoWPWSb16sKryo3oOwJlxMr3MIDEZbNWpmDF0nKcwD19A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(102415293)(102615271)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY1PR12MB0743; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0743; X-Forefront-PRVS: 08756AC3C8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(479174004)(164054003)(5423002)(24454002)(66066001)(65956001)(2950100001)(86362001)(65806001)(575784001)(189998001)(84326002)(117156001)(36756003)(40100003)(42186005)(19580395003)(83506001)(512874002)(2906002)(19580405001)(6116002)(3846002)(64126003)(5008740100001)(87976001)(65816999)(5890100001)(50986999)(76176999)(54356999)(92566002)(4610100001)(77096005)(15975445007)(586003)(122386002)(2476003)(5001770100001)(5004730100002)(1096002)(568964002)(107886002)(81166005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0743; H:[192.168.1.109]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwNzQzOzIzOklaYlNFRFM0NGlpYjY4QjZaZHdFVTFkWG4y?= =?utf-8?B?VUluUlJBYUI4Z1B3WDFjOGZGeUJ2eUd3QXRxdytBVTdDZDZvTWh6NERiM1l3?= =?utf-8?B?Uk9rd3BjOEhwNStHcTYxcGFTbWJ4MW0rQmFxNC83Q0QrRVFybUl6K3MyMTFx?= =?utf-8?B?VXBtS2toK1RsNHVObEhhbUxFdDZkOE9uQ2VpVkw2MEMwakNJS1gwMnJmRkQy?= =?utf-8?B?a3gzN2dVdGxSck05amlQYnQreEVLU3ExZUs0VkYxN2ZhQnZQS250R21wR3VU?= =?utf-8?B?cW94elVjNDJFamJUT2dXaTJGTFNoQkN4emZZbnlNNWJBenZsZlNGWlhERWky?= =?utf-8?B?bE9ucitXMmh2b1lIK1RtbnhrbHZLWWpmOXMrZzZPaVhteURjZmtVVC9idUJp?= =?utf-8?B?K0FHeGxJNTl4bEc5TmR2Z1FoYytkMWhVbjAwVHhNaUdzZnVmUTFSVXh2bWRw?= =?utf-8?B?Qno4UEh5TTduVlhhUXV1MG1MMm9aTU1XT0xta1dkeGJOaUpvL0crbHUxbTRs?= =?utf-8?B?SHZiSHF3RUFWcW50K1A0N0ZweXRRbW10U2hXdU9uc3hHWTlLUGhBZi85VXlt?= =?utf-8?B?YmlaeXBKZW5WN3ZHcS9UVlVqV245emd6NVVTZkNBN0tmU1ZlWC9QUXp3M1VP?= =?utf-8?B?U01NRW9zOVlBYWh5MERmZzFQdzQ2STVKeExPTkdBQzVvVENhNWxzbk9lWlc1?= =?utf-8?B?YzlzTU82UDd3N1pNWVFpK205cG84bXBpUWNZTDNqMVVKck0wV0dYTVJEZmxt?= =?utf-8?B?TUgrZjFnZlhiT2tZbmtCVXRFVlB0WXZscy95aTNHZnJyajQybmNUUUJzakJ1?= =?utf-8?B?UUFISDlvNW9PU0RJMVFNZGpzdW5XQXBFdTgzYkc5MkNIamorclAyQmt3M3Bz?= =?utf-8?B?S0lOUnZqQUNuK1Y0eHIwdU1TbmpmdjIvYXVPU2w3dktGd2E1V25vL0dyYjZs?= =?utf-8?B?Qk5BL3ZiSHFJYmdQYWMzTEFPdU1BVEZKRHE5UUh6NHhsdW56YnNpMEZmN2Nt?= =?utf-8?B?UGhtNS85a1VvYVgvS2pGaHEwVGtmVFVxK29rZkFFblVuU2NFTEVqb2UzSENw?= =?utf-8?B?TkZPMnBJdTFXejRabGZmZW1RaWtpN3RsUTN6cmlpYlBhdmhsTzlmbWhwZ1hs?= =?utf-8?B?SDhMWm5hUnFUcWVWZkZnL1FvYWNvNHJINTluYWRjejRxQncrUXVjWFBNV290?= =?utf-8?B?MFFiMjM2UXBZSHF3T3pQRFhHcjdOMzZDNTg2a0hWcUpkVTNPRGRreHVxNkkw?= =?utf-8?B?SjZaQXNqcmxxbUtmRUZWcHR2RTU5UWswK2VxcDVMUjNSaHZ3RFBKWVdOWHN6?= =?utf-8?B?Tnkxc1lsa0ZmYVQvVUlUeFV1NFJCbjZFRDBoQlU4dlpQMElnUDZYamxYeFZF?= =?utf-8?B?MUIza1FHVGUzbWpiUk1ZYlNzVXZsNUhhbi80YktvWi9lOGhmOG1hOGExSmZG?= =?utf-8?B?MmhsVzY3QlZuN1lHNksySFRMTlRaYTMrQ2x0d1dZUXpENzdVbVlSdHM3V01k?= =?utf-8?B?WFlXSDB1MFNuczRlVUt2K1BBZE1IRVZ6TmdGSFpnSldrV1VDY3VBblB0QkJt?= =?utf-8?B?MTJmR09GY2tETkp0OGpvbmpmblZTemtBWmVFZnMvd2NkY1N3L0VaVHFjcVI1?= =?utf-8?B?MmlLYnl3Q1dJZVB0NXBaVG04Z3lzM3pTMXIrUjUxUzZsRmQ3QUsyUkhnPT0=?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0743; 5:xikxhuk2VwjKStYXQgWH575Q/9ltB3PToUzp365bkg+uXrvfbAXW5nkYvo557Unb8wHfPd0ciXWhi7xE0gEGG3Gk6m7VMY4+XKqtXYY29g+XVkByQ9iqLF4hbELEC2C1MAJcoW2FgiBdl4shD5G5rg==; 24:psZJ+6uchiBucDeiuN3KQ985WTkNcunS1vvWIfU6xqyUgn0YStLbQqkoF1/4cFv1PFth3tUgkkmjhP/pm9xFAbDcOoTLFrYzAOkUebBB+yg=; 20:rlx/GDbeD/DxtZGVcXu97lkessO888CuxMkS6rfppYz/NDcsEciWn22qv0JS0rUWvNWmmYYhZarKNItqrkmQNVyZ+MBotXa/9u7vZuKkOl7XgYNuL7zFbsQuroCT7/ipSelqAXDAYSE/3c8Keo2nY/lTfmuaye4p/D0Atrc9dTLphyxK47lKuxjroG+2MSTb5pjkx/lwqjEGHVTVVSMr3vt8O0nfr6k9IffNQhSjZn13iNBYHfjlms2qDB2LYh+V X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2016 02:54:50.7043 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0743 X-Mailman-Approved-At: Tue, 08 Mar 2016 03:47:45 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, On 05.03.2016 16:24, Christian König wrote: > just an educated guess, but I think the problem is simply that kernel > 3.14 doesn't yet contain the code so that radeon_fence_get() can safely > called with a NULL pointer. > > So the backport of Nicolai's patch needs and extra check for the case > when the fence is NULL. Oops indeed. Only the ref call should need the guard, the unref has always had a NULL pointer test as far as I can see. Lutz, could you please test whether the attached patch on top of 3.14.63 fixes the problem? Thanks, Nicolai > Regards, > Christian. > > Am 05.03.2016 um 18:16 schrieb Lutz Euler: >> Hi, >> >> after upgrading from kernel 3.14.62 to 3.14.63, while surfing, the >> screen suddenly got black and the mouse cursor froze. I had to reset >> the machine and found an oops followed by repeated messages >> "BUG: scheduling while atomic: Xorg/3757/0x00000002" in the logs. >> I have copied the oops and the first of these messages below. >> >> This was repeatable: After the reboot, when the browser restored its >> tabs, the oops occurred again. I then rebooted into 3.14.62 and the >> problem didn't occur again. >> >> Just guessing: Of the commits regarding radeon between these two >> kernel versions might the following be involved >> >> Nicolai Hähnle (1): >> drm/radeon: hold reference to fences in radeon_sa_bo_new >> >> as it mentions fences and the stack trace starts with radeon_sa_bo_new? >> >> Thanks and Regards, >> >> Lutz >> >> From lspci -v: >> >> 05:00.0 VGA compatible controller: ATI Technologies Inc NI Caicos [AMD >> RADEON HD 6450] (prog-if 00 [VGA controller]) >> Subsystem: PC Partner Limited Device e164 >> Flags: bus master, fast devsel, latency 0, IRQ 53 >> Memory at d0000000 (64-bit, prefetchable) [size=256M] >> Memory at fe9e0000 (64-bit, non-prefetchable) [size=128K] >> I/O ports at e000 [size=256] >> Expansion ROM at fe9c0000 [disabled] [size=128K] >> Capabilities: [50] Power Management version 3 >> Capabilities: [58] Express Legacy Endpoint, MSI 00 >> Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+ >> Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 >> Len=010 >> Capabilities: [150] Advanced Error Reporting >> Kernel driver in use: radeon >> Kernel modules: radeon >> >> X.Org version: 1.10.4 >> >> decodecode of the oops: >> >> Mar 5 15:04:58 lutz kernel: [ 6995.216776] Code: c7 c6 d8 3e 36 a0 31 >> c0 45 31 e4 e8 7b 70 15 e1 eb b5 66 0f 1f 84 00 00 00 00 00 55 48 89 >> f8 ba 01 00 00 00 48 89 e5 48 83 ec 10 0f c1 57 08 ff c2 ff ca 7e >> 02 c9 c3 80 3d 10 ae 10 00 01 74 >> All code >> ======== >> 0: c7 c6 d8 3e 36 a0 mov $0xa0363ed8,%esi >> 6: 31 c0 xor %eax,%eax >> 8: 45 31 e4 xor %r12d,%r12d >> b: e8 7b 70 15 e1 callq 0xffffffffe115708b >> 10: eb b5 jmp 0xffffffffffffffc7 >> 12: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) >> 19: 00 00 >> 1b: 55 push %rbp >> 1c: 48 89 f8 mov %rdi,%rax >> 1f: ba 01 00 00 00 mov $0x1,%edx >> 24: 48 89 e5 mov %rsp,%rbp >> 27: 48 83 ec 10 sub $0x10,%rsp >> 2b:* f0 0f c1 57 08 lock xadd %edx,0x8(%rdi) >> <-- trapping instruction >> 30: ff c2 inc %edx >> 32: ff ca dec %edx >> 34: 7e 02 jle 0x38 >> 36: c9 leaveq >> 37: c3 retq >> 38: 80 3d 10 ae 10 00 01 cmpb $0x1,0x10ae10(%rip) # >> 0x10ae4f >> 3f: 74 .byte 0x74 >> >> Code starting with the faulting instruction >> =========================================== >> 0: f0 0f c1 57 08 lock xadd %edx,0x8(%rdi) >> 5: ff c2 inc %edx >> 7: ff ca dec %edx >> 9: 7e 02 jle 0xd >> b: c9 leaveq >> c: c3 retq >> d: 80 3d 10 ae 10 00 01 cmpb $0x1,0x10ae10(%rip) # >> 0x10ae24 >> 14: 74 .byte 0x74 >> >> Mar 5 15:04:58 lutz kernel: [ 6995.192330] BUG: unable to handle >> kernel NULL pointer dereference at 0000000000000008 >> Mar 5 15:04:58 lutz kernel: [ 6995.192375] IP: [] >> radeon_fence_ref+0x10/0x50 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.192441] PGD 22a86a067 PUD >> 22d8e8067 PMD 0 >> Mar 5 15:04:58 lutz kernel: [ 6995.192463] Oops: 0002 [#1] PREEMPT SMP >> Mar 5 15:04:58 lutz kernel: [ 6995.192484] Modules linked in: >> binfmt_misc parport_pc ppdev snd_hda_codec_hdmi snd_opl3_synth >> snd_seq_midi_emul snd_hda_intel snd_hda_codec snd_es1938 gameport >> snd_pcm_oss snd_mixer_oss snd_seq_dummy snd_pcm snd_seq_oss >> snd_opl3_lib snd_hwdep snd_mpu401_uart snd_seq_midi snd_rawmidi >> snd_seq_midi_event snd_seq psmouse fbcon tileblit edac_core font >> serio_raw i2c_piix4 bitblit softcursor radeon snd_seq_device snd_timer >> hwmon_vid ttm drm_kms_helper asus_atk0110 drm i2c_algo_bit snd >> soundcore lp parport usbhid btrfs raid6_pq zlib_deflate xor r8169 mii >> xhci_hcd libcrc32c >> Mar 5 15:04:58 lutz kernel: [ 6995.192741] CPU: 5 PID: 3757 Comm: >> Xorg Not tainted 3.14.63 #1 >> Mar 5 15:04:58 lutz kernel: [ 6995.192765] Hardware name: System >> manufacturer System Product Name/M4A87TD/USB3, BIOS 1202 02/17/2011 >> Mar 5 15:04:58 lutz kernel: [ 6995.192803] task: ffff88022c1d5f80 ti: >> ffff8800c42a6000 task.ti: ffff8800c42a6000 >> Mar 5 15:04:58 lutz kernel: [ 6995.192833] RIP: >> 0010:[] [] >> radeon_fence_ref+0x10/0x50 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.192881] RSP: >> 0018:ffff8800c42a7a68 EFLAGS: 00010282 >> Mar 5 15:04:58 lutz kernel: [ 6995.192903] RAX: 0000000000000000 RBX: >> ffff8800c5d61328 RCX: 0000000000000000 >> Mar 5 15:04:58 lutz kernel: [ 6995.192931] RDX: 0000000000000001 RSI: >> 0000000000000000 RDI: 0000000000000000 >> Mar 5 15:04:58 lutz kernel: [ 6995.192960] RBP: ffff8800c42a7a78 R08: >> ffff8800c5d60000 R09: 0000000000000000 >> Mar 5 15:04:58 lutz kernel: [ 6995.192988] R10: 0000000000000000 R11: >> 0000000000000000 R12: 0000000000000100 >> Mar 5 15:04:58 lutz kernel: [ 6995.193016] R13: ffff8800c5d613b0 R14: >> ffff8800c42a7ae8 R15: ffff8800c42a7b08 >> Mar 5 15:04:58 lutz kernel: [ 6995.193045] FS: >> 00007f7ebe91d8a0(0000) GS:ffff880237d40000(0000) knlGS:0000000000000000 >> Mar 5 15:04:58 lutz kernel: [ 6995.193076] CS: 0010 DS: 0000 ES: >> 0000 CR0: 0000000080050033 >> Mar 5 15:04:58 lutz kernel: [ 6995.193100] CR2: 0000000000000008 CR3: >> 000000022de3e000 CR4: 00000000000007e0 >> Mar 5 15:04:58 lutz kernel: [ 6995.193128] Stack: >> Mar 5 15:04:58 lutz kernel: [ 6995.193137] ffff880159dcef00 >> ffff8800c5d61328 ffff8800c42a7b88 ffffffffa02d9f22 >> Mar 5 15:04:58 lutz kernel: [ 6995.193170] 01ff8800c42a7a98 >> ffff8800c5d60000 ffff8800c42a7b08 ffff8800c42a7c88 >> Mar 5 15:04:58 lutz kernel: [ 6995.193203] 0000f00455ee5200 >> ffff8800c5d613b0 00000100c42a7b08 0006e97800200000 >> Mar 5 15:04:58 lutz kernel: [ 6995.193237] Call Trace: >> Mar 5 15:04:58 lutz kernel: [ 6995.194709] [] >> radeon_sa_bo_new+0x302/0x590 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.196175] [] ? >> __kmalloc+0x66/0x1d0 >> Mar 5 15:04:58 lutz kernel: [ 6995.197659] [] ? >> copy_from_user+0x9/0x10 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.199160] [] >> radeon_ib_get+0x43/0xe0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.200655] [] >> radeon_cs_ioctl+0x201/0xac0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.202135] [] ? >> idr_mark_full+0x52/0x70 >> Mar 5 15:04:58 lutz kernel: [ 6995.203620] [] >> drm_ioctl+0x401/0x580 [drm] >> Mar 5 15:04:58 lutz kernel: [ 6995.205094] [] ? >> radeon_cs_parser_init+0x470/0x470 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.206564] [] ? >> __do_page_fault+0x1cc/0x560 >> Mar 5 15:04:58 lutz kernel: [ 6995.208033] [] >> radeon_drm_ioctl+0x9/0x10 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.209510] [] >> do_vfs_ioctl+0x81/0x4d0 >> Mar 5 15:04:58 lutz kernel: [ 6995.210975] [] ? >> SyS_mmap_pgoff+0xd9/0x210 >> Mar 5 15:04:58 lutz kernel: [ 6995.212432] [] >> SyS_ioctl+0x91/0xa0 >> Mar 5 15:04:58 lutz kernel: [ 6995.213874] [] ? >> do_page_fault+0xc/0x10 >> Mar 5 15:04:58 lutz kernel: [ 6995.215323] [] >> system_call_fastpath+0x16/0x1b >> Mar 5 15:04:58 lutz kernel: [ 6995.216776] Code: c7 c6 d8 3e 36 a0 31 >> c0 45 31 e4 e8 7b 70 15 e1 eb b5 66 0f 1f 84 00 00 00 00 00 55 48 89 >> f8 ba 01 00 00 00 48 89 e5 48 83 ec 10 0f c1 57 08 ff c2 ff ca 7e >> 02 c9 c3 80 3d 10 ae 10 00 01 74 >> Mar 5 15:04:58 lutz kernel: [ 6995.218402] RIP [] >> radeon_fence_ref+0x10/0x50 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.219987] RSP >> Mar 5 15:04:58 lutz kernel: [ 6995.221568] CR2: 0000000000000008 >> Mar 5 15:04:58 lutz kernel: [ 6995.234168] ---[ end trace >> 37c0545f39a2b3e5 ]--- >> >> Mar 5 15:04:58 lutz kernel: [ 6995.234170] note: Xorg[3757] exited >> with preempt_count 1 >> Mar 5 15:04:58 lutz kernel: [ 6995.239926] BUG: scheduling while >> atomic: Xorg/3757/0x00000002 >> Mar 5 15:04:58 lutz kernel: [ 6995.239931] Modules linked in: >> binfmt_misc parport_pc ppdev snd_hda_codec_hdmi snd_opl3_synth >> snd_seq_midi_emul snd_hda_intel snd_hda_c >> odec snd_es1938 gameport snd_pcm_oss snd_mixer_oss snd_seq_dummy >> snd_pcm snd_seq_oss snd_opl3_lib snd_hwdep snd_mpu401_uart >> snd_seq_midi snd_rawmidi snd_seq_midi_event >> snd_seq psmouse fbcon tileblit edac_core font serio_raw i2c_piix4 >> bitblit softcursor radeon snd_seq_device snd_timer hwmon_vid ttm >> drm_kms_helper asus_atk0110 drm i2c >> _algo_bit snd soundcore lp parport usbhid btrfs raid6_pq zlib_deflate >> xor r8169 mii xhci_hcd libcrc32c >> Mar 5 15:04:58 lutz kernel: [ 6995.239960] CPU: 5 PID: 3757 Comm: >> Xorg Tainted: G D 3.14.63 #1 >> Mar 5 15:04:58 lutz kernel: [ 6995.239961] Hardware name: System >> manufacturer System Product Name/M4A87TD/USB3, BIOS 1202 02/17/2011 >> Mar 5 15:04:58 lutz kernel: [ 6995.239963] 0000000000000000 >> ffff8800c42a7078 ffffffff8164f89c ffff880237d518c0 >> Mar 5 15:04:58 lutz kernel: [ 6995.239965] 0000000000000005 >> ffff8800c42a7088 ffffffff81075d27 ffff8800c42a70f8 >> Mar 5 15:04:58 lutz kernel: [ 6995.239967] ffffffff81650680 >> ffff8800c42a7184 ffff88022c1d5f80 ffff8800c42a6000 >> Mar 5 15:04:58 lutz kernel: [ 6995.239969] Call Trace: >> Mar 5 15:04:58 lutz kernel: [ 6995.239976] [] >> dump_stack+0x4f/0x6b >> Mar 5 15:04:58 lutz kernel: [ 6995.239980] [] >> __schedule_bug+0x47/0x60 >> Mar 5 15:04:58 lutz kernel: [ 6995.239982] [] >> __schedule+0x600/0x810 >> Mar 5 15:04:58 lutz kernel: [ 6995.239984] [] >> schedule+0x24/0x70 >> Mar 5 15:04:58 lutz kernel: [ 6995.239986] [] >> schedule_timeout+0x151/0x320 >> Mar 5 15:04:58 lutz kernel: [ 6995.239989] [] ? >> call_timer_fn+0x1a0/0x1a0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240028] [] >> radeon_fence_wait_seq+0x3ca/0x530 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240043] [] ? >> evergreen_program_watermarks+0x150/0x670 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240046] [] ? >> bit_waitqueue+0xd0/0xd0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240062] [] ? >> evergreen_line_buffer_adjust.clone.5+0xcb/0x1a0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240073] [] >> radeon_fence_wait_empty_locked+0xb0/0xe0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240088] [] >> radeon_pm_compute_clocks+0x59d/0x840 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240100] [] >> atombios_crtc_dpms+0x6f/0x100 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240111] [] >> atombios_crtc_disable+0x28/0x2f0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240126] [] ? >> radeon_atom_encoder_dpms+0xf4/0x230 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240132] [] >> drm_helper_disable_unused_functions+0x105/0x160 [drm_kms_helper] >> Mar 5 15:04:58 lutz kernel: [ 6995.240135] [] >> drm_crtc_helper_set_config+0x130/0x970 [drm_kms_helper] >> Mar 5 15:04:58 lutz kernel: [ 6995.240138] [] ? >> __slab_free+0x302/0x480 >> Mar 5 15:04:58 lutz kernel: [ 6995.240151] [] >> radeon_crtc_set_config+0x31/0xb0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240172] [] >> drm_mode_set_config_internal+0x5c/0xe0 [drm] >> Mar 5 15:04:58 lutz kernel: [ 6995.240180] [] >> drm_framebuffer_remove+0x10d/0x160 [drm] >> Mar 5 15:04:58 lutz kernel: [ 6995.240188] [] >> drm_fb_release+0xa5/0xd0 [drm] >> Mar 5 15:04:58 lutz kernel: [ 6995.240195] [] >> drm_release+0x548/0x5c0 [drm] >> Mar 5 15:04:58 lutz kernel: [ 6995.240198] [] >> __fput+0xa4/0x220 >> Mar 5 15:04:58 lutz kernel: [ 6995.240199] [] >> ____fput+0x9/0x10 >> Mar 5 15:04:58 lutz kernel: [ 6995.240202] [] >> task_work_run+0xac/0xd0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240205] [] >> do_exit+0x2c0/0xac0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240207] [] ? >> printk+0x48/0x4a >> Mar 5 15:04:58 lutz kernel: [ 6995.240209] [] ? >> kmsg_dump+0xb9/0xd0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240211] [] >> oops_end+0x9a/0xe0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240214] [] >> no_context+0x132/0x2e0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240216] [] >> __bad_area_nosemaphore+0x115/0x210 >> Mar 5 15:04:58 lutz kernel: [ 6995.240218] [] ? >> __alloc_pages_nodemask+0x141/0x910 >> Mar 5 15:04:58 lutz kernel: [ 6995.240220] [] >> bad_area_nosemaphore+0xe/0x10 >> Mar 5 15:04:58 lutz kernel: [ 6995.240222] [] >> __do_page_fault+0x332/0x560 >> Mar 5 15:04:58 lutz kernel: [ 6995.240230] [] ? >> ttm_mem_global_alloc_zone.clone.1+0x12b/0x150 [ttm] >> Mar 5 15:04:58 lutz kernel: [ 6995.240233] [] ? >> ttm_mem_global_alloc_page+0x42/0x50 [ttm] >> Mar 5 15:04:58 lutz kernel: [ 6995.240237] [] ? >> alloc_pages_current+0xae/0x170 >> Mar 5 15:04:58 lutz kernel: [ 6995.240238] [] >> do_page_fault+0xc/0x10 >> Mar 5 15:04:58 lutz kernel: [ 6995.240240] [] >> page_fault+0x22/0x30 >> Mar 5 15:04:58 lutz kernel: [ 6995.240252] [] ? >> radeon_fence_ref+0x10/0x50 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240268] [] >> radeon_sa_bo_new+0x302/0x590 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240270] [] ? >> __kmalloc+0x66/0x1d0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240283] [] ? >> copy_from_user+0x9/0x10 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240296] [] >> radeon_ib_get+0x43/0xe0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240309] [] >> radeon_cs_ioctl+0x201/0xac0 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240312] [] ? >> idr_mark_full+0x52/0x70 >> Mar 5 15:04:58 lutz kernel: [ 6995.240320] [] >> drm_ioctl+0x401/0x580 [drm] >> Mar 5 15:04:58 lutz kernel: [ 6995.240333] [] ? >> radeon_cs_parser_init+0x470/0x470 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240335] [] ? >> __do_page_fault+0x1cc/0x560 >> Mar 5 15:04:58 lutz kernel: [ 6995.240346] [] >> radeon_drm_ioctl+0x9/0x10 [radeon] >> Mar 5 15:04:58 lutz kernel: [ 6995.240348] [] >> do_vfs_ioctl+0x81/0x4d0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240351] [] ? >> SyS_mmap_pgoff+0xd9/0x210 >> Mar 5 15:04:58 lutz kernel: [ 6995.240353] [] >> SyS_ioctl+0x91/0xa0 >> Mar 5 15:04:58 lutz kernel: [ 6995.240355] [] ? >> do_page_fault+0xc/0x10 >> Mar 5 15:04:58 lutz kernel: [ 6995.240357] [] >> system_call_fastpath+0x16/0x1b >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > Tested-by: Lutz Euler From 85d028178d9772f2a07e4ed156820d95c4e0ad18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Mon, 7 Mar 2016 23:41:52 -0300 Subject: [PATCH] drm/radeon: guard call to radeon_fence_ref against NULL pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Candidate fix for a kernel oops that was introduced by the backport of commit 954605ca3 "drm/radeon: hold reference to fences in radeon_sa_bo_new" to kernels where radeon does not use the common fence implementation for fences. Reported-by: Lutz Euler Signed-off-by: Nicolai Hähnle --- drivers/gpu/drm/radeon/radeon_sa.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_sa.c b/drivers/gpu/drm/radeon/radeon_sa.c index 197b157..7d11901 100644 --- a/drivers/gpu/drm/radeon/radeon_sa.c +++ b/drivers/gpu/drm/radeon/radeon_sa.c @@ -349,8 +349,10 @@ int radeon_sa_bo_new(struct radeon_device *rdev, /* see if we can skip over some allocations */ } while (radeon_sa_bo_next_hole(sa_manager, fences, tries)); - for (i = 0; i < RADEON_NUM_RINGS; ++i) - radeon_fence_ref(fences[i]); + for (i = 0; i < RADEON_NUM_RINGS; ++i) { + if (fences[i]) + radeon_fence_ref(fences[i]); + } spin_unlock(&sa_manager->wq.lock); r = radeon_fence_wait_any(rdev, fences, false); -- 2.5.0