All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode
@ 2017-04-11  0:15 Tony Lindgren
  2017-04-11  7:28   ` Roger Quadros
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2017-04-11  0:15 UTC (permalink / raw)
  To: Lee Jones, Samuel Ortiz
  Cc: linux-kernel, linux-omap, Felipe Balbi, Keshava Munegowda,
	Marcel Partap, Michael Scott, Roger Quadros, Sebastian Reichel

Commit 16fa3dc75c22 ("mfd: omap-usb-tll: HOST TLL platform driver")
added support for USB TLL, but uses OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
bit the wrong way. The comments in the code are mostly correct, but the
inverted use of OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF causes the register
to be enabled instead of disabled like the comments say. And the
idle mode should be only disabled for UTMIAUTOIDLE while ULPIAUTOIDLE
can be enabled.

This matches the TLL_CHANNEL_CONF_i register configuration for ehci-tll
in the Motorola Linux kernel tree for Wrigley 3G LTE modem on droid 4.
Without this patch the modem can only be pinged few times before it
stops responding. Also lsub -v output shows errors without this patch.

Fixes: 16fa3dc75c22 ("mfd: omap-usb-tll: HOST TLL platform driver")
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Keshava Munegowda <keshava_mgowda@ti.com>
Cc: Marcel Partap <mpartap@gmx.net>
Cc: Michael Scott <michael.scott@linaro.org>
Cc: Roger Quadros <rogerq@ti.com>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mfd/omap-usb-tll.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -373,12 +373,13 @@ int omap_tll_init(struct usbhs_omap_platform_data *pdata)
 			} else if (pdata->port_mode[i] ==
 					OMAP_EHCI_PORT_MODE_TLL) {
 				/*
-				 * Disable AutoIdle, BitStuffing
-				 * and use SDR Mode
+				 * Disable UTMI AutoIdle, BitStuffing
+				 * and use SDR Mode. Enable ULPI AutoIdle.
 				 */
-				reg &= ~(OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE
-					| OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
-					| OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE);
+				reg &= ~(OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE |
+					 OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE);
+				reg |= OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF;
+				reg |= OMAP_TLL_CHANNEL_CONF_ULPI_ULPIAUTOIDLE;
 			} else if (pdata->port_mode[i] ==
 					OMAP_EHCI_PORT_MODE_HSIC) {
 				/*
-- 
2.12.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode
  2017-04-11  0:15 [PATCH] mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode Tony Lindgren
@ 2017-04-11  7:28   ` Roger Quadros
  0 siblings, 0 replies; 4+ messages in thread
From: Roger Quadros @ 2017-04-11  7:28 UTC (permalink / raw)
  To: Tony Lindgren, Lee Jones, Samuel Ortiz
  Cc: linux-kernel, linux-omap, Felipe Balbi, Marcel Partap,
	Michael Scott, Sebastian Reichel

Hi Tony,

On 11/04/17 03:15, Tony Lindgren wrote:
> Commit 16fa3dc75c22 ("mfd: omap-usb-tll: HOST TLL platform driver")
> added support for USB TLL, but uses OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
> bit the wrong way. The comments in the code are mostly correct, but the
> inverted use of OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF causes the register
> to be enabled instead of disabled like the comments say. And the
> idle mode should be only disabled for UTMIAUTOIDLE while ULPIAUTOIDLE
> can be enabled.
> 
> This matches the TLL_CHANNEL_CONF_i register configuration for ehci-tll
> in the Motorola Linux kernel tree for Wrigley 3G LTE modem on droid 4.
> Without this patch the modem can only be pinged few times before it
> stops responding. Also lsub -v output shows errors without this patch.

This patch does 2 things.
- Fixes the bad commit by correctly disabling Bitstuffing
- Enables ULPI Autoidle.

Is enabling ULPI autoidle required to fix the LTE modem issue? If not I'd put it
in a separate patch.

cheers,
-roger

> 
> Fixes: 16fa3dc75c22 ("mfd: omap-usb-tll: HOST TLL platform driver")
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Cc: Keshava Munegowda <keshava_mgowda@ti.com>
> Cc: Marcel Partap <mpartap@gmx.net>
> Cc: Michael Scott <michael.scott@linaro.org>
> Cc: Roger Quadros <rogerq@ti.com>
> Cc: Sebastian Reichel <sre@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/mfd/omap-usb-tll.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
> --- a/drivers/mfd/omap-usb-tll.c
> +++ b/drivers/mfd/omap-usb-tll.c
> @@ -373,12 +373,13 @@ int omap_tll_init(struct usbhs_omap_platform_data *pdata)
>  			} else if (pdata->port_mode[i] ==
>  					OMAP_EHCI_PORT_MODE_TLL) {
>  				/*
> -				 * Disable AutoIdle, BitStuffing
> -				 * and use SDR Mode
> +				 * Disable UTMI AutoIdle, BitStuffing
> +				 * and use SDR Mode. Enable ULPI AutoIdle.
>  				 */
> -				reg &= ~(OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE
> -					| OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
> -					| OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE);
> +				reg &= ~(OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE |
> +					 OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE);
> +				reg |= OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF;
> +				reg |= OMAP_TLL_CHANNEL_CONF_ULPI_ULPIAUTOIDLE;
>  			} else if (pdata->port_mode[i] ==
>  					OMAP_EHCI_PORT_MODE_HSIC) {
>  				/*
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode
@ 2017-04-11  7:28   ` Roger Quadros
  0 siblings, 0 replies; 4+ messages in thread
From: Roger Quadros @ 2017-04-11  7:28 UTC (permalink / raw)
  To: Tony Lindgren, Lee Jones, Samuel Ortiz
  Cc: linux-kernel, linux-omap, Felipe Balbi, Marcel Partap,
	Michael Scott, Sebastian Reichel

Hi Tony,

On 11/04/17 03:15, Tony Lindgren wrote:
> Commit 16fa3dc75c22 ("mfd: omap-usb-tll: HOST TLL platform driver")
> added support for USB TLL, but uses OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
> bit the wrong way. The comments in the code are mostly correct, but the
> inverted use of OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF causes the register
> to be enabled instead of disabled like the comments say. And the
> idle mode should be only disabled for UTMIAUTOIDLE while ULPIAUTOIDLE
> can be enabled.
> 
> This matches the TLL_CHANNEL_CONF_i register configuration for ehci-tll
> in the Motorola Linux kernel tree for Wrigley 3G LTE modem on droid 4.
> Without this patch the modem can only be pinged few times before it
> stops responding. Also lsub -v output shows errors without this patch.

This patch does 2 things.
- Fixes the bad commit by correctly disabling Bitstuffing
- Enables ULPI Autoidle.

Is enabling ULPI autoidle required to fix the LTE modem issue? If not I'd put it
in a separate patch.

cheers,
-roger

> 
> Fixes: 16fa3dc75c22 ("mfd: omap-usb-tll: HOST TLL platform driver")
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Cc: Keshava Munegowda <keshava_mgowda@ti.com>
> Cc: Marcel Partap <mpartap@gmx.net>
> Cc: Michael Scott <michael.scott@linaro.org>
> Cc: Roger Quadros <rogerq@ti.com>
> Cc: Sebastian Reichel <sre@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/mfd/omap-usb-tll.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
> --- a/drivers/mfd/omap-usb-tll.c
> +++ b/drivers/mfd/omap-usb-tll.c
> @@ -373,12 +373,13 @@ int omap_tll_init(struct usbhs_omap_platform_data *pdata)
>  			} else if (pdata->port_mode[i] ==
>  					OMAP_EHCI_PORT_MODE_TLL) {
>  				/*
> -				 * Disable AutoIdle, BitStuffing
> -				 * and use SDR Mode
> +				 * Disable UTMI AutoIdle, BitStuffing
> +				 * and use SDR Mode. Enable ULPI AutoIdle.
>  				 */
> -				reg &= ~(OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE
> -					| OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
> -					| OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE);
> +				reg &= ~(OMAP_TLL_CHANNEL_CONF_UTMIAUTOIDLE |
> +					 OMAP_TLL_CHANNEL_CONF_ULPIDDRMODE);
> +				reg |= OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF;
> +				reg |= OMAP_TLL_CHANNEL_CONF_ULPI_ULPIAUTOIDLE;
>  			} else if (pdata->port_mode[i] ==
>  					OMAP_EHCI_PORT_MODE_HSIC) {
>  				/*
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode
  2017-04-11  7:28   ` Roger Quadros
  (?)
@ 2017-04-11 15:18   ` Tony Lindgren
  -1 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2017-04-11 15:18 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Lee Jones, Samuel Ortiz, linux-kernel, linux-omap, Felipe Balbi,
	Marcel Partap, Michael Scott, Sebastian Reichel

* Roger Quadros <rogerq@ti.com> [170411 00:31]:
> Hi Tony,
> 
> On 11/04/17 03:15, Tony Lindgren wrote:
> > Commit 16fa3dc75c22 ("mfd: omap-usb-tll: HOST TLL platform driver")
> > added support for USB TLL, but uses OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF
> > bit the wrong way. The comments in the code are mostly correct, but the
> > inverted use of OMAP_TLL_CHANNEL_CONF_ULPINOBITSTUFF causes the register
> > to be enabled instead of disabled like the comments say. And the
> > idle mode should be only disabled for UTMIAUTOIDLE while ULPIAUTOIDLE
> > can be enabled.
> > 
> > This matches the TLL_CHANNEL_CONF_i register configuration for ehci-tll
> > in the Motorola Linux kernel tree for Wrigley 3G LTE modem on droid 4.
> > Without this patch the modem can only be pinged few times before it
> > stops responding. Also lsub -v output shows errors without this patch.
> 
> This patch does 2 things.
> - Fixes the bad commit by correctly disabling Bitstuffing
> - Enables ULPI Autoidle.
> 
> Is enabling ULPI autoidle required to fix the LTE modem issue? If not I'd put it
> in a separate patch.

No but it presumably saves some power. I'll resend as to patches.

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-11 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-11  0:15 [PATCH] mfd: omap-usb-tll: Fix inverted bit use for USB TLL mode Tony Lindgren
2017-04-11  7:28 ` Roger Quadros
2017-04-11  7:28   ` Roger Quadros
2017-04-11 15:18   ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.