Am Donnerstag, 13. Juni 2002 18:14 schrieb Greg KH:
> On Thu, Jun 13, 2002 at 09:56:20AM +0200, Oliver Neukum wrote:
> > Hi,
> >
> > the included change sets fix a disconnect bug on stv680.
> > It took a little interactive debugging to get it to work.
> > Therefor it's in four change sets against the 2.4 tree.
> > 2.5 would need the fix, too, but I am too lazy.
> > Thanks to Ian for testing.
>
> Can you merge these changesets into one patch so I can attempt to apply
> it to both trees?

Here it is.

        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], 2002-06-13 18:36:47+02:00, [EMAIL PROTECTED]
  disconnect fix




diff -Nru a/drivers/usb/stv680.c b/drivers/usb/stv680.c
--- a/drivers/usb/stv680.c      Thu Jun 13 18:37:30 2002
+++ b/drivers/usb/stv680.c      Thu Jun 13 18:37:30 2002
@@ -1072,6 +1072,9 @@
                        errors++;
                }
                wait_event_interruptible (stv680->wq, 
(stv680->scratch[stv680->scratch_use].state == BUFFER_READY));
+               
+               if (stv680->removed)
+                       return -ENODEV;
 
                if (stv680->nullpackets > STV680_MAX_NULLPACKETS) {
                        stv680->nullpackets = 0;
@@ -1140,10 +1143,10 @@
 
        for (i = 0; i < STV680_NUMFRAMES; i++)
                stv680->frame[i].grabstate = FRAME_UNUSED;
-       if (stv680->streaming)
+       if (stv680->streaming && !stv680->removed)
                stv680_stop_stream (stv680);
 
-       if ((i = stv_stop_video (stv680)) < 0)
+       if ((!stv680->removed) && (i = stv_stop_video (stv680)) < 0)
                PDEBUG (1, "STV(e): stop_video failed in stv_close");
 
        rvfree (stv680->fbuf, stv680->maxframesize * STV680_NUMFRAMES);
@@ -1169,6 +1172,9 @@
 
        if (!stv680->udev)
                return -EIO;
+               
+       if (stv680->removed)
+               return -ENODEV;
 
        switch (cmd) {
        case VIDIOCGCAP:{
@@ -1578,6 +1584,7 @@
 static void stv680_disconnect (struct usb_device *dev, void *ptr)
 {
        struct usb_stv *stv680 = (struct usb_stv *) ptr;
+       int i;
 
        lock_kernel ();
        /* We don't want people trying to open up the device */
@@ -1586,6 +1593,9 @@
                usb_stv680_remove_disconnected (stv680);
        } else {
                stv680->removed = 1;
+               for( i = 0; i < STV680_NUMSBUF; i++)
+                       usb_unlink_urb(stv680->urb[i]);
+               wake_up_interruptible (&stv680->wq);
        }
        unlock_kernel ();
 }

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


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


begin 664 bkpatch2353
M'XL(`$K*"#T``ZU4;6_:,!#^C'_%394J$`K8>7$"+15KZ;9J6UNUHU^F"1G'
M@$6(F9W03LJ/GY.T;'W57AI92GSWW'/GNR?>@;$1NM]0B=P(C7;@@S*9W8I4
MI:*S4"N1R#2_Z2@]M\X+I:RS6YJ[=41WNG0R+83IFFR#+.2<97P!UF/Z#=+Q
MMI;LQUKT&Q?'[\>?WEX@-!C`T8*E<W$I,A@,T'0YC'.1=)9:L469K=BZ"Q=C
M@@-,7,^GV"UPB$E0T#!FH>_A7A#X,1$$95JF<[EMAIL PROTECTED]#.SD.G\,9.+*7%=
MC[A!K_`H(0$:`>F$A`)VNYAVB0<DZGNT[X=M[/8QAOJ@PZ=:`FT"#D:'\/_E
M'R$.L31<I:G@&<SD#?H(7AC@")W_:A5R_O)!"#.,#F!=#N%AC;$N3V:ZN9F6
MXZ,1[O"J7-LA2J+`"W!!0H*]8A:Q6+`9M\:0]7K\I:8\2UNVWB/4H]@O".V%
M7B6#I]"E(EZY8C378CZLF;A:O5BD2T(7D["@/HYJ?1#WH3RP_T?R<,%Q7TT?
M#N2I)5]"KJ<&5/J[8&0*+$D2X,P(4V&OV5)`O@8M;"?T?7@%L!H#J7B6W/>)
M&&*QD5Q8`=9C.@-'7U?+"NK\R8G]@S!/"`Y]\%"C89><0;/F<@ZT6*F-B%O6
MW-`BRW4*SO'IV>CX:@^-"/'M"&QP_;X7:.Q-Q%;VMX?=77CSB*Z,I;>Q]"ZV
M^0A7!C<E#,`Z)B93Z\E&QD+=I6FU8!]PJV0)R6WYSU3_L/@3$D2X2IS:@=7[
MJ**8*=V$,B?>LZ]]N/QR9<DFI^//EX?C=];6;E?ML"V?U!J86`UL<]KOK_);
M:\]"RJE/\O7$IA!:Y^M,3A,!S=T[Z/5W"]O>RGPA^-+DJT'<XP'#K(=^`IMC
&8*(1!@``
`
end


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to