Hi,

here for for convinience the patches that should reasonably fix the
problem. Matt, shall they go in?

        Regards
                Oliver
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[EMAIL PROTECTED], 2003-03-22 17:05:17+01:00, [EMAIL PROTECTED]
  - reduced reset logic restricting usb resets to simple cases


 scsiglue.c |   40 ++++++++++++++--------------------------
 1 files changed, 14 insertions(+), 26 deletions(-)


diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
--- a/drivers/usb/storage/scsiglue.c	Sat Mar 22 17:06:21 2003
+++ b/drivers/usb/storage/scsiglue.c	Sat Mar 22 17:06:21 2003
@@ -231,36 +231,24 @@
 	scsi_unlock(srb->device->host);
 	us = (struct us_data *)srb->device->host->hostdata[0];
 
-	/* attempt to reset the port */
-	result = usb_reset_device(us->pusb_dev);
-	US_DEBUGP("usb_reset_device returns %d\n", result);
-	if (result < 0) {
-		scsi_lock(srb->device->host);
-		return FAILED;
+	/* The USB subsystem doesn't handle synchronisation between
+	   a device's several drivers. Therefore we reset only devices
+	   with one interface which we of course own.
+	*/
+	
+	//FIXME: needs locking against config changes
+	
+	if ( us->pusb_dev->actconfig->desc.bNumInterfaces == 1) {
+		/* attempt to reset the port */
+		result = usb_reset_device(us->pusb_dev);
+		US_DEBUGP("usb_reset_device returns %d\n", result);
+	} else {
+		result = -EBUSY;
 	}
 
-	/* FIXME: This needs to lock out driver probing while it's working
-	 * or we can have race conditions */
-	/* This functionality really should be provided by the khubd thread */
-	for (i = 0; i < us->pusb_dev->actconfig->desc.bNumInterfaces; i++) {
- 		struct usb_interface *intf =
-			&us->pusb_dev->actconfig->interface[i];
-
-		/* if this is an unclaimed interface, skip it */
-		if (!intf->driver) {
-			continue;
-		}
-
-		US_DEBUGP("Examining driver %s...", intf->driver->name);
-
-		/* simulate a disconnect and reconnect for all interfaces */
-		US_DEBUGPX("simulating disconnect/reconnect.\n");
-		usb_device_remove (&intf->dev);
-		usb_device_probe (&intf->dev);
-	}
 	US_DEBUGP("bus_reset() complete\n");
 	scsi_lock(srb->device->host);
-	return SUCCESS;
+	return result < 0 ? FAILED : SUCCESS;
 }
 
 /***********************************************************************

===================================================================


This BitKeeper patch contains the following changesets:
1.1515
## Wrapped with gzip_uu ##


begin 664 bkpatch11317
M'XL(`/V)?#X``[U6^V_;-A#^V?PK#BV&INTL\2')EK-D>;8+VFU!/`,;,""0
MJ;-,Q!8-D4H65/O?=Y+S:N"E6_8P!)`F[X[???>=J)<P<5B->G9A+K%B+^$[
MZSS]Q=*6&,SM$A>FK'\+;%70YIFUM!FVR^':(YQ>]'V%Z$+G;25C1E:GF==S
MH$TWZHE`W:WXZQ6.>F?'[R<?]\\8V]F!PWE6%CA&#SL[;'JQE]>X""XJF\W;
M`YN[[49R+H20,5=Q(N)&#I6*&I'P:4[37`[2V31)65%AL;=VUW;YN;OB2DHN
M8BZC)J)1L2,[EMAIL PROTECTED]@)8C#B\4@,WG(QXAS6&>[EMAIL PROTECTED]>[EMAIL PROTECTED]'/0A
MT]"'"O-:8TZC(S86MC"ZG?O*:&_*`FHW7>\Y\!:<6:X6"#ISZ-@'B&3*)3N]
MIY/U_^:/,9YQMKLAG0/C/R"NJ-+H=6B*TE;X.#,5Q:[EMAIL PROTECTED]'/!\.!Y$:
M/L7?GX;MRD0<15PV7$1)LA%47K6174BL=+K+"@R==J98U!CH>[EMAIL PROTECTED]:\(0/
MHB89:IZ(-!ZJ6&5<R"?A??F`AT"EB`=I)^A-:6W6]O-Y?2SSIZCD(HU2I9I$
M<BD[Q4OUN=ZC$9?_N][W\YRT?DNR042ATBBTM0GTW?(2<Y.%ER9'&P93[R_[
M9A;8(&\;P,\1;MA=&.>I!SJM_`C]ZJI[2-*G&ZOQC-8XH:[EMAIL PROTECTED]
M6D^;%?)OB/RQ5OZ*KDG50L4#F32Q&@RC3C61?)YJ1`1]F?RW[TDJ_KH!'U7_
MZ5R?H8,CJ2)(V(E4*0C%>N$;^([EMAIL PROTECTED])NT96O/%!V.;VBW76I
MYY4MC<N\L25,T5\AEJP'`!GD>&[EMAIL PROTECTED],01NXPEFK[RN\2=:6B^L;
M#]?Y7QD_IU7JA-)C-<LT&<\-7;3D8F>@;5TYFEV5`>N]"5F/$([EMAIL PROTECTED]
M)6+NB#Y]T5XN69&9TGGR*&>[EMAIL PROTECTED];=/?T=U?$XCD=WM_-M%_;]7=S
M=#J8_E`O3VX!.)(RB-?PB?5:>C)/E*Q\V['K'[EMAIL PROTECTED]
M[PS.U_EM/3SR]3:93L;G1\<'D_>G6R\>&U-H7U>[EMAIL PROTECTED],Z:NOU.^""
M&/[EMAIL PROTECTED])$V+E,9$@:"B=D-O'>LF!GP#'+Z%=_LG'X^/8`3CR>'A
>\7B\??^1H^>H+UR]W)D-,[EMAIL PROTECTED]>U1"0``
`
end
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[EMAIL PROTECTED], 2003-03-22 20:02:21+01:00, [EMAIL PROTECTED]
  - memory allocation in block io error code path with GFP_KERNEL


 hub.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c	Sat Mar 22 20:02:59 2003
+++ b/drivers/usb/core/hub.c	Sat Mar 22 20:02:59 2003
@@ -647,7 +647,7 @@
 	struct usb_port_status *portsts;
 	int ret = -ENOMEM;
 
-	portsts = kmalloc(sizeof(*portsts), GFP_KERNEL);
+	portsts = kmalloc(sizeof(*portsts), GFP_NOIO);
 	if (portsts) {
 		ret = usb_get_port_status(hub, port + 1, portsts);
 		if (ret < 0)

===================================================================


This BitKeeper patch contains the following changesets:
1.1516
## Wrapped with gzip_uu ##


begin 664 bkpatch12167
M'XL(`&.S?#X``\U476_3,!1]KG_%E?:R,9+X(TZ6H*#"UHUITUH5[0DA%"=N
M$R6-*]O=&,J/[EMAIL PROTECTED]'.8!;(W4Z4&U])[EMAIL PROTECTED]>5
MG>JD7ZF%;.MN]=57>N[`J5(.#-;'P38B$(UGM90F,%9IRI&[-<EM48$#33H@
M/GL\L0]+F0ZFHXO;ZW=3A+(,3JN\F\N/TD*6(=$,RY5L_4:KO%I_L'^$>XHQ
M(81RS'A$>$]/&`M[$F%1NM>2QLE,1`G:4AKN(_\T%\.,4A?.2=R'-,$4G0'Q
M"2<18!:X22E0G&*:4G*,28HQ/),;[EMAIL PROTECTED]&+V'[EMAIL PROTECTED]@P4(NE'Z`O&U5D=M:
M=5!W([EMAIL PROTECTED];"NYKMUR<3[Y<C:8WHVMT!2&C(4>3G;S(^\N!
M$,XQ>[EMAIL PROTECTED]@F_V%46XH1$/2,A97U!\FC&8Q:&I>`\YL_I]R1G
MH;3<)=XVRC6(XIY&.&8;V^R_O]]#+^2+RORN+CTQ7.:%D&WK=])^FFLY__P;
MMH3B,`JI8TL)[EMAIL PROTECTED]"O^AJ<A_9*JM_&/P]/UF.I-,?M&)%]CM+.(8"+K<
M/@9+I:VQ!C)H%AO&AZ;^)M7L\-4/Y.CUAMW-^')\]&;WTRDJ631FM<ABD@@G
,RPGZ#K3=X?KA!```
`
end
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[EMAIL PROTECTED], 2003-03-22 22:36:25+01:00, [EMAIL PROTECTED]
  - add logging to reset


 scsiglue.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)


diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
--- a/drivers/usb/storage/scsiglue.c	Sat Mar 22 22:36:59 2003
+++ b/drivers/usb/storage/scsiglue.c	Sat Mar 22 22:36:59 2003
@@ -209,17 +209,11 @@
 	return result;
 }
 
-/* This resets the device port, and simulates the device
- * disconnect/reconnect for all drivers which have claimed
- * interfaces, including ourself. */
+/* This resets the device port */
+/* It refuses to work if there's more than one interface in
+   this device, so that other users are not affected. */
 /* This is always called with scsi_lock(srb->host) held */
 
