Module Name:    src
Committed By:   martin
Date:           Sat Feb 13 02:09:41 UTC 2010

Modified Files:
        src/sys/dev/usb: umass.c umass_quirks.c umassvar.h

Log Message:
Remove UMASS_QUIRK_IGNORE_RESIDUE, instead max out the expected response
size at the actual transfer length. Fixes PR kern/42225 differently.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/dev/usb/umass.c
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/umass_quirks.c
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/umassvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/umass.c
diff -u src/sys/dev/usb/umass.c:1.136 src/sys/dev/usb/umass.c:1.137
--- src/sys/dev/usb/umass.c:1.136	Thu Nov 12 19:58:27 2009
+++ src/sys/dev/usb/umass.c	Sat Feb 13 02:09:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass.c,v 1.136 2009/11/12 19:58:27 dyoung Exp $	*/
+/*	$NetBSD: umass.c,v 1.137 2010/02/13 02:09:41 martin Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -124,7 +124,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.136 2009/11/12 19:58:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.137 2010/02/13 02:09:41 martin Exp $");
 
 #include "atapibus.h"
 #include "scsibus.h"
@@ -1178,10 +1178,9 @@
 
 		DIF(UDMASS_BBB, umass_bbb_dump_csw(sc, &sc->csw));
 
-		if (sc->sc_quirks & UMASS_QUIRK_IGNORE_RESIDUE)
-                    residue = sc->transfer_datalen - sc->transfer_actlen;
-                else
-                    residue = UGETDW(sc->csw.dCSWDataResidue);
+		residue = UGETDW(sc->csw.dCSWDataResidue);
+		if (residue < sc->transfer_datalen - sc->transfer_actlen)
+		    residue = sc->transfer_datalen - sc->transfer_actlen;
 
 		/* Translate weird command-status signatures. */
 		if ((sc->sc_quirks & UMASS_QUIRK_WRONG_CSWSIG) &&

Index: src/sys/dev/usb/umass_quirks.c
diff -u src/sys/dev/usb/umass_quirks.c:1.78 src/sys/dev/usb/umass_quirks.c:1.79
--- src/sys/dev/usb/umass_quirks.c:1.78	Fri Oct 30 16:22:32 2009
+++ src/sys/dev/usb/umass_quirks.c	Sat Feb 13 02:09:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: umass_quirks.c,v 1.78 2009/10/30 16:22:32 is Exp $	*/
+/*	$NetBSD: umass_quirks.c,v 1.79 2010/02/13 02:09:41 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.78 2009/10/30 16:22:32 is Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_quirks.c,v 1.79 2010/02/13 02:09:41 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -229,17 +229,6 @@
 	  UMATCH_VENDOR_PRODUCT,
 	  NULL, NULL
 	},
-
-        /*
-         * Devices with bad residue.
-         */
-        { { USB_VENDOR_SUPERTOP, USB_PRODUCT_SUPERTOP_IDEBRIDGE },
-          UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
-          UMASS_QUIRK_IGNORE_RESIDUE,
-          0,
-          UMATCH_VENDOR_PRODUCT,
-          NULL, NULL
-        },
 };
 
 const struct umass_quirk *

Index: src/sys/dev/usb/umassvar.h
diff -u src/sys/dev/usb/umassvar.h:1.28 src/sys/dev/usb/umassvar.h:1.29
--- src/sys/dev/usb/umassvar.h:1.28	Fri Oct 30 16:22:32 2009
+++ src/sys/dev/usb/umassvar.h	Sat Feb 13 02:09:41 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: umassvar.h,v 1.28 2009/10/30 16:22:32 is Exp $	*/
+/*	$NetBSD: umassvar.h,v 1.29 2010/02/13 02:09:41 martin Exp $	*/
 /*-
  * Copyright (c) 1999 MAEKAWA Masahide <bis...@rr.iij4u.or.jp>,
  *		      Nick Hibma <n_hi...@freebsd.org>
@@ -180,7 +180,6 @@
 #define	UMASS_QUIRK_WRONG_CSWTAG	0x00000002
 #define	UMASS_QUIRK_RBC_PAD_TO_12	0x00000004
 #define	UMASS_QUIRK_NOGETMAXLUN		0x00000008
-#define UMASS_QUIRK_IGNORE_RESIDUE      0x00000010
 
 #define UMASS_QUIRK_USE_DEFAULTMATCH	-1
 

Reply via email to