All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: james.smart@emulex.com
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 5/7] lpfc 8.3.13: BSG management fixes
Date: Wed, 12 May 2010 12:38:33 -0500	[thread overview]
Message-ID: <4BEAE799.9010502@cs.wisc.edu> (raw)
In-Reply-To: <1273671164.24670.21.camel@wookie>

On 05/12/2010 08:32 AM, James Smart wrote:
> + * lpfc_bsg_get_kboject - gets a reference on the drivers module kobject


I think you wanted to name this lpfc_bsg_get_kobject and name the put 
function lpfc_bsg_put_kobject?



> + * @phba: Pointer to HBA context object
> + *
> + * This function bumps the reference on the drivers module kobject preventing
> + * the driver from being removed. Prevents the sysfs tree from being
> + * corrupted because the driver was removed while bsg jobs are unfinished,
> + * this would be the case for registered events or any command sent to hardware
> + * and the driver needs to wait for the command to complete.
> + **/
> +static void
> +lpfc_bsg_get_kboject(struct lpfc_hba *phba)
> +{
> +	struct lpfc_vport *vport = phba->pport;
> +	struct Scsi_Host  *shost = lpfc_shost_from_vport(vport);
> +	unsigned long flags;
> +
> +	spin_lock_irqsave(shost->host_lock, flags);
> +	__module_get(shost->dma_dev->driver->owner);
> +	spin_unlock_irqrestore(shost->host_lock, flags);
> +}

> +

What is the host_lock use for?

With this patch is is still possible for the module to unload right 
before lpfc_bsg_request is called? Should this use a try_module_get and 
if that fails fail the request?

Why not just add the module get() and put() calls to the fc class (would 
it just push the problem up?)?

Or what about in bsg.c, have bsg_open do a module_get? Could we add a 
module pointer to the bsg's devices request_queue and have bsg do the 
get when the device is opened?

  reply	other threads:[~2010-05-12 17:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12 13:32 [PATCH 5/7] lpfc 8.3.13: BSG management fixes James Smart
2010-05-12 17:38 ` Mike Christie [this message]
2010-05-12 19:00   ` James Smart
2010-05-14  9:29 ` FUJITA Tomonori
2010-05-14 13:46   ` James Smart
2010-05-14 14:30     ` James Smart
2010-05-17  6:24       ` FUJITA Tomonori
2010-05-19 18:35         ` James Smart
2010-05-20 11:41           ` FUJITA Tomonori

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=4BEAE799.9010502@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=james.smart@emulex.com \
    --cc=linux-scsi@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 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.