From: Muli Ben-Yehuda <mulix@mulix.org>
To: Brian King <brking@us.ibm.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [RFC] IBM Power RAID driver (ipr)
Date: Sat, 17 Jan 2004 01:01:19 +0200 [thread overview]
Message-ID: <20040116230118.GP734@actcom.co.il> (raw)
In-Reply-To: <40085EDA.4010802@us.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 3046 bytes --]
On Fri, Jan 16, 2004 at 03:59:54PM -0600, Brian King wrote:
> http://www-124.ibm.com/storageio/ipr/patch-2.6.1-ipr-2.0.0-1.gz
Hi, I took a look and I have some comments / questions. I will try to
go over all of it in the next few days, but here's what I went over so
far:
> +static int ipr_unsafe = 1; /* xxx set to 0 for ship */
Should it be set to 0 or to 1 for inclusion in the kernel? any driver
that is first included is considered experimental, so just how unsafe
is ipr_unsafe?
> +module_param_named(unsafe, ipr_unsafe, int, 0);
> +MODULE_PARM_DESC(unsafe, "Do not use!");
Same question, I guess, and if you decide to keep it, please add a
more descriptive MODULE_PARM_DESC string...
> +static void ipr_sleep_no_lock(signed long delay)
> +{
> + DECLARE_WAIT_QUEUE_HEAD(internal_wait);
> +
> + sleep_on_timeout(&internal_wait, (delay * HZ) / 1000);
> + return;
just a nitpick, but the Linux coding style says no 'return' from void
functions.
>+static void ipr_sleep(struct ipr_ioa_cfg *ioa_cfg, signed long delay)
> +{
> + spin_unlock_irq(ioa_cfg->host->host_lock);
> + ipr_sleep_no_lock(delay);
> + spin_lock_irq(ioa_cfg->host->host_lock);
Hmpf... it's called from ipr_diagnostic_ioctl(), which does
spin_lock_irqsave()
ipr_sleep()
spin_unlock_irqrestore()
So I guess you really do intend to enable interrupts before going to
sleep? it's somewhat fragile... also, is the dropping and
reacquisition of the lock safe here (in the sense that none of the
data the lock is protecting that we care about can change while the
lock is not held?)
Same questions wrt ipr_interruptible_sleep_on(), which does the same
thing. By the way, ipr_dump_ioctl does not check the return value from
ipr_interruptible_sleep_on(). If this is intentional, perhaps call it
using (void)ipr_interruptible_sleep_on()?
> +static void ipr_block_requests(struct ipr_ioa_cfg *ioa_cfg)
> +{
> + ENTER;
> +
> + if (0 == ioa_cfg->block_host_ops++) {
> + ioa_cfg->allow_cmds = 0;
This is racy unless a lock is held. I think a lock is held here in all
callers of this function, but a comment to that effect would be nice
before the function. This also applies to every other function which
either must be called with a lock taken, or modifies the "locking
status" - takes a lock which is released elsewhere, enables interrupts
unconditionally, etc.
+static void ipr_unblock_requests(struct ipr_ioa_cfg *ioa_cfg)
+{
+ ENTER;
+
+ if (0 == --ioa_cfg->block_host_ops) {
+ ioa_cfg->allow_cmds = 1;
+ spin_unlock_irq(ioa_cfg->host->host_lock);
+ scsi_unblock_requests(ioa_cfg->host);
+ spin_lock_irq(ioa_cfg->host->host_lock);
Eeek! What happens if on another CPU a call comes in that does
ipr_block_requests() after the lock is released and before it is taken
again?
That's as far as I got, for now.
Cheers,
Muli
--
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
"the nucleus of linux oscillates my world" - gccbot@#offtopic
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-01-16 23:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-16 21:59 [RFC] IBM Power RAID driver (ipr) Brian King
2004-01-16 23:01 ` Muli Ben-Yehuda [this message]
2004-01-16 23:46 ` Brian King
2004-01-18 14:10 ` Anton Blanchard
2004-01-19 16:16 ` Brian King
2004-01-19 18:34 ` Christoph Hellwig
2004-01-19 19:33 ` Mike Anderson
2004-01-19 19:35 ` Christoph Hellwig
2004-01-20 5:57 ` Douglas Gilbert
2004-01-20 13:21 ` Christoph Hellwig
2004-01-19 20:30 ` Brian King
2004-01-20 13:38 ` Christoph Hellwig
2004-01-20 16:41 ` Brian King
2004-01-20 17:18 ` Mike Anderson
2004-01-20 18:01 ` Christoph Hellwig
2004-01-20 19:13 ` Brian King
2004-01-20 19:28 ` Christoph Hellwig
2004-01-20 20:13 ` Brian King
2004-01-21 20:49 ` Brian King
2004-01-22 14:02 ` Christoph Hellwig
2004-01-22 16:39 ` Patrick Mansfield
2004-01-22 16:56 ` Patrick Mansfield
2004-01-22 17:09 ` Brian King
2004-01-22 17:27 ` Patrick Mansfield
2004-01-22 17:33 ` Brian King
2004-01-20 20:35 ` Patrick Mansfield
2004-01-20 22:37 ` Brian King
2004-01-20 22:39 ` Christoph Hellwig
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=20040116230118.GP734@actcom.co.il \
--to=mulix@mulix.org \
--cc=brking@us.ibm.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.