[7890] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: Devices not supporting read-6....

daemon@ATHENA.MIT.EDU (Jens Axboe)
Sat Jan 22 13:28:25 2000

Date:   Fri, 21 Jan 2000 15:20:17 +0100
From: Jens Axboe <axboe@suse.de>
To: Rogier Wolff <R.E.Wolff@BitWizard.nl>
Cc: linux-kernel@vger.rutgers.edu, linux-scsi@vger.rutgers.edu,
	phoenix@thesindicate.com
Message-ID: <20000121152017.T669@suse.de>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="neYutvxvOLaeuPCA"
In-Reply-To: <200001202306.AAA22947@cave.bitwizard.nl>; from R.E.Wolff@BitWizard.nl on Fri, Jan 21, 2000 at 12:06:42AM +0100


--neYutvxvOLaeuPCA
Content-Type: text/plain; charset=us-ascii

On Fri, Jan 21 2000, Rogier Wolff wrote:
> Hi,
> 
> As far as I know, "read-6" is a very mandatory command. However
> there is a device, the 
> 
>    {"TOSHIBA","DVD-RAM SD-W1101","*", BLIST_GHOST},
> 
> which doesn't implement it.

The W1111 doesn't either. And if you look at write-6 we have the
same problem.

> 
> What do we do? 
> 
> 	- Blacklist it as "doesn't support read-6" and implement
>           stuff to prevent read-6 if that flag is set?
> 
> 	- Ignore the issue, and just let people with this hardware
> 	  live with a non-working drive?
> 
> Is there maybe already something implemented? Anybody the "owner" of
> that piece of code?

I updated sd in 2.3 to use READ_10/WRITE_10 whenever possible and
fall back to the 6 byte variants if the device does not support it.
The actual patch is very simple, we just change the ten flag
to read "use only 10 byte read/writes". I've attached it. I
generally don't like the black lists, I'd much rather do it
dynamically.

> I seem to own the "blist_ghost" stuff, so it's going to be listed
> there, but then the system runs into not-working read-6 commands.

Yes, it gets quite ugly. I battled with the W1111 for some time
before I discovered its READ_6/WRITE_6 weirdness.

> P.S. (I'm not on linux-scsi, and I'm on vacation starting saturday).
> I had been hoping it would've been as easy as listing the drive as
> a 'blist_ghost' thing, but now things are more complicated... 

Still easy ;)

-- 
*  Jens Axboe <axboe@suse.de>
*  Linux CD-ROM Maintainer
*  http://www.kernel.dk

--neYutvxvOLaeuPCA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sd_ten.diff"

--- linux-2.2.14-pre10/drivers/scsi/sd.c	Thu Dec  2 20:43:31 1999
+++ linux/drivers/scsi/sd.c	Fri Dec  3 13:21:37 1999
@@ -483,11 +483,16 @@
 	 * would be a ten byte read where only a six byte read was supported.
 	 * Also, on a system where READ CAPACITY failed, we have have read
 	 * past the end of the disk.
+	 *
+	 * Don't screw with the ten byte flag unless we are certain that
+	 * the drive does not understand the command /axboe
 	 */
 
 	if (SCpnt->sense_buffer[2] == ILLEGAL_REQUEST) {
 	    if (rscsi_disks[DEVICE_NR(SCpnt->request.rq_dev)].ten) {
-		rscsi_disks[DEVICE_NR(SCpnt->request.rq_dev)].ten = 0;
+		if (SCpnt->cmnd[0] == READ_10 || SCpnt->cmnd[0] == WRITE_10 ||
+		    SCpnt->sense_buffer[12] == 0x20)
+		    rscsi_disks[DEVICE_NR(SCpnt->request.rq_dev)].ten = 0;
 		requeue_sd_request(SCpnt);
 		result = 0;
 	    } else {
@@ -1016,7 +1021,7 @@
 	this_count = this_count << 1;
     }
 
-    if (((this_count > 0xff) ||  (block > 0x1fffff)) && rscsi_disks[dev].ten)
+    if (((this_count > 0xff) ||  (block > 0x1fffff)) || rscsi_disks[dev].ten)
     {
 	if (this_count > 0xffff)
 	    this_count = 0xffff;

--neYutvxvOLaeuPCA--

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post