From patchwork Thu Dec 12 23:17:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yinghai Lu X-Patchwork-Id: 300812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C96232C00A4 for ; Fri, 13 Dec 2013 10:17:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751890Ab3LLXRw (ORCPT ); Thu, 12 Dec 2013 18:17:52 -0500 Received: from mail-ie0-f170.google.com ([209.85.223.170]:38207 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874Ab3LLXRv (ORCPT ); Thu, 12 Dec 2013 18:17:51 -0500 Received: by mail-ie0-f170.google.com with SMTP id qd12so1783831ieb.15 for ; Thu, 12 Dec 2013 15:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=u+qFl/o0xW3WieepNUb9l1jQtkiM5/02D0HdpJs7Oc8=; b=pJIFMynH98zyG1FJwafZMBchE5mtaprZ9FAmyKJ82VEbj49c4I0OY/9X49oDuENF0t qw6iY6i67dne8UrVbdklPeZN3Sw6Z4JGY0Fit7O/R2o3vzQyTbdZKP4u3rHJnsGP2U+1 NredXMwcXlIh3lwu+034/0GsCdTBOFtfZEfucrtheHGvbIS0APQwqHFFAVrnoVyAhQEj +omS0bExza58Opyif/okiLULuDkH68kU4HGmfqv7nhEELXlSdpeuBaH8ut+uVtvUMse3 HsNOS5oAiQcPjwnB0w/lM+wcPcClJBE8AgnMbD1gG4+PvZjvpcyZjnNH4xI2QFt9eS7A +GYA== MIME-Version: 1.0 X-Received: by 10.50.49.65 with SMTP id s1mr382416ign.43.1386890270967; Thu, 12 Dec 2013 15:17:50 -0800 (PST) Received: by 10.64.235.70 with HTTP; Thu, 12 Dec 2013 15:17:50 -0800 (PST) In-Reply-To: References: <20131127184652.GA1856@kroah.com> Date: Thu, 12 Dec 2013 15:17:50 -0800 X-Google-Sender-Auth: yAFROvn0EsV_Z7LUMJFqRN061tU Message-ID: Subject: Re: [PATCH] PCI: export MSI mode using attributes, not kobjects From: Yinghai Lu To: Bjorn Helgaas Cc: Greg Kroah-Hartman , Neil Horman , Linus Torvalds , Veaceslav Falico , "linux-pci@vger.kernel.org" , Thomas Gleixner , Knut Petersen , Ingo Molnar , Paul McKenney , =?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?= , Linux Kernel Mailing List Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Sat, Dec 7, 2013 at 12:41 PM, Bjorn Helgaas wrote: > On Wed, Nov 27, 2013 at 11:46 AM, Greg Kroah-Hartman > wrote: >> From: Greg Kroah-Hartman >> >> The PCI MSI sysfs code is a mess with kobjects for things that don't >> really need to be kobjects. This patch creates attributes dynamically >> for the MSI interrupts instead of using kobjects. >> >> Note, this removes a directory from the current MSI interrupt sysfs >> code: >> >> old MSI kobjects: >> pci_device >> └── msi_irqs >> └── 40 >> └── mode >> >> new MSI attributes: >> pci_device >> └── msi_irqs >> └── 40 >> >> As there was only one file "mode" with the kobject model, the interrupt >> number is now a file that returns the "mode" of the interrupt (msi vs. >> msix). >> >> Signed-off-by: Greg Kroah-Hartman > > I added the acks from Neil and Veaceslav, folded in the > Documentation/ABI update, and applied the whole thing to my pci/misc > branch for v3.14. Thanks! got: [ 71.429735] BUG: key ffff887fcf082a58 not in .data! [ 71.429737] ------------[ cut here ]------------ [ 71.429742] WARNING: CPU: 0 PID: 4 at kernel/locking/lockdep.c:2987 lockdep_i nit_map+0x127/0x5b0() [ 71.429743] DEBUG_LOCKS_WARN_ON(1) [ 71.429744] Modules linked in: [ 71.429747] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G I 3.13.0-rc3 -yh-01187-ge0e4e4e-dirty #45 [ 71.429757] Workqueue: events work_for_cpu_fn [ 71.429792] 0000000000000009 ffff881fcf95da58 ffffffff82020475 ffff881fcf95d aa0 [ 71.429800] ffff881fcf95da90 ffffffff81097c3d ffff887fcf082a58 ffff88dfcec1a d28 [ 71.429809] 0000000000000000 0000000000000000 ffff889fcf2eecd0 ffff881fcf95d af0 [ 71.429809] Call Trace: [ 71.429814] [] dump_stack+0x45/0x56 [ 71.429818] [] warn_slowpath_common+0x7d/0xa0 [ 71.429822] [] warn_slowpath_fmt+0x4c/0x50 [ 71.429826] [] lockdep_init_map+0x127/0x5b0 [ 71.429835] [] ? sysfs_new_dirent+0x98/0x140 [ 71.429839] [] sysfs_add_file_mode_ns+0x63/0xc0 [ 71.429843] [] internal_create_group+0x18d/0x260 [ 71.429853] [] ? populate_msi_sysfs+0x185/0x1d0 [ 71.429857] [] sysfs_create_groups+0x42/0xa0 [ 71.429861] [] populate_msi_sysfs+0x1a7/0x1d0 [ 71.429865] [] pci_enable_msi_block+0x1f7/0x2a0 [ 71.429870] [] pcie_port_device_register+0x335/0x520 [ 71.429874] [] pcie_portdrv_probe+0x68/0xa0 [ 71.429883] [] local_pci_probe+0x45/0xa0 [ 71.429887] [] work_for_cpu_fn+0x14/0x20 [ 71.429891] [] process_one_work+0x28b/0x4a0 [ 71.429895] [] ? process_one_work+0x202/0x4a0 [ 71.429899] [] worker_thread+0x26b/0x3a0 [ 71.429903] [] ? trace_hardirqs_on+0xd/0x10 [ 71.429906] [] ? manage_workers.isra.17+0x340/0x340 [ 71.429912] [] kthread+0x111/0x120 [ 71.429919] [] ? local_clock+0x2b/0x40 [ 71.429923] [] ? kthread_stop+0xf0/0xf0 [ 71.429927] [] ret_from_fork+0x7c/0xb0 [ 71.429931] [] ? kthread_stop+0xf0/0xf0 [ 71.429933] ---[ end trace c511e3d74efea94e ]--- looks like Greg forgot adding attr init. Can you fold attached patch into Greg's patch ? Acked-by: Greg Kroah-Hartman --- drivers/pci/msi.c | 1 + 1 file changed, 1 insertion(+) Index: linux-2.6/drivers/pci/msi.c =================================================================== --- linux-2.6.orig/drivers/pci/msi.c +++ linux-2.6/drivers/pci/msi.c @@ -547,6 +547,7 @@ static int populate_msi_sysfs(struct pci msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL); if (!msi_dev_attr) return -ENOMEM; + sysfs_attr_init(&msi_dev_attr->attr); sprintf(name, "%d", entry->irq); msi_dev_attr->attr.name = name; msi_dev_attr->attr.mode = S_IRUGO;