public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/USB 00/16] usb patches accepted by Greg
@ 2010-01-19 13:13 Felipe Balbi
  2010-01-19 13:14 ` [PATCH/USB 01/16] USB: musb: use resource_size() Felipe Balbi
                   ` (15 more replies)
  0 siblings, 16 replies; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:13 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

Hi Tony,

the following patches have reached Greg's queue and will
be applied to mainline on next -rc. It would be nice to get
them in linux-omap before hand so people can start working
on top of those changes.

Ajay Kumar Gupta (5):
  USB: musb: Add new fifo table for a OMAP3 errata
  usb: musb: save dynfifo in musb struct
  usb: musb: Add 'extvbus' in musb_hdrc_platform_data
  usb: host: ehci: fix missing kfree in remove path also
  usb: host: ehci: adding regulator framework in ehci-omap.c driver.

Anand Gadiyar (2):
  usb: musb: hsdma: add wrapper for reading DMA count
  usb: musb: workaround MUSB DMA_INTR sometimes reads zero

Arnaud Mandy (1):
  usb: musb: handle irqs in the order dictated by programming guide

Bryan Wu (1):
  usb: musb: clean up commit 'workaround Blackfin FIFO anomalies'

Felipe Balbi (4):
  USB: musb: use resource_size()
  USB: musb: move two printk to dev_err
  USB: musb: move to sysfs_groups
  USB: musb: remove some of the never defined defines

Roel Kluin (1):
  USB: musb: don't dereference NULL tusb_dma in
    dma_controller_destroy()

Swaminathan S (2):
  usb: musb: workaround toggle bug when doing bulk transfer after isoc
  usb: musb: Fix cppi_channel_abort() function to handle Tx abort
    correctly

 drivers/usb/host/ehci-omap.c     |   37 ++++
 drivers/usb/musb/blackfin.c      |   28 ++--
 drivers/usb/musb/cppi_dma.c      |   33 +---
 drivers/usb/musb/musb_core.c     |  364 +++++++++++++++++++-------------------
 drivers/usb/musb/musb_core.h     |   17 +--
 drivers/usb/musb/musb_host.c     |   24 +++
 drivers/usb/musb/musb_regs.h     |    5 +
 drivers/usb/musb/musbhsdma.c     |   25 +++-
 drivers/usb/musb/musbhsdma.h     |   17 ++
 drivers/usb/musb/tusb6010_omap.c |    2 +-
 include/linux/usb/musb.h         |    3 +
 11 files changed, 316 insertions(+), 239 deletions(-)


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

* [PATCH/USB 01/16] USB: musb: use resource_size()
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  1:44   ` [APPLIED] " Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 02/16] USB: musb: move two printk to dev_err Felipe Balbi
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

it makes ioremap() usage looks cleaner.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 5eb9318..1927fa9 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2134,7 +2134,7 @@ static int __init musb_probe(struct platform_device *pdev)
 	if (!iomem || irq == 0)
 		return -ENODEV;
 
-	base = ioremap(iomem->start, iomem->end - iomem->start + 1);
+	base = ioremap(iomem->start, resource_size(iomem));
 	if (!base) {
 		dev_err(dev, "ioremap failed\n");
 		return -ENOMEM;
-- 
1.6.6.rc0


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

* [PATCH/USB 02/16] USB: musb: move two printk to dev_err
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
  2010-01-19 13:14 ` [PATCH/USB 01/16] USB: musb: use resource_size() Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  1:45   ` [APPLIED] " Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 03/16] USB: musb: move to sysfs_groups Felipe Balbi
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

trivial cleanup, no functional changes.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 1927fa9..91c31f2 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1696,7 +1696,7 @@ musb_vbus_store(struct device *dev, struct device_attribute *attr,
 	unsigned long	val;
 
 	if (sscanf(buf, "%lu", &val) < 1) {
-		printk(KERN_ERR "Invalid VBUS timeout ms value\n");
+		dev_err(dev, "Invalid VBUS timeout ms value\n");
 		return -EINVAL;
 	}
 
@@ -1746,7 +1746,7 @@ musb_srp_store(struct device *dev, struct device_attribute *attr,
 
 	if (sscanf(buf, "%hu", &srp) != 1
 			|| (srp != 1)) {
-		printk(KERN_ERR "SRP: Value must be 1\n");
+		dev_err(dev, "SRP: Value must be 1\n");
 		return -EINVAL;
 	}
 
-- 
1.6.6.rc0


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

* [PATCH/USB 03/16] USB: musb: move to sysfs_groups
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
  2010-01-19 13:14 ` [PATCH/USB 01/16] USB: musb: use resource_size() Felipe Balbi
  2010-01-19 13:14 ` [PATCH/USB 02/16] USB: musb: move two printk to dev_err Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  1:45   ` [APPLIED] " Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 04/16] USB: musb: remove some of the never defined defines Felipe Balbi
                   ` (12 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

it's easier to keep up and add more sysfs entries
as necessary.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_core.c |   33 +++++++++++++++------------------
 1 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 91c31f2..52295bc 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1759,6 +1759,19 @@ static DEVICE_ATTR(srp, 0644, NULL, musb_srp_store);
 
 #endif /* CONFIG_USB_GADGET_MUSB_HDRC */
 
+static struct attribute *musb_attributes[] = {
+	&dev_attr_mode.attr,
+	&dev_attr_vbus.attr,
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+	&dev_attr_srp.attr,
+#endif
+	NULL
+};
+
+static const struct attribute_group musb_attr_group = {
+	.attrs = musb_attributes,
+};
+
 #endif	/* sysfs */
 
 /* Only used to provide driver mode change events */
@@ -1833,11 +1846,7 @@ static void musb_free(struct musb *musb)
 	 */
 
 #ifdef CONFIG_SYSFS
-	device_remove_file(musb->controller, &dev_attr_mode);
-	device_remove_file(musb->controller, &dev_attr_vbus);
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
-	device_remove_file(musb->controller, &dev_attr_srp);
-#endif
+	sysfs_remove_group(&musb->controller->kobj, &musb_attr_group);
 #endif
 
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
@@ -2079,12 +2088,7 @@ bad_config:
 	}
 
 #ifdef CONFIG_SYSFS
-	status = device_create_file(dev, &dev_attr_mode);
-	status = device_create_file(dev, &dev_attr_vbus);
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
-	status = device_create_file(dev, &dev_attr_srp);
-#endif /* CONFIG_USB_GADGET_MUSB_HDRC */
-	status = 0;
+	status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group);
 #endif
 	if (status)
 		goto fail2;
@@ -2092,13 +2096,6 @@ bad_config:
 	return 0;
 
 fail2:
-#ifdef CONFIG_SYSFS
-	device_remove_file(musb->controller, &dev_attr_mode);
-	device_remove_file(musb->controller, &dev_attr_vbus);
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
-	device_remove_file(musb->controller, &dev_attr_srp);
-#endif
-#endif
 	musb_platform_exit(musb);
 fail:
 	dev_err(musb->controller,
-- 
1.6.6.rc0


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

* [PATCH/USB 04/16] USB: musb: remove some of the never defined defines
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (2 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 03/16] USB: musb: move to sysfs_groups Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  1:46   ` [APPLIED] [PATCH/USB 04/16] USB: musb: remove some of the never defined Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 05/16] USB: musb: Add new fifo table for a OMAP3 errata Felipe Balbi
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

