Advertisement
Guest User

Untitled

a guest
Jan 24th, 2011
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. commit 7c3addd6690b9b0e0c0abd7f6e8645840ae76e99
  2. Author: sideral <asieoniezi@gmx.net>
  3. Date: Mon Jan 24 14:05:34 2011 +0100
  4.  
  5. Do not reset driver on USB bus reset. Rather, simply cancel ongoing
  6. transfers.
  7.  
  8. I suspect the USB reset leads to some kind of IRQ race (a new IRQ
  9. arriving and reentering INT_USB while the driver is reset), leaving
  10. the controller in a weird state. cancel_all_transfers is my attempt
  11. at fixing the root of the problem that led to the driver-reset
  12. workaround being introduced in the first place.
  13.  
  14. diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c
  15. index eb6d1bb..060c90a 100644
  16. --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c
  17. +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c
  18. @@ -90,7 +90,7 @@ static struct usb_endpoint endpoints[USB_NUM_ENDPOINTS][2];
  19. static struct usb_ctrlrequest _ep0_setup_pkt __attribute__((aligned(32)));
  20. static struct usb_ctrlrequest *ep0_setup_pkt = AS3525_UNCACHED_ADDR(&_ep0_setup_pkt);
  21.  
  22. -static int g_usbreset_count = 0;
  23. +// static int g_usbreset_count = 0;
  24.  
  25. /* state of EP0 */
  26. static enum ep0state ep0_state;
  27. @@ -452,7 +452,7 @@ void usb_drv_init(void)
  28. /* Enable global interrupts */
  29. enable_global_interrupts();
  30.  
  31. - g_usbreset_count = 0;
  32. +// g_usbreset_count = 0;
  33. }
  34.  
  35. void usb_drv_exit(void)
  36. @@ -591,6 +591,8 @@ void INT_USB(void)
  37. {
  38. logf("usb-drv: bus reset");
  39.  
  40. + cancel_all_transfers(true); /* XXX */
  41. +#if 0 /* XXX */
  42. g_usbreset_count++;
  43.  
  44. if(g_usbreset_count == 2)
  45. @@ -603,7 +605,7 @@ void INT_USB(void)
  46. usb_drv_exit();
  47. usb_drv_init(); /* reset g_usbreset_count here */
  48. }
  49. -
  50. +#endif
  51. /* Clear the Remote Wakeup Signalling */
  52. DCTL &= ~DCTL_rmtwkupsig;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement