linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "\"T?th Attila\"" <atoth@atoth.sote.hu>,
	adam radford <aradford@gmail.com>,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: twa generates WARNING upon boot
Date: Wed, 30 Sep 2015 09:15:30 -0700	[thread overview]
Message-ID: <1443629730.2185.25.camel@HansenPartnership.com> (raw)
In-Reply-To: <20150930160835.GA16534@infradead.org>

On Wed, 2015-09-30 at 09:08 -0700, Christoph Hellwig wrote:
> Hi all,
> 
> I'd like to propose the following patch intead.  It uses a helper
> to check the conditions for the copied commands, and also fixes another
> place to use it which uses a different and I think buggy check:
> 
> This avoids the usage of scsi_cmnd.SCp which I'd like to get rid of
> mid-term.
> 
> diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
> index add419d..74eac90 100644
> --- a/drivers/scsi/3w-9xxx.c
> +++ b/drivers/scsi/3w-9xxx.c
> @@ -212,6 +212,17 @@ static const struct file_operations twa_fops = {
>  	.llseek		= noop_llseek,
>  };
>  
> +/*
> + * The controllers use an inline buffer instead of a mapped SGL for small,
> + * single entry buffers.  Note that we treat a zero-length transfer like
> + * a mapped SGL.
> + */
> +static bool twa_command_mapped(struct scsi_cmnd *cmd)
> +{
> +	return scsi_sg_count(cmd) != 1 ||
> +		scsi_bufflen(cmd) >= TW_MIN_SGL_LENGTH;
> +}

I already thought of this.  Unfortunately, it fails if the internally
posted command is a single sector (the size of TW_MIN_SGL_LENGTH), which
is true for most of them.

James



  reply	other threads:[~2015-09-30 16:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-27 11:56 twa generates WARNING upon boot "Tóth Attila"
2015-09-27 21:19 ` adam radford
2015-09-29 16:49   ` "Tóth Attila"
2015-09-29 17:37     ` James Bottomley
2015-09-29 18:02       ` James Bottomley
2015-09-29 18:25         ` "Tóth Attila"
2015-09-29 18:33           ` James Bottomley
2015-09-30 16:08             ` Christoph Hellwig
2015-09-30 16:15               ` James Bottomley [this message]
2015-09-30 16:31                 ` Christoph Hellwig
2015-09-30 16:36                   ` James Bottomley
2015-09-30 16:41                     ` Christoph Hellwig
2015-09-30 16:43                       ` James Bottomley
2015-09-30 16:44                         ` Christoph Hellwig
2015-09-30 20:18                           ` "Tóth Attila"
2015-09-30 16:20               ` kbuild test robot
  -- strict thread matches above, loose matches on Subject: below --
2015-09-28  5:55 "Tóth Attila"
2015-09-29 19:17 "Tóth Attila"

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=1443629730.2185.25.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=aradford@gmail.com \
    --cc=atoth@atoth.sote.hu \
    --cc=hch@infradead.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).