backport acx100 2.6.24 fixes from SVN
[15.05/openwrt.git] / target / linux / adm5120 / patches-2.6.24 / 913-usb_avoid_donelist_after_an_error.patch
1 Index: linux-2.6.24/drivers/usb/host/adm5120-q.c
2 ===================================================================
3 --- linux-2.6.24.orig/drivers/usb/host/adm5120-q.c
4 +++ linux-2.6.24/drivers/usb/host/adm5120-q.c
5 @@ -641,10 +641,11 @@ static int td_done(struct admhcd *ahcd, 
6  
7  /*-------------------------------------------------------------------------*/
8  
9 -static inline struct td *
10 +static inline void
11  ed_halted(struct admhcd *ahcd, struct td *td, int cc, struct td *rev)
12  {
13         struct urb              *urb = td->urb;
14 +       struct urb_priv         *urb_priv = urb->hcpriv;
15         struct ed               *ed = td->ed;
16         struct list_head        *tmp = td->td_list.next;
17         __hc32                  toggle = ed->hwHeadP & cpu_to_hc32(ahcd, ED_C);
18 @@ -657,13 +658,12 @@ ed_halted(struct admhcd *ahcd, struct td
19         wmb();
20         ed->hwHeadP &= ~cpu_to_hc32(ahcd, ED_H);
21  
22 -       /* put any later tds from this urb onto the donelist, after 'td',
23 -        * order won't matter here: no errors, and nothing was transferred.
24 -        * also patch the ed so it looks as if those tds completed normally.
25 +       /* Get rid of all later tds from this urb. We don't have
26 +        * to be careful: no errors and nothing was transferred.
27 +        * Also patch the ed so it looks as if those tds completed normally.
28          */
29         while (tmp != &ed->td_list) {
30                 struct td       *next;
31 -               __hc32          info;
32  
33                 next = list_entry(tmp, struct td, td_list);
34                 tmp = next->td_list.next;
35 @@ -678,16 +678,8 @@ ed_halted(struct admhcd *ahcd, struct td
36                  * then we need to leave the control STATUS packet queued
37                  * and clear ED_SKIP.
38                  */
39 -               info = next->hwINFO;
40 -#if 0          /* FIXME */
41 -               info |= cpu_to_hc32(ahcd, TD_DONE);
42 -#endif
43 -               info &= ~cpu_to_hc32(ahcd, TD_CC);
44 -               next->hwINFO = info;
45 -
46 -               next->next_dl_td = rev;
47 -               rev = next;
48 -
49 +               list_del(&next->td_list);
50 +               urb_priv->td_cnt++;
51                 ed->hwHeadP = next->hwNextTD | toggle;
52         }
53  
54 @@ -713,8 +705,6 @@ ed_halted(struct admhcd *ahcd, struct td
55                         hc32_to_cpu(ahcd, td->hwINFO),
56                         cc, cc_to_error [cc]);
57         }
58 -
59 -       return rev;
60  }
61  
62  /*-------------------------------------------------------------------------*/