diff options
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
| -rw-r--r-- | drivers/usb/host/ehci-hcd.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 6fee3cd58efe..74dcf49bd015 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
| @@ -572,6 +572,8 @@ static int ehci_init(struct usb_hcd *hcd) | |||
| 572 | ehci->iaa_watchdog.function = ehci_iaa_watchdog; | 572 | ehci->iaa_watchdog.function = ehci_iaa_watchdog; |
| 573 | ehci->iaa_watchdog.data = (unsigned long) ehci; | 573 | ehci->iaa_watchdog.data = (unsigned long) ehci; |
| 574 | 574 | ||
| 575 | hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params); | ||
| 576 | |||
| 575 | /* | 577 | /* |
| 576 | * hw default: 1K periodic list heads, one per frame. | 578 | * hw default: 1K periodic list heads, one per frame. |
| 577 | * periodic_size can shrink by USBCMD update if hcc_params allows. | 579 | * periodic_size can shrink by USBCMD update if hcc_params allows. |
| @@ -579,11 +581,20 @@ static int ehci_init(struct usb_hcd *hcd) | |||
| 579 | ehci->periodic_size = DEFAULT_I_TDPS; | 581 | ehci->periodic_size = DEFAULT_I_TDPS; |
| 580 | INIT_LIST_HEAD(&ehci->cached_itd_list); | 582 | INIT_LIST_HEAD(&ehci->cached_itd_list); |
| 581 | INIT_LIST_HEAD(&ehci->cached_sitd_list); | 583 | INIT_LIST_HEAD(&ehci->cached_sitd_list); |
| 584 | |||
| 585 | if (HCC_PGM_FRAMELISTLEN(hcc_params)) { | ||
| 586 | /* periodic schedule size can be smaller than default */ | ||
| 587 | switch (EHCI_TUNE_FLS) { | ||
| 588 | case 0: ehci->periodic_size = 1024; break; | ||
| 589 | case 1: ehci->periodic_size = 512; break; | ||
| 590 | case 2: ehci->periodic_size = 256; break; | ||
| 591 | default: BUG(); | ||
| 592 | } | ||
| 593 | } | ||
| 582 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) | 594 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) |
| 583 | return retval; | 595 | return retval; |
| 584 | 596 | ||
| 585 | /* controllers may cache some of the periodic schedule ... */ | 597 | /* controllers may cache some of the periodic schedule ... */ |
| 586 | hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params); | ||
| 587 | if (HCC_ISOC_CACHE(hcc_params)) // full frame cache | 598 | if (HCC_ISOC_CACHE(hcc_params)) // full frame cache |
| 588 | ehci->i_thresh = 2 + 8; | 599 | ehci->i_thresh = 2 + 8; |
| 589 | else // N microframes cached | 600 | else // N microframes cached |
| @@ -637,12 +648,6 @@ static int ehci_init(struct usb_hcd *hcd) | |||
| 637 | /* periodic schedule size can be smaller than default */ | 648 | /* periodic schedule size can be smaller than default */ |
| 638 | temp &= ~(3 << 2); | 649 | temp &= ~(3 << 2); |
| 639 | temp |= (EHCI_TUNE_FLS << 2); | 650 | temp |= (EHCI_TUNE_FLS << 2); |
| 640 | switch (EHCI_TUNE_FLS) { | ||
| 641 | case 0: ehci->periodic_size = 1024; break; | ||
| 642 | case 1: ehci->periodic_size = 512; break; | ||
| 643 | case 2: ehci->periodic_size = 256; break; | ||
| 644 | default: BUG(); | ||
| 645 | } | ||
| 646 | } | 651 | } |
| 647 | if (HCC_LPM(hcc_params)) { | 652 | if (HCC_LPM(hcc_params)) { |
| 648 | /* support link power management EHCI 1.1 addendum */ | 653 | /* support link power management EHCI 1.1 addendum */ |
