From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912Ab0IMV7D (ORCPT ); Mon, 13 Sep 2010 17:59:03 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:53190 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805Ab0IMV7A (ORCPT ); Mon, 13 Sep 2010 17:59:00 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=I515RRWKEElqPpTtMY9XjIqsRJNXGCLNxfEwg/PdfPKBUuIFI/dHsk+n5UkeVJ2UCc kFeyHrD+HXR+XSRSC0oUdRSGhNOY8wkrlL3LXDG8L8BE0pF0xhMk2QLzwATRRwgQtgOO ieheRjzwWVKGeQBzifFlFWr1qS/8lq3H7qwMs= Date: Mon, 13 Sep 2010 23:58:50 +0200 From: Jarek Poplawski To: linux-fbdev@vger.kernel.org Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: [PATCH] fbcon: fix lockdep warning from fbcon_deinit() Message-ID: <20100913215850.GA2176@del.dom.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here is a warning and a patch proposal below. Jarek P. [ 13.334829] i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 13.350597] i915 0000:00:02.0: setting latency timer to 64 [ 13.382380] [drm] set up 7M of stolen space [ 13.420049] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem [ 13.422851] [drm] initialized overlay support [ 13.655021] checking generic (f0000000 180000) vs hw (f0000000 8000000) [ 13.655055] fb: conflicting fb hw usage inteldrmfb vs VESA VGA - removing generic driver [ 13.657164] INFO: trying to register non-static key. [ 13.657169] the code is fine but needs lockdep annotation. [ 13.657171] turning off the locking correctness validator. [ 13.657177] Pid: 622, comm: modprobe Not tainted 2.6.36-rc3c #8 [ 13.657180] Call Trace: [ 13.657194] [] ? printk+0x18/0x20 [ 13.657202] [] register_lock_class+0x336/0x350 [ 13.657208] [] __lock_acquire+0x449/0x1180 [ 13.657215] [] lock_acquire+0x67/0x80 [ 13.657222] [] ? __cancel_work_timer+0x51/0x230 [ 13.657227] [] __cancel_work_timer+0x83/0x230 [ 13.657231] [] ? __cancel_work_timer+0x51/0x230 [ 13.657236] [] ? mark_held_locks+0x62/0x80 [ 13.657243] [] ? kfree+0x7f/0xe0 [ 13.657248] [] ? trace_hardirqs_on_caller+0x11c/0x160 [ 13.657253] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657259] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657263] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657268] [] cancel_work_sync+0xa/0x10 [ 13.657272] [] fbcon_deinit+0xe4/0x1e0 [ 13.657280] [] bind_con_driver+0x1ac/0x3d0 [ 13.657286] [] ? get_parent_ip+0xb/0x40 [ 13.657292] [] ? release_console_sem+0x1d1/0x210 [ 13.657297] [] unbind_con_driver+0x1b3/0x1f0 [ 13.657303] [] fbcon_event_notify+0x575/0x920 [ 13.657308] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657314] [] ? mark_held_locks+0x62/0x80 [ 13.657320] [] ? restore_all_notrace+0x0/0x18 [ 13.657324] [] ? trace_hardirqs_on_caller+0x11c/0x160 [ 13.657331] [] ? trace_hardirqs_on_thunk+0xc/0x10 [ 13.657339] [] ? __blocking_notifier_call_chain+0x2a/0x60 [ 13.657344] [] notifier_call_chain+0x2d/0x70 [ 13.657349] [] __blocking_notifier_call_chain+0x44/0x60 [ 13.657354] [] blocking_notifier_call_chain+0x1a/0x20 [ 13.657360] [] fb_notifier_call_chain+0x11/0x20 [ 13.657364] [] unregister_framebuffer+0x58/0xf0 [ 13.657369] [] remove_conflicting_framebuffers+0x175/0x1a0 [ 13.657375] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657380] [] register_framebuffer+0x7d/0x270 [ 13.657386] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657396] [] ? drm_setup_crtcs+0x3a8/0x640 [drm_kms_helper] [ 13.657402] [] drm_fb_helper_single_fb_probe+0x26b/0x2d0 [drm_kms_helper] [ 13.657409] [] drm_fb_helper_initial_config+0x29b/0x610 [drm_kms_helper] [ 13.657417] [] ? kmem_cache_alloc+0x69/0xb0 [ 13.657423] [] ? drm_fb_helper_single_add_all_connectors+0x3f/0xc0 [drm_kms_helper] [ 13.657456] [] intel_fbdev_init+0x6f/0x90 [i915] [ 13.657473] [] i915_driver_load+0x113d/0x13b0 [i915] [ 13.657492] [] ? i915_vga_set_decode+0x0/0x20 [i915] [ 13.657519] [] drm_get_pci_dev+0x149/0x250 [drm] [ 13.657527] [] ? sub_preempt_count+0x7b/0xb0 [ 13.657546] [] i915_pci_probe+0xd/0x18d [i915] [ 13.657552] [] local_pci_probe+0xe/0x10 [ 13.657558] [] pci_device_probe+0x60/0x80 [ 13.657565] [] driver_probe_device+0x6c/0x190 [ 13.657570] [] __driver_attach+0x81/0x90 [ 13.657576] [] bus_for_each_dev+0x5b/0x80 [ 13.657580] [] ? pci_device_remove+0x0/0x40 [ 13.657585] [] driver_attach+0x19/0x20 [ 13.657589] [] ? __driver_attach+0x0/0x90 [ 13.657594] [] bus_add_driver+0x1a7/0x270 [ 13.657599] [] ? pci_device_remove+0x0/0x40 [ 13.657604] [] driver_register+0x75/0x160 [ 13.657620] [] ? i915_init+0x0/0x93 [i915] [ 13.657625] [] __pci_register_driver+0x54/0xc0 [ 13.657644] [] ? i915_init+0x0/0x93 [i915] [ 13.657657] [] drm_pci_init+0xa5/0xb0 [drm] [ 13.657675] [] ? i915_init+0x0/0x93 [i915] [ 13.657687] [] drm_init+0x4f/0x70 [drm] [ 13.657703] [] i915_init+0x6a/0x93 [i915] [ 13.657710] [] do_one_initcall+0x2b/0x150 [ 13.657714] [] ? __vunmap+0xa4/0xf0 [ 13.657721] [] sys_init_module+0x14d/0x18b0 [ 13.657744] [] syscall_call+0x7/0xb [ 13.657885] Console: switching to colour dummy device 80x25 [ 13.659795] checking generic (a0000 10000) vs hw (f0000000 8000000) [ 13.659818] fb: conflicting fb hw usage inteldrmfb vs VGA16 VGA - removing generic driver [ 13.688319] [drm:intel_calculate_wm] *ERROR* Insufficient FIFO for plane, expect flickering: entries required = 51, available = 47. [ 13.688400] Console: switching to colour frame buffer device 128x48 [ 13.693608] fb0: inteldrmfb frame buffer device ... -------------> This patch fixes the lockdep warning: [ 13.657164] INFO: trying to register non-static key. [ 13.657169] the code is fine but needs lockdep annotation. [ 13.657171] turning off the locking correctness validator. [ 13.657177] Pid: 622, comm: modprobe Not tainted 2.6.36-rc3c #8 [ 13.657180] Call Trace: [ 13.657194] [] ? printk+0x18/0x20 [ 13.657202] [] register_lock_class+0x336/0x350 [ 13.657208] [] __lock_acquire+0x449/0x1180 [ 13.657215] [] lock_acquire+0x67/0x80 [ 13.657222] [] ? __cancel_work_timer+0x51/0x230 [ 13.657227] [] __cancel_work_timer+0x83/0x230 [ 13.657231] [] ? __cancel_work_timer+0x51/0x230 [ 13.657236] [] ? mark_held_locks+0x62/0x80 [ 13.657243] [] ? kfree+0x7f/0xe0 [ 13.657248] [] ? trace_hardirqs_on_caller+0x11c/0x160 [ 13.657253] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657259] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657263] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657268] [] cancel_work_sync+0xa/0x10 [ 13.657272] [] fbcon_deinit+0xe4/0x1e0 ... The warning is caused by trying to cancel an uninitialized work from fbcon_exit(). Fix it by adding a check for queue.func, similarly to other places in this code. Signed-off-by: Jarek Poplawski --- diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 84f8423..7ccc967 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -3508,7 +3508,7 @@ static void fbcon_exit(void) softback_buf = 0UL; for (i = 0; i < FB_MAX; i++) { - int pending; + int pending = 0; mapped = 0; info = registered_fb[i]; @@ -3516,7 +3516,8 @@ static void fbcon_exit(void) if (info == NULL) continue; - pending = cancel_work_sync(&info->queue); + if (info->queue.func) + pending = cancel_work_sync(&info->queue); DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" : "no")); From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarek Poplawski Date: Mon, 13 Sep 2010 21:58:50 +0000 Subject: [PATCH] fbcon: fix lockdep warning from fbcon_deinit() Message-Id: <20100913215850.GA2176@del.dom.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-fbdev@vger.kernel.org Cc: Andrew Morton , linux-kernel@vger.kernel.org Hi, Here is a warning and a patch proposal below. Jarek P. [ 13.334829] i915 0000:00:02.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [ 13.350597] i915 0000:00:02.0: setting latency timer to 64 [ 13.382380] [drm] set up 7M of stolen space [ 13.420049] vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem [ 13.422851] [drm] initialized overlay support [ 13.655021] checking generic (f0000000 180000) vs hw (f0000000 8000000) [ 13.655055] fb: conflicting fb hw usage inteldrmfb vs VESA VGA - removing generic driver [ 13.657164] INFO: trying to register non-static key. [ 13.657169] the code is fine but needs lockdep annotation. [ 13.657171] turning off the locking correctness validator. [ 13.657177] Pid: 622, comm: modprobe Not tainted 2.6.36-rc3c #8 [ 13.657180] Call Trace: [ 13.657194] [] ? printk+0x18/0x20 [ 13.657202] [] register_lock_class+0x336/0x350 [ 13.657208] [] __lock_acquire+0x449/0x1180 [ 13.657215] [] lock_acquire+0x67/0x80 [ 13.657222] [] ? __cancel_work_timer+0x51/0x230 [ 13.657227] [] __cancel_work_timer+0x83/0x230 [ 13.657231] [] ? __cancel_work_timer+0x51/0x230 [ 13.657236] [] ? mark_held_locks+0x62/0x80 [ 13.657243] [] ? kfree+0x7f/0xe0 [ 13.657248] [] ? trace_hardirqs_on_caller+0x11c/0x160 [ 13.657253] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657259] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657263] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657268] [] cancel_work_sync+0xa/0x10 [ 13.657272] [] fbcon_deinit+0xe4/0x1e0 [ 13.657280] [] bind_con_driver+0x1ac/0x3d0 [ 13.657286] [] ? get_parent_ip+0xb/0x40 [ 13.657292] [] ? release_console_sem+0x1d1/0x210 [ 13.657297] [] unbind_con_driver+0x1b3/0x1f0 [ 13.657303] [] fbcon_event_notify+0x575/0x920 [ 13.657308] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657314] [] ? mark_held_locks+0x62/0x80 [ 13.657320] [] ? restore_all_notrace+0x0/0x18 [ 13.657324] [] ? trace_hardirqs_on_caller+0x11c/0x160 [ 13.657331] [] ? trace_hardirqs_on_thunk+0xc/0x10 [ 13.657339] [] ? __blocking_notifier_call_chain+0x2a/0x60 [ 13.657344] [] notifier_call_chain+0x2d/0x70 [ 13.657349] [] __blocking_notifier_call_chain+0x44/0x60 [ 13.657354] [] blocking_notifier_call_chain+0x1a/0x20 [ 13.657360] [] fb_notifier_call_chain+0x11/0x20 [ 13.657364] [] unregister_framebuffer+0x58/0xf0 [ 13.657369] [] remove_conflicting_framebuffers+0x175/0x1a0 [ 13.657375] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657380] [] register_framebuffer+0x7d/0x270 [ 13.657386] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657396] [] ? drm_setup_crtcs+0x3a8/0x640 [drm_kms_helper] [ 13.657402] [] drm_fb_helper_single_fb_probe+0x26b/0x2d0 [drm_kms_helper] [ 13.657409] [] drm_fb_helper_initial_config+0x29b/0x610 [drm_kms_helper] [ 13.657417] [] ? kmem_cache_alloc+0x69/0xb0 [ 13.657423] [] ? drm_fb_helper_single_add_all_connectors+0x3f/0xc0 [drm_kms_helper] [ 13.657456] [] intel_fbdev_init+0x6f/0x90 [i915] [ 13.657473] [] i915_driver_load+0x113d/0x13b0 [i915] [ 13.657492] [] ? i915_vga_set_decode+0x0/0x20 [i915] [ 13.657519] [] drm_get_pci_dev+0x149/0x250 [drm] [ 13.657527] [] ? sub_preempt_count+0x7b/0xb0 [ 13.657546] [] i915_pci_probe+0xd/0x18d [i915] [ 13.657552] [] local_pci_probe+0xe/0x10 [ 13.657558] [] pci_device_probe+0x60/0x80 [ 13.657565] [] driver_probe_device+0x6c/0x190 [ 13.657570] [] __driver_attach+0x81/0x90 [ 13.657576] [] bus_for_each_dev+0x5b/0x80 [ 13.657580] [] ? pci_device_remove+0x0/0x40 [ 13.657585] [] driver_attach+0x19/0x20 [ 13.657589] [] ? __driver_attach+0x0/0x90 [ 13.657594] [] bus_add_driver+0x1a7/0x270 [ 13.657599] [] ? pci_device_remove+0x0/0x40 [ 13.657604] [] driver_register+0x75/0x160 [ 13.657620] [] ? i915_init+0x0/0x93 [i915] [ 13.657625] [] __pci_register_driver+0x54/0xc0 [ 13.657644] [] ? i915_init+0x0/0x93 [i915] [ 13.657657] [] drm_pci_init+0xa5/0xb0 [drm] [ 13.657675] [] ? i915_init+0x0/0x93 [i915] [ 13.657687] [] drm_init+0x4f/0x70 [drm] [ 13.657703] [] i915_init+0x6a/0x93 [i915] [ 13.657710] [] do_one_initcall+0x2b/0x150 [ 13.657714] [] ? __vunmap+0xa4/0xf0 [ 13.657721] [] sys_init_module+0x14d/0x18b0 [ 13.657744] [] syscall_call+0x7/0xb [ 13.657885] Console: switching to colour dummy device 80x25 [ 13.659795] checking generic (a0000 10000) vs hw (f0000000 8000000) [ 13.659818] fb: conflicting fb hw usage inteldrmfb vs VGA16 VGA - removing generic driver [ 13.688319] [drm:intel_calculate_wm] *ERROR* Insufficient FIFO for plane, expect flickering: entries required = 51, available = 47. [ 13.688400] Console: switching to colour frame buffer device 128x48 [ 13.693608] fb0: inteldrmfb frame buffer device ... -------------> This patch fixes the lockdep warning: [ 13.657164] INFO: trying to register non-static key. [ 13.657169] the code is fine but needs lockdep annotation. [ 13.657171] turning off the locking correctness validator. [ 13.657177] Pid: 622, comm: modprobe Not tainted 2.6.36-rc3c #8 [ 13.657180] Call Trace: [ 13.657194] [] ? printk+0x18/0x20 [ 13.657202] [] register_lock_class+0x336/0x350 [ 13.657208] [] __lock_acquire+0x449/0x1180 [ 13.657215] [] lock_acquire+0x67/0x80 [ 13.657222] [] ? __cancel_work_timer+0x51/0x230 [ 13.657227] [] __cancel_work_timer+0x83/0x230 [ 13.657231] [] ? __cancel_work_timer+0x51/0x230 [ 13.657236] [] ? mark_held_locks+0x62/0x80 [ 13.657243] [] ? kfree+0x7f/0xe0 [ 13.657248] [] ? trace_hardirqs_on_caller+0x11c/0x160 [ 13.657253] [] ? trace_hardirqs_on+0xb/0x10 [ 13.657259] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657263] [] ? fbcon_deinit+0x16d/0x1e0 [ 13.657268] [] cancel_work_sync+0xa/0x10 [ 13.657272] [] fbcon_deinit+0xe4/0x1e0 ... The warning is caused by trying to cancel an uninitialized work from fbcon_exit(). Fix it by adding a check for queue.func, similarly to other places in this code. Signed-off-by: Jarek Poplawski --- diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 84f8423..7ccc967 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -3508,7 +3508,7 @@ static void fbcon_exit(void) softback_buf = 0UL; for (i = 0; i < FB_MAX; i++) { - int pending; + int pending = 0; mapped = 0; info = registered_fb[i]; @@ -3516,7 +3516,8 @@ static void fbcon_exit(void) if (info = NULL) continue; - pending = cancel_work_sync(&info->queue); + if (info->queue.func) + pending = cancel_work_sync(&info->queue); DPRINTK("fbcon: %s pending work\n", (pending ? "canceled" : "no"));