mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Rose <johnrose@austin.ibm.com>
To: jbarnes@sgi.com, Greg KH <greg@kroah.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] release_pcibus_dev() crash
Date: Wed, 12 Jan 2005 18:39:16 -0600	[thread overview]
Message-ID: <1105576756.8062.17.camel@sinatra.austin.ibm.com> (raw)

During the course of a hotplug removal of a PCI bus, release_pcibus_dev()
attempts to remove attribute files from a kobject directory that no longer
exists.  The calls that cause the crash were recently added, and this patch
removes them.  The partial oops traceback, observed on ppc64, is:

[c0000000ba1eb2d0] c0000000000f6eb4 .sysfs_remove_file+0x20/0x38
[c0000000ba1eb350] c00000000024c564 .class_device_remove_file+0x28/0x40
[c0000000ba1eb3d0] c0000000001dad5c .release_pcibus_dev+0x38/0x90
[c0000000ba1eb460] c00000000024c884 .class_dev_release+0x50/0x84
[c0000000ba1eb4e0] c0000000001cf4a8 .kobject_cleanup+0xec/0xf4
[c0000000ba1eb580] c0000000001d02f8 .kref_put+0x90/0x98
[c0000000ba1eb600] c0000000001cf500 .kobject_put+0x34/0x50
[c0000000ba1eb680] c00000000024d2ac .class_device_put+0x1c/0x34
[c0000000ba1eb700] c00000000024d194 .class_device_unregister+0x28/0x44
[c0000000ba1eb790] c0000000001dc8d8 .pci_remove_bus+0x78/0x98
...

The removal of the class device from sysfs is carried out explicitly by
class_device_del(), which occurs prior to class_device_put().  The class device
is gone from sysfs by the time class_device_put() is called.  As such, this
release function should not carry out sysfs cleanups for the class device.

I'm unsure how pci_remove_legacy_files() doesn't cause the same crash for those
who implemented it, but I'll leave that alone for now.

Thanks-
John

Signed-off-by: John Rose <johnrose@austin.ibm.com>

diff -puN drivers/pci/probe.c~01_release_pcibus_dev drivers/pci/probe.c
--- 2_6_linus_2/drivers/pci/probe.c~01_release_pcibus_dev	2005-01-12 18:22:00.000000000 -0600
+++ 2_6_linus_2-johnrose/drivers/pci/probe.c	2005-01-12 18:22:29.000000000 -0600
@@ -96,9 +96,6 @@ static void release_pcibus_dev(struct cl
 	struct pci_bus *pci_bus = to_pci_bus(class_dev);
 
 	pci_remove_legacy_files(pci_bus);
-	class_device_remove_file(&pci_bus->class_dev,
-				 &class_device_attr_cpuaffinity);
-	sysfs_remove_link(&pci_bus->class_dev.kobj, "bridge");
 	if (pci_bus->bridge)
 		put_device(pci_bus->bridge);
 	kfree(pci_bus);

_


             reply	other threads:[~2005-01-13  0:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-13  0:39 John Rose [this message]
2005-01-13  0:55 ` Jesse Barnes
2005-01-13 17:11   ` John Rose
2005-01-13 17:33     ` Jesse Barnes
2005-01-13 17:49       ` John Rose
2005-01-13 18:18         ` Greg KH
2005-01-13 18:21           ` Jesse Barnes
2005-01-13 18:37             ` Greg KH
2005-01-13 20:12               ` John Rose
2005-01-13 20:25                 ` Greg KH
2005-01-13 20:54                   ` John Rose
2005-01-13 21:05                     ` Greg KH
2005-01-13 21:17                       ` John Rose
2005-01-13 21:55                         ` John Rose
2005-01-13 23:41                         ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1105576756.8062.17.camel@sinatra.austin.ibm.com \
    --to=johnrose@austin.ibm.com \
    --cc=greg@kroah.com \
    --cc=jbarnes@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®