just makes the musb init code a bit cleaner.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_core.c |   24 ------------------------
 drivers/usb/musb/musb_core.h |   16 ++++------------
 2 files changed, 4 insertions(+), 36 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 52295bc..b7e2d1b 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1314,9 +1314,6 @@ enum { MUSB_CONTROLLER_MHDRC, MUSB_CONTROLLER_HDRC, };
  */
 static int __init musb_core_init(u16 musb_type, struct musb *musb)
 {
-#ifdef MUSB_AHB_ID
-	u32 data;
-#endif
 	u8 reg;
 	char *type;
 	char aInfo[90], aRevision[32], aDate[12];
@@ -1332,19 +1329,11 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
 		strcat(aInfo, ", dyn FIFOs");
 	if (reg & MUSB_CONFIGDATA_MPRXE) {
 		strcat(aInfo, ", bulk combine");
-#ifdef C_MP_RX
 		musb->bulk_combine = true;
-#else
-		strcat(aInfo, " (X)");		/* no driver support */
-#endif
 	}
 	if (reg & MUSB_CONFIGDATA_MPTXE) {
 		strcat(aInfo, ", bulk split");
-#ifdef C_MP_TX
 		musb->bulk_split = true;
-#else
-		strcat(aInfo, " (X)");		/* no driver support */
-#endif
 	}
 	if (reg & MUSB_CONFIGDATA_HBRXE) {
 		strcat(aInfo, ", HB-ISO Rx");
@@ -1360,20 +1349,7 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
 	printk(KERN_DEBUG "%s: ConfigData=0x%02x (%s)\n",
 			musb_driver_name, reg, aInfo);
 
-#ifdef MUSB_AHB_ID
-	data = musb_readl(mbase, 0x404);
-	sprintf(aDate, "%04d-%02x-%02x", (data & 0xffff),
-		(data >> 16) & 0xff, (data >> 24) & 0xff);
-	/* FIXME ID2 and ID3 are unused */
-	data = musb_readl(mbase, 0x408);
-	printk(KERN_DEBUG "ID2=%lx\n", (long unsigned)data);
-	data = musb_readl(mbase, 0x40c);
-	printk(KERN_DEBUG "ID3=%lx\n", (long unsigned)data);
-	reg = musb_readb(mbase, 0x400);
-	musb_type = ('M' == reg) ? MUSB_CONTROLLER_MHDRC : MUSB_CONTROLLER_HDRC;
-#else
 	aDate[0] = 0;
-#endif
 	if (MUSB_CONTROLLER_MHDRC == musb_type) {
 		musb->is_multipoint = 1;
 		type = "M";
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 03d5090..2ac0e6f 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -412,21 +412,13 @@ struct musb {
 	unsigned		hb_iso_rx:1;	/* high bandwidth iso rx? */
 	unsigned		hb_iso_tx:1;	/* high bandwidth iso tx? */
 
-#ifdef C_MP_TX
-	unsigned bulk_split:1;
+	unsigned		bulk_split:1;
 #define	can_bulk_split(musb,type) \
-		(((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split)
-#else
-#define	can_bulk_split(musb, type)	0
-#endif
+	(((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_split)
 
-#ifdef C_MP_RX
-	unsigned bulk_combine:1;
+	unsigned		bulk_combine:1;
 #define	can_bulk_combine(musb,type) \
-		(((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine)
-#else
-#define	can_bulk_combine(musb, type)	0
-#endif
+	(((type) == USB_ENDPOINT_XFER_BULK) && (musb)->bulk_combine)
 
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
 	/* is_suspended means USB B_PERIPHERAL suspend */
-- 
1.6.6.rc0


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

* [PATCH/USB 05/16] USB: musb: Add new fifo table for a OMAP3 errata
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (3 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 04/16] USB: musb: remove some of the never defined defines Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  1:46   ` [APPLIED] " Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA count Felipe Balbi
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

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>
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 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 b7e2d1b..c489326 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.6.rc0


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

* [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA count
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (4 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 05/16] USB: musb: Add new fifo table for a OMAP3 errata Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  1:46   ` [APPLIED] [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes reads zero Felipe Balbi
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Anand Gadiyar <gadiyar@ti.com>

Add a wrapper for reading the DMA count register, analogous
to the one for writing to this register.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musbhsdma.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musbhsdma.h b/drivers/usb/musb/musbhsdma.h
index 1299d92..613f95a 100644
--- a/drivers/usb/musb/musbhsdma.h
+++ b/drivers/usb/musb/musbhsdma.h
@@ -55,6 +55,10 @@
 		    MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_ADDRESS), \
 		    addr)
 
+#define musb_read_hsdma_count(mbase, bchannel)	\
+	musb_readl(mbase,	\
+		   MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT))
+
 #define musb_write_hsdma_count(mbase, bchannel, len) \
 	musb_writel(mbase, \
 		    MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT), \
@@ -96,6 +100,19 @@ static inline void musb_write_hsdma_addr(void __iomem *mbase,
 		((u16)(((u32) dma_addr >> 16) & 0xFFFF)));
 }
 
+static inline u32 musb_read_hsdma_count(void __iomem *mbase, u8 bchannel)
+{
+	u32 count = musb_readw(mbase,
+		MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_HIGH));
+
+	count = count << 16;
+
+	count |= musb_readw(mbase,
+		MUSB_HSDMA_CHANNEL_OFFSET(bchannel, MUSB_HSDMA_COUNT_LOW));
+
+	return count;
+}
+
 static inline void musb_write_hsdma_count(void __iomem *mbase,
 				u8 bchannel, u32 len)
 {
-- 
1.6.6.rc0


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

* [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes reads zero
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (5 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA count Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  1:46   ` [APPLIED] [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk transfer after isoc Felipe Balbi
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Anand Gadiyar <gadiyar@ti.com>

MUSB DMA_INTR register may sometimes read zero when infact there
was a pending interrupt. Workaround this by reading the DMA_COUNT
values for all enabled channels when this condition occurs.
Flag these channels as the ones needing to be serviced.

Additionally, the absence of a debug print meant we would never
catch a spurious DMA interrupt in MUSB. So this patch adds a
debug print in the IRQ handler.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Ajay Kumar Gupta <ajay.gupta@ti.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musbhsdma.c |   25 ++++++++++++++++++++++---
 1 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c
index a237550..2fa7d5c 100644
--- a/drivers/usb/musb/musbhsdma.c
+++ b/drivers/usb/musb/musbhsdma.c
@@ -250,20 +250,39 @@ static irqreturn_t dma_controller_irq(int irq, void *private_data)
 	u8 bchannel;
 	u8 int_hsdma;
 
-	u32 addr;
+	u32 addr, count;
 	u16 csr;
 
 	spin_lock_irqsave(&musb->lock, flags);
 
 	int_hsdma = musb_readb(mbase, MUSB_HSDMA_INTR);
-	if (!int_hsdma)
-		goto done;
 
 #ifdef CONFIG_BLACKFIN
 	/* Clear DMA interrupt flags */
 	musb_writeb(mbase, MUSB_HSDMA_INTR, int_hsdma);
 #endif
 
+	if (!int_hsdma) {
+		DBG(2, "spurious DMA irq\n");
+
+		for (bchannel = 0; bchannel < MUSB_HSDMA_CHANNELS; bchannel++) {
+			musb_channel = (struct musb_dma_channel *)
+					&(controller->channel[bchannel]);
+			channel = &musb_channel->channel;
+			if (channel->status == MUSB_DMA_STATUS_BUSY) {
+				count = musb_read_hsdma_count(mbase, bchannel);
+
+				if (count == 0)
+					int_hsdma |= (1 << bchannel);
+			}
+		}
+
+		DBG(2, "int_hsdma = 0x%x\n", int_hsdma);
+
+		if (!int_hsdma)
+			goto done;
+	}
+
 	for (bchannel = 0; bchannel < MUSB_HSDMA_CHANNELS; bchannel++) {
 		if (int_hsdma & (1 << bchannel)) {
 			musb_channel = (struct musb_dma_channel *)
-- 
1.6.6.rc0


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

* [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk transfer after isoc
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (6 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes reads zero Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:06   ` [APPLIED] [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to handle Tx abort correctly Felipe Balbi
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Swaminathan S <swami.iyer@ti.com>

This patch implements the work around for a Mentor controller related
bug where it's observed a BULK Tx toggle error on the bus when a
BULK IO gets scheduled on an endpoint that was earlier used for
handling ISOC transaction and needed to start on 1 toggle.  When such
a situation arises even if the TXCSR toggle bits are programmed
correctly by the musb driver the data gets transmitted with 0 toggle
which leads to toggle error on the bus and the BULK transaction fails.
In case of MSC write, the device gets reset by the Host.

This Mentor bug is observed on almost all Mentor versions (1.3, 1.5,
1.8).  Confirmed on DM644x, DM355, DM365, OMAPL13x platforms.

Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_host.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 74c4c36..c3fdd6d 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -1771,6 +1771,9 @@ static int musb_schedule(
 	int			best_end, epnum;
 	struct musb_hw_ep	*hw_ep = NULL;
 	struct list_head	*head = NULL;
+	u8			toggle;
+	u8			txtype;
+	struct urb		*urb = next_urb(qh);
 
 	/* use fixed hardware for control and bulk */
 	if (qh->type == USB_ENDPOINT_XFER_CONTROL) {
@@ -1809,6 +1812,27 @@ static int musb_schedule(
 		diff -= (qh->maxpacket * qh->hb_mult);
 
 		if (diff >= 0 && best_diff > diff) {
+
+			/*
+			 * Mentor controller has a bug in that if we schedule
+			 * a BULK Tx transfer on an endpoint that had earlier
+			 * handled ISOC then the BULK transfer has to start on
+			 * a zero toggle.  If the BULK transfer starts on a 1
+			 * toggle then this transfer will fail as the mentor
+			 * controller starts the Bulk transfer on a 0 toggle
+			 * irrespective of the programming of the toggle bits
+			 * in the TXCSR register.  Check for this condition
+			 * while allocating the EP for a Tx Bulk transfer.  If
+			 * so skip this EP.
+			 */
+			hw_ep = musb->endpoints + epnum;
+			toggle = usb_gettoggle(urb->dev, qh->epnum, !is_in);
+			txtype = (musb_readb(hw_ep->regs, MUSB_TXTYPE)
+					>> 4) & 0x3;
+			if (!is_in && (qh->type == USB_ENDPOINT_XFER_BULK) &&
+				toggle && (txtype == USB_ENDPOINT_XFER_ISOC))
+				continue;
+
 			best_diff = diff;
 			best_end = epnum;
 		}
-- 
1.6.6.rc0


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

* [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to handle Tx abort correctly
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (7 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk transfer after isoc Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:06   ` [APPLIED] [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 10/16] usb: musb: clean up commit 'workaround Blackfin FIFO anomalies' Felipe Balbi
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Swaminathan S <swami.iyer@ti.com>

This patch fixes the Tx abort/teardown logic. We now wait for the teardown
completion interrupt and acknowledge the same by setting the tx_complete
register to 0.

This change is needed to ensure that abort processing works on DM365 platform.
Without this change after completion of abort processing the system is
overwhelmed with continuous stream of abort interrupts.

This change has been tested on all CPPI3.x platforms (DM644x, DM646x, DM35x,
DM36x).

Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/cppi_dma.c |   33 ++++++++++-----------------------
 1 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c
index a44a450..3c69a76 100644
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -1191,8 +1191,13 @@ irqreturn_t cppi_interrupt(int irq, void *dev_id)
 
 		bd = tx_ch->head;
 
+		/*
+		 * If Head is null then this could mean that a abort interrupt
+		 * that needs to be acknowledged.
+		 */
 		if (NULL == bd) {
 			DBG(1, "null BD\n");
+			tx_ram->tx_complete = 0;
 			continue;
 		}
 
@@ -1412,15 +1417,6 @@ static int cppi_channel_abort(struct dma_channel *channel)
 
 	if (cppi_ch->transmit) {
 		struct cppi_tx_stateram __iomem *tx_ram;
-		int			enabled;
-
-		/* mask interrupts raised to signal teardown complete.  */
-		enabled = musb_readl(tibase, DAVINCI_TXCPPI_INTENAB_REG)
-				& (1 << cppi_ch->index);
-		if (enabled)
-			musb_writel(tibase, DAVINCI_TXCPPI_INTCLR_REG,
-					(1 << cppi_ch->index));
-
 		/* REVISIT put timeouts on these controller handshakes */
 
 		cppi_dump_tx(6, cppi_ch, " (teardown)");
@@ -1435,7 +1431,6 @@ static int cppi_channel_abort(struct dma_channel *channel)
 		do {
 			value = musb_readl(&tx_ram->tx_complete, 0);
 		} while (0xFFFFFFFC != value);
-		musb_writel(&tx_ram->tx_complete, 0, 0xFFFFFFFC);
 
 		/* FIXME clean up the transfer state ... here?
 		 * the completion routine should get called with
@@ -1448,23 +1443,15 @@ static int cppi_channel_abort(struct dma_channel *channel)
 		musb_writew(regs, MUSB_TXCSR, value);
 		musb_writew(regs, MUSB_TXCSR, value);
 
-		/* While we scrub the TX state RAM, ensure that we clean
-		 * up any interrupt that's currently asserted:
+		/*
 		 * 1. Write to completion Ptr value 0x1(bit 0 set)
 		 *    (write back mode)
-		 * 2. Write to completion Ptr value 0x0(bit 0 cleared)
-		 *    (compare mode)
-		 * Value written is compared(for bits 31:2) and when
-		 * equal, interrupt is deasserted.
+		 * 2. Wait for abort interrupt and then put the channel in
+		 *    compare mode by writing 1 to the tx_complete register.
 		 */
 		cppi_reset_tx(tx_ram, 1);
-		musb_writel(&tx_ram->tx_complete, 0, 0);
-
-		/* re-enable interrupt */
-		if (enabled)
-			musb_writel(tibase, DAVINCI_TXCPPI_INTENAB_REG,
-					(1 << cppi_ch->index));
-
+		cppi_ch->head = 0;
+		musb_writel(&tx_ram->tx_complete, 0, 1);
 		cppi_dump_tx(5, cppi_ch, " (done teardown)");
 
 		/* REVISIT tx side _should_ clean up the same way
-- 
1.6.6.rc0


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

* [PATCH/USB 10/16] usb: musb: clean up commit 'workaround Blackfin FIFO anomalies'
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (8 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to handle Tx abort correctly Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:06   ` [APPLIED] [PATCH/USB 10/16] usb: musb: clean up commit &#39;workaround Blackfin Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by programming guide Felipe Balbi
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Bryan Wu <cooloney@kernel.org>

The version applied had a few comments which are now
done.

Thanks to Sergei for pointing out.

Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/blackfin.c |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index ad26e65..bcee133 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -30,7 +30,6 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 	void __iomem *fifo = hw_ep->fifo;
 	void __iomem *epio = hw_ep->regs;
 	u8 epnum = hw_ep->epnum;
-	u16 dma_reg = 0;
 
 	prefetch((u8 *)src);
 
@@ -42,15 +41,17 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 	dump_fifo_data(src, len);
 
 	if (!ANOMALY_05000380 && epnum != 0) {
-		flush_dcache_range((unsigned int)src,
-			(unsigned int)(src + len));
+		u16 dma_reg;
+
+		flush_dcache_range((unsigned long)src,
+			(unsigned long)(src + len));
 
 		/* Setup DMA address register */
-		dma_reg = (u16) ((u32) src & 0xFFFF);
+		dma_reg = (u32)src;
 		bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_LOW), dma_reg);
 		SSYNC();
 
-		dma_reg = (u16) (((u32) src >> 16) & 0xFFFF);
+		dma_reg = (u32)src >> 16;
 		bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_HIGH), dma_reg);
 		SSYNC();
 
@@ -79,12 +80,9 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
 		SSYNC();
 
 		if (unlikely((unsigned long)src & 0x01))
-			outsw_8((unsigned long)fifo, src,
-				len & 0x01 ? (len >> 1) + 1 : len >> 1);
+			outsw_8((unsigned long)fifo, src, (len + 1) >> 1);
 		else
-			outsw((unsigned long)fifo, src,
-				len & 0x01 ? (len >> 1) + 1 : len >> 1);
-
+			outsw((unsigned long)fifo, src, (len + 1) >> 1);
 	}
 }
 /*
@@ -94,19 +92,19 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
 {
 	void __iomem *fifo = hw_ep->fifo;
 	u8 epnum = hw_ep->epnum;
-	u16 dma_reg = 0;
 
 	if (ANOMALY_05000467 && epnum != 0) {
+		u16 dma_reg;
 
-		invalidate_dcache_range((unsigned int)dst,
-			(unsigned int)(dst + len));
+		invalidate_dcache_range((unsigned long)dst,
+			(unsigned long)(dst + len));
 
 		/* Setup DMA address register */
-		dma_reg = (u16) ((u32) dst & 0xFFFF);
+		dma_reg = (u32)dst;
 		bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_LOW), dma_reg);
 		SSYNC();
 
-		dma_reg = (u16) (((u32) dst >> 16) & 0xFFFF);
+		dma_reg = (u32)dst >> 16;
 		bfin_write16(USB_DMA_REG(epnum, USB_DMAx_ADDR_HIGH), dma_reg);
 		SSYNC();
 
-- 
1.6.6.rc0


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

* [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by programming guide
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (9 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 10/16] usb: musb: clean up commit 'workaround Blackfin FIFO anomalies' Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:06   ` [APPLIED] [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 12/16] usb: musb: save dynfifo in musb struct Felipe Balbi
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Arnaud Mandy <ext-arnaud.2.mandy@nokia.com>

MUSB's programming guide dictates how we should handle its
irqs and in which order. Follow that.

Signed-off-by: Arnaud Mandy <ext-arnaud.2.mandy@nokia.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_core.c |  255 +++++++++++++++++++-----------------------
 1 files changed, 116 insertions(+), 139 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index c489326..bd14e81 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -557,6 +557,69 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 		handled = IRQ_HANDLED;
 	}
 
+
+	if (int_usb & MUSB_INTR_SUSPEND) {
+		DBG(1, "SUSPEND (%s) devctl %02x power %02x\n",
+				otg_state_string(musb), devctl, power);
+		handled = IRQ_HANDLED;
+
+		switch (musb->xceiv->state) {
+#ifdef	CONFIG_USB_MUSB_OTG
+		case OTG_STATE_A_PERIPHERAL:
+			/* We also come here if the cable is removed, since
+			 * this silicon doesn't report ID-no-longer-grounded.
+			 *
+			 * We depend on T(a_wait_bcon) to shut us down, and
+			 * hope users don't do anything dicey during this
+			 * undesired detour through A_WAIT_BCON.
+			 */
+			musb_hnp_stop(musb);
+			usb_hcd_resume_root_hub(musb_to_hcd(musb));
+			musb_root_disconnect(musb);
+			musb_platform_try_idle(musb, jiffies
+					+ msecs_to_jiffies(musb->a_wait_bcon
+						? : OTG_TIME_A_WAIT_BCON));
+
+			break;
+#endif
+		case OTG_STATE_B_IDLE:
+			if (!musb->is_active)
+				break;
+		case OTG_STATE_B_PERIPHERAL:
+			musb_g_suspend(musb);
+			musb->is_active = is_otg_enabled(musb)
+					&& musb->xceiv->gadget->b_hnp_enable;
+			if (musb->is_active) {
+#ifdef	CONFIG_USB_MUSB_OTG
+				musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
+				DBG(1, "HNP: Setting timer for b_ase0_brst\n");
+				mod_timer(&musb->otg_timer, jiffies
+					+ msecs_to_jiffies(
+							OTG_TIME_B_ASE0_BRST));
+#endif
+			}
+			break;
+		case OTG_STATE_A_WAIT_BCON:
+			if (musb->a_wait_bcon != 0)
+				musb_platform_try_idle(musb, jiffies
+					+ msecs_to_jiffies(musb->a_wait_bcon));
+			break;
+		case OTG_STATE_A_HOST:
+			musb->xceiv->state = OTG_STATE_A_SUSPEND;
+			musb->is_active = is_otg_enabled(musb)
+					&& musb->xceiv->host->b_hnp_enable;
+			break;
+		case OTG_STATE_B_HOST:
+			/* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */
+			DBG(1, "REVISIT: SUSPEND as B_HOST\n");
+			break;
+		default:
+			/* "should not happen" */
+			musb->is_active = 0;
+			break;
+		}
+	}
+
 	if (int_usb & MUSB_INTR_CONNECT) {
 		struct usb_hcd *hcd = musb_to_hcd(musb);
 
@@ -625,10 +688,61 @@ b_host:
 	}
 #endif	/* CONFIG_USB_MUSB_HDRC_HCD */
 
+	if ((int_usb & MUSB_INTR_DISCONNECT) && !musb->ignore_disconnect) {
+		DBG(1, "DISCONNECT (%s) as %s, devctl %02x\n",
+				otg_state_string(musb),
+				MUSB_MODE(musb), devctl);
+		handled = IRQ_HANDLED;
+
+		switch (musb->xceiv->state) {
+#ifdef CONFIG_USB_MUSB_HDRC_HCD
+		case OTG_STATE_A_HOST:
+		case OTG_STATE_A_SUSPEND:
+			usb_hcd_resume_root_hub(musb_to_hcd(musb));
+			musb_root_disconnect(musb);
+			if (musb->a_wait_bcon != 0 && is_otg_enabled(musb))
+				musb_platform_try_idle(musb, jiffies
+					+ msecs_to_jiffies(musb->a_wait_bcon));
+			break;
+#endif	/* HOST */
+#ifdef CONFIG_USB_MUSB_OTG
+		case OTG_STATE_B_HOST:
+			/* REVISIT this behaves for "real disconnect"
+			 * cases; make sure the other transitions from
+			 * from B_HOST act right too.  The B_HOST code
+			 * in hnp_stop() is currently not used...
+			 */
+			musb_root_disconnect(musb);
+			musb_to_hcd(musb)->self.is_b_host = 0;
+			musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
+			MUSB_DEV_MODE(musb);
+			musb_g_disconnect(musb);
+			break;
+		case OTG_STATE_A_PERIPHERAL:
+			musb_hnp_stop(musb);
+			musb_root_disconnect(musb);
+			/* FALLTHROUGH */
+		case OTG_STATE_B_WAIT_ACON:
+			/* FALLTHROUGH */
+#endif	/* OTG */
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+		case OTG_STATE_B_PERIPHERAL:
+		case OTG_STATE_B_IDLE:
+			musb_g_disconnect(musb);
+			break;
+#endif	/* GADGET */
+		default:
+			WARNING("unhandled DISCONNECT transition (%s)\n",
+				otg_state_string(musb));
+			break;
+		}
+	}
+
 	/* mentor saves a bit: bus reset and babble share the same irq.
 	 * only host sees babble; only peripheral sees bus reset.
 	 */
 	if (int_usb & MUSB_INTR_RESET) {
+		handled = IRQ_HANDLED;
 		if (is_host_capable() && (devctl & MUSB_DEVCTL_HM) != 0) {
 			/*
 			 * Looks like non-HS BABBLE can be ignored, but
@@ -641,7 +755,7 @@ b_host:
 				DBG(1, "BABBLE devctl: %02x\n", devctl);
 			else {
 				ERR("Stopping host session -- babble\n");
-				musb_writeb(mbase, MUSB_DEVCTL, 0);
+				musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
 			}
 		} else if (is_peripheral_capable()) {
 			DBG(1, "BUS RESET as %s\n", otg_state_string(musb));
@@ -686,29 +800,7 @@ b_host:
 					otg_state_string(musb));
 			}
 		}
-
-		handled = IRQ_HANDLED;
 	}
-	schedule_work(&musb->irq_work);
-
-	return handled;
-}
-
-/*
- * Interrupt Service Routine to record USB "global" interrupts.
- * Since these do not happen often and signify things of
- * paramount importance, it seems OK to check them individually;
- * the order of the tests is specified in the manual
- *
- * @param musb instance pointer
- * @param int_usb register contents
- * @param devctl
- * @param power
- */
-static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
-				u8 devctl, u8 power)
-{
-	irqreturn_t handled = IRQ_NONE;
 
 #if 0
 /* REVISIT ... this would be for multiplexing periodic endpoints, or
@@ -755,117 +847,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb,
 	}
 #endif
 
-	if ((int_usb & MUSB_INTR_DISCONNECT) && !musb->ignore_disconnect) {
-		DBG(1, "DISCONNECT (%s) as %s, devctl %02x\n",
-				otg_state_string(musb),
-				MUSB_MODE(musb), devctl);
-		handled = IRQ_HANDLED;
-
-		switch (musb->xceiv->state) {
-#ifdef CONFIG_USB_MUSB_HDRC_HCD
-		case OTG_STATE_A_HOST:
-		case OTG_STATE_A_SUSPEND:
-			usb_hcd_resume_root_hub(musb_to_hcd(musb));
-			musb_root_disconnect(musb);
-			if (musb->a_wait_bcon != 0 && is_otg_enabled(musb))
-				musb_platform_try_idle(musb, jiffies
-					+ msecs_to_jiffies(musb->a_wait_bcon));
-			break;
-#endif	/* HOST */
-#ifdef CONFIG_USB_MUSB_OTG
-		case OTG_STATE_B_HOST:
-			/* REVISIT this behaves for "real disconnect"
-			 * cases; make sure the other transitions from
-			 * from B_HOST act right too.  The B_HOST code
-			 * in hnp_stop() is currently not used...
-			 */
-			musb_root_disconnect(musb);
-			musb_to_hcd(musb)->self.is_b_host = 0;
-			musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
-			MUSB_DEV_MODE(musb);
-			musb_g_disconnect(musb);
-			break;
-		case OTG_STATE_A_PERIPHERAL:
-			musb_hnp_stop(musb);
-			musb_root_disconnect(musb);
-			/* FALLTHROUGH */
-		case OTG_STATE_B_WAIT_ACON:
-			/* FALLTHROUGH */
-#endif	/* OTG */
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
-		case OTG_STATE_B_PERIPHERAL:
-		case OTG_STATE_B_IDLE:
-			musb_g_disconnect(musb);
-			break;
-#endif	/* GADGET */
-		default:
-			WARNING("unhandled DISCONNECT transition (%s)\n",
-				otg_state_string(musb));
-			break;
-		}
-
-		schedule_work(&musb->irq_work);
-	}
-
-	if (int_usb & MUSB_INTR_SUSPEND) {
-		DBG(1, "SUSPEND (%s) devctl %02x power %02x\n",
-				otg_state_string(musb), devctl, power);
-		handled = IRQ_HANDLED;
-
-		switch (musb->xceiv->state) {
-#ifdef	CONFIG_USB_MUSB_OTG
-		case OTG_STATE_A_PERIPHERAL:
-			/* We also come here if the cable is removed, since
-			 * this silicon doesn't report ID-no-longer-grounded.
-			 *
-			 * We depend on T(a_wait_bcon) to shut us down, and
-			 * hope users don't do anything dicey during this
-			 * undesired detour through A_WAIT_BCON.
-			 */
-			musb_hnp_stop(musb);
-			usb_hcd_resume_root_hub(musb_to_hcd(musb));
-			musb_root_disconnect(musb);
-			musb_platform_try_idle(musb, jiffies
-					+ msecs_to_jiffies(musb->a_wait_bcon
-						? : OTG_TIME_A_WAIT_BCON));
-			break;
-#endif
-		case OTG_STATE_B_PERIPHERAL:
-			musb_g_suspend(musb);
-			musb->is_active = is_otg_enabled(musb)
-					&& musb->xceiv->gadget->b_hnp_enable;
-			if (musb->is_active) {
-#ifdef	CONFIG_USB_MUSB_OTG
-				musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
-				DBG(1, "HNP: Setting timer for b_ase0_brst\n");
-				mod_timer(&musb->otg_timer, jiffies
-					+ msecs_to_jiffies(
-							OTG_TIME_B_ASE0_BRST));
-#endif
-			}
-			break;
-		case OTG_STATE_A_WAIT_BCON:
-			if (musb->a_wait_bcon != 0)
-				musb_platform_try_idle(musb, jiffies
-					+ msecs_to_jiffies(musb->a_wait_bcon));
-			break;
-		case OTG_STATE_A_HOST:
-			musb->xceiv->state = OTG_STATE_A_SUSPEND;
-			musb->is_active = is_otg_enabled(musb)
-					&& musb->xceiv->host->b_hnp_enable;
-			break;
-		case OTG_STATE_B_HOST:
-			/* Transition to B_PERIPHERAL, see 6.8.2.6 p 44 */
-			DBG(1, "REVISIT: SUSPEND as B_HOST\n");
-			break;
-		default:
-			/* "should not happen" */
-			musb->is_active = 0;
-			break;
-		}
-		schedule_work(&musb->irq_work);
-	}
-
+	schedule_work(&musb->irq_work);
 
 	return handled;
 }
@@ -1597,11 +1579,6 @@ irqreturn_t musb_interrupt(struct musb *musb)
 		ep_num++;
 	}
 
-	/* finish handling "global" interrupts after handling fifos */
-	if (musb->int_usb)
-		retval |= musb_stage2_irq(musb,
-				musb->int_usb, devctl, power);
-
 	return retval;
 }
 
-- 
1.6.6.rc0


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

* [PATCH/USB 12/16] usb: musb: save dynfifo in musb struct
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (10 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by programming guide Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:06   ` [APPLIED] " Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 13/16] usb: musb: Add 'extvbus' in musb_hdrc_platform_data Felipe Balbi
                   ` (3 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

Save dynamic FIFO read only information for later uses during
musb_save/restore_context functions.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_core.c |    4 +++-
 drivers/usb/musb/musb_core.h |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index bd14e81..4c8962f 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1341,8 +1341,10 @@ static int __init musb_core_init(u16 musb_type, struct musb *musb)
 	reg = musb_read_configdata(mbase);
 
 	strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");
-	if (reg & MUSB_CONFIGDATA_DYNFIFO)
+	if (reg & MUSB_CONFIGDATA_DYNFIFO) {
 		strcat(aInfo, ", dyn FIFOs");
+		musb->dyn_fifo = true;
+	}
 	if (reg & MUSB_CONFIGDATA_MPRXE) {
 		strcat(aInfo, ", bulk combine");
 		musb->bulk_combine = true;
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 2ac0e6f..eaa0114 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -411,6 +411,7 @@ struct musb {
 
 	unsigned		hb_iso_rx:1;	/* high bandwidth iso rx? */
 	unsigned		hb_iso_tx:1;	/* high bandwidth iso tx? */
+	unsigned		dyn_fifo:1;	/* dynamic FIFO supported? */
 
 	unsigned		bulk_split:1;
 #define	can_bulk_split(musb,type) \
-- 
1.6.6.rc0


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

* [PATCH/USB 13/16] usb: musb: Add 'extvbus' in musb_hdrc_platform_data
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (11 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 12/16] usb: musb: save dynfifo in musb struct Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:07   ` [APPLIED] [PATCH/USB 13/16] usb: musb: Add &#39;extvbus&#39; in Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 14/16] usb: host: ehci: fix missing kfree in remove path also Felipe Balbi
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

Some of the board might use external Vbus power supply on musb
interface which would require to program ULPI_BUSCONTROL register.

Adding 'extvbus' flag which can be set from such boards which will
be checked at musb driver files before programming ULPI_BUSCONTROL.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/musb_core.c |    8 ++++++++
 drivers/usb/musb/musb_regs.h |    5 +++++
 include/linux/usb/musb.h     |    3 +++
 3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 4c8962f..074d380 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2031,6 +2031,7 @@ bad_config:
 	/* host side needs more setup */
 	if (is_host_enabled(musb)) {
 		struct usb_hcd	*hcd = musb_to_hcd(musb);
+		u8 busctl;
 
 		otg_set_host(musb->xceiv, &hcd->self);
 
@@ -2038,6 +2039,13 @@ bad_config:
 			hcd->self.otg_port = 1;
 		musb->xceiv->host = &hcd->self;
 		hcd->power_budget = 2 * (plat->power ? : 250);
+
+		/* program PHY to use external vBus if required */
+		if (plat->extvbus) {
+			busctl = musb_readb(musb->mregs, MUSB_ULPI_BUSCONTROL);
+			busctl |= MUSB_ULPI_USE_EXTVBUS;
+			musb_writeb(musb->mregs, MUSB_ULPI_BUSCONTROL, busctl);
+		}
 	}
 
 	/* For the host-only role, we can activate right away.
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index 473a94e..9a8621a 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -72,6 +72,10 @@
 #define MUSB_DEVCTL_HR		0x02
 #define MUSB_DEVCTL_SESSION	0x01
 
+/* MUSB ULPI VBUSCONTROL */
+#define MUSB_ULPI_USE_EXTVBUS	0x01
+#define MUSB_ULPI_USE_EXTVBUSIND 0x02
+
 /* TESTMODE */
 #define MUSB_TEST_FORCE_HOST	0x80
 #define MUSB_TEST_FIFO_ACCESS	0x40
@@ -246,6 +250,7 @@
 
 /* REVISIT: vctrl/vstatus: optional vendor utmi+phy register at 0x68 */
 #define MUSB_HWVERS		0x6C	/* 8 bit */
+#define MUSB_ULPI_BUSCONTROL	0x70	/* 8 bit */
 
 #define MUSB_EPINFO		0x78	/* 8 bit */
 #define MUSB_RAMINFO		0x79	/* 8 bit */
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index d437556..4b7f8fa 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -76,6 +76,9 @@ struct musb_hdrc_platform_data {
 	/* (HOST or OTG) msec/2 after VBUS on till power good */
 	u8		potpgt;
 
+	/* (HOST or OTG) program PHY for external Vbus */
+	unsigned	extvbus:1;
+
 	/* Power the device on or off */
 	int		(*set_power)(int state);
 
-- 
1.6.6.rc0


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

* [PATCH/USB 14/16] usb: host: ehci: fix missing kfree in remove path also
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (12 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 13/16] usb: musb: Add 'extvbus' in musb_hdrc_platform_data Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-19 13:14 ` [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in ehci-omap.c driver Felipe Balbi
  2010-01-19 13:14 ` [PATCH/USB 16/16] USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy() Felipe Balbi
  15 siblings, 0 replies; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

Added missing kfree() in ehci_hcd_omap_remove().

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/host/ehci-omap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 74d07f4..2460f0d 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -681,6 +681,7 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
 	iounmap(omap->tll_base);
 	iounmap(omap->uhh_base);
 	usb_put_hcd(hcd);
+	kfree(omap);
 
 	return 0;
 }
-- 
1.6.6.rc0


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

* [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in ehci-omap.c driver.
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (13 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 14/16] usb: host: ehci: fix missing kfree in remove path also Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:08   ` [APPLIED] [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in Tony Lindgren
  2010-01-19 13:14 ` [PATCH/USB 16/16] USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy() Felipe Balbi
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

OMAP3 has three HS USB ports so it can have three different regulator
for each PHY connected to each port.

Currently these regulators are assumed to be optional and driver doesn't
fail but continue with the initialization if it doesn't get any regulators.

Regulator supply names has to be mapped in board files as 'hsusbN' where
'N' is port number and can be {0, 1 ,2}.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/host/ehci-omap.c |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 2460f0d..17e4ceb 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -37,6 +37,7 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/gpio.h>
+#include <linux/regulator/consumer.h>
 #include <plat/usb.h>
 
 /*
@@ -178,6 +179,11 @@ struct ehci_hcd_omap {
 	void __iomem		*uhh_base;
 	void __iomem		*tll_base;
 	void __iomem		*ehci_base;
+
+	/* Regulators for USB PHYs.
+	 * Each PHY can have a seperate regulator.
+	 */
+	struct regulator        *regulator[OMAP3_HS_USB_PORTS];
 };
 
 /*-------------------------------------------------------------------------*/
@@ -546,6 +552,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 
 	int irq = platform_get_irq(pdev, 0);
 	int ret = -ENODEV;
+	int i;
+	char supply[7];
 
 	if (!pdata) {
 		dev_dbg(&pdev->dev, "missing platform_data\n");
@@ -613,6 +621,21 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 		goto err_tll_ioremap;
 	}
 
+	/* get ehci regulator and enable */
+	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
+		if (omap->port_mode[i] != EHCI_HCD_OMAP_MODE_PHY) {
+			omap->regulator[i] = NULL;
+			continue;
+		}
+		snprintf(supply, sizeof(supply), "hsusb%d", i);
+		omap->regulator[i] = regulator_get(omap->dev, supply);
+		if (IS_ERR(omap->regulator[i]))
+			dev_dbg(&pdev->dev,
+			"failed to get ehci port%d regulator\n", i);
+		else
+			regulator_enable(omap->regulator[i]);
+	}
+
 	ret = omap_start_ehc(omap, hcd);
 	if (ret) {
 		dev_dbg(&pdev->dev, "failed to start ehci\n");
@@ -641,6 +664,12 @@ err_add_hcd:
 	omap_stop_ehc(omap, hcd);
 
 err_start:
+	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
+		if (omap->regulator[i]) {
+			regulator_disable(omap->regulator[i]);
+			regulator_put(omap->regulator[i]);
+		}
+	}
 	iounmap(omap->tll_base);
 
 err_tll_ioremap:
@@ -674,10 +703,17 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
 {
 	struct ehci_hcd_omap *omap = platform_get_drvdata(pdev);
 	struct usb_hcd *hcd = ehci_to_hcd(omap->ehci);
+	int i;
 
 	usb_remove_hcd(hcd);
 	omap_stop_ehc(omap, hcd);
 	iounmap(hcd->regs);
+	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
+		if (omap->regulator[i]) {
+			regulator_disable(omap->regulator[i]);
+			regulator_put(omap->regulator[i]);
+		}
+	}
 	iounmap(omap->tll_base);
 	iounmap(omap->uhh_base);
 	usb_put_hcd(hcd);
-- 
1.6.6.rc0


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

* [PATCH/USB 16/16] USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy()
  2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
                   ` (14 preceding siblings ...)
  2010-01-19 13:14 ` [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in ehci-omap.c driver Felipe Balbi
@ 2010-01-19 13:14 ` Felipe Balbi
  2010-01-20  2:09   ` [APPLIED] [PATCH/USB 16/16] USB: musb: don&#39;t dereference NULL tusb_dma in Tony Lindgren
  15 siblings, 1 reply; 32+ messages in thread
From: Felipe Balbi @ 2010-01-19 13:14 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Linux OMAP Mailing List, felipe.balbi

From: Roel Kluin <roel.kluin@gmail.com>

Test whether tusb_dma is not NULL before dereferencing

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/usb/musb/tusb6010_omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/tusb6010_omap.c b/drivers/usb/musb/tusb6010_omap.c
index e13c770..1c86809 100644
--- a/drivers/usb/musb/tusb6010_omap.c
+++ b/drivers/usb/musb/tusb6010_omap.c
@@ -648,7 +648,7 @@ void dma_controller_destroy(struct dma_controller *c)
 		}
 	}
 
-	if (!tusb_dma->multichannel && tusb_dma && tusb_dma->ch >= 0)
+	if (tusb_dma && !tusb_dma->multichannel && tusb_dma->ch >= 0)
 		omap_free_dma(tusb_dma->ch);
 
 	kfree(tusb_dma);
-- 
1.6.6.rc0


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

* [APPLIED] [PATCH/USB 01/16] USB: musb: use resource_size()
  2010-01-19 13:14 ` [PATCH/USB 01/16] USB: musb: use resource_size() Felipe Balbi
@ 2010-01-20  1:44   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  1:44 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 75ecde9c4fcf2ec04419f86344b523190af79704

PatchWorks
http://patchwork.kernel.org/patch/73868/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=75ecde9c4fcf2ec04419f86344b523190af79704



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

* [APPLIED] [PATCH/USB 02/16] USB: musb: move two printk to dev_err
  2010-01-19 13:14 ` [PATCH/USB 02/16] USB: musb: move two printk to dev_err Felipe Balbi
@ 2010-01-20  1:45   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  1:45 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 1170802cecc4cff40833b423af73eb3195bbeb15

PatchWorks
http://patchwork.kernel.org/patch/73876/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=1170802cecc4cff40833b423af73eb3195bbeb15



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

* [APPLIED] [PATCH/USB 03/16] USB: musb: move to sysfs_groups
  2010-01-19 13:14 ` [PATCH/USB 03/16] USB: musb: move to sysfs_groups Felipe Balbi
@ 2010-01-20  1:45   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  1:45 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 55b1762e17a6e26f2f77193bc36baa1973affd7d

PatchWorks
http://patchwork.kernel.org/patch/73865/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=55b1762e17a6e26f2f77193bc36baa1973affd7d



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

* [APPLIED] [PATCH/USB 04/16] USB: musb: remove some of the never defined
  2010-01-19 13:14 ` [PATCH/USB 04/16] USB: musb: remove some of the never defined defines Felipe Balbi
@ 2010-01-20  1:46   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  1:46 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 9691b46e52d46ff385231f75e7d23be8cd8b3db1

PatchWorks
http://patchwork.kernel.org/patch/73867/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=9691b46e52d46ff385231f75e7d23be8cd8b3db1



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

* [APPLIED] [PATCH/USB 05/16] USB: musb: Add new fifo table for a OMAP3 errata
  2010-01-19 13:14 ` [PATCH/USB 05/16] USB: musb: Add new fifo table for a OMAP3 errata Felipe Balbi
@ 2010-01-20  1:46   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  1:46 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): af292b1280b7119d23e9fb38ddb550bd4145fb3b

PatchWorks
http://patchwork.kernel.org/patch/73863/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=af292b1280b7119d23e9fb38ddb550bd4145fb3b



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

* [APPLIED] [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA
  2010-01-19 13:14 ` [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA count Felipe Balbi
@ 2010-01-20  1:46   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  1:46 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): d27abb4eef3952f9b8a560ec3b58817ed3864a7c

PatchWorks
http://patchwork.kernel.org/patch/73869/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=d27abb4eef3952f9b8a560ec3b58817ed3864a7c



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

* [APPLIED] [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes
  2010-01-19 13:14 ` [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes reads zero Felipe Balbi
@ 2010-01-20  1:46   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  1:46 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 4216cecee0a7ded105f7dd062c11020ebd507de4

PatchWorks
http://patchwork.kernel.org/patch/73866/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=4216cecee0a7ded105f7dd062c11020ebd507de4



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

* [APPLIED] [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk
  2010-01-19 13:14 ` [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk transfer after isoc Felipe Balbi
@ 2010-01-20  2:06   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:06 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 18c432f15cb98a39c8661b98492ccf35c68fde03

PatchWorks
http://patchwork.kernel.org/patch/73875/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=18c432f15cb98a39c8661b98492ccf35c68fde03



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

* [APPLIED] [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to
  2010-01-19 13:14 ` [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to handle Tx abort correctly Felipe Balbi
@ 2010-01-20  2:06   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:06 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 87884cb776d702996ae49e69551b051f1f1f13cd

PatchWorks
http://patchwork.kernel.org/patch/73862/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=87884cb776d702996ae49e69551b051f1f1f13cd



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

* [APPLIED] [PATCH/USB 10/16] usb: musb: clean up commit &#39;workaround Blackfin
  2010-01-19 13:14 ` [PATCH/USB 10/16] usb: musb: clean up commit 'workaround Blackfin FIFO anomalies' Felipe Balbi
@ 2010-01-20  2:06   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:06 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): c82913f6ee8b9087c6d6af0dfc9f785df0b6604b

PatchWorks
http://patchwork.kernel.org/patch/73864/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=c82913f6ee8b9087c6d6af0dfc9f785df0b6604b



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

* [APPLIED] [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by
  2010-01-19 13:14 ` [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by programming guide Felipe Balbi
@ 2010-01-20  2:06   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:06 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 6bf57f2a555e6281e306e6f3c6f2589920417f05

PatchWorks
http://patchwork.kernel.org/patch/73870/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=6bf57f2a555e6281e306e6f3c6f2589920417f05



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

* [APPLIED] [PATCH/USB 12/16] usb: musb: save dynfifo in musb struct
  2010-01-19 13:14 ` [PATCH/USB 12/16] usb: musb: save dynfifo in musb struct Felipe Balbi
@ 2010-01-20  2:06   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:06 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): fab8bd5484c20e376fb385224bfd6d3efce812a3

PatchWorks
http://patchwork.kernel.org/patch/73877/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=fab8bd5484c20e376fb385224bfd6d3efce812a3



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

* [APPLIED] [PATCH/USB 13/16] usb: musb: Add &#39;extvbus&#39; in
  2010-01-19 13:14 ` [PATCH/USB 13/16] usb: musb: Add 'extvbus' in musb_hdrc_platform_data Felipe Balbi
@ 2010-01-20  2:07   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:07 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): 37c8293d289cce5521a3a41b16dc76778ecb7c15

PatchWorks
http://patchwork.kernel.org/patch/73871/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=37c8293d289cce5521a3a41b16dc76778ecb7c15



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

* [APPLIED] [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in
  2010-01-19 13:14 ` [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in ehci-omap.c driver Felipe Balbi
@ 2010-01-20  2:08   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:08 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): ee913c7626c571c04d8e4e2c60e9c3b017c84bcc

PatchWorks
http://patchwork.kernel.org/patch/73873/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=ee913c7626c571c04d8e4e2c60e9c3b017c84bcc



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

* [APPLIED] [PATCH/USB 16/16] USB: musb: don&#39;t dereference NULL tusb_dma in
  2010-01-19 13:14 ` [PATCH/USB 16/16] USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy() Felipe Balbi
@ 2010-01-20  2:09   ` Tony Lindgren
  0 siblings, 0 replies; 32+ messages in thread
From: Tony Lindgren @ 2010-01-20  2:09 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-testing

Initial commit ID (Likely to change): de644557a6b1d76fdd266169098f25226c56f778

PatchWorks
http://patchwork.kernel.org/patch/73874/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=de644557a6b1d76fdd266169098f25226c56f778



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

end of thread, other threads:[~2010-01-20  2:09 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19 13:13 [PATCH/USB 00/16] usb patches accepted by Greg Felipe Balbi
2010-01-19 13:14 ` [PATCH/USB 01/16] USB: musb: use resource_size() Felipe Balbi
2010-01-20  1:44   ` [APPLIED] " Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 02/16] USB: musb: move two printk to dev_err Felipe Balbi
2010-01-20  1:45   ` [APPLIED] " Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 03/16] USB: musb: move to sysfs_groups Felipe Balbi
2010-01-20  1:45   ` [APPLIED] " Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 04/16] USB: musb: remove some of the never defined defines Felipe Balbi
2010-01-20  1:46   ` [APPLIED] [PATCH/USB 04/16] USB: musb: remove some of the never defined Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 05/16] USB: musb: Add new fifo table for a OMAP3 errata Felipe Balbi
2010-01-20  1:46   ` [APPLIED] " Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA count Felipe Balbi
2010-01-20  1:46   ` [APPLIED] [PATCH/USB 06/16] usb: musb: hsdma: add wrapper for reading DMA Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes reads zero Felipe Balbi
2010-01-20  1:46   ` [APPLIED] [PATCH/USB 07/16] usb: musb: workaround MUSB DMA_INTR sometimes Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk transfer after isoc Felipe Balbi
2010-01-20  2:06   ` [APPLIED] [PATCH/USB 08/16] usb: musb: workaround toggle bug when doing bulk Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to handle Tx abort correctly Felipe Balbi
2010-01-20  2:06   ` [APPLIED] [PATCH/USB 09/16] usb: musb: Fix cppi_channel_abort() function to Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 10/16] usb: musb: clean up commit 'workaround Blackfin FIFO anomalies' Felipe Balbi
2010-01-20  2:06   ` [APPLIED] [PATCH/USB 10/16] usb: musb: clean up commit &#39;workaround Blackfin Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by programming guide Felipe Balbi
2010-01-20  2:06   ` [APPLIED] [PATCH/USB 11/16] usb: musb: handle irqs in the order dictated by Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 12/16] usb: musb: save dynfifo in musb struct Felipe Balbi
2010-01-20  2:06   ` [APPLIED] " Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 13/16] usb: musb: Add 'extvbus' in musb_hdrc_platform_data Felipe Balbi
2010-01-20  2:07   ` [APPLIED] [PATCH/USB 13/16] usb: musb: Add &#39;extvbus&#39; in Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 14/16] usb: host: ehci: fix missing kfree in remove path also Felipe Balbi
2010-01-19 13:14 ` [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in ehci-omap.c driver Felipe Balbi
2010-01-20  2:08   ` [APPLIED] [PATCH/USB 15/16] usb: host: ehci: adding regulator framework in Tony Lindgren
2010-01-19 13:14 ` [PATCH/USB 16/16] USB: musb: don't dereference NULL tusb_dma in dma_controller_destroy() Felipe Balbi
2010-01-20  2:09   ` [APPLIED] [PATCH/USB 16/16] USB: musb: don&#39;t dereference NULL tusb_dma in Tony Lindgren

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