From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751529Ab0CTTIM (ORCPT ); Sat, 20 Mar 2010 15:08:12 -0400 Received: from hera.kernel.org ([140.211.167.34]:33010 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346Ab0CTTIK (ORCPT ); Sat, 20 Mar 2010 15:08:10 -0400 Message-ID: <4BA51CD7.1070108@kernel.org> Date: Sat, 20 Mar 2010 12:07:03 -0700 From: Yinghai Lu User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100228 SUSE/3.0.3-1.1.1 Thunderbird/3.0.3 MIME-Version: 1.0 To: James Bottomley , Greg KH CC: "Eric W. Biederman" , Linux Kernel Mailing List , Linux-Scsi Subject: [PATCH] driver: fix lockdep with sysfs References: <86802c441003081612r2f44efd6n9664b4b7c98a636a@mail.gmail.com> <4B95F37E.6060309@kernel.org> <4B99A6F0.4080203@kernel.org> <4BA47692.7040401@kernel.org> <1269099710.4353.106.camel@mulgrave.site> In-Reply-To: <1269099710.4353.106.camel@mulgrave.site> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 135.305026] QLogic Fibre Channel HBA Driver: 8.03.02-k1 [ 135.310509] qla2xxx 0000:cc:00.0: PCI INT A -> GSI 99 (level, low) -> IRQ 99 [ 135.326453] qla2xxx 0000:cc:00.0: MSI-X vector count: 31 [ 135.341911] qla2xxx 0000:cc:00.0: Found an ISP2532, irq 99, iobase 0xffffc9007285c000 [ 135.352495] alloc irq_desc for 146 on node 6 [ 135.356272] alloc kstat_irqs on node 6 [ 135.367624] qla2xxx 0000:cc:00.0: irq 146 for MSI/MSI-X [ 135.372172] alloc irq_desc for 147 on node 6 [ 135.376164] alloc kstat_irqs on node 6 [ 135.391973] qla2xxx 0000:cc:00.0: irq 147 for MSI/MSI-X [ 135.403591] qla2xxx 0000:cc:00.0: Configuring PCI space... [ 135.413614] qla2xxx 0000:cc:00.0: setting latency timer to 64 [ 135.422740] qla2xxx 0000:cc:00.0: enabling Mem-Wr-Inval [ 135.445429] qla2xxx 0000:cc:00.0: Configure NVRAM parameters... [ 135.462077] qla2xxx 0000:cc:00.0: Verifying loaded RISC code... [ 135.469113] qla2xxx 0000:cc:00.0: firmware: using built-in firmware ql2500_fw.bin [ 135.482852] qla2xxx 0000:cc:00.0: FW: Loading via request-firmware... [ 135.519818] qla2xxx 0000:cc:00.0: Allocated (64 KB) for FCE... [ 135.525475] qla2xxx 0000:cc:00.0: Allocated (64 KB) for EFT... [ 135.533345] qla2xxx 0000:cc:00.0: Allocated (1350 KB) for firmware dump... [ 135.539819] scsi0 : qla2xxx [ 135.554163] BUG: key ffff8840723fe310 not in .data! [ 135.558600] ------------[ cut here ]------------ [ 135.562666] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xf1/0x53c() [ 135.574592] Hardware name: Sun Fire x4800 [ 135.576871] Modules linked in: [ 135.592605] Pid: 14368, comm: work_for_cpu Not tainted 2.6.34-rc2-tip-yh-03489-gae232d1-dirty #687 [ 135.599585] Call Trace: [ 135.612279] [] warn_slowpath_common+0x7c/0x94 [ 135.618090] [] warn_slowpath_null+0x14/0x16 [ 135.633496] [] lockdep_init_map+0xf1/0x53c [ 135.638220] [] ? sysfs_new_dirent+0x8f/0x104 [ 135.654379] [] sysfs_add_file_mode+0x66/0xae [ 135.659672] [] ? kobject_put+0x47/0x4b [ 135.674975] [] ? transport_add_class_device+0x0/0x39 [ 135.681399] [] sysfs_add_file+0x11/0x13 [ 135.695045] [] sysfs_create_file+0x2a/0x2c [ 135.698206] [] device_create_file+0x19/0x1b [ 135.714671] [] attribute_container_add_attrs+0x56/0x74 [ 135.731897] [] attribute_container_add_class_device+0x22/0x27 [ 135.738647] [] transport_add_class_device+0x1a/0x39 [ 135.754319] [] attribute_container_device_trigger+0x7c/0xbc [ 135.759012] [] transport_add_device+0x15/0x17 [ 135.777621] [] scsi_sysfs_add_host+0x8c/0x9e [ 135.791587] [] scsi_add_host_with_dma+0x1c2/0x217 [ 135.798047] [] qla2x00_probe_one+0xbeb/0xe17 [ 135.813384] [] ? trace_hardirqs_on+0xd/0xf [ 135.819473] [] ? _raw_spin_unlock_irq+0x30/0x36 [ 135.834964] [] ? finish_task_switch+0x70/0xe4 [ 135.839030] [] ? schedule+0x65f/0x72b [ 135.854065] [] ? do_work_for_cpu+0x0/0x2a [ 135.858979] [] local_pci_probe+0x17/0x1b [ 135.874627] [] do_work_for_cpu+0x18/0x2a [ 135.879828] [] kthread+0x9a/0xa2 [ 135.893473] [] ? trace_hardirqs_on_caller+0x120/0x14b [ 135.897853] [] kernel_thread_helper+0x4/0x10 [ 135.915221] [] ? restore_args+0x0/0x30 [ 135.920415] [] ? kthread+0x0/0xa2 [ 135.934108] [] ? kernel_thread_helper+0x0/0x10 [ 135.938754] ---[ end trace 0f8a5c5b26192860 ]--- [ 135.955325] BUG: key ffff8840723fe348 not in .data! [ 135.957618] BUG: key ffff8840723fe380 not in .data! [ 135.972538] BUG: key ffff8840723fe3b8 not in .data! [ 135.976839] BUG: key ffff8840723fe3f0 not in .data! [ 135.992169] BUG: key ffff8840723fe428 not in .data! [ 135.995598] BUG: key ffff8840723fe460 not in .data! [ 136.001329] BUG: key ffff8840723fe498 not in .data! [ 136.015597] BUG: key ffff8840723fe4d0 not in .data! [ 136.019889] BUG: key ffff8840723fe508 not in .data! [ 136.034086] BUG: key ffff8840723fe540 not in .data! [ 136.036915] BUG: key ffff8840723fe578 not in .data! [ 136.053066] BUG: key ffff8840723fe5b0 not in .data! [ 136.058530] BUG: key ffff8840723fe5e8 not in .data! [ 136.071615] BUG: key ffff8840723fe620 not in .data! [ 136.076256] BUG: key ffff8840723fe658 not in .data! [ 136.081129] BUG: key ffff8840723fe690 not in .data! and [ 132.409474] Emulex LightPulse Fibre Channel SCSI driver 8.3.10 [ 132.424746] Copyright(c) 2004-2009 Emulex. All rights reserved. [ 132.430422] lpfc 0000:cd:00.0: PCI INT A -> GSI 101 (level, low) -> IRQ 101 [ 132.445731] lpfc 0000:cd:00.0: setting latency timer to 64 [ 132.450672] lpfc 0000:cd:00.0: enabling Mem-Wr-Inval [ 132.469272] scsi0 : on PCI bus cd device 00 irq 101 [ 132.476490] BUG: key ffff881c7b86c310 not in .data! [ 132.484102] ------------[ cut here ]------------ [ 132.486701] WARNING: at kernel/lockdep.c:2706 lockdep_init_map+0xf1/0x53c() [ 132.504379] Hardware name: Sun Fire x4800 [ 132.507564] Modules linked in: [ 132.509834] Pid: 7071, comm: work_for_cpu Not tainted 2.6.34-rc2-tip-yh-03489-gae232d1-dirty #687 [ 132.527149] Call Trace: [ 132.541391] [] warn_slowpath_common+0x7c/0x94 [ 132.544345] [] warn_slowpath_null+0x14/0x16 [ 132.562047] [] lockdep_init_map+0xf1/0x53c [ 132.566212] [] ? sysfs_new_dirent+0x8f/0x104 [ 132.581672] [] sysfs_add_file_mode+0x66/0xae [ 132.585236] [] ? kobject_put+0x47/0x4b [ 132.603426] [] ? transport_add_class_device+0x0/0x39 [ 132.607886] [] sysfs_add_file+0x11/0x13 [ 132.623460] [] sysfs_create_file+0x2a/0x2c [ 132.628466] [] device_create_file+0x19/0x1b [ 132.643430] [] attribute_container_add_attrs+0x56/0x74 [ 132.648177] [] attribute_container_add_class_device+0x22/0x27 [ 132.665296] [] transport_add_class_device+0x1a/0x39 [ 132.681485] [] attribute_container_device_trigger+0x7c/0xbc [ 132.686590] [] transport_add_device+0x15/0x17 [ 132.702516] [] scsi_sysfs_add_host+0x8c/0x9e [ 132.708766] [] scsi_add_host_with_dma+0x1c2/0x217 [ 132.724171] [] lpfc_create_port+0x247/0x295 [ 132.740978] [] lpfc_create_shost+0x50/0x8e [ 132.745700] [] lpfc_pci_probe_one_s3+0x21f/0x48b [ 132.762194] [] ? do_work_for_cpu+0x0/0x2a [ 132.768137] [] lpfc_pci_probe_one+0x66/0x6d [ 132.781613] [] local_pci_probe+0x17/0x1b [ 132.786593] [] do_work_for_cpu+0x18/0x2a [ 132.801537] [] kthread+0x9a/0xa2 [ 132.805921] [] ? trace_hardirqs_on_caller+0x120/0x14b [ 132.822948] [] kernel_thread_helper+0x4/0x10 [ 132.827937] [] ? restore_args+0x0/0x30 [ 132.843328] [] ? kthread+0x0/0xa2 [ 132.845962] [] ? kernel_thread_helper+0x0/0x10 [ 132.862076] ---[ end trace b22595c04061dc94 ]--- [ 132.863756] BUG: key ffff881c7b86c348 not in .data! [ 132.881037] BUG: key ffff881c7b86c380 not in .data! [ 132.884181] BUG: key ffff881c7b86c3b8 not in .data! [ 132.888249] BUG: key ffff881c7b86c3f0 not in .data! [ 132.905692] BUG: key ffff881c7b86c428 not in .data! [ 132.908299] BUG: key ffff881c7b86c460 not in .data! [ 132.922920] BUG: key ffff881c7b86c498 not in .data! [ 132.928176] BUG: key ffff881c7b86c4d0 not in .data! [ 132.942182] BUG: key ffff881c7b86c508 not in .data! [ 132.946896] BUG: key ffff881c7b86c540 not in .data! [ 132.960576] BUG: key ffff881c7b86c578 not in .data! [ 132.964449] BUG: key ffff881c7b86c5b0 not in .data! [ 132.967376] BUG: key ffff881c7b86c5e8 not in .data! [ 132.983418] BUG: key ffff881c7b86c620 not in .data! Signed-off-by: Yinghai Lu --- drivers/base/attribute_container.c | 1 + 1 file changed, 1 insertion(+) Index: linux-2.6/drivers/base/attribute_container.c =================================================================== --- linux-2.6.orig/drivers/base/attribute_container.c +++ linux-2.6/drivers/base/attribute_container.c @@ -328,6 +328,7 @@ attribute_container_add_attrs(struct dev return sysfs_create_group(&classdev->kobj, cont->grp); for (i = 0; attrs[i]; i++) { + sysfs_attr_init(&attrs[i]->attr); error = device_create_file(classdev, attrs[i]); if (error) return error;