Skip to contentSkip to conversation

usb: gadget: udc: atmel: Endpoint allocation scheme fixes

PATCH New [email protected] 1 participant 3 messages Apr 7, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

v4 cover usb: gadget: udc: atmel: Endpoint allocation scheme fixes

From: Cristian Birsan <[email protected]>

This patch series provides fixes, based on the feedback received on the mailing list, for the following:
- fifo table parameters validation against device tree values
- coding style
- message display for EP configuration error
- Kconfig comments for fifo_mode=0

Changes since v1:
- Removed static for usba_config_fifo_table() function from "Check fifo configuration values against device tree" patch

Changes since v2:
- Use shorter warning message if the fifo table size is greather than device tree value
- replace dev_warn() with dev_err() for hardware fifo allocation error

Changes since v3:
- rebase the code on testing/next branch as requested
- remove from patch series the patches that are already in testing/next branch

Cristian Birsan (2):
usb: gadget: udc: atmel: Use dev_err() to display EP configuration
error
usb: gadget: udc: atmel: Update Kconfig help for fifo_mode = 0

 drivers/usb/gadget/udc/Kconfig          | 5 +++--
 drivers/usb/gadget/udc/atmel_usba_udc.c | 8 ++++----
 2 files changed, 7 insertions(+), 6 deletions(-)
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH v4 1/2 usb: gadget: udc: atmel: Use dev_err() to display EP configuration error

From: Cristian Birsan <[email protected]>

Use dev_err() to display EP configuration error to avoid silent failure.

---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/gadget/udc/atmel_usba_udc.c +4 -4
index 8bc0b52a..3ccc341 100644
@@ -1851,8 +1851,8 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
 		 * but it's clearly harmless...
 		 */
 		if (!(usba_ep_readl(ep0, CFG) & USBA_EPT_MAPPED))
-			dev_dbg(&udc->pdev->dev,
-				 "ODD: EP0 configuration is invalid!\n");
+			dev_err(&udc->pdev->dev,
+				"ODD: EP0 configuration is invalid!\n");
 
 		/* Preallocate other endpoints */
 		n = fifo_mode ? udc->num_ep : udc->configured_ep;
@@ -1860,8 +1860,8 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
 			ep = &udc->usba_ep[i];
 			usba_ep_writel(ep, CFG, ep->ept_cfg);
 			if (!(usba_ep_readl(ep, CFG) & USBA_EPT_MAPPED))
-				dev_dbg(&udc->pdev->dev,
-				 "ODD: EP%d configuration is invalid!\n", i);
+				dev_err(&udc->pdev->dev,
+					"ODD: EP%d configuration is invalid!\n", i);
 		}
 	}
 
Signature · 1 line
2.7.4
author maintainer
#2 lore raw

PATCH v4 2/2 usb: gadget: udc: atmel: Update Kconfig help for fifo_mode = 0

In reply to [email protected]

From: Cristian Birsan <[email protected]>

Update Kconfig help for fifo_mode = 0 to explain the behavior better.

---
 drivers/usb/gadget/udc/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/gadget/udc/Kconfig +3 -2
index 707814d..c90a4a2 100644
@@ -62,8 +62,9 @@ config USB_ATMEL_USBA
 
 	  The fifo_mode parameter is used to select endpoint allocation mode.
 	  fifo_mode = 0 is used to let the driver autoconfigure the endpoints.
-	  In this case 2 banks are allocated for isochronous endpoints and
-	  only one bank is allocated for the rest of the endpoints.
+	  In this case, for ep1 2 banks are allocated if it works in isochronous
+	  mode and only 1 bank otherwise. For the rest of the endpoints
+	  only 1 bank is allocated.
 
 	  fifo_mode = 1 is a generic maximum fifo size (1024 bytes) configuration
 	  allowing the usage of ep1 - ep6
Signature · 1 line
2.7.4