Hi,

this fixes an unplugging problem and an SMP deadlock.
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:11:52+02:00, [EMAIL PROTECTED]
  - hpusbscsi update




diff -Nru a/drivers/usb/hpusbscsi.c b/drivers/usb/hpusbscsi.c
--- a/drivers/usb/hpusbscsi.c   Thu Sep 26 12:02:31 2002
+++ b/drivers/usb/hpusbscsi.c   Thu Sep 26 12:02:31 2002
@@ -200,8 +200,14 @@
 static void
 hpusbscsi_usb_disconnect (struct usb_device *dev, void *ptr)
 {
-                 usb_unlink_urb(&(((struct hpusbscsi *) ptr)->controlurb));
-       ((struct hpusbscsi *) ptr)->dev = NULL;
+       struct hpusbscsi *hp = (struct hpusbscsi *)ptr;
+
+       usb_unlink_urb(&hp->controlurb);
+       usb_unlink_urb(&hp->dataurb);
+
+       spin_lock_irq(&io_request_lock);
+       hp->dev = NULL;
+       spin_unlock_irq(&io_request_lock);
 }
 
 static struct usb_device_id hpusbscsi_usb_ids[] = {
@@ -335,15 +341,13 @@
        usb_urb_callback usb_callback;
        int res;
 
-       hpusbscsi->use_count++;
+       spin_unlock_irq(&io_request_lock);
 
        /* we don't answer for anything but our single device on any faked host 
controller */
        if ( srb->device->lun || srb->device->id || srb->device->channel ) {
-               if (callback) {
-                       srb->result = DID_BAD_TARGET;
-                       callback(srb);
-               }
-                       goto out;
+               srb->result = DID_BAD_TARGET;
+               callback(srb);
+               goto out;
        }
 
        /* Now we need to decide which callback to give to the urb we send the command 
with */
@@ -407,14 +411,13 @@
        if (res) {
                hpusbscsi->state = HP_STATE_FREE;
                PDEBUG(2, "state= %s", states[hpusbscsi->state]);
-               if (callback) {
-                       srb->result = DID_ERROR;
-                       callback(srb);
-               }
+               srb->result = DID_ERROR;
+               callback(srb);
+
        }
 
 out:
-       hpusbscsi->use_count--;
+       spin_lock_irq(&io_request_lock);
        return 0;
 }
 
@@ -438,7 +441,7 @@
        spin_unlock_irq(&io_request_lock);
        usb_unlink_urb(&hpusbscsi->dataurb);
        hpusbscsi->state = HP_STATE_FREE;
-       
+
        spin_lock_irq(&io_request_lock);
 
        return SCSI_ABORT_PENDING;

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


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


begin 664 bkpatch419
M'XL(`#?;DCT``ZU5:T_;,!3]'/^**R$A&$IK.\ZC144\BE@U-%`'WY"J)/9(
ME#8.ML-`RH^?DTR%">C81I3(\KT^)\?W'B=;<*V%&CMRF=\+A;;@L]3&3D4I
M2S'(Y$HL\[)^&$AU:Y-S*6URV(:'/6*8%*Y10NAAK1.7#ABRRRYCDV9@LWKL
MD(&WCIC'2HR=^>G9]?G1'*')!$ZRN+P5WX2!R00EQ2&OQ7)0*!EG[1N;=;JA
M&!/L8T(]%F#:X!`3OPE"'H?,PR/?9YP(@GI-AZ^I_YV+XA%I'\^RL(@%(9H"
M&83A"#`=XM&0!D#(V-X^W<-TC#%LH(8]`BY&Q_#_&SA!*;B05;:8.M4YU!6/
MC4!?H!49H<NG@B'W+R^$<(S1`51M*PZYT,4SG5RUN^N:.%R_?9!VJ@G&H1U]
M&C345@@W/!0\XIQ%/`D3$7B;:K.)V3:`!K8)Q">-%["0=99X`]`:Y..E;W3,
M9NF$4-M+YC<TBDCO'^*_L`]YEWU"<`G[0`-]SQ]@)592/4*\7,HT-KDL@8N8
MVTD!>0EWM:A%*E>KN.1KB)25AG9AKE-9EB(UUGE]9R[`53^ZVSKI\JTF_8,I
MIQ1[0-&,8@81<K11=6J>G8!/6043V'D9WZV,VD<WR+&115W:<A:+6B4[VUGE
M'ECY1LFEG>_NO[["GJNX3UL*7>7EHBW-(E=W.]NY7"AA*Z1-%VPI.HBXMU*^
M7I^?[_^"6-(-H*GG14#0K!_>AV`4?(M@`7C(<;1*W`,E=+VT'TB8SJ:+XZ/I
MXNIH?G9Z934XJ>UN$J?%CNXWZMQ*(T'6QE(Q@H&A&2/>&U2G\_G%_!66FQ8;
GML+[X<_5F3)&NO7=<//T"T@SD1:Z7DVB(*8<QQS]!&03M-=P!@``
`
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

Reply via email to