From: Oliver Neukum <oneukum@suse.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
Kernel development list <linux-kernel@vger.kernel.org>,
Hans de Goede <hdegoede@redhat.com>
Subject: Re: Unbinding drivers for resources that are in use
Date: Tue, 14 Jun 2011 08:41:11 +0200 [thread overview]
Message-ID: <201106140841.11631.oneukum@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1106131048080.1983-100000@iolanthe.rowland.org>
Am Montag, 13. Juni 2011, 17:10:57 schrieb Alan Stern:
> Therefore I'm asking if the driver core should add a refcount to every
> struct device for keeping track of the number of open file references
> (or other types of resource) using this device. If this number is
> nonzero, the kernel should prevent the device from being unbound from
> its driver -- except of course in cases where the device has been
> hot-unplugged; there's nothing we can do to prevent errors when this
> happens.
>
Firstly, the user may want to unbind a driver for a device that is in use.
Secondly, the driver doesn't know in the general case. You've given the best example
yourself. A driver certainly must not know about mounted filesystems. Things
get really hairy if you consider i-scsi and related stuff.
So I'd say it would be major work for an additional feature that doesn't
help in the case that hurts most.
Now, if you are looking for a quick and dirty solution, you could export the
pm counters and provide an ioctl for unbind if zero.
Regards
Oliver
--
- - -
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5
90409 Nürnberg
Germany
- - -
prev parent reply other threads:[~2011-06-14 7:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-13 15:10 Unbinding drivers for resources that are in use Alan Stern
2011-06-13 15:42 ` Greg KH
2011-06-13 17:50 ` Hans de Goede
2011-06-13 19:15 ` Greg KH
2011-06-14 6:41 ` Oliver Neukum [this message]
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=201106140841.11631.oneukum@suse.de \
--to=oneukum@suse.de \
--cc=greg@kroah.com \
--cc=hdegoede@redhat.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