-/* FIXME: This needs to be re-examined in the face of the new
- * hotplug system -- this will implicitly cause a detach/reattach of
- * usb-storage, which is not what we want now.
- *
- * Can we just skip over usb-storage in the while loop?
- */
 static int usb_storage_bus_reset( Scsi_Cmnd *srb )
 {
 	struct us_data *us;
@@ -244,6 +238,7 @@
 		US_DEBUGP("usb_reset_device returns %d\n", result);
 	} else {
 		result = -EBUSY;
+		US_DEBUGP("cannot reset a multiinterface device. failing to reset.\n");
 	}
 
 	US_DEBUGP("bus_reset() complete\n");

===================================================================


This BitKeeper patch contains the following changesets:
1.1517
## Wrapped with gzip_uu ##


begin 664 bkpatch12882
M'XL(`'S7?#X``[546V_3,!1^KG_%T?8`;#3Q+6E35#1VT9A`HMKH&Q)RDY.+
MFL:[EMAIL PROTECTED]<?CI-(*8BKC%EF)[>]<OG/\.8>PM&AF(UU7=VC((;S5UODE-KK!
MH-0;K*NF_1)H4WCP6FL/AOUVN/4(5^NQ,[EMAIL PROTECTED];'A%OM5`N+<&[EMAIL PROTECTED]
M<5]O<3:ZOKA<OG]S3<A\#F>E:@J\00?S.5FM3[(6ZV!MM"K[A-T#W'%*&6,\
MHB**6=3QJ1"R8S%=97Z:\4F2K^*$;"F=/$;^QUB""LY90OVKDX++B)P#"UC$
M)D!%Z`?GP/E,Q#,>'5,VHQ3VQ(9C!F-*3N'[EMAIL PROTECTED]@"GP:!%
M1]Y!SW1*%KNND?%O/H101<GK1XAFIB_/AJU=#2>I"@QM:JNB;C%(=^PE35C2
MT9A.9!=/4QJS))J*2"C*^+X>/2'!<"B<B9A+GR`2TT$B^_T>U\V_*&:OF)Y8
MC#]>27G'631)!H5)\9.^Y%/T)6&<_!]]>5D-K?X`8W,_#*^2Q2^Z_@>Z.^=>
M'X)<<2;])SR"CV5EM\JVX$J$#.^J%.%6&P='86]QY3R>MQ9M?PGNM5E#E?>V
M!I]9V&B#?J$:\/V"JG%H<I7V,[EMAIL PROTECTED]&_(E6-T;.M"]+_B`QH+RWHUVH/(<
M4X=9T"?U)"<0>Y(R!D9&H^7-Y_.+T^7EXOE!JIK>?"`,"C9M[:I=TFVF`')5
CU=]?VN!3<_#BU>Z?F):8KFV[F<L\8],)S<@WCU-V&(`%````
`
end

Reply via email to