From: Jeff Garzik <jeff@garzik.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
James Bottomley <James.Bottomley@suse.de>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] SCSI host lock push-down
Date: Sat, 13 Nov 2010 01:01:38 -0500 [thread overview]
Message-ID: <4CDE29C2.5040206@garzik.org> (raw)
In-Reply-To: <20101113051635.GA11613@havoc.gtf.org>
On 11/13/2010 12:16 AM, Jeff Garzik wrote:
> diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
> index 9e71ac6..f9581a3 100644
> --- a/drivers/scsi/arm/fas216.c
> +++ b/drivers/scsi/arm/fas216.c
> @@ -2198,7 +2198,7 @@ no_command:
> * Returns: 0 on success, else error.
> * Notes: io_request_lock is held, interrupts are disabled.
> */
> -int fas216_queue_command(struct scsi_cmnd *SCpnt,
> +static int fas216_queue_command_lck(struct scsi_cmnd *SCpnt,
> void (*done)(struct scsi_cmnd *))
> {
> FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
> @@ -2240,6 +2240,8 @@ int fas216_queue_command(struct scsi_cmnd *SCpnt,
> return result;
> }
>
> +DEF_SCSI_QCMD(fas216_queue_command)
> +
> /**
> * fas216_internal_done - trigger restart of a waiting thread in fas216_noqueue_command
> * @SCpnt: Command to wake
> @@ -2263,7 +2265,7 @@ static void fas216_internal_done(struct scsi_cmnd *SCpnt)
> * Returns: scsi result code.
> * Notes: io_request_lock is held, interrupts are disabled.
> */
> -int fas216_noqueue_command(struct scsi_cmnd *SCpnt,
> +static int fas216_noqueue_command_lck(struct scsi_cmnd *SCpnt,
> void (*done)(struct scsi_cmnd *))
> {
> FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
> @@ -2277,7 +2279,7 @@ int fas216_noqueue_command(struct scsi_cmnd *SCpnt,
> BUG_ON(info->scsi.irq != NO_IRQ);
>
> info->internal_done = 0;
> - fas216_queue_command(SCpnt, fas216_internal_done);
> + fas216_queue_command(SCpnt->device->host, SCpnt, fas216_internal_done);
>
> /*
> * This wastes time, since we can't return until the command is
hmmmm.
Linus's suggestion to add Scsi_Host to queuecommand seems to have had a
helpful side effect, exposing a minor bug present in nab's (v1), Andi's
(v2), my v3 and v4 push-down patches:
A few odd ducks, such as fas16 or ancient megaraid, call their own
->queuecommand directly. None of the major SCSI drivers do this,
thankfully.
The host lock push-down patch should be calling the _lck function in
those rare cases, otherwise we've created a deadlock.
Time for v5...
Jeff
next prev parent reply other threads:[~2010-11-13 6:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-12 23:55 [GIT PULL] SCSI queuecommand API change for 2.6.37-rc1 James Bottomley
2010-11-13 0:38 ` Nicholas A. Bellinger
2010-11-13 1:42 ` Linus Torvalds
2010-11-13 2:03 ` Jeff Garzik
2010-11-13 2:09 ` Jeff Garzik
2010-11-13 2:30 ` Linus Torvalds
2010-11-13 4:28 ` Matthew Wilcox
2010-11-13 4:42 ` Linus Torvalds
2010-11-13 5:26 ` Jeff Garzik
2010-11-13 6:01 ` James Bottomley
2010-11-13 6:07 ` Jeff Garzik
2010-11-13 7:18 ` Nicholas A. Bellinger
2010-11-16 6:57 ` Jeff Garzik
2010-11-16 7:08 ` Jeff Garzik
2010-11-13 5:16 ` [PATCH v4] SCSI host lock push-down Jeff Garzik
2010-11-13 6:01 ` Jeff Garzik [this message]
2010-11-16 7:10 ` [PATCH v5] " Jeff Garzik
2010-11-16 7:31 ` Jeff Garzik
2010-11-16 17:25 ` Linus Torvalds
2010-11-16 17:36 ` James Bottomley
2010-11-16 21:30 ` Linus Torvalds
2010-11-16 21:32 ` James Bottomley
2010-11-16 21:26 ` Jeff Garzik
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=4CDE29C2.5040206@garzik.org \
--to=jeff@garzik.org \
--cc=James.Bottomley@suse.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=torvalds@linux-foundation.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