013-ohci_workarounds.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --- a/drivers/usb/host/ohci.h
  2. +++ b/drivers/usb/host/ohci.h
  3. @@ -122,7 +122,7 @@ struct td {
  4. /* PSW is only for ISO. Only 1 PSW entry is used, but on
  5. * big-endian PPC hardware that's the second entry.
  6. */
  7. -#define MAXPSW 2
  8. +#define MAXPSW 8
  9. __hc16 hwPSW [MAXPSW];
  10. /* rest are purely for the driver's use */
  11. --- a/drivers/usb/host/ohci-hcd.c
  12. +++ b/drivers/usb/host/ohci-hcd.c
  13. @@ -441,6 +441,7 @@ static int ohci_init (struct ohci_hcd *o
  14. {
  15. int ret;
  16. struct usb_hcd *hcd = ohci_to_hcd(ohci);
  17. + u32 hcca_area;
  18. /* Accept arbitrarily long scatter-gather lists */
  19. hcd->self.sg_tablesize = ~0;
  20. @@ -501,11 +502,13 @@ static int ohci_init (struct ohci_hcd *o
  21. (unsigned long) ohci);
  22. set_timer_slack(&ohci->io_watchdog, msecs_to_jiffies(20));
  23. - ohci->hcca = dma_alloc_coherent (hcd->self.controller,
  24. - sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL);
  25. + hcca_area = ohci_readl(ohci, &ohci->regs->hcca);
  26. + ohci->hcca = ioremap_nocache(hcca_area, sizeof *ohci->hcca);
  27. if (!ohci->hcca)
  28. return -ENOMEM;
  29. + ohci->hcca_dma = hcca_area;
  30. +
  31. if ((ret = ohci_mem_init (ohci)) < 0)
  32. ohci_stop (hcd);
  33. else {
  34. @@ -523,6 +526,7 @@ static int ohci_init (struct ohci_hcd *o
  35. */
  36. static int ohci_run (struct ohci_hcd *ohci)
  37. {
  38. + int i = 0;
  39. u32 mask, val;
  40. int first = ohci->fminterval == 0;
  41. struct usb_hcd *hcd = ohci_to_hcd(ohci);
  42. @@ -573,6 +577,8 @@ static int ohci_run (struct ohci_hcd *oh
  43. msleep(val);
  44. memset (ohci->hcca, 0, sizeof (struct ohci_hcca));
  45. + for (i = 0; i < NUM_INTS; i++)
  46. + ohci->hcca->int_table[i] = 0;
  47. /* 2msec timelimit here means no irqs/preempt */
  48. spin_lock_irq (&ohci->lock);
  49. @@ -984,9 +990,6 @@ static void ohci_stop (struct usb_hcd *h
  50. remove_debug_files (ohci);
  51. ohci_mem_cleanup (ohci);
  52. if (ohci->hcca) {
  53. - dma_free_coherent (hcd->self.controller,
  54. - sizeof *ohci->hcca,
  55. - ohci->hcca, ohci->hcca_dma);
  56. ohci->hcca = NULL;
  57. ohci->hcca_dma = 0;
  58. }