public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Device core removal ordering brokenness
Date: Mon, 11 May 2009 08:17:04 +1000	[thread overview]
Message-ID: <1241993824.19955.14.camel@pasglop> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0905101035410.31353-100000@netrider.rowland.org>

On Sun, 2009-05-10 at 10:58 -0400, Alan Stern wrote:

> Before the patch, the ordering was like this:
> 
> device_add: 	ADD  dpm_sysfs_add()  ->probe
> device_del:	dpm_sysfs_remove()  ->remove  DEL

Right.

> Now the ordering is like this:
> 
> device_add:	dpm_sysfs_add()  ADD  ->probe
> device_del:	DEL  dpm_sysfs_remove()  ->remove
> 
> Okay, yes, it's not symmetrical.  But the point of the patch was to put
> the DEL before the dpm_sysfs_remove(), and in any case the code wasn't
> symmetrical even before the patch.

How so ? It does definitely look symetrical above :-) That's not a big
deal per-se though, it's just that I want to be able to tear down data
structures in DEL that may be indirectly used by the driver (DMA mapping
related or even MMIO related internal arch stuff).

>   I gather that you'd prefer to see
> 
> device_del:	->remove  DEL  dpm_sysfs_remove()

I don't actually care that much about where drm_sysfs_remove() is vs.
DEL, but you seem to want to adjust the sysfs files in ADD and DEL, so
that would make sense.

> Offhand I can't think of any reason not to do this.  Maybe someone else 
> can; this code has a lot of undocumented constraints.  (Hmm, what 
> happens if a system suspend occurs after the device has been 
> unregistered from its bus but before it has been taken off the dpm 
> list?  It's probably okay but worth checking...)
> 
> If you'd like to submit a patch moving the "if (dev->bus)...", 
> device_pm_remove(), and dpm_sysfs_remove() stuff after the call to 
> bus_remove_device(), go ahead.

I first want to "probe" you guys in case there's some nasty skeleton
waiting around the corner, but yeah I'll probably do that. One other
option is to split DEL in two.

Ben



  reply	other threads:[~2009-05-10 22:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-09 23:29 Device core removal ordering brokenness Benjamin Herrenschmidt
2009-05-10 14:58 ` Alan Stern
2009-05-10 22:17   ` Benjamin Herrenschmidt [this message]
2009-05-11 14:02     ` Alan Stern

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=1241993824.19955.14.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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