aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index f8030ee928e8..f72ae0b6ee7f 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -94,7 +94,8 @@ static const char hcd_name [] = "ehci_hcd";
94#define EHCI_IAA_MSECS 10 /* arbitrary */ 94#define EHCI_IAA_MSECS 10 /* arbitrary */
95#define EHCI_IO_JIFFIES (HZ/10) /* io watchdog > irq_thresh */ 95#define EHCI_IO_JIFFIES (HZ/10) /* io watchdog > irq_thresh */
96#define EHCI_ASYNC_JIFFIES (HZ/20) /* async idle timeout */ 96#define EHCI_ASYNC_JIFFIES (HZ/20) /* async idle timeout */
97#define EHCI_SHRINK_FRAMES 5 /* async qh unlink delay */ 97#define EHCI_SHRINK_JIFFIES (DIV_ROUND_UP(HZ, 200) + 1)
98 /* 200-ms async qh unlink delay */
98 99
99/* Initial IRQ latency: faster than hw default */ 100/* Initial IRQ latency: faster than hw default */
100static int log2_irq_thresh = 0; // 0 to 6 101static int log2_irq_thresh = 0; // 0 to 6
@@ -114,7 +115,7 @@ MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications");
114/* for link power management(LPM) feature */ 115/* for link power management(LPM) feature */
115static unsigned int hird; 116static unsigned int hird;
116module_param(hird, int, S_IRUGO); 117module_param(hird, int, S_IRUGO);
117MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us\n"); 118MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us");
118 119
119#define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT) 120#define INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
120 121
@@ -152,10 +153,7 @@ timer_action(struct ehci_hcd *ehci, enum ehci_timer_action action)
152 break; 153 break;
153 /* case TIMER_ASYNC_SHRINK: */ 154 /* case TIMER_ASYNC_SHRINK: */
154 default: 155 default:
155 /* add a jiffie since we synch against the 156 t = EHCI_SHRINK_JIFFIES;
156 * 8 KHz uframe counter.
157 */
158 t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1;
159 break; 157 break;
160 } 158 }
161 mod_timer(&ehci->watchdog, t + jiffies); 159 mod_timer(&ehci->watchdog, t + jiffies);
@@ -340,6 +338,7 @@ static void ehci_work(struct ehci_hcd *ehci);
340#include "ehci-mem.c" 338#include "ehci-mem.c"
341#include "ehci-q.c" 339#include "ehci-q.c"
342#include "ehci-sched.c" 340#include "ehci-sched.c"
341#include "ehci-sysfs.c"
343 342
344/*-------------------------------------------------------------------------*/ 343/*-------------------------------------------------------------------------*/
345 344
@@ -524,7 +523,7 @@ static void ehci_stop (struct usb_hcd *hcd)
524 ehci_reset (ehci); 523 ehci_reset (ehci);
525 spin_unlock_irq(&ehci->lock); 524 spin_unlock_irq(&ehci->lock);
526 525
527 remove_companion_file(ehci); 526 remove_sysfs_files(ehci);
528 remove_debug_files (ehci); 527 remove_debug_files (ehci);
529 528
530 /* root hub is shut down separately (first, when possible) */ 529 /* root hub is shut down separately (first, when possible) */
@@ -575,6 +574,12 @@ static int ehci_init(struct usb_hcd *hcd)
575 hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params); 574 hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
576 575
577 /* 576 /*
577 * by default set standard 80% (== 100 usec/uframe) max periodic
578 * bandwidth as required by USB 2.0
579 */
580 ehci->uframe_periodic_max = 100;
581
582 /*
578 * hw default: 1K periodic list heads, one per frame. 583 * hw default: 1K periodic list heads, one per frame.
579 * periodic_size can shrink by USBCMD update if hcc_params allows. 584 * periodic_size can shrink by USBCMD update if hcc_params allows.
580 */ 585 */
@@ -758,7 +763,7 @@ static int ehci_run (struct usb_hcd *hcd)
758 * since the class device isn't created that early. 763 * since the class device isn't created that early.
759 */ 764 */
760 create_debug_files(ehci); 765 create_debug_files(ehci);
761 create_companion_file(ehci); 766 create_sysfs_files(ehci);
762 767
763 return 0; 768 return 0;
764} 769}