All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Marcet <lists@marcet.info>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Dharm <mdharm-kernel@one-eyed-alien.net>,
	<linux-kernel@vger.kernel.org>, <usb-storage@one-eyed-alien.net>,
	<linux-usb-users@lists.sourceforge.net>
Subject: Re: usb-storage && iRIVER flash player problem
Date: Tue, 6 Jan 2004 21:32:23 +0100	[thread overview]
Message-ID: <20040106203223.GA8840@hiroshi> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0401061035420.770-100000@ida.rowland.org>

[-- Attachment #1: Type: text/plain, Size: 1149 bytes --]

* Alan Stern <stern@rowland.harvard.edu> [040106 16:41]:

>> > >It looks like your device is choking over the ALLOW_MEDIUM_REMOVAL command
>> > >-- I've never seen a device broken in this particular way before.

>> Hrm... what's the easiest way for Javier to figure out if his device sets
>> the RMB or not?

>> I feel another SCSI enhancement coming on....

>It's not so simple, unfortunately.  In 2.6, sd.c already does check that 
>sdev->removable is set before issuing PREVENT ALLOW MEDIUM REMOVAL.

Yeah, I noticed that upon looking over sd.c et all.
It seems this iRiver player reports incorrectly that it is removable,
since the protocol used by usb-stoareg for this device is
transparent_scsi, thus all the info is fed directly from the device to
the scsi layer.

I have added a new flag for SCSI devices that need special treatment,
and the "iRiver" "iFP Mass Driver"  to the list of those devices with
that new flag. this way nothing is broken to support the iRiver.
However, since this is not a real SCSI device, shouldn't this be
transparently fixed by usb-storage instead? Or is it ok this way?


-- 
Javier Marcet <javier@marcet.info>

[-- Attachment #2: broken_RMB_scsi.patch --]
[-- Type: text/plain, Size: 1341 bytes --]

--- linux/include/scsi/scsi_devinfo.h.orig	2004-01-06 01:00:29.000000000 +0100
+++ linux/include/scsi/scsi_devinfo.h	2004-01-06 20:15:50.036892568 +0100
@@ -19,4 +19,5 @@
 #define BLIST_MS_SKIP_PAGE_08	0x2000	/* do not send ms page 0x08 */
 #define BLIST_MS_SKIP_PAGE_3F	0x4000	/* do not send ms page 0x3f */
 #define BLIST_USE_10_BYTE_MS	0x8000	/* use 10 byte ms before 6 byte ms */
+#define BLIST_NORMB     	0x10000	/* Known to be not removable */
 #endif
--- linux/drivers/scsi/scsi_scan.c.orig	2004-01-06 01:00:29.000000000 +0100
+++ linux/drivers/scsi/scsi_scan.c	2004-01-06 20:10:19.731106680 +0100
@@ -536,7 +536,8 @@
 		sdev->online = FALSE;
 	}
 
-	sdev->removable = (0x80 & inq_result[1]) >> 7;
+	sdev->removable = (((0x80 & inq_result[1]) >> 7) &&
+		!(*bflags & BLIST_NORMB));
 	sdev->lockable = sdev->removable;
 	sdev->soft_reset = (inq_result[7] & 1) && ((inq_result[3] & 7) == 2);
 
--- linux/drivers/scsi/scsi_devinfo.c.orig	2004-01-06 01:00:29.000000000 +0100
+++ linux/drivers/scsi/scsi_devinfo.c	2004-01-06 20:13:46.890613648 +0100
@@ -183,6 +183,7 @@
 	{"SGI", "TP9500", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
 	{"MYLEX", "DACARMRB", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
 	{"XYRATEX", "RS", "*", BLIST_SPARSELUN | BLIST_LARGELUN},
+	{"iRiver", "iFP Mass Driver", NULL, BLIST_NORMB},
 	{ NULL, NULL, NULL, 0 },
 };
 

      reply	other threads:[~2004-01-06 20:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-05 12:59 usb-storage && iRIVER flash player problem Javier Marcet
2004-01-05 19:02 ` Matthew Dharm
2004-01-05 20:03   ` Javier Marcet
2004-01-06  6:56     ` [usb-storage] " Matthew Dharm
2004-01-06 15:37       ` Alan Stern
2004-01-06 20:32         ` Javier Marcet [this message]

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=20040106203223.GA8840@hiroshi \
    --to=lists@marcet.info \
    --cc=javier@marcet.info \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-users@lists.sourceforge.net \
    --cc=mdharm-kernel@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@one-eyed-alien.net \
    /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.