All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Remove ksets from sysfs eagerly
@ 2013-10-08 20:20 Bjorn Helgaas
  2013-10-08 20:20 ` [PATCH 1/2] kobject: remove kset from sysfs immediately in kset_unregister() Bjorn Helgaas
  2013-10-08 20:20 ` [PATCH 2/2] kobject: fix kset sample error path Bjorn Helgaas
  0 siblings, 2 replies; 7+ messages in thread
From: Bjorn Helgaas @ 2013-10-08 20:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Veaceslav Falico, Russell King, Neil Horman, linux-pci,
	linux-kernel, Zdenek Kabelac

With CONFIG_DEBUG_KOBJECT_RELEASE=y, kobject release is delayed even after
the last reference to the object is dropped.

With this turned on, Veaceslav and Zdenek noticed that when we enable,
disable, and re-enable MSIs, we often see errors like "sysfs: cannot create
duplicate filename '/devices/pci0000:00/.../msi_irqs'".  This happens
when we unload and reload drivers that use MSI.

The reason is that the MSI disable path uses kset_unregister(dev->msi_kset),
which doesn't remove the kset from sysfs until the the kobject release
function is called.  With CONFIG_DEBUG_KOBJECT_RELEASE, the release is
obviously delayed, but even without it, the release will be delayed if
somebody has the kset sysfs file open when kset_unregister() is called.

We could work around this by explicitly calling
"kobject_del(&dev->msi_kset->kobj)", but that seems clunky and other
kset_unregister() users are likely to have similar problems.

The idea of this patch is to make kset_unregister() unlink the kset from
sysfs immediately, before dropping the kset reference.

---

Bjorn Helgaas (2):
      kobject: remove kset from sysfs immediately in kset_unregister()
      kobject: fix kset sample error path


 Documentation/kobject.txt      |    3 ++-
 lib/kobject.c                  |    1 +
 samples/kobject/kset-example.c |    1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-12-06  0:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 20:20 [PATCH 0/2] Remove ksets from sysfs eagerly Bjorn Helgaas
2013-10-08 20:20 ` [PATCH 1/2] kobject: remove kset from sysfs immediately in kset_unregister() Bjorn Helgaas
2013-12-03 18:04   ` Greg Kroah-Hartman
2013-12-03 22:41     ` Bjorn Helgaas
2013-12-06  0:01       ` Greg Kroah-Hartman
2013-12-06  0:34         ` Bjorn Helgaas
2013-10-08 20:20 ` [PATCH 2/2] kobject: fix kset sample error path Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.