mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: LKML <linux-kernel@vger.kernel.org>, linux-pcmcia@lists.infradead.org
Subject: Re: pcmcia: release_class patch concern
Date: Tue, 28 Jun 2005 08:14:00 +0200	[thread overview]
Message-ID: <20050628061400.GA9019@isilmar.linta.de> (raw)
In-Reply-To: <200506272356.50029.dtor_core@ameritech.net>

Hi Dmitry,

On Mon, Jun 27, 2005 at 11:56:49PM -0500, Dmitry Torokhov wrote:
> Hi Dominik,
> 
> I noticed that Linus committed the patch from you that introduces waiting
> for completion in module's exit routine. I believe it is a big no-no

Is it really? Any PCI driver which calls pci_unregister_driver() waits for
completion (-> driver_unregister() -> wait_for_completion(&drv->unloaded) ).


> as something like this will wedge the kernel:
> 
> 	rmmod <module> < /sys/path/to/devices/attribute

Why would anybody issue such a command? But it even wouldn't succeed, as
the module usage count would be >0 if there are attributes below
/sys/class/pcmcia_socket/

> Have you considered using Greg's class_create()/class_destroy()

Oh, don't get me started... they're for class_device_create() -- and we
don't register char devices here -- and this interface has some severe 
limitations and shortcomings:
http://marc.theaimsgroup.com/?l=linux-usb-devel&m=111193575527911&w=2
and follow the thread...

> or maybe
> bumping up module's refrerence count when registering class devices so
> rmmod would fail if there are users of this module?

In fact, this is done already, even though indirectly: socket drivers will
always increase the reference count as they use exports from pcmcia_core.ko,
and their call to pcmcia_unregister_socket in the device's ->remove()
function only succeeds if the class device is actually freed. So I could
have left the other wait_for_completion out, as it should never actually
_wait_. Nonethteless, I consider it to be a safeguard.

Thanks,
	Dominik

  reply	other threads:[~2005-06-28  8:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-28  4:56 Dmitry Torokhov
2005-06-28  6:14 ` Dominik Brodowski [this message]
2005-06-28  6:41   ` Dmitry Torokhov

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=20050628061400.GA9019@isilmar.linta.de \
    --to=linux@dominikbrodowski.net \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.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®