Hi,
this fixes a few SMP locking issues for kaweth.
It's for 2.4. Please apply.
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], 2002-09-26 11:59:31+02:00, [EMAIL PROTECTED]
- smp locking bugs
diff -Nru a/drivers/usb/kaweth.c b/drivers/usb/kaweth.c
--- a/drivers/usb/kaweth.c Thu Sep 26 12:01:17 2002
+++ b/drivers/usb/kaweth.c Thu Sep 26 12:01:17 2002
@@ -495,6 +495,7 @@
static void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth)
{
int result;
+ long flags;
FILL_BULK_URB(kaweth->rx_urb,
kaweth->dev,
@@ -504,13 +505,17 @@
kaweth_usb_receive,
kaweth);
- if((result = usb_submit_urb(kaweth->rx_urb))) {
- if (result == -ENOMEM)
- kaweth->suspend_lowmem = 1;
- kaweth_err("resubmitting rx_urb %d failed", result);
- } else {
- kaweth->suspend_lowmem = 0;
+ spin_lock_irqsave(&kaweth->device_lock, flags);
+ if (!kaweth->removed) { /* no resubmit if disconnecting */
+ if((result = usb_submit_urb(kaweth->rx_urb))) {
+ if (result == -ENOMEM)
+ kaweth->suspend_lowmem = 1;
+ kaweth_err("resubmitting rx_urb %d failed", result);
+ } else {
+ kaweth->suspend_lowmem = 0;
+ }
}
+ spin_unlock_irqrestore(&kaweth->device_lock, flags);
}
static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth);
@@ -623,8 +628,10 @@
struct kaweth_device *kaweth = net->priv;
netif_stop_queue(net);
-
+
+ spin_lock_irq(&kaweth->device_lock);
kaweth->status |= KAWETH_STATUS_CLOSING;
+ spin_unlock_irq(&kaweth->device_lock);
usb_unlink_urb(kaweth->irq_urb);
usb_unlink_urb(kaweth->rx_urb);
@@ -1063,12 +1070,12 @@
usb_unlink_urb(kaweth->rx_urb);
/* we need to wait for the urb to be cancelled, if it is active */
- spin_lock(&kaweth->device_lock);
+ spin_lock_irq(&kaweth->device_lock);
if (usb_unlink_urb(kaweth->tx_urb) == -EINPROGRESS) {
- spin_unlock(&kaweth->device_lock);
+ spin_unlock_irq(&kaweth->device_lock);
wait_event(kaweth->term_wait, kaweth->end);
} else {
- spin_unlock(&kaweth->device_lock);
+ spin_unlock_irq(&kaweth->device_lock);
}
if(kaweth->net) {
===================================================================
This BitKeeper patch contains the following changesets:
1.780
## Wrapped with gzip_uu ##
begin 664 bkpatch378
M'XL(`.W:DCT``[55:V^;,!3]C'_%7:M-25N";1Z&5*FR-=56;5VK3OT<$7`2
M%,`IAK33V'^?#4FF;6G7[H&0+'/ON>?<XRNS#S>2%WU#I,F*%V@?W@E9JBW/
M1<Y[<Y'Q-,FK^YXH9BIX+80*6OJSU2*LR<(L"\ZE5<F)27L.4FE781G-045E
MWR`]>_NE_+SD?>/Z[.W-A]?7"`T&<#H/\QG_Q$L8#-!D,8PKGO86A0CGFK'>
MAFN*,<$N)M1V/$QKS#!Q:X_%(7-L'+BN$Q-.4*MIN$O]C[4H#JB'`T)<6CN^
MX_EH!*3'?`R86CBPJ`>$]-V@;Y-#3/L8PR.EX9"`B=$;^/L&3E$$)LAL":F(
M%DD^@TDUD^@].('O,'3UW3!D/O-!"(<8G<!2'\50BG"YUIDK=7&ANVL.T5J$
M=[R<]Z)6LD]LPEPENG:42%S;U(M\$K`HCAGAC#QFS(-EU_:[@8UKASJ4-L.P
M*UO/Q3]6C&8%GPW;2I'('A-),%$SXO@U88'O-3-"?QT1_*0186"2_STDC967
M8!9WS:L._6JGJW\P/.=.P(`@(Q6*;YJ&,WF,1BYFX*%SEU`(D"&723[6DL9)
M<2O#%>^\:@G-DYBODH@WP:,6W3U&1C*%SHM-2L$SL>)Q%[Z`=0"Y@(++:I(E
M):BT.)&1R',>E;K=`PL9"MSIZ)14W1V@FANWV>.JF'2V->_UMMM5116BX=M`
M!F">?;R\.+OHZHBQ0<A*+GD>*Z5W&<]497*,MN$Q+XK.WD97(Z5E@)<Q3,,D
MY?'>$;0,NC_C*_!4\I;\00;<9&H7;6UPXV*5;WQ4U4I1_,[*D:?'$9WKA2+C
MI[/8"58HE<YV4#Z4/B+8:UC6Z]-(-,I?H_1J/(-.72\-L%F?#-S^;Z(YCQ:R
2R@;4QVSJDAA]`Z66T#OO!@``
`
end
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel