Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
To: "Jason J. Herne" <hernejj@gmail.com>
Cc: linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org,
	pbonzini@redhat.com, JBottomley@parallels.com,
	stern@rowland.harvard.edu
Subject: Re: [PATCH] Try #2: Use SCSI read/write(16) with >2TB drives
Date: Wed, 14 Nov 2012 20:02:14 +0100	[thread overview]
Message-ID: <20121114190214.GD6439@breakpoint.cc> (raw)
In-Reply-To: <1352872513-2424-1-git-send-email-hernejj@gmail.com>

On Wed, Nov 14, 2012 at 12:55:13AM -0500, Jason J. Herne wrote:
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -887,7 +887,7 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
>  		SCpnt->cmnd[29] = (unsigned char) (this_count >> 16) & 0xff;
>  		SCpnt->cmnd[30] = (unsigned char) (this_count >> 8) & 0xff;
>  		SCpnt->cmnd[31] = (unsigned char) this_count & 0xff;
> -	} else if (block > 0xffffffff) {
> +	} else if (sdp->use_16_for_rw) {
>  		SCpnt->cmnd[0] += READ_16 - READ_6;
>  		SCpnt->cmnd[1] = protect | ((rq->cmd_flags & REQ_FUA) ? 0x8 : 0);
>  		SCpnt->cmnd[2] = sizeof(block) > 4 ? (unsigned char) (block >> 56) & 0xff : 0;
> @@ -2054,6 +2054,9 @@ got_data:
>  		}
>  	}
>  
> +	/* Use read/write(16) for > 2TB disks */
> +	sdp->use_16_for_rw = (sdkp->capacity > 0xffffffff);

The comment is pointless if you assume the reading is able to read C. What
would help is a link either here or in patch's description to the mail thread
where it has been descovered that some >2TB devices don't recognize the small
command.

> +
>  	/* Rescale capacity to 512-byte units */
>  	if (sector_size == 4096)
>  		sdkp->capacity <<= 3;

Sebastian

  reply	other threads:[~2012-11-14 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <50A2F12F.9060209 () redhat ! com>
2012-11-14  5:55 ` [PATCH] Try #2: Use SCSI read/write(16) with >2TB drives Jason J. Herne
2012-11-14 19:02   ` Sebastian Andrzej Siewior [this message]
2012-11-14 22:06     ` Jason J. Herne

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=20121114190214.GD6439@breakpoint.cc \
    --to=sebastian@breakpoint.cc \
    --cc=JBottomley@parallels.com \
    --cc=hernejj@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=stern@rowland.harvard.edu \
    /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