All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: patches@opensource.cirrus.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, rafael@kernel.org
Subject: Re: [PATCH] component: try_module_get() to prevent unloading while in use
Date: Mon, 25 Jul 2022 20:09:19 +0200	[thread overview]
Message-ID: <Yt7cT66p0Bn+aXn5@kroah.com> (raw)
In-Reply-To: <20220725160859.1274472-1-rf@opensource.cirrus.com>

On Mon, Jul 25, 2022 at 05:08:59PM +0100, Richard Fitzgerald wrote:
> Call try_module_get() on a component before attempting to call its
> bind() function, to ensure that a loadable module cannot be
> unloaded while we are executing its bind().

How can bind be called while the module is unloaded?

> If the bind is successful the module_put() is called only after it
> has been unbound. This ensures that the module cannot be unloaded
> while it is in use as an aggregate device.

That's almost never the correct thing to do, what problem is this
solving?

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <gregkh@linuxfoundation.org>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: rafael@kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, patches@opensource.cirrus.com
Subject: Re: [PATCH] component: try_module_get() to prevent unloading while in use
Date: Mon, 25 Jul 2022 20:09:19 +0200	[thread overview]
Message-ID: <Yt7cT66p0Bn+aXn5@kroah.com> (raw)
In-Reply-To: <20220725160859.1274472-1-rf@opensource.cirrus.com>

On Mon, Jul 25, 2022 at 05:08:59PM +0100, Richard Fitzgerald wrote:
> Call try_module_get() on a component before attempting to call its
> bind() function, to ensure that a loadable module cannot be
> unloaded while we are executing its bind().

How can bind be called while the module is unloaded?

> If the bind is successful the module_put() is called only after it
> has been unbound. This ensures that the module cannot be unloaded
> while it is in use as an aggregate device.

That's almost never the correct thing to do, what problem is this
solving?

thanks,

greg k-h

  reply	other threads:[~2022-07-25 18:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 16:08 [PATCH] component: try_module_get() to prevent unloading while in use Richard Fitzgerald
2022-07-25 16:08 ` Richard Fitzgerald
2022-07-25 18:09 ` Greg KH [this message]
2022-07-25 18:09   ` Greg KH
2022-07-26 10:32   ` Richard Fitzgerald
2022-07-26 10:32     ` Richard Fitzgerald
2022-07-26 17:28     ` Greg KH
2022-07-26 17:28       ` Greg KH
2022-07-28 10:49       ` Richard Fitzgerald
2022-07-28 10:49         ` Richard Fitzgerald
2022-07-28 11:48         ` Greg KH
2022-07-28 11:48           ` Greg KH

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=Yt7cT66p0Bn+aXn5@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rafael@kernel.org \
    --cc=rf@opensource.cirrus.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.