Am Mittwoch, 12. Mai 2004 21:38 schrieb Alan Stern:
> On Wed, 12 May 2004, Oliver Neukum wrote:
> 
> > > There are plenty of other places in the USB code that could use this sort
> > > of cleanup.  How about defining and exporting a utility routine in usb.c
> > > for this purpose?  Something like
> > 
> > Excellent suggestion, but if you complete the thought, then you'll
> > find nothing specific to USB in that functionality. Therefore it should
> > live in the generic parts of the kernel.
> 
> Absolutely.  The people in charge of those things tend not to listen to
> me.  Maybe they'll listen to Greg, though, if you submit such a utility
> through him.

Neither do they listen to me. Nor do I hide behind Greg's skirts.
Is that your clothing style, Greg? ;-)
Anyway, how about this:

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], 2004-05-12 22:45:39+02:00, [EMAIL PROTECTED]
   - add safe waiting helper


 usb.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+)


diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.c    Wed May 12 22:46:51 2004
+++ b/drivers/usb/core/usb.c    Wed May 12 22:46:51 2004
@@ -40,6 +40,7 @@
 #include <linux/errno.h>
 #include <linux/smp_lock.h>
 #include <linux/usb.h>
+#include <linux/time.h>
 
 #include <asm/io.h>
 #include <asm/scatterlist.h>
@@ -1543,6 +1544,21 @@
        return 0;
 }
 
+/**
+ * usb_uninterruptible_sleep_ms - safely free an amount of time uninterruptably
+ * @msecs: how long to sleep, given in milliseconds
+ */
+
+void usb_uninterruptible_sleep_ms (int msecs)
+{
+       long timeout = MSEC_TO_JIFFIES(msecs);
+
+       while (timeout) {
+               set_current_state(TASK_UNINTERRUPTIBLE);
+               timeout = schedule_timeout(timeout);
+       }
+}
+
 struct bus_type usb_bus_type = {
        .name =         "usb",
        .match =        usb_device_match,
@@ -1646,6 +1662,8 @@
 
 EXPORT_SYMBOL (usb_buffer_alloc);
 EXPORT_SYMBOL (usb_buffer_free);
+
+EXPORT_SYMBOL (usb_uninterruptible_sleep_ms);
 
 EXPORT_SYMBOL (usb_buffer_map);
 #if 0

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


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


begin 664 bkpatch11094
M'XL(`#N-HD```[54:V_3,!3]7/^**^U+M]'&=AY-"[EMAIL PROTECTED])!"@R$V\
M)EH23[&S,9']=VZZ-QH=3)"'[EMAIL PROTECTED],MBUY#I<FY+,@:?%#:X%+F
M*I?M6&4R3?+R>UL5"_PY40I_6O6VI=(TX=:LD%);=8SF+L&0L3!A#(BE>PW6
MMN]VS.69[#4FP_?'^V\GA/3[L!.+?"&GTD"_3XPJSD4:Z8$P<:KRMBE$KC-I
M1#M467476G%*.=XNZ]C4]2KF4:=3A2QB3#A,1I0[ON>0A92%&2R9MS+//ZWI
M?[DM\>TQG([EMAIL PROTECTED]'?`VLSC':".15V+<>"[EMAIL PROTECTED])>8]2N&[6
MX*DFP2:#%B7;\&\%[9`0H`4BBD"+$PD7(C%)OH!8IF=X;'O`7=_WR/B^J:3U
MEQ<A5%"R]0SQJ*BE:ZO4\_IMAP\$.)1U*L?E7;^:.]*><Y]U7>EQ6T2K6O8(
M,U2%O`>NSX9SBIBTLKN^UUT:Y^GXYUWT0NYD4<C%X+10(JYAOM3+;RM)VS:R
M9AWF5;[EMAIL PROTECTED]:BO_J)TS_RD_^_#+7*3]?=/H)6<;%\T!_CWS3^!4X;.1P864OR
M,"TC"6^6<BV39*A^BXR8Z[C`7&)M;!#8`*P2E'F2&UD4Y9E)YJD,="KE69!I
M%%$+2"_A!"<1B!Q$ILK<@#J!&@\>)(IY>EGC#3(M0]V#6%T`=G*!K84EWBM8
MH,`<DARR!,<;AJD\TIACD:_D7"71:BY-W(<E^#KY01K7V$A"E3CCX&`ZW`EF
M1\''T>[N:#AM7@>^1N3&19RD$IHWL>N`R0TM31"[EMAIL PROTECTED]&[EMAIL PROTECTED]/#
MT>%L.)D<CV>C[?TAYC<:]S5T&,NH1$XW6W>0&'9%KK#6B'F.#QR_AI_&1Y-9
E,/U\L'VT#\U5RC#];I!CA?!4EUF?=FP9GCB4_`1.,9TG1`8`````
`
end


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to