diff options
author | Stephen Warren <swarren@nvidia.com> | 2014-04-14 17:21:23 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-16 16:59:13 -0400 |
commit | 4f2fe2d27472f4a5dbd875888af4fc5175f3fdc5 (patch) | |
tree | bf93520a69ccb388c052924bde8667cbbf3ddfff /drivers/usb/host | |
parent | e155b5b8d2d42455d3a94c2460c287e97184ec61 (diff) |
USB: EHCI: tegra: set txfill_tuning
To avoid memory fetch underflows with larger USB transfers, Tegra SoCs
need txfill_tuning's txfifothresh register field set to a non-default
value. Add a custom reset override in order to set this up.
These values are recommended practice for all Tegra chips. However,
I've only noticed practical problems when not setting them this way on
systems using Tegra124. Hence, CC: stable only for recent kernels which
actually support Tegra124.
Cc: <stable@vger.kernel.org> # 3.14+
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 27ac6ad53c3d..7ef00ecb0da1 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
@@ -509,8 +509,31 @@ static struct platform_driver tegra_ehci_driver = { | |||
509 | } | 509 | } |
510 | }; | 510 | }; |
511 | 511 | ||
512 | static int tegra_ehci_reset(struct usb_hcd *hcd) | ||
513 | { | ||
514 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | ||
515 | int retval; | ||
516 | int txfifothresh; | ||
517 | |||
518 | retval = ehci_setup(hcd); | ||
519 | if (retval) | ||
520 | return retval; | ||
521 | |||
522 | /* | ||
523 | * We should really pull this value out of tegra_ehci_soc_config, but | ||
524 | * to avoid needing access to it, make use of the fact that Tegra20 is | ||
525 | * the only one so far that needs a value of 10, and Tegra20 is the | ||
526 | * only one which doesn't set has_hostpc. | ||
527 | */ | ||
528 | txfifothresh = ehci->has_hostpc ? 0x10 : 10; | ||
529 | ehci_writel(ehci, txfifothresh << 16, &ehci->regs->txfill_tuning); | ||
530 | |||
531 | return 0; | ||
532 | } | ||
533 | |||
512 | static const struct ehci_driver_overrides tegra_overrides __initconst = { | 534 | static const struct ehci_driver_overrides tegra_overrides __initconst = { |
513 | .extra_priv_size = sizeof(struct tegra_ehci_hcd), | 535 | .extra_priv_size = sizeof(struct tegra_ehci_hcd), |
536 | .reset = tegra_ehci_reset, | ||
514 | }; | 537 | }; |
515 | 538 | ||
516 | static int __init ehci_tegra_init(void) | 539 | static int __init ehci_tegra_init(void) |