public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: dtor_core@ameritech.net
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Driver bind/unbind and __devinit
Date: Thu, 8 Dec 2005 13:55:22 -0800	[thread overview]
Message-ID: <20051208215522.GA25925@suse.de> (raw)
In-Reply-To: <d120d5000512081314r6b574eb3jf5516ef5bc28730d@mail.gmail.com>

On Thu, Dec 08, 2005 at 04:14:58PM -0500, Dmitry Torokhov wrote:
> Hi,
> 
> Many drivers have their probe routines declared as __devinit which is
> a no-op unless CONFIG_HOTPLUG is set. However driver's bind/unbind
> attributes are created unconditionally, as fas as I can see. Would not
> it cause an oops if someone tries to use these attributes with
> CONFIG_HOTPLUG=N? Am I missing something?

You are missing the CONFIG_HOTPLUG checks around the functions that add
and check the device ids from these sysfs files.  If CONFIG_HOTPLUG is
not enabled, those files do not do anything.

In 2.6.16, CONFIG_HOTPLUG is moving under CONFIG_EMBEDDED, so the odds
of people disabling it are going to be pretty small now.

> Also, unbind implementation does not seem safe - we check the driver
> before taking device's semaphore so we risk unbinding wrong driver (in
> the unlikely event that we manage to unbind and bind another driver in
> another thread).

Do you have a suggestion as to how to fix this?

thanks,

greg k-h

  reply	other threads:[~2005-12-08 21:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08 21:14 Driver bind/unbind and __devinit Dmitry Torokhov
2005-12-08 21:55 ` Greg KH [this message]
2005-12-08 22:22   ` Dmitry Torokhov
2005-12-08 22:26     ` Greg KH
2005-12-08 23:01       ` 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=20051208215522.GA25925@suse.de \
    --to=gregkh@suse.de \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.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