From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756699AbZISJ14 (ORCPT ); Sat, 19 Sep 2009 05:27:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753307AbZISJ1z (ORCPT ); Sat, 19 Sep 2009 05:27:55 -0400 Received: from fg-out-1718.google.com ([72.14.220.158]:19126 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903AbZISJ1x (ORCPT ); Sat, 19 Sep 2009 05:27:53 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=RCMl+ksnTQpSCNqGr3D0t7h9EjLXv3bmEkqSCN35Hr8h5IBJZFRvvoDwd6cG6j5UFr ml9sMJ8+tm7WlYDpyyhfFNLbUZL1v7asrlEZIqqHKfzsKV3hntDS5OsD+qqTo1fezhAv VR5M0Sji1V9xmgqS0UCZDUS3V2WkDApboCIy8= Message-ID: <4AB4A25C.9000904@gmail.com> Date: Sat, 19 Sep 2009 11:20:28 +0200 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; cs-CZ; rv:1.9.1.1) Gecko/20090715 SUSE/3.0b3-8.6 Thunderbird/3.0b3 MIME-Version: 1.0 To: Krzysztof Helt CC: linux-input@vger.kernel.org, Linux Kernel Mailing List Subject: Re: hid-core: fix lockdep in hid_input_report() References: <20090919081549.669b6773.krzysztof.h1@wp.pl> In-Reply-To: <20090919081549.669b6773.krzysztof.h1@wp.pl> X-Enigmail-Version: 0.97a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/19/2009 08:15 AM, Krzysztof Helt wrote: > There is a lockdep warning in the hid_input_report() due to dynamic allocation > of a temporary buffer. > Change the buffer to a local variable. The buffer size is 512 chars. I personally don't like this approach. Adding 0.5k to a stack is not a good idea (and it is worse when one looks at the long trace). I think hid_ctrl should call hid_input_report with 1 as the last argument instead. > The lockdep trace is: > > WARNING: at kernel/lockdep.c:2457 lockdep_trace_alloc+0xca/0xd0() > Hardware name: Product Name > Modules linked in: usbhid(+) hid uhci_hcd ne2k_pci via_agp 8390 i2c_via > Pid: 0, comm: swapper Not tainted 2.6.31 #74 > Call Trace: > [] ? lockdep_trace_alloc+0xca/0xd0 > [] warn_slowpath_common+0x7c/0xa0 > [] ? lockdep_trace_alloc+0xca/0xd0 > [] warn_slowpath_null+0x15/0x20 > [] lockdep_trace_alloc+0xca/0xd0 > [] kmem_cache_alloc+0x28/0x100 > [] ? hid_input_report+0x6f/0x220 [hid] > [] hid_input_report+0x6f/0x220 [hid] > [] hid_ctrl+0x7f/0x180 [usbhid] > [] usb_hcd_giveback_urb+0x41/0xa0 > [] uhci_giveback_urb+0x8c/0x280 [uhci_hcd] > [] ? dma_pool_free+0xd3/0x120 > [] ? uhci_free_td+0x58/0xa0 [uhci_hcd] > [] uhci_scan_schedule+0x301/0x910 [uhci_hcd] > [] uhci_irq+0x94/0x940 [uhci_hcd] > [] ? __lock_acquire+0x433/0xab0 > [] ? mask_and_ack_8259A+0x66/0x100 > [] usb_hcd_irq+0x6b/0x90 > [] handle_IRQ_event+0x2d/0xc0 > [] handle_level_irq+0x65/0xe0 > [] handle_irq+0x34/0x60 > [] do_IRQ+0x39/0xb0 > [] ? trace_hardirqs_on_caller+0x12c/0x180 > [] common_interrupt+0x2e/0x40 > [] ? default_idle+0x38/0x50 > [] apm_cpu_idle+0x10f/0x290 > [] cpu_idle+0x21/0x40 > [] rest_init+0x4d/0x60 > [] start_kernel+0x235/0x280 > [] ? unknown_bootoption+0x0/0x210 > [] __init_begin+0x3f/0x50