mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: James Bottomley <jbottomley@parallels.com>
Cc: Tejun Heo <tj@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] sysfs: handle duplicate removal attempts in sysfs_remove_group()
Date: Mon, 25 Nov 2013 13:43:58 +0100	[thread overview]
Message-ID: <3149277.4DLRgh8lWk@vostro.rjw.lan> (raw)
In-Reply-To: <1385375339.2354.28.camel@dabdike>

On Monday, November 25, 2013 10:29:00 AM James Bottomley wrote:
> On Fri, 2013-11-22 at 11:02 -0500, Tejun Heo wrote:
> > Hello,
> > 
> > On Fri, Nov 22, 2013 at 08:43:55AM -0700, Bjorn Helgaas wrote:
> > > > So, we do have cases where the parent is removed before the child.  I
> > > > suppose the parent pci bridge is removed already?  AFAICS this
> > > > shouldn't break anything but people did seem to expect the removals to
> > > > be ordered from child to parent.  Bjorn, is this something you expect
> > > > to happened?
> > > 
> > > I do not expect a PCI bridge to be removed before the devices below
> > > it.  We should be removing all the children before removing the parent
> > > bridge.
> > > 
> > > But is this related to PCI?  I don't see the connection yet.  I tried
> > 
> > I'm not sure.  It was from thunderbolt and nobody is reporting it on
> > other interconnects, so it could be.
> > 
> > > to look into this a bit (my notes are at
> > > https://bugzilla.kernel.org/show_bug.cgi?id=65281), but I haven't
> > > figured out the big-picture problem yet.
> > > 
> > > I don't have warm fuzzies that adding a "have we already removed this"
> > > check is the best resolution, but maybe that's just because I don't
> > > understand the problem.
> > 
> > Yeah, the whole thing is sorta pointless.  Just issuing removal and
> > continuing on should do, IMHO.
> 
> I'd go for that as well.  We have huge problems with the _del calls
> because visibility is strict hierarchy and it's not always easy to work
> out who's underneath us.
> 
> It's going to be really annoying when refcounting works perfectly for
> objects, so you can just do puts in any order, but you have to have
> _del() called to remove subordinate objects before their parent.

Well, that would be fine and dandy, but device_del() calls bus_remove_device()
which in turn runs device_release_driver() and the order in which *these*
things are done actually matters in general.

So yes, after we have released all of the drivers in question, we can do _del()
right before the final _put() in any order just fine.

Thanks,
Rafael


  reply	other threads:[~2013-11-25 12:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 13:09 Mika Westerberg
2013-11-19 13:28 ` Rafael J. Wysocki
2013-11-20  6:18 ` Tejun Heo
2013-11-20  9:56   ` [PATCH v2] " Mika Westerberg
2013-11-22 15:43   ` [PATCH] " Bjorn Helgaas
2013-11-22 16:02     ` Tejun Heo
2013-11-25 10:29       ` James Bottomley
2013-11-25 12:43         ` Rafael J. Wysocki [this message]
2013-11-22 22:43     ` Rafael J. Wysocki
2013-11-23 22:56     ` Rafael J. Wysocki
2013-11-23 22:53       ` Greg Kroah-Hartman
2013-11-23 23:12         ` Rafael J. Wysocki
2013-11-23 23:07           ` Greg Kroah-Hartman
2013-11-23 23:36             ` Rafael J. Wysocki
2013-11-24  1:09               ` Rafael J. Wysocki
2013-11-24 15:05                 ` Tejun Heo
2013-11-25 10:11                 ` Mika Westerberg
2013-11-25 10:41                   ` Rafael J. Wysocki
2013-11-25 23:51                     ` Gwendal Grignou
2013-11-25 12:19                   ` [PATCH] ATA: Fix port removal ordering Rafael J. Wysocki
2013-11-27  1:58                     ` Rafael J. Wysocki
2013-11-27  4:34                     ` Jingoo Han
2013-11-27 18:56                     ` Tejun Heo
2013-11-24  0:17             ` [PATCH] PCI: Move device_del() from pci_stop_dev() to pci_destroy_dev() Rafael J. Wysocki
2013-11-25  4:54               ` Yinghai Lu
2013-11-25  4:58                 ` Yinghai Lu
2013-11-25 11:23                   ` Rafael J. Wysocki
2013-11-25 19:48                     ` Yinghai Lu
2013-11-25 11:22                 ` Rafael J. Wysocki
2013-11-25 19:45                   ` Yinghai Lu
2013-11-25 20:57                     ` Rafael J. Wysocki
2013-11-25  9:47               ` Mika Westerberg
2013-11-25 11:24                 ` Rafael J. Wysocki
2013-11-25 21:59               ` Bjorn Helgaas
2013-11-25 22:19                 ` Rafael J. Wysocki
2013-11-28  0:41                 ` Jingoo Han

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=3149277.4DLRgh8lWk@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=tj@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®