Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753866AbaJASnA (ORCPT ); Wed, 1 Oct 2014 14:43:00 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43413 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbaJASm6 (ORCPT ); Wed, 1 Oct 2014 14:42:58 -0400 Date: Wed, 1 Oct 2014 11:42:57 -0700 From: Andrew Morton To: Samuel Thibault Cc: Dmitry Torokhov , Pavel Machek , David Herrmann , jslaby@suse.cz, Bryan Wu , rpurdie@rpsys.net, linux-kernel@vger.kernel.org, Evan Broder , Arnaud Patard , Peter Korsgaard , Sascha Hauer , Matt Sealey , Rob Clark , Niels de Vos , linux-arm-kernel@lists.infradead.org, Steev Klimaszewski , blogic@openwrt.org, Pali =?ISO-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH] Route keyboard LEDs through the generic LEDs layer. Message-Id: <20141001114257.f0f6a94508bdd7df83602eda@linux-foundation.org> In-Reply-To: <20140331122323.GC6044@type.bordeaux.inria.fr> References: <20140331122323.GC6044@type.bordeaux.inria.fr> X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 31 Mar 2014 14:23:23 +0200 Samuel Thibault wrote: > This permits to reassign keyboard LEDs to something else than keyboard "leds" > state, by adding keyboard led and modifier triggers connected to a series > of VT input LEDs, themselves connected to VT input triggers, which > per-input device LEDs use by default. Userland can thus easily change the LED > behavior of (a priori) all input devices, or of particular input devices. > > This also permits to fix #7063 from userland by using a modifier to implement > proper CapsLock behavior and have the keyboard caps lock led show that modifier > state. When this patch is combined with current linux-next I'm getting the below lockdep splat. Config: http://ozlabs.org/~akpm/config-akpm2.txt [ 4.304279] [ 4.304280] ============================================= [ 4.304281] [ INFO: possible recursive locking detected ] [ 4.304283] 3.17.0-rc7-mm1 #5 Not tainted [ 4.304284] --------------------------------------------- [ 4.304285] kworker/6:1/398 is trying to acquire lock: [ 4.304294] (&trig->leddev_list_lock){.+.?..}, at: [] led_trigger_event+0x22/0x6b [ 4.304294] [ 4.304294] but task is already holding lock: [ 4.304298] (&trig->leddev_list_lock){.+.?..}, at: [] led_trigger_event+0x22/0x6b [ 4.304299] [ 4.304299] other info that might help us debug this: [ 4.304300] Possible unsafe locking scenario: [ 4.304300] [ 4.304301] CPU0 [ 4.304301] ---- [ 4.304303] lock(&trig->leddev_list_lock); [ 4.304305] lock(&trig->leddev_list_lock); [ 4.304306] [ 4.304306] *** DEADLOCK *** [ 4.304306] [ 4.304307] May be due to missing lock nesting notation [ 4.304307] [ 4.304308] 11 locks held by kworker/6:1/398: [ 4.304315] #0: ("events_long"){.+.+.+}, at: [] process_one_work+0x1af/0x39d [ 4.304319] #1: (serio_event_work){+.+.+.}, at: [] process_one_work+0x1af/0x39d [ 4.304326] #2: (serio_mutex){+.+.+.}, at: [] serio_handle_event+0x19/0x1f1 [ 4.304332] #3: (&dev->mutex){......}, at: [] __driver_attach+0x39/0x80 [ 4.304336] #4: (&dev->mutex){......}, at: [] __driver_attach+0x47/0x80 [ 4.304341] #5: (&serio->drv_mutex){+.+.+.}, at: [] serio_connect_driver+0x24/0x48 [ 4.304346] #6: (input_mutex){+.+.+.}, at: [] input_register_device+0x2e9/0x3c0 [ 4.304351] #7: (vt_led_registered_lock){+.+.+.}, at: [] input_led_connect+0x50/0x1ff [ 4.304355] #8: (triggers_list_lock){++++.+}, at: [] led_trigger_set_default+0x2b/0x88 [ 4.304359] #9: (&led_cdev->trigger_lock){+.+.+.}, at: [] led_trigger_set_default+0x33/0x88 [ 4.304363] #10: (&trig->leddev_list_lock){.+.?..}, at: [] led_trigger_event+0x22/0x6b [ 4.304364] [ 4.304364] stack backtrace: [ 4.304367] CPU: 6 PID: 398 Comm: kworker/6:1 Not tainted 3.17.0-rc7-mm1 #5 [ 4.304368] Hardware name: , BIOS Bridgeport CRB BIOS 73 external 2006-08-05 [ 4.304371] Workqueue: events_long serio_handle_event [ 4.304374] ffffffff82190450 ffff880255b577f8 ffffffff81463e05 ffffffff82a886e0 [ 4.304377] ffff880255890850 ffff880255b578b8 ffffffff81076fef ffff880255b57838 [ 4.304379] ffffffff82190450 ffff880200000000 ffff880255891258 ffff880355b57848 [ 4.304380] Call Trace: [ 4.304384] [] dump_stack+0x49/0x5c [ 4.304387] [] validate_chain+0x741/0xf93 [ 4.304390] [] ? check_usage_backwards+0x9a/0xd3 [ 4.304394] [] ? sched_clock_local+0x1c/0x82 [ 4.304396] [] __lock_acquire+0x97a/0xa29 [ 4.304398] [] ? mark_lock+0x475/0x5a4 [ 4.304400] [] lock_acquire+0xaa/0xc4 [ 4.304402] [] ? led_trigger_event+0x22/0x6b [ 4.304405] [] _raw_read_lock+0x34/0x69 [ 4.304408] [] ? led_trigger_event+0x22/0x6b [ 4.304410] [] led_trigger_event+0x22/0x6b [ 4.304412] [] vt_led_set+0x32/0x34 [ 4.304415] [] led_set_brightness+0x49/0x4b [ 4.304417] [] led_trigger_event+0x3e/0x6b [ 4.304421] [] kbd_ledstate_trigger_activate+0x49/0x52 [ 4.304423] [] led_trigger_set+0xfd/0x13b [ 4.304426] [] ? down_write+0x8c/0xa4 [ 4.304428] [] ? led_trigger_set_default+0x33/0x88 [ 4.304430] [] led_trigger_set_default+0x58/0x88 [ 4.304433] [] led_classdev_register+0x124/0x12f [ 4.304435] [] input_led_connect+0xb3/0x1ff [ 4.304437] [] input_register_device+0x321/0x3c0 [ 4.304441] [] atkbd_connect+0x235/0x27e [ 4.304443] [] serio_connect_driver+0x2f/0x48 [ 4.304447] [] ? sysfs_create_link+0x2a/0x2c [ 4.304449] [] serio_driver_probe+0x1b/0x1d [ 4.304451] [] driver_probe_device+0xac/0x1be [ 4.304453] [] __driver_attach+0x5c/0x80 [ 4.304455] [] ? driver_probe_device+0x1be/0x1be [ 4.304457] [] bus_for_each_dev+0x56/0x94 [ 4.304460] [] driver_attach+0x19/0x1b [ 4.304462] [] serio_handle_event+0x163/0x1f1 [ 4.304464] [] process_one_work+0x216/0x39d [ 4.304466] [] ? process_one_work+0x1af/0x39d [ 4.304468] [] worker_thread+0x366/0x442 [ 4.304470] [] ? trace_hardirqs_on+0xd/0xf [ 4.304472] [] ? process_one_work+0x39d/0x39d [ 4.304475] [] kthread+0xe1/0xe9 [ 4.304478] [] ? __init_kthread_worker+0x56/0x56 [ 4.304481] [] ret_from_fork+0x7c/0xb0 [ 4.304483] [] ? __init_kthread_worker+0x56/0x56 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/