Re: [PATCH] Add allow_restart usb_storage quirk

Matthew Dharm <[email protected]> Tue, 27 Nov 2007 12:48:31 -0800
Newsgroups gmane.linux.usb.user
Organization One Eyed Alien Networks
Message-ID <[email protected]>
--===============1895449898==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr"
Content-Disposition: inline


--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
> =20
> Signed-off-by: Kyle McMartin <[email protected]>
> ---
>=20
> Resent... sigh, that will learn me to hand-edit diff in my mail client.
> Fixed dropped "*/" in the scsiglue.c comment.
>=20
> Cheers,
> 	Kyle
> ---
> diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglu=
e.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 =3D 0;
> =20
> +	/* Some devices need allow_restart to spin back up... */
> +	if (us->flags & US_FL_ALLOW_RESTART)
> +		sdev->allow_restart =3D 1;
> +
>  	/* this is to satisfy the compiler, tho I don't think the=20
>  	 * return code is ever checked anywhere. */
>  	return 0;
> diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unu=
sual_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),
> =20
> +/* Reported by Kyle McMartin <[email protected]> */
> +UNUSUAL_DEV(  0x0bc2, 0x3000, 0x0000, 0x9999,
> +		"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,	0x00000800)			\
>  		/* Don't claim device */			\
>  	US_FLAG(CAPACITY_HEURISTICS,	0x00001000)		\
> -		/* sometimes sizes is too big */
> +		/* sometimes sizes is too big */		\
> +	US_FLAG(ALLOW_RESTART,	0x00002000)			\
> +		/* needs allow_restart to wake up */
> =20
>  #define US_FLAG(name, value)	US_FL_##name =3D value ,
>  enum { US_DO_ALL_FLAGS };

--=20
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.=
net=20
Maintainer, Linux USB Mass Storage Driver

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

--liOOAslEiF7prFVr
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFHTIKfHL9iwnUZqnkRAi/KAJ47o/+cjrmpsIWbRzLtib0rZWjtBwCfepaP
wOWrfYcjXe0v4LSMLNn2Ev4=
=Hbx3
-----END PGP SIGNATURE-----

--liOOAslEiF7prFVr--


--===============1895449898==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--===============1895449898==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

--===============1895449898==--