public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] musb: Add new fifo table for a OMAP3 errata
@ 2009-12-21  9:29 Ajay Kumar Gupta
  2009-12-21 10:12 ` Gadiyar, Anand
  0 siblings, 1 reply; 3+ messages in thread
From: Ajay Kumar Gupta @ 2009-12-21  9:29 UTC (permalink / raw)
  To: linux-usb; +Cc: linux-omap, felipe.balbi, Ajay Kumar Gupta

We have observed MSC data read corruption when USB LAN device is
also connected and it's interface is up.

Silicon team has confirmed an errata where in all the active
transfers should use FIFO space either in first 8K or next 8K.
So far we have observed the issue in above use case scenario.

As a workaround to it, adding a new FIFO config (5) fitting well
within first 8K which can be used for such use cases.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 drivers/usb/musb/musb_core.c |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index bfe08f4..0c8f5ec 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1095,6 +1095,36 @@ static struct fifo_cfg __initdata mode_4_cfg[] = {
 { .hw_ep_num = 15, .style = FIFO_RXTX, .maxpacket = 1024, },
 };
 
+/* mode 5 - fits in 8KB */
+static struct fifo_cfg __initdata mode_5_cfg[] = {
+{ .hw_ep_num =  1, .style = FIFO_TX,   .maxpacket = 512, },
+{ .hw_ep_num =  1, .style = FIFO_RX,   .maxpacket = 512, },
+{ .hw_ep_num =  2, .style = FIFO_TX,   .maxpacket = 512, },
+{ .hw_ep_num =  2, .style = FIFO_RX,   .maxpacket = 512, },
+{ .hw_ep_num =  3, .style = FIFO_TX,   .maxpacket = 512, },
+{ .hw_ep_num =  3, .style = FIFO_RX,   .maxpacket = 512, },
+{ .hw_ep_num =  4, .style = FIFO_TX,   .maxpacket = 512, },
+{ .hw_ep_num =  4, .style = FIFO_RX,   .maxpacket = 512, },
+{ .hw_ep_num =  5, .style = FIFO_TX,   .maxpacket = 512, },
+{ .hw_ep_num =  5, .style = FIFO_RX,   .maxpacket = 512, },
+{ .hw_ep_num =  6, .style = FIFO_TX,   .maxpacket = 32, },
+{ .hw_ep_num =  6, .style = FIFO_RX,   .maxpacket = 32, },
+{ .hw_ep_num =  7, .style = FIFO_TX,   .maxpacket = 32, },
+{ .hw_ep_num =  7, .style = FIFO_RX,   .maxpacket = 32, },
+{ .hw_ep_num =  8, .style = FIFO_TX,   .maxpacket = 32, },
+{ .hw_ep_num =  8, .style = FIFO_RX,   .maxpacket = 32, },
+{ .hw_ep_num =  9, .style = FIFO_TX,   .maxpacket = 32, },
+{ .hw_ep_num =  9, .style = FIFO_RX,   .maxpacket = 32, },
+{ .hw_ep_num = 10, .style = FIFO_TX,   .maxpacket = 32, },
+{ .hw_ep_num = 10, .style = FIFO_RX,   .maxpacket = 32, },
+{ .hw_ep_num = 11, .style = FIFO_TX,   .maxpacket = 32, },
+{ .hw_ep_num = 11, .style = FIFO_RX,   .maxpacket = 32, },
+{ .hw_ep_num = 12, .style = FIFO_TX,   .maxpacket = 32, },
+{ .hw_ep_num = 12, .style = FIFO_RX,   .maxpacket = 32, },
+{ .hw_ep_num = 13, .style = FIFO_RXTX, .maxpacket = 512, },
+{ .hw_ep_num = 14, .style = FIFO_RXTX, .maxpacket = 1024, },
+{ .hw_ep_num = 15, .style = FIFO_RXTX, .maxpacket = 1024, },
+};
 
 /*
  * configure a fifo; for non-shared endpoints, this may be called
@@ -1210,6 +1240,10 @@ static int __init ep_config_from_table(struct musb *musb)
 		cfg = mode_4_cfg;
 		n = ARRAY_SIZE(mode_4_cfg);
 		break;
+	case 5:
+		cfg = mode_5_cfg;
+		n = ARRAY_SIZE(mode_5_cfg);
+		break;
 	}
 
 	printk(KERN_DEBUG "%s: setup fifo_mode %d\n",
-- 
1.6.2.4


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

* RE: [PATCH] musb: Add new fifo table for a OMAP3 errata
  2009-12-21  9:29 [PATCH] musb: Add new fifo table for a OMAP3 errata Ajay Kumar Gupta
@ 2009-12-21 10:12 ` Gadiyar, Anand
       [not found]   ` <5A47E75E594F054BAF48C5E4FC4B92AB031DB9AF94-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Gadiyar, Anand @ 2009-12-21 10:12 UTC (permalink / raw)
  To: Gupta, Ajay Kumar, linux-usb@vger.kernel.org
  Cc: linux-omap@vger.kernel.org, felipe.balbi@nokia.com

Gupta, Ajay Kumar wrote:
> 
> We have observed MSC data read corruption when USB LAN device is
> also connected and it's interface is up.
> 
> Silicon team has confirmed an errata where in all the active
> transfers should use FIFO space either in first 8K or next 8K.
> So far we have observed the issue in above use case scenario.
> 
> As a workaround to it, adding a new FIFO config (5) fitting well
> within first 8K which can be used for such use cases.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>

Long term, do you think the board files should define the
the FIFO configuration table that they want to use (instead of
having different options in musb_core.c)?


For now, this change should be okay (although I don't see a
user now. Or maybe you pass this as a module parameter).

FWIW, this patch is:

Acked-by: Anand Gadiyar <gadiyar@ti.com>

> ---
>  drivers/usb/musb/musb_core.c |   34 ++++++++++++++++++++++++++++++++++
>  1 files changed, 34 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index bfe08f4..0c8f5ec 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -1095,6 +1095,36 @@ static struct fifo_cfg __initdata mode_4_cfg[] = {
>  { .hw_ep_num = 15, .style = FIFO_RXTX, .maxpacket = 1024, },
>  };
>  
> +/* mode 5 - fits in 8KB */
> +static struct fifo_cfg __initdata mode_5_cfg[] = {
> +{ .hw_ep_num =  1, .style = FIFO_TX,   .maxpacket = 512, },
> +{ .hw_ep_num =  1, .style = FIFO_RX,   .maxpacket = 512, },
> +{ .hw_ep_num =  2, .style = FIFO_TX,   .maxpacket = 512, },
> +{ .hw_ep_num =  2, .style = FIFO_RX,   .maxpacket = 512, },
> +{ .hw_ep_num =  3, .style = FIFO_TX,   .maxpacket = 512, },
> +{ .hw_ep_num =  3, .style = FIFO_RX,   .maxpacket = 512, },
> +{ .hw_ep_num =  4, .style = FIFO_TX,   .maxpacket = 512, },
> +{ .hw_ep_num =  4, .style = FIFO_RX,   .maxpacket = 512, },
> +{ .hw_ep_num =  5, .style = FIFO_TX,   .maxpacket = 512, },
> +{ .hw_ep_num =  5, .style = FIFO_RX,   .maxpacket = 512, },
> +{ .hw_ep_num =  6, .style = FIFO_TX,   .maxpacket = 32, },
> +{ .hw_ep_num =  6, .style = FIFO_RX,   .maxpacket = 32, },
> +{ .hw_ep_num =  7, .style = FIFO_TX,   .maxpacket = 32, },
> +{ .hw_ep_num =  7, .style = FIFO_RX,   .maxpacket = 32, },
> +{ .hw_ep_num =  8, .style = FIFO_TX,   .maxpacket = 32, },
> +{ .hw_ep_num =  8, .style = FIFO_RX,   .maxpacket = 32, },
> +{ .hw_ep_num =  9, .style = FIFO_TX,   .maxpacket = 32, },
> +{ .hw_ep_num =  9, .style = FIFO_RX,   .maxpacket = 32, },
> +{ .hw_ep_num = 10, .style = FIFO_TX,   .maxpacket = 32, },
> +{ .hw_ep_num = 10, .style = FIFO_RX,   .maxpacket = 32, },
> +{ .hw_ep_num = 11, .style = FIFO_TX,   .maxpacket = 32, },
> +{ .hw_ep_num = 11, .style = FIFO_RX,   .maxpacket = 32, },
> +{ .hw_ep_num = 12, .style = FIFO_TX,   .maxpacket = 32, },
> +{ .hw_ep_num = 12, .style = FIFO_RX,   .maxpacket = 32, },
> +{ .hw_ep_num = 13, .style = FIFO_RXTX, .maxpacket = 512, },
> +{ .hw_ep_num = 14, .style = FIFO_RXTX, .maxpacket = 1024, },
> +{ .hw_ep_num = 15, .style = FIFO_RXTX, .maxpacket = 1024, },
> +};
>  
>  /*
>   * configure a fifo; for non-shared endpoints, this may be called
> @@ -1210,6 +1240,10 @@ static int __init ep_config_from_table(struct musb *musb)
>  		cfg = mode_4_cfg;
>  		n = ARRAY_SIZE(mode_4_cfg);
>  		break;
> +	case 5:
> +		cfg = mode_5_cfg;
> +		n = ARRAY_SIZE(mode_5_cfg);
> +		break;
>  	}
>  
>  	printk(KERN_DEBUG "%s: setup fifo_mode %d\n",
> -- 
> 1.6.2.4

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

* Re: [PATCH] musb: Add new fifo table for a OMAP3 errata
       [not found]   ` <5A47E75E594F054BAF48C5E4FC4B92AB031DB9AF94-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2009-12-21 10:46     ` Felipe Balbi
  0 siblings, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2009-12-21 10:46 UTC (permalink / raw)
  To: ext Gadiyar, Anand
  Cc: Gupta, Ajay Kumar,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Balbi Felipe (Nokia-D/Helsinki)

On Mon, Dec 21, 2009 at 11:12:16AM +0100, ext Gadiyar, Anand wrote:
>Gupta, Ajay Kumar wrote:
>>
>> We have observed MSC data read corruption when USB LAN device is
>> also connected and it's interface is up.
>>
>> Silicon team has confirmed an errata where in all the active
>> transfers should use FIFO space either in first 8K or next 8K.
>> So far we have observed the issue in above use case scenario.
>>
>> As a workaround to it, adding a new FIFO config (5) fitting well
>> within first 8K which can be used for such use cases.
>>
>> Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
>
>Long term, do you think the board files should define the
>the FIFO configuration table that they want to use (instead of
>having different options in musb_core.c)?

I think so too and even sent a patch long time about doing that but it 
got lost.

I recall Dave wanted to have a default mode on musb_core.c though.

>Acked-by: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>

I'm taking this one

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

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

end of thread, other threads:[~2009-12-21 10:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-21  9:29 [PATCH] musb: Add new fifo table for a OMAP3 errata Ajay Kumar Gupta
2009-12-21 10:12 ` Gadiyar, Anand
     [not found]   ` <5A47E75E594F054BAF48C5E4FC4B92AB031DB9AF94-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-12-21 10:46     ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox