Re: [PATCH] USB: EHCI: tegra: set txfill_tuning

2014-04-15 Thread Alan Stern
On Mon, 14 Apr 2014, Stephen Warren wrote:

 From: Stephen Warren swar...@nvidia.com
 
 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: sta...@vger.kernel.org # 3.14+
 Signed-off-by: Stephen Warren swar...@nvidia.com

Acked-by: Alan Stern st...@rowland.harvard.edu

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] USB: EHCI: tegra: set txfill_tuning

2014-04-14 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

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: sta...@vger.kernel.org # 3.14+
Signed-off-by: Stephen Warren swar...@nvidia.com
---
 drivers/usb/host/ehci-tegra.c | 23 +++
 1 file changed, 23 insertions(+)

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 = {
}
 };
 
+static int tegra_ehci_reset(struct usb_hcd *hcd)
+{
+   struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+   int retval;
+   int txfifothresh;
+
+   retval = ehci_setup(hcd);
+   if (retval)
+   return retval;
+
+   /*
+* We should really pull this value out of tegra_ehci_soc_config, but
+* to avoid needing access to it, make use of the fact that Tegra20 is
+* the only one so far that needs a value of 10, and Tegra20 is the
+* only one which doesn't set has_hostpc.
+*/
+   txfifothresh = ehci-has_hostpc ? 0x10 : 10;
+   ehci_writel(ehci, txfifothresh  16, ehci-regs-txfill_tuning);
+
+   return 0;
+}
+
 static const struct ehci_driver_overrides tegra_overrides __initconst = {
.extra_priv_size= sizeof(struct tegra_ehci_hcd),
+   .reset  = tegra_ehci_reset,
 };
 
 static int __init ehci_tegra_init(void)
-- 
1.8.1.5

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] USB: EHCI: tegra: set txfill_tuning

2014-04-14 Thread Alexandre Courbot
On Tue, Apr 15, 2014 at 6:21 AM, Stephen Warren swar...@wwwdotorg.org wrote:
 From: Stephen Warren swar...@nvidia.com

 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.

Yay, I can finally ssh into my Venice2!

FWIW:

Tested-by: Alexandre Courbot acour...@nvidia.com
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html