Re: [Linux-usb-users] [PATCH] Add allow_restart usb_storage quirk

2007-11-27 Thread Kyle McMartin
On Tue, Nov 27, 2007 at 03:51:00PM -0500, Alan Stern wrote:
> There already is a patch in Greg's USB development tree turning on 
> allow_restart unconditionally for all USB mass-storage devices:
> 
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-03-usb/usb-storage-always-set-the-allow_restart-flag.patch
> 

Ah, I saw it fly by a couple weeks ago, but didn't know it was a
candidate for merging (as opposed to using UNUSUAL_DEVS.) and then
forgot about it.

Great! I'll slurp it into Fedora too.

cheers,
Kyle

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] [PATCH] Add allow_restart usb_storage quirk

2007-11-27 Thread Alan Stern
On Tue, 27 Nov 2007, Kyle McMartin wrote:

> This Seagate FreeAgent external USB disk I just purchased seems to need
> allow_restart enabled to spin back up; otherwise I just get a pile of
> read errors when I try to access it. Add a new unusual flag for devices
> needing scsi_device->allow_restart set, and add this Seagate drive to
> the unusual devs table.

There already is a patch in Greg's USB development tree turning on 
allow_restart unconditionally for all USB mass-storage devices:

http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-03-usb/usb-storage-always-set-the-allow_restart-flag.patch

Alan Stern


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] [PATCH] Add allow_restart usb_storage quirk

2007-11-27 Thread Matthew Dharm
Didn't we already change this globally for all devices in the -mm tree?

Matt

On Tue, Nov 27, 2007 at 03:06:54PM -0500, Kyle McMartin wrote:
> This Seagate FreeAgent external USB disk I just purchased seems to need
> allow_restart enabled to spin back up; otherwise I just get a pile of
> read errors when I try to access it. Add a new unusual flag for devices
> needing scsi_device->allow_restart set, and add this Seagate drive to
> the unusual devs table.
>  
> Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]>
> ---
> 
> Resent... sigh, that will learn me to hand-edit diff in my mail client.
> Fixed dropped "*/" in the scsiglue.c comment.
> 
> Cheers,
>   Kyle
> ---
> diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> index 1ba19ea..c171140 100644
> --- a/drivers/usb/storage/scsiglue.c
> +++ b/drivers/usb/storage/scsiglue.c
> @@ -200,6 +200,10 @@ static int slave_configure(struct scsi_device *sdev)
>   if (us->flags & US_FL_NOT_LOCKABLE)
>   sdev->lockable = 0;
>  
> + /* Some devices need allow_restart to spin back up... */
> + if (us->flags & US_FL_ALLOW_RESTART)
> + sdev->allow_restart = 1;
> +
>   /* this is to satisfy the compiler, tho I don't think the 
>* return code is ever checked anywhere. */
>   return 0;
> diff --git a/drivers/usb/storage/unusual_devs.h 
> b/drivers/usb/storage/unusual_devs.h
> index 22ab238..a538aa6 100644
> --- a/drivers/usb/storage/unusual_devs.h
> +++ b/drivers/usb/storage/unusual_devs.h
> @@ -1574,6 +1574,12 @@ UNUSUAL_DEV(  0xed06, 0x4500, 0x0001, 0x0001,
>   US_SC_DEVICE, US_PR_DEVICE, NULL,
>   US_FL_CAPACITY_HEURISTICS),
>  
> +/* Reported by Kyle McMartin <[EMAIL PROTECTED]> */
> +UNUSUAL_DEV(  0x0bc2, 0x3000, 0x, 0x,
> + "Seagate", "FreeAgentDesktop 320",
> + US_SC_SCSI, US_PR_BULK, NULL,
> + US_FL_ALLOW_RESTART),
> +
>  /* Control/Bulk transport for all SubClass values */
>  USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR),
>  USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR),
> diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
> index 1b792b9..d01dc72 100644
> --- a/include/linux/usb_usual.h
> +++ b/include/linux/usb_usual.h
> @@ -48,7 +48,9 @@
>   US_FLAG(IGNORE_DEVICE,  0x0800) \
>   /* Don't claim device */\
>   US_FLAG(CAPACITY_HEURISTICS,0x1000) \
> - /* sometimes sizes is too big */
> + /* sometimes sizes is too big */\
> + US_FLAG(ALLOW_RESTART,  0x2000) \
> + /* needs allow_restart to wake up */
>  
>  #define US_FLAG(name, value) US_FL_##name = value ,
>  enum { US_DO_ALL_FLAGS };

-- 
Matthew Dharm  Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

YOU SEE!!?? It's like being born with only one nipple!
-- Erwin
User Friendly, 10/19/1998


pgpSBt4ITTA1J.pgp
Description: PGP signature
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users


Re: [Linux-usb-users] [PATCH] Add allow_restart usb_storage quirk

2007-11-27 Thread Kyle McMartin
This Seagate FreeAgent external USB disk I just purchased seems to need
allow_restart enabled to spin back up; otherwise I just get a pile of
read errors when I try to access it. Add a new unusual flag for devices
needing scsi_device->allow_restart set, and add this Seagate drive to
the unusual devs table.
 
Signed-off-by: Kyle McMartin <[EMAIL PROTECTED]>
---

Resent... sigh, that will learn me to hand-edit diff in my mail client.
Fixed dropped "*/" in the scsiglue.c comment.

Cheers,
Kyle
---
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 1ba19ea..c171140 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -200,6 +200,10 @@ static int slave_configure(struct scsi_device *sdev)
if (us->flags & US_FL_NOT_LOCKABLE)
sdev->lockable = 0;
 
+   /* Some devices need allow_restart to spin back up... */
+   if (us->flags & US_FL_ALLOW_RESTART)
+   sdev->allow_restart = 1;
+
/* this is to satisfy the compiler, tho I don't think the 
 * return code is ever checked anywhere. */
return 0;
diff --git a/drivers/usb/storage/unusual_devs.h 
b/drivers/usb/storage/unusual_devs.h
index 22ab238..a538aa6 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1574,6 +1574,12 @@ UNUSUAL_DEV(  0xed06, 0x4500, 0x0001, 0x0001,
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_CAPACITY_HEURISTICS),
 
+/* Reported by Kyle McMartin <[EMAIL PROTECTED]> */
+UNUSUAL_DEV(  0x0bc2, 0x3000, 0x, 0x,
+   "Seagate", "FreeAgentDesktop 320",
+   US_SC_SCSI, US_PR_BULK, NULL,
+   US_FL_ALLOW_RESTART),
+
 /* Control/Bulk transport for all SubClass values */
 USUAL_DEV(US_SC_RBC, US_PR_CB, USB_US_TYPE_STOR),
 USUAL_DEV(US_SC_8020, US_PR_CB, USB_US_TYPE_STOR),
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 1b792b9..d01dc72 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -48,7 +48,9 @@
US_FLAG(IGNORE_DEVICE,  0x0800) \
/* Don't claim device */\
US_FLAG(CAPACITY_HEURISTICS,0x1000) \
-   /* sometimes sizes is too big */
+   /* sometimes sizes is too big */\
+   US_FLAG(ALLOW_RESTART,  0x2000) \
+   /* needs allow_restart to wake up */
 
 #define US_FLAG(name, value)   US_FL_##name = value ,
 enum { US_DO_ALL_FLAGS };

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users