Re: [PATCH v2 0/3] Increase the number of USB to serial devices we can support at once

2013-06-07 Thread Tobias Winter
Hey Greg,

I patched it two times to be safe, but I can't seem to get it to compile.

  CC  drivers/usb/serial/console.o
drivers/usb/serial/console.c: In function ‘usb_console_setup’:
drivers/usb/serial/console.c:111:2: error: implicit declaration of
function ‘usb_serial_get_by_index’ [-Werror=implicit-function-declaration]
drivers/usb/serial/console.c:111:9: warning: assignment makes pointer
from integer without a cast [enabled by default]
drivers/usb/serial/console.c:122:40: error: ‘struct usb_serial’ has no
member named ‘minor’
cc1: some warnings being treated as errors
make[4]: *** [drivers/usb/serial/console.o] Error 1
make[3]: *** [drivers/usb/serial] Error 2
make[2]: *** [drivers/usb] Error 2
make[1]: *** [drivers] Error 2
make[1]: Leaving directory `/root/usb.git'
make: *** [debian/stamp/build/kernel] Error 2

thanks

Tobias



signature.asc
Description: OpenPGP digital signature


[RFC][PATCH 2/7] USB: OHCI: make ohci-omap a separate driver

2013-06-07 Thread Manjunath Goudar
Separate the  TI OHCI OMAP1/2 host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Cc: Felipe Balbi ba...@ti.com
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: Alan Stern st...@rowland.harvard.edu
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/Kconfig |2 +-
 drivers/usb/host/Makefile|1 +
 drivers/usb/host/ohci-hcd.c  |   20 +-
 drivers/usb/host/ohci-omap.c |  142 --
 4 files changed, 55 insertions(+), 110 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index f827386..744673b 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -397,7 +397,7 @@ config USB_OHCI_HCD
 if USB_OHCI_HCD
 
 config USB_OHCI_HCD_OMAP1
-   bool OHCI support for OMAP1/2 chips
+   tristate OHCI support for OMAP1/2 chips
depends on ARCH_OMAP1
default y
---help---
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 2a4f11f..1326df2 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -47,6 +47,7 @@ obj-$(CONFIG_USB_OHCI_HCD)+= ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI) += ohci-pci.o
 obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)+= ohci-platform.o
 obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
+obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 14962f8..4bfd890 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1178,11 +1178,6 @@ MODULE_LICENSE (GPL);
 #define S3C2410_PLATFORM_DRIVERohci_hcd_s3c2410_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_OMAP1
-#include ohci-omap.c
-#define OMAP1_PLATFORM_DRIVER  ohci_hcd_omap_driver
-#endif
-
 #ifdef CONFIG_USB_OHCI_HCD_OMAP3
 #include ohci-omap3.c
 #define OMAP3_PLATFORM_DRIVER  ohci_hcd_omap3_driver
@@ -1256,8 +1251,8 @@ MODULE_LICENSE (GPL);
 #if!IS_ENABLED(CONFIG_USB_OHCI_HCD_PCI)  \
!IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM)  \
!IS_ENABLED(CONFIG_USB_OHCI_EXYNOS)  \
+   !IS_ENABLED(CONFIG_USB_OHCI_HCD_OMAP1)  \
!defined(PLATFORM_DRIVER) \
-   !defined(OMAP1_PLATFORM_DRIVER)   \
!defined(OMAP3_PLATFORM_DRIVER)   \
!defined(OF_PLATFORM_DRIVER)  \
!defined(SA_DRIVER)   \
@@ -1305,12 +1300,6 @@ static int __init ohci_hcd_mod_init(void)
goto error_platform;
 #endif
 
-#ifdef OMAP1_PLATFORM_DRIVER
-   retval = platform_driver_register(OMAP1_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_omap1_platform;
-#endif
-
 #ifdef OMAP3_PLATFORM_DRIVER
retval = platform_driver_register(OMAP3_PLATFORM_DRIVER);
if (retval  0)
@@ -1424,10 +1413,6 @@ static int __init ohci_hcd_mod_init(void)
platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
  error_omap3_platform:
 #endif
-#ifdef OMAP1_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP1_PLATFORM_DRIVER);
- error_omap1_platform:
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
  error_platform:
@@ -1482,9 +1467,6 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef OMAP3_PLATFORM_DRIVER
platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
 #endif
-#ifdef OMAP1_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP1_PLATFORM_DRIVER);
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 8747fa6..eee4b72 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -14,12 +14,21 @@
  * This file is licenced under the GPL.
  */
 
-#include linux/signal.h
-#include linux/jiffies.h
-#include linux/platform_device.h
 #include linux/clk.h
+#include linux/dma-mapping.h
 #include linux/err.h
 #include linux/gpio.h
+#include linux/io.h
+#include linux/jiffies.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/usb/otg.h
+#include linux/platform_device.h
+#include linux/signal.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ohci.h
 
 #include asm/io.h
 #include asm/mach-types.h
@@ -42,10 +51,7 @@
 #define OMAP1510_LB_MMU_RAM_H  0xfffec234
 #define OMAP1510_LB_MMU_RAM_L  0xfffec238
 
-
-#ifndef CONFIG_ARCH_OMAP
-#error This file is OMAP bus glue.  CONFIG_OMAP must be defined.
-#endif
+#define DRIVER_DESC OHCI OMAP driver
 
 #ifdef CONFIG_TPS65010
 #include linux/i2c/tps65010.h
@@ -71,6 +77,10 @@ static struct clk *usb_dc_ck;
 static int host_enabled;
 static int host_initialized;
 
+static const char hcd_name[] = ohci-omap;
+static struct hc_driver __read_mostly ohci_omap_hc_driver;
+
+
 static void omap_ohci_clock_power(int on)
 {
if (on) {
@@ 

[RFC][PATCH 0/7] USB: OHCI: more bus glues as separate modules

2013-06-07 Thread Manjunath Goudar
These patches are for separating the SOC On-Chip ohci host controller 
from ohci-hcd host code into its own driver module.
This work is part of enabling multi-platform kernels on ARM.

Manjunath Goudar (7):
  USB: OHCI: make ohci-exynos a separate driver
  USB: OHCI: make ohci-omap a separate driver
  USB: OHCI: make ohci-omap3 a separate driver
  USB: OHCI: make ohci-spear a separate driver
  USB: OHCI: export ohci_hub_control and ohci_hub_status_data
  USB: OHCI: make ohci-at91 a separate driver
  USB: OHCI: make ohci-s3c2410 a separate driver

 drivers/usb/host/Kconfig|   30 +++-
 drivers/usb/host/Makefile   |6 ++
 drivers/usb/host/ohci-at91.c|  135 +++---
 drivers/usb/host/ohci-exynos.c  |  154 +--
 drivers/usb/host/ohci-hcd.c |  122 ++-
 drivers/usb/host/ohci-hub.c |8 +-
 drivers/usb/host/ohci-omap.c|  142 +---
 drivers/usb/host/ohci-omap3.c   |  122 +++
 drivers/usb/host/ohci-s3c2410.c |  116 -
 drivers/usb/host/ohci-spear.c   |  149 -
 drivers/usb/host/ohci.h |9 +++
 11 files changed, 383 insertions(+), 610 deletions(-)

-- 
1.7.9.5

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


[RFC][PATCH 1/7] USB: OHCI: make ohci-exynos a separate driver

2013-06-07 Thread Manjunath Goudar
Separate the  Samsung OHCI EXYNOS host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Cc: Arnd Bergmann a...@arndb.de
Cc: Jingoo Han jg1@samsung.com
Cc: Kukjin Kim kgene@samsung.com
Cc: Greg KH g...@kroah.com
Cc: Alan Stern st...@rowland.harvard.edu
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/Kconfig   |2 +-
 drivers/usb/host/Makefile  |1 +
 drivers/usb/host/ohci-exynos.c |  154 +---
 drivers/usb/host/ohci-hcd.c|   20 +-
 4 files changed, 70 insertions(+), 107 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 5391a38..f827386 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -484,7 +484,7 @@ config USB_OHCI_SH
  If you use the PCI OHCI controller, this option is not necessary.
 
 config USB_OHCI_EXYNOS
-   boolean OHCI support for Samsung EXYNOS SoC Series
+   tristate OHCI support for Samsung EXYNOS SoC Series
depends on ARCH_EXYNOS
help
 Enable support for the Samsung Exynos SOC's on-chip OHCI controller.
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 8a89c3d..2a4f11f 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -46,6 +46,7 @@ obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o
 obj-$(CONFIG_USB_OHCI_HCD_PCI) += ohci-pci.o
 obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)+= ohci-platform.o
+obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index 07592c0..a5f4c33 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -12,24 +12,38 @@
  */
 
 #include linux/clk.h
+#include linux/dma-mapping.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
 #include linux/of.h
 #include linux/platform_device.h
 #include linux/platform_data/usb-ohci-exynos.h
 #include linux/usb/phy.h
 #include linux/usb/samsung_usb_phy.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+#include linux/usb/otg.h
+
+#include ohci.h
+
+#define DRIVER_DESC OHCI exynos driver
+
+static const char hcd_name[] = ohci-exynos;
+static struct hc_driver __read_mostly exynos_ohci_hc_driver;
+
+#define to_exynos_ohci(hcd) (struct exynos_ohci_hcd *)(hcd_to_ohci(hcd)-priv)
 
 struct exynos_ohci_hcd {
-   struct device *dev;
-   struct usb_hcd *hcd;
struct clk *clk;
struct usb_phy *phy;
struct usb_otg *otg;
struct exynos4_ohci_platdata *pdata;
 };
 
-static void exynos_ohci_phy_enable(struct exynos_ohci_hcd *exynos_ohci)
+static void exynos_ohci_phy_enable(struct platform_device *pdev)
 {
-   struct platform_device *pdev = to_platform_device(exynos_ohci-dev);
+   struct exynos_ohci_hcd *exynos_ohci = platform_get_drvdata(pdev);
 
if (exynos_ohci-phy)
usb_phy_init(exynos_ohci-phy);
@@ -37,9 +51,9 @@ static void exynos_ohci_phy_enable(struct exynos_ohci_hcd 
*exynos_ohci)
exynos_ohci-pdata-phy_init(pdev, USB_PHY_TYPE_HOST);
 }
 
-static void exynos_ohci_phy_disable(struct exynos_ohci_hcd *exynos_ohci)
+static void exynos_ohci_phy_disable(struct platform_device *pdev)
 {
-   struct platform_device *pdev = to_platform_device(exynos_ohci-dev);
+   struct exynos_ohci_hcd *exynos_ohci = platform_get_drvdata(pdev);
 
if (exynos_ohci-phy)
usb_phy_shutdown(exynos_ohci-phy);
@@ -47,57 +61,6 @@ static void exynos_ohci_phy_disable(struct exynos_ohci_hcd 
*exynos_ohci)
exynos_ohci-pdata-phy_exit(pdev, USB_PHY_TYPE_HOST);
 }
 
-static int ohci_exynos_reset(struct usb_hcd *hcd)
-{
-   return ohci_init(hcd_to_ohci(hcd));
-}
-
-static int ohci_exynos_start(struct usb_hcd *hcd)
-{
-   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-   int ret;
-
-   ohci_dbg(ohci, ohci_exynos_start, ohci:%p, ohci);
-
-   ret = ohci_run(ohci);
-   if (ret  0) {
-   dev_err(hcd-self.controller, can't start %s\n,
-   hcd-self.bus_name);
-   ohci_stop(hcd);
-   return ret;
-   }
-
-   return 0;
-}
-
-static const struct hc_driver exynos_ohci_hc_driver = {
-   .description= hcd_name,
-   .product_desc   = EXYNOS OHCI Host Controller,
-   .hcd_priv_size  = sizeof(struct ohci_hcd),
-
-   .irq= ohci_irq,
-   .flags  = HCD_MEMORY|HCD_USB11,
-
-   .reset  = ohci_exynos_reset,
-   .start  = ohci_exynos_start,
-   .stop   = ohci_stop,
-   .shutdown   = ohci_shutdown,
-
-   .get_frame_number 

[RFC][PATCH 3/7] USB: OHCI: make ohci-omap3 a separate driver

2013-06-07 Thread Manjunath Goudar
Separate the  TI OHCI OMAP3 host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Cc: Anand Gadiyar gadi...@ti.com
Cc: Felipe Balbi ba...@ti.com
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: Alan Stern st...@rowland.harvard.edu
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/Kconfig  |2 +-
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ohci-hcd.c   |   20 +--
 drivers/usb/host/ohci-omap3.c |  122 ++---
 4 files changed, 45 insertions(+), 100 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 744673b..f42db93 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -404,7 +404,7 @@ config USB_OHCI_HCD_OMAP1
  Enables support for the OHCI controller on OMAP1/2 chips.
 
 config USB_OHCI_HCD_OMAP3
-   bool OHCI support for OMAP3 and later chips
+   tristate OHCI support for OMAP3 and later chips
depends on (ARCH_OMAP3 || ARCH_OMAP4)
default y
---help---
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 1326df2..ceb4e55 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_USB_OHCI_HCD_PCI)+= ohci-pci.o
 obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)+= ohci-platform.o
 obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
+obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 4bfd890..8002bbe 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1178,11 +1178,6 @@ MODULE_LICENSE (GPL);
 #define S3C2410_PLATFORM_DRIVERohci_hcd_s3c2410_driver
 #endif
 
-#ifdef CONFIG_USB_OHCI_HCD_OMAP3
-#include ohci-omap3.c
-#define OMAP3_PLATFORM_DRIVER  ohci_hcd_omap3_driver
-#endif
-
 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 #include ohci-pxa27x.c
 #define PLATFORM_DRIVERohci_hcd_pxa27x_driver
@@ -1252,8 +1247,8 @@ MODULE_LICENSE (GPL);
!IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM)  \
!IS_ENABLED(CONFIG_USB_OHCI_EXYNOS)  \
!IS_ENABLED(CONFIG_USB_OHCI_HCD_OMAP1)  \
+   !IS_ENABLED(CONFIG_USB_OHCI_HCD_OMAP3)  \
!defined(PLATFORM_DRIVER) \
-   !defined(OMAP3_PLATFORM_DRIVER)   \
!defined(OF_PLATFORM_DRIVER)  \
!defined(SA_DRIVER)   \
!defined(PS3_SYSTEM_BUS_DRIVER)  \
@@ -1300,12 +1295,6 @@ static int __init ohci_hcd_mod_init(void)
goto error_platform;
 #endif
 
-#ifdef OMAP3_PLATFORM_DRIVER
-   retval = platform_driver_register(OMAP3_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_omap3_platform;
-#endif
-
 #ifdef OF_PLATFORM_DRIVER
retval = platform_driver_register(OF_PLATFORM_DRIVER);
if (retval  0)
@@ -1409,10 +1398,6 @@ static int __init ohci_hcd_mod_init(void)
platform_driver_unregister(OF_PLATFORM_DRIVER);
  error_of_platform:
 #endif
-#ifdef OMAP3_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
- error_omap3_platform:
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
  error_platform:
@@ -1464,9 +1449,6 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef OF_PLATFORM_DRIVER
platform_driver_unregister(OF_PLATFORM_DRIVER);
 #endif
-#ifdef OMAP3_PLATFORM_DRIVER
-   platform_driver_unregister(OMAP3_PLATFORM_DRIVER);
-#endif
 #ifdef PLATFORM_DRIVER
platform_driver_unregister(PLATFORM_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index 08e811d..1d30bc8 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -29,90 +29,22 @@
  * - add kernel-doc
  */
 
+#include linux/dma-mapping.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/of.h
+#include linux/usb/otg.h
 #include linux/platform_device.h
 #include linux/pm_runtime.h
-#include linux/of.h
-#include linux/dma-mapping.h
-
-/*-*/
-
-static int ohci_omap3_init(struct usb_hcd *hcd)
-{
-   dev_dbg(hcd-self.controller, starting OHCI controller\n);
-
-   return ohci_init(hcd_to_ohci(hcd));
-}
-
-/*-*/
-
-static int ohci_omap3_start(struct usb_hcd *hcd)
-{
-   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
-   int ret;
-
-   /*
-* RemoteWakeupConnected has to be set explicitly before
-* calling ohci_run. The reset value of RWC is 0.
-*/
-   ohci-hc_control = OHCI_CTRL_RWC;
-   writel(OHCI_CTRL_RWC, 

[RFC][PATCH 5/7] USB: OHCI: export ohci_hub_control and ohci_hub_status_data

2013-06-07 Thread Manjunath Goudar
In order to make ohci-at91 and ohci-s3c2410 as a separate driver,
ohci_hub_control and ohci_hub_status_data symbol needs to be exported.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Cc: Arnd Bergmann a...@arndb.de
Cc: Alan Stern st...@rowland.harvard.edu
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ohci-hub.c |8 
 drivers/usb/host/ohci.h |9 +
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c
index 2347ab8..c601e70 100644
--- a/drivers/usb/host/ohci-hub.c
+++ b/drivers/usb/host/ohci-hub.c
@@ -437,8 +437,7 @@ static int ohci_root_hub_state_changes(struct ohci_hcd 
*ohci, int changed,
 
 /* build status change packet (one or two bytes) from HC registers */
 
-static int
-ohci_hub_status_data (struct usb_hcd *hcd, char *buf)
+int ohci_hub_status_data(struct usb_hcd *hcd, char *buf)
 {
struct ohci_hcd *ohci = hcd_to_ohci (hcd);
int i, changed = 0, length = 1;
@@ -503,6 +502,7 @@ done:
 
return changed ? length : 0;
 }
+EXPORT_SYMBOL_GPL(ohci_hub_status_data);
 
 /*-*/
 
@@ -645,7 +645,7 @@ static inline int root_port_reset (struct ohci_hcd *ohci, 
unsigned port)
return 0;
 }
 
-static int ohci_hub_control (
+int ohci_hub_control(
struct usb_hcd  *hcd,
u16 typeReq,
u16 wValue,
@@ -773,4 +773,4 @@ error:
}
return retval;
 }
-
+EXPORT_SYMBOL_GPL(ohci_hub_control);
diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
index e2e5faa..d0d9b60 100644
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -738,3 +738,12 @@ extern int ohci_setup(struct usb_hcd *hcd);
 extern int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup);
 extern int ohci_resume(struct usb_hcd *hcd, bool hibernated);
 #endif
+extern int ohci_hub_control(
+   struct usb_hcd  *hcd,
+   u16 typeReq,
+   u16 wValue,
+   u16 wIndex,
+   char*buf,
+   u16 wLength
+);
+extern int ohci_hub_status_data(struct usb_hcd *hcd, char *buf);
-- 
1.7.9.5

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


[RFC][PATCH 6/7] USB: OHCI: make ohci-at91 a separate driver

2013-06-07 Thread Manjunath Goudar
Separate the  TI OHCI Atmel host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Cc: Arnd Bergmann a...@arndb.de
Cc: Alan Stern st...@rowland.harvard.edu
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/Kconfig |8 +++
 drivers/usb/host/Makefile|1 +
 drivers/usb/host/ohci-at91.c |  135 ++
 drivers/usb/host/ohci-hcd.c  |   20 +--
 4 files changed, 67 insertions(+), 97 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index c347cb3..0aabd84 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -411,6 +411,14 @@ config USB_OHCI_HCD_SPEAR
   Enables support for the on-chip OHCI controller on
   ST SPEAr chips.
 
+config USB_OHCI_HCD_AT91
+tristate  Support for Atmel on-chip OHCI USB controller
+depends on USB_OHCI_HCD  ARCH_AT91
+default y
+---help---
+  Enables support for the on-chip OHCI controller on
+  Atmel chips.
+
 config USB_OHCI_HCD_OMAP3
tristate OHCI support for OMAP3 and later chips
depends on (ARCH_OMAP3 || ARCH_OMAP4)
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 1e0d83e..746ffc7 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -50,6 +50,7 @@ obj-$(CONFIG_USB_OHCI_EXYNOS) += ohci-exynos.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
 obj-$(CONFIG_USB_OHCI_HCD_SPEAR)   += ohci-spear.o
+obj-$(CONFIG_USB_OHCI_HCD_AT91)+= ohci-at91.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index a0cb44f..b4a88a6 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -13,16 +13,25 @@
  */
 
 #include linux/clk.h
-#include linux/platform_device.h
+#include linux/dma-mapping.h
 #include linux/of_platform.h
 #include linux/of_gpio.h
+#include linux/platform_device.h
 #include linux/platform_data/atmel.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/usb.h
+#include linux/usb/hcd.h
 
 #include mach/hardware.h
 #include asm/gpio.h
 
 #include mach/cpu.h
 
+
+#include ohci.h
+
 #ifndef CONFIG_ARCH_AT91
 #error CONFIG_ARCH_AT91 must be defined.
 #endif
@@ -32,6 +41,12 @@
for ((index) = 0; (index)  AT91_MAX_USBH_PORTS; (index)++)
 
 /* interface and function clocks; sometimes also an AHB clock */
+
+#define DRIVER_DESC OHCI Atmel driver
+
+static const char hcd_name[] = ohci-atmel;
+
+static struct hc_driver __read_mostly ohci_at91_hc_driver;
 static struct clk *iclk, *fclk, *hclk;
 static int clocked;
 
@@ -111,6 +126,8 @@ static void usb_hcd_at91_remove (struct usb_hcd *, struct 
platform_device *);
 static int usb_hcd_at91_probe(const struct hc_driver *driver,
struct platform_device *pdev)
 {
+   struct at91_usbh_data   *board;
+   struct ohci_hcd *ohci;
int retval;
struct usb_hcd *hcd = NULL;
 
@@ -163,8 +180,11 @@ static int usb_hcd_at91_probe(const struct hc_driver 
*driver,
goto err5;
}
 
+   board = hcd-self.controller-platform_data;
+   ohci = hcd_to_ohci(hcd);
+   ohci-num_ports = board-ports;
at91_start_hc(pdev);
-   ohci_hcd_init(hcd_to_ohci(hcd));
+   ohci_setup(hcd);
 
retval = usb_add_hcd(hcd, pdev-resource[1].start, IRQF_SHARED);
if (retval == 0)
@@ -221,36 +241,6 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
 }
 
 /*-*/
-
-static int
-ohci_at91_reset (struct usb_hcd *hcd)
-{
-   struct at91_usbh_data   *board = hcd-self.controller-platform_data;
-   struct ohci_hcd *ohci = hcd_to_ohci (hcd);
-   int ret;
-
-   if ((ret = ohci_init(ohci))  0)
-   return ret;
-
-   ohci-num_ports = board-ports;
-   return 0;
-}
-
-static int
-ohci_at91_start (struct usb_hcd *hcd)
-{
-   struct ohci_hcd *ohci = hcd_to_ohci (hcd);
-   int ret;
-
-   if ((ret = ohci_run(ohci))  0) {
-   dev_err(hcd-self.controller, can't start %s\n,
-   hcd-self.bus_name);
-   ohci_stop(hcd);
-   return ret;
-   }
-   return 0;
-}
-
 static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, 
int enable)
 {
if (!valid_port(port))
@@ -413,51 +403,6 @@ static int ohci_at91_hub_control(struct usb_hcd *hcd, u16 
typeReq, u16 wValue,
 
 /*-*/
 
-static const struct hc_driver 

[RFC][PATCH 7/7] USB: OHCI: make ohci-s3c2410 a separate driver

2013-06-07 Thread Manjunath Goudar
Separate the Samsung OHCI S3C host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Cc: Arnd Bergmann a...@arndb.de
Cc: Alan Stern st...@rowland.harvard.edu
Cc: Greg KH g...@kroah.com
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/Kconfig|8 +++
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ohci-hcd.c |   20 +--
 drivers/usb/host/ohci-s3c2410.c |  116 ---
 4 files changed, 58 insertions(+), 87 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 0aabd84..a863c60 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -411,6 +411,14 @@ config USB_OHCI_HCD_SPEAR
   Enables support for the on-chip OHCI controller on
   ST SPEAr chips.
 
+config USB_OHCI_HCD_S3C
+tristate Support for S3C on-chip OHCI USB controller
+depends on USB_OHCI_HCD  (ARCH_S3C24XX) || (ARCH_S3C64XX)
+default y
+---help---
+  Enables support for the on-chip OHCI controller on
+  S3C chips.
+
 config USB_OHCI_HCD_AT91
 tristate  Support for Atmel on-chip OHCI USB controller
 depends on USB_OHCI_HCD  ARCH_AT91
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 746ffc7..4290701 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_USB_OHCI_HCD_OMAP1)  += ohci-omap.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
 obj-$(CONFIG_USB_OHCI_HCD_SPEAR)   += ohci-spear.o
 obj-$(CONFIG_USB_OHCI_HCD_AT91)+= ohci-at91.o
+obj-$(CONFIG_USB_OHCI_HCD_S3C) += ohci-s3c2410.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 00409b9..8e5d979 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1173,11 +1173,6 @@ MODULE_LICENSE (GPL);
 #define SA_DRIVER  ohci_hcd_sa_driver
 #endif
 
-#if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S3C64XX)
-#include ohci-s3c2410.c
-#define S3C2410_PLATFORM_DRIVERohci_hcd_s3c2410_driver
-#endif
-
 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
 #include ohci-pxa27x.c
 #define PLATFORM_DRIVERohci_hcd_pxa27x_driver
@@ -1240,13 +1235,13 @@ MODULE_LICENSE (GPL);
!IS_ENABLED(CONFIG_USB_OHCI_HCD_OMAP3)  \
!IS_ENABLED(CONFIG_USB_OHCI_HCD_SPEAR)  \
!IS_ENABLED(CONFIG_USB_OHCI_HCD_AT91)  \
+   !IS_ENABLED(CONFIG_USB_OHCI_HCD_S3C)  \
!defined(PLATFORM_DRIVER) \
!defined(OF_PLATFORM_DRIVER)  \
!defined(SA_DRIVER)   \
!defined(PS3_SYSTEM_BUS_DRIVER)  \
!defined(SM501_OHCI_DRIVER)  \
!defined(TMIO_OHCI_DRIVER)  \
-   !defined(S3C2410_PLATFORM_DRIVER)  \
!defined(EP93XX_PLATFORM_DRIVER)  \
!defined(NXP_PLATFORM_DRIVER)  \
!defined(DAVINCI_PLATFORM_DRIVER)
@@ -1309,12 +1304,6 @@ static int __init ohci_hcd_mod_init(void)
goto error_tmio;
 #endif
 
-#ifdef S3C2410_PLATFORM_DRIVER
-   retval = platform_driver_register(S3C2410_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_s3c2410;
-#endif
-
 #ifdef EP93XX_PLATFORM_DRIVER
retval = platform_driver_register(EP93XX_PLATFORM_DRIVER);
if (retval  0)
@@ -1348,10 +1337,6 @@ static int __init ohci_hcd_mod_init(void)
platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
  error_ep93xx:
 #endif
-#ifdef S3C2410_PLATFORM_DRIVER
-   platform_driver_unregister(S3C2410_PLATFORM_DRIVER);
- error_s3c2410:
-#endif
 #ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(TMIO_OHCI_DRIVER);
  error_tmio:
@@ -1398,9 +1383,6 @@ static void __exit ohci_hcd_mod_exit(void)
 #ifdef EP93XX_PLATFORM_DRIVER
platform_driver_unregister(EP93XX_PLATFORM_DRIVER);
 #endif
-#ifdef S3C2410_PLATFORM_DRIVER
-   platform_driver_unregister(S3C2410_PLATFORM_DRIVER);
-#endif
 #ifdef TMIO_OHCI_DRIVER
platform_driver_unregister(TMIO_OHCI_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c
index e125770..14843d2 100644
--- a/drivers/usb/host/ohci-s3c2410.c
+++ b/drivers/usb/host/ohci-s3c2410.c
@@ -19,14 +19,27 @@
  * This file is licenced under the GPL.
 */
 
-#include linux/platform_device.h
 #include linux/clk.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/platform_device.h
 #include linux/platform_data/usb-ohci-s3c2410.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+
+#include ohci.h
+
 
 #define valid_port(idx) ((idx) == 1 || (idx) == 2)
 
 /* clock device associated with the hcd */
 
+
+#define DRIVER_DESC OHCI S3C driver
+
+static const char hcd_name[] = 

[RFC][PATCH 4/7] USB: OHCI: make ohci-spear a separate driver

2013-06-07 Thread Manjunath Goudar
Separate the  TI OHCI SPEAr host controller driver from ohci-hcd
host code so that it can be built as a separate driver module.
This work is part of enabling multi-platform kernels on ARM.

Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org
Cc: Viresh Kumar viresh.li...@gmail.com
Cc: Arnd Bergmann a...@arndb.de
Cc: Greg KH g...@kroah.com
Cc: Alan Stern st...@rowland.harvard.edu
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/Kconfig  |8 +++
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ohci-hcd.c   |   22 +-
 drivers/usb/host/ohci-spear.c |  149 ++---
 4 files changed, 75 insertions(+), 105 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index f42db93..c347cb3 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -403,6 +403,14 @@ config USB_OHCI_HCD_OMAP1
---help---
  Enables support for the OHCI controller on OMAP1/2 chips.
 
+config USB_OHCI_HCD_SPEAR
+tristate Support for ST SPEAr on-chip OHCI USB controller
+depends on USB_OHCI_HCD  PLAT_SPEAR
+default y
+---help---
+  Enables support for the on-chip OHCI controller on
+  ST SPEAr chips.
+
 config USB_OHCI_HCD_OMAP3
tristate OHCI support for OMAP3 and later chips
depends on (ARCH_OMAP3 || ARCH_OMAP4)
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index ceb4e55..1e0d83e 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_USB_OHCI_HCD_PLATFORM)   += ohci-platform.o
 obj-$(CONFIG_USB_OHCI_EXYNOS)  += ohci-exynos.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP1)   += ohci-omap.o
 obj-$(CONFIG_USB_OHCI_HCD_OMAP3)   += ohci-omap3.o
+obj-$(CONFIG_USB_OHCI_HCD_SPEAR)   += ohci-spear.o
 
 obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o
 obj-$(CONFIG_USB_FHCI_HCD) += fhci.o
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 8002bbe..27f0abe 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1208,11 +1208,6 @@ MODULE_LICENSE (GPL);
 #define OF_PLATFORM_DRIVER ohci_hcd_ppc_of_driver
 #endif
 
-#ifdef CONFIG_PLAT_SPEAR
-#include ohci-spear.c
-#define SPEAR_PLATFORM_DRIVER  spear_ohci_hcd_driver
-#endif
-
 #ifdef CONFIG_PPC_PS3
 #include ohci-ps3.c
 #define PS3_SYSTEM_BUS_DRIVER  ps3_ohci_driver
@@ -1248,6 +1243,7 @@ MODULE_LICENSE (GPL);
!IS_ENABLED(CONFIG_USB_OHCI_EXYNOS)  \
!IS_ENABLED(CONFIG_USB_OHCI_HCD_OMAP1)  \
!IS_ENABLED(CONFIG_USB_OHCI_HCD_OMAP3)  \
+   !IS_ENABLED(CONFIG_USB_OHCI_HCD_SPEAR)  \
!defined(PLATFORM_DRIVER) \
!defined(OF_PLATFORM_DRIVER)  \
!defined(SA_DRIVER)   \
@@ -1258,8 +1254,7 @@ MODULE_LICENSE (GPL);
!defined(EP93XX_PLATFORM_DRIVER)  \
!defined(AT91_PLATFORM_DRIVER)  \
!defined(NXP_PLATFORM_DRIVER)  \
-   !defined(DAVINCI_PLATFORM_DRIVER)  \
-   !defined(SPEAR_PLATFORM_DRIVER)
+   !defined(DAVINCI_PLATFORM_DRIVER)
 #error missing bus glue for ohci-hcd
 #endif
 
@@ -1349,19 +1344,9 @@ static int __init ohci_hcd_mod_init(void)
goto error_davinci;
 #endif
 
-#ifdef SPEAR_PLATFORM_DRIVER
-   retval = platform_driver_register(SPEAR_PLATFORM_DRIVER);
-   if (retval  0)
-   goto error_spear;
-#endif
-
return retval;
 
/* Error path */
-#ifdef SPEAR_PLATFORM_DRIVER
-   platform_driver_unregister(SPEAR_PLATFORM_DRIVER);
- error_spear:
-#endif
 #ifdef DAVINCI_PLATFORM_DRIVER
platform_driver_unregister(DAVINCI_PLATFORM_DRIVER);
  error_davinci:
@@ -1419,9 +1404,6 @@ module_init(ohci_hcd_mod_init);
 
 static void __exit ohci_hcd_mod_exit(void)
 {
-#ifdef SPEAR_PLATFORM_DRIVER
-   platform_driver_unregister(SPEAR_PLATFORM_DRIVER);
-#endif
 #ifdef DAVINCI_PLATFORM_DRIVER
platform_driver_unregister(DAVINCI_PLATFORM_DRIVER);
 #endif
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index 6a7cb14..9e79d24 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -11,94 +11,41 @@
 * warranty of any kind, whether express or implied.
 */
 
-#include linux/signal.h
-#include linux/platform_device.h
+#include linux/dma-mapping.h
 #include linux/clk.h
+#include linux/io.h
+#include linux/kernel.h
+#include linux/module.h
 #include linux/of.h
+#include linux/platform_device.h
+#include linux/signal.h
+#include linux/usb.h
+#include linux/usb/hcd.h
+#include linux/debugfs.h
+#include linux/errno.h
 
-struct spear_ohci {
-   struct ohci_hcd ohci;
-   struct clk *clk;
-};
-
-#define to_spear_ohci(hcd) (struct spear_ohci *)hcd_to_ohci(hcd)
-
-static void spear_start_ohci(struct spear_ohci *ohci)
-{
-   clk_prepare_enable(ohci-clk);
-}
-
-static void spear_stop_ohci(struct spear_ohci *ohci)
-{
-   clk_disable_unprepare(ohci-clk);
-}
-
-static int ohci_spear_start(struct usb_hcd *hcd)
-{
-   

Re: serial/ftdi_sio byte loss / performance regression

2013-06-07 Thread Tomaž Šolc
On 06/06/2013 11:58 AM, Johan Hovold wrote:
 On Thu, Jun 06, 2013 at 10:50:36AM +0200, Tomaž Šolc wrote:
 I have noticed that the ftdi_sio serial driver in recent kernel versions
 has very bad performance when used through the Python's serial library.

 As a test case I have a custom device that will send a continuous block
 of 5k characters once every few seconds over a RS-232 line (115200 baud)
 to an Olimex programmer (based on FT2232C, also tried one with FT2232H).

 Programmer is connected to a Linux system where a simple Python script
 reads the device:

 import serial
 comm = serial.Serial(/dev/ttyUSB0, 115200)
 while True:
  line = comm.readline()

 With kernels before 3.7.0 the script reads uncorrupted data while using
 newer kernels (including 3.9.4) the Python script sees heavy byte loss.
 top shows an 95% idle CPU. Only very slow transmissions (on the
 order of tens of bytes per second) will come through uncorrupted.

 Using git-bisect, I have found the commit that introduced this problem:

 6f602912c9d0c84c2edbd446dd9f72660b701605
 usb: serial: ftdi_sio: Add missing chars_in_buffer function

 This might also be related with the unusual way Python serial library
 reads the device. It uses select() with no timeout and single byte
 read()s in a loop. strace output:

 select(4, [3], [], [], NULL)= 1 (in [3])
 read(3, D, 1) = 1
 select(4, [3], [], [], NULL)= 1 (in [3])
 read(3, E, 1) = 1
 ...

 With sufficiently large read()s the byte loss can be eliminated.

 With the commit above, each select() now causes an additional round trip
 over USB to read the state of the hardware buffer. It's possible that
 constant status querying triggers some bug in the hardware or the query
 is simply too slow and causes overflows in the hardware buffer.
 
 You're absolutely right. This is a known issue (the select overhead)
 that was just recently fixed by commit a37025b5c7 (USB: ftdi_sio: fix
 chars_in_buffer overhead) in v3.10-rc3. Care to give v3.10-rc4 a try?

Johan, thanks for the prompt reply. I have tried v3.10-rc4 and indeed
the issue is fixed.

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


DWC3: Event Interrupt Mask issue

2013-06-07 Thread Huang Rui
Hi Felipe,

I was reading dwc3 codes and found that during the process of
configuring event buffer (dwc3_event_buffers_setup), it only write the
size of the buffer and doesn't write interrupt mask bit into GEVNTSIZ
register like below,

dwc3_writel(dwc-regs, DWC3_GEVNTSIZ(n),
evt-length  0x);

But in spec, it suggests that write this bit to prevent the interrupt
from being generated in an event buffer configuration. So need we set
this bit? If I was wrong, please correct me.

Thanks,
Rui

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


Re: [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code

2013-06-07 Thread Simon Horman
On Sun, Jun 02, 2013 at 01:28:05AM +0400, Sergei Shtylyov wrote:
 Hello.
 
Here's the set of 9 patches against the Simon Horman's 'renesas.git' repo,
 'renesas-next-20130528' tag.  It was created to fix the shortcomings in the
 R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
 spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches 
 have
 to touch both subtrees). The patches were conceived with the complete
 bisectability goal in mind.
 
 [1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 
 code
 [2/9] ehci-platform: add pre_setup() method to platform data
 [3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
 [4/9] phy-rcar-usb: remove EHCI internal buffer setup
 [5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
 [6/9] phy-rcar-usb: correct base address
 [7/9] phy-rcar-usb: add platform data
 [8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
 [9/9] phy-rcar-usb: handle platform data
 
The patchset is completely ready to be merged now.

Can I confirm that the plan is for me to merge this code?

If so, I should be able to do so next week.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Linux USB file storage gadget with new UDC

2013-06-07 Thread victor yeo
Hi,

 Thanks a lot. i understand this part now. Do you notice the Set
 Address request is not seen by the gadget driver? The Set Address
 request is handled by the hardware. Could it be the root cause? As
 gadget driver may expect the address information from the host, and
 for now UDC driver just ignore the Set Address request ?

 That may very well be related to the problem.  Gadget drivers expect
 UDC drivers or UDC hardware to handle Set-Address requests
 automatically.  If your UDC or driver doesn't handle them, it could
 cause a test to fail.

The hardware handles Set Address request, and i can see the address of
the USB gadget being shown in Windows host. Here i attach the gadget
driver log for the Device Descriptor Test - Addressed State. The
test just failed after Get Configuration request.

Another question, in ep0_complete():
if (req-status == 0  req-context)
((fsg_routine_t) (req-context))(fsg);

Is req-context pointing to a function in UDC driver?

Thanks,
victor
# dmesg
g_file_storage gadget: ep0-setup, length 8:
: 80 06 00 01 00 00 12 00
g_file_storage gadget: get device descriptor
ept0 in queue len 0x12, buffer 0xc1289800
ep0_complete
g_file_storage gadget: ep0-in, length 18:
: 12 01 00 02 00 00 00 40 25 05 a5 a4 33 03 01 02
0010: 00 01
g_file_storage gadget: ep0-setup, length 8:
: 80 06 00 06 00 00 0a 00
g_file_storage gadget: get device qualifier
ept0 in queue len 0xa, buffer 0xc1289800
ep0_complete
g_file_storage gadget: ep0-in, length 10:
: 0a 06 00 02 00 00 00 40 01 00
g_file_storage gadget: ep0-setup, length 8:
: 80 06 00 02 00 00 09 00
g_file_storage gadget: get configuration descriptor
ept0 in queue len 0x9, buffer 0xc1289800
ep0_complete
g_file_storage gadget: ep0-in, length 9:
: 09 02 20 00 01 01 04 c0 01
g_file_storage gadget: ep0-setup, length 8:
: 80 08 00 00 00 00 01 00
g_file_storage gadget: get configuration
ept0 in queue len 0x1, buffer 0xc1289800
ep0_complete
g_file_storage gadget: ep0-in, length 1:
: 01
g_file_storage gadget: ep0-setup, length 8:
: 80 08 00 00 00 00 01 00
g_file_storage gadget: get configuration
ept0 in queue len 0x1, buffer 0xc1289800
ep0_complete
g_file_storage gadget: ep0-in, length 1:
: 01
# 

[RFC 00/50] ARM: at91: move to common clk framework

2013-06-07 Thread Boris BREZILLON
Hello,

This patch series is a proposal to move at91 clock implementation
to common clk framework.

Most of the clock provided by the PMC (Power Management Controller) are
implemented :
- main clock (main oscillator)
- pll clocks
- master clock
- programmable clocks
- utmi clock
- peripheral clocks
- system clocks

This implementation is compatible with device tree: the goal is
to define the whole clock tree in the device tree (all currently
available dt SoCs and boards are patched to support dt clocks).
Please feel free to comment the dt bindinds (I'm not sure about the
name I choose or the position of clock nodes: children of pmc node).

I removed the register_clocks function in SoC supporting dt boards only:
- at91sam9x5 SoCs
- at91sam9n12 SoC
- sama5d3 SoCs

This patch series also update at91 drivers calling clk_enable/disable
instead of the preferred clk_prepare_enable/disable_unprepare functions.


I know there are a lot of cleanup in progress for at91 arch, so please tell
me if you think this transition to common clk framework should wait.

This patch series has been tested on Kizbox (sam9g20 SoC) board using device
tree. It compiles for other SoCs and both with and without dt support, but it
has not been tested.

The clocks rate/parent change has not been tested.

Best Regards,
Boris

Boris BREZILLON (50):
  ARM: at91: move arch/arm/mach-at91/include/mach/at91_pmc.h to
include/linux/clk/at91.h
  ARM: at91: add PMC main clock using common clk framework.
  ARM: at91: add PMC pll clocks support using common clk framework.
  ARM: at91: add PMC master clock support using common clk framework.
  ARM: at91: add PMC system clocks support using common clk framework.
  ARM: at91: add PMC peripheral clocks support using common clk
framework.
  ARM: at91: add PMC programmable clocks support using common clk
framework.
  ARM: at91: add PMC utmi clock support using common clk framework.
  ARM: at91: add PMC usb clock support using common clk framework.
  ARM: at91: add PMC smd clock support using common clk framework.
  ARM: at91: add PMC clk device tree binding doc.
  ARM: at91: move to common clk framework.
  ARM: at91: move at91rm9200 SoC to common clk framework.
  ARM: at91: move at91sam9260 SoC to common clk framework.
  ARM: at91: move at91sam9263 SoC to common clk framework.
  ARM: at91: move at91sam9263 SoC to common clk framework.
  ARM: at91: move at91sam9g45 SoC to common clk framework.
  ARM: at91: move at91sam9n12 SoC to common clk framework.
  ARM: at91: move at91sam9rl SoC to common clk framework.
  ARM: at91: move at91sam9x5 SoCs to common clk framework.
  ARM: at91: move at91sam9 SoCs to common clk framework.
  ARM: at91: move sama5d3 SoCs to common clk framework.
  ARM: at91: move at91rm9200 non dt boards to common clk framework.
  ARM: at91: move at91sam9 non dt boards to common clk framework.
  ARM: at91: move pit timer to common clk framework.
  ARM: at91/tc/clocksource: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  at_hdmac: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  ASoC: atmel-ssc: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  mmc: atmel-mci: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  pwm: atmel-tcb: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  tty: atmel_serial: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  usb: gadget: at91_udc: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  drivers/usb/host/ehci-atmel.c: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  USB: ohci-at91: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  ARM: at91/avr32/atmel_lcdfb: replace clk_enable/disable with
clk_prepare_enable/disable_unprepare.
  ARM: at91/dt: move at91rm9200 SoC to clk framework.
  ARM: at91/dt: move at91sam9260 SoC to common clk framework.
  ARM: at91/dt: move at91sam9263 SoC to common clk framework.
  ARM: at91/dt: move at91sam9g45 SoC to common clk framework.
  ARM: at91/dt: move at91sam9n12 SoC to common clk framework.
  ARM: at91/dt: move at91sam9x5 SoCs to common clk framework.
  ARM: at91/dt: move at91sam9g20 SoC to common clk framework.
  ARM: at91/dt: move sama5d3 SoCs to common clk framework.
  ARM: at91/dt: move at91sam9260/sam9g20 boards to common clk
framework.
  ARM: at91/dt: move at91rm9200 boards to common clk framework.
  ARM: at91/dt: move at91sam9263 boards to common clk framework.
  ARM: at91/dt: move at91sam9g45 boards to common clk framework.
  ARM: at91/dt: move at91sam9n12 boards to common clk framework.
  ARM: at91/dt: move at91sam9x5 boards to common clk framework.
  ARM: at91/dt: move sama5d3 boards to common clk framework.

 .../devicetree/bindings/clock/at91-clock.txt   |  247 +
 arch/arm/boot/dts/animeo_ip.dts|   17 +-
 arch/arm/boot/dts/at91-ariag25.dts

[RFC 01/50] ARM: at91: move arch/arm/mach-at91/include/mach/at91_pmc.h to include/linux/clk/at91.h

2013-06-07 Thread Boris BREZILLON
This patch moves at91_pmc.h header from machine specific directory
(arch/arm/mach-at91/include/mach/at91_pmc.h) to clk include directory
(include/linux/clk/at91.h).
We need this to avoid reference to machine specific headers in clk
drivers.
 

Signed-off-by: Boris BREZILLON b.brezil...@overkiz.com
---
 arch/arm/mach-at91/at91rm9200.c|2 +-
 arch/arm/mach-at91/at91sam9260.c   |2 +-
 arch/arm/mach-at91/at91sam9261.c   |2 +-
 arch/arm/mach-at91/at91sam9263.c   |2 +-
 arch/arm/mach-at91/at91sam9g45.c   |2 +-
 arch/arm/mach-at91/at91sam9n12.c   |2 +-
 arch/arm/mach-at91/at91sam9rl.c|2 +-
 arch/arm/mach-at91/at91sam9x5.c|2 +-
 arch/arm/mach-at91/clock.c |2 +-
 arch/arm/mach-at91/pm.c|2 +-
 arch/arm/mach-at91/pm_slowclock.S  |2 +-
 arch/arm/mach-at91/sama5d3.c   |2 +-
 arch/arm/mach-at91/setup.c |2 +-
 drivers/usb/gadget/atmel_usba_udc.c|2 +-
 .../mach/at91_pmc.h = include/linux/clk/at91.h|2 +-
 15 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index d193a40..6ea6de7 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -11,13 +11,13 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include asm/system_misc.h
 #include mach/at91rm9200.h
-#include mach/at91_pmc.h
 #include mach/at91_st.h
 #include mach/cpu.h
 
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index a8ce245..df32768 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -11,6 +11,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -20,7 +21,6 @@
 #include mach/cpu.h
 #include mach/at91_dbgu.h
 #include mach/at91sam9260.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 25efb5a..8a63b81 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -11,6 +11,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -19,7 +20,6 @@
 #include asm/system_misc.h
 #include mach/cpu.h
 #include mach/at91sam9261.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index f44ffd2..77b3c24 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -11,6 +11,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -18,7 +19,6 @@
 #include asm/mach/map.h
 #include asm/system_misc.h
 #include mach/at91sam9263.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 8b7fce0..31a1304 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -12,13 +12,13 @@
 
 #include linux/module.h
 #include linux/dma-mapping.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include asm/system_misc.h
 #include mach/at91sam9g45.h
-#include mach/at91_pmc.h
 #include mach/cpu.h
 
 #include at91_aic.h
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index 13cdbcd..f9ff4d2 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -8,12 +8,12 @@
 
 #include linux/module.h
 #include linux/dma-mapping.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include mach/at91sam9n12.h
-#include mach/at91_pmc.h
 #include mach/cpu.h
 
 #include board.h
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index f77fae5..6fbda1a 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -10,6 +10,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -19,7 +20,6 @@
 #include mach/cpu.h
 #include mach/at91_dbgu.h
 #include mach/at91sam9rl.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index e631fec..83fc6b3 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -8,12 +8,12 @@
 
 #include linux/module.h
 #include linux/dma-mapping.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include 

Re: [RFC 00/50] ARM: at91: move to common clk framework

2013-06-07 Thread Nicolas Ferre

On 07/06/2013 10:34, Boris BREZILLON :

Hello,

This patch series is a proposal to move at91 clock implementation
to common clk framework.


Before discussion begins I would like to give my kudos to you Boris! 
This is huge work and I thank you for it: It is so great!


I am sure that Jean-Christophe will have his idea on that because he 
told me that he thought a little bit about that, but I am sure that we 
will come to a quick and seamlessly integration soon.


(Hey, I know it is not technical email, but I am so exited to see this 
happen that the noise worth it! ;-))



Most of the clock provided by the PMC (Power Management Controller) are
implemented :
- main clock (main oscillator)
- pll clocks
- master clock
- programmable clocks
- utmi clock
- peripheral clocks
- system clocks

This implementation is compatible with device tree: the goal is
to define the whole clock tree in the device tree (all currently
available dt SoCs and boards are patched to support dt clocks).
Please feel free to comment the dt bindinds (I'm not sure about the
name I choose or the position of clock nodes: children of pmc node).

I removed the register_clocks function in SoC supporting dt boards only:
- at91sam9x5 SoCs
- at91sam9n12 SoC
- sama5d3 SoCs

This patch series also update at91 drivers calling clk_enable/disable
instead of the preferred clk_prepare_enable/disable_unprepare functions.


I know there are a lot of cleanup in progress for at91 arch, so please tell
me if you think this transition to common clk framework should wait.

This patch series has been tested on Kizbox (sam9g20 SoC) board using device
tree. It compiles for other SoCs and both with and without dt support, but it
has not been tested.

The clocks rate/parent change has not been tested.

Best Regards,
Boris

Boris BREZILLON (50):
   ARM: at91: move arch/arm/mach-at91/include/mach/at91_pmc.h to
 include/linux/clk/at91.h
   ARM: at91: add PMC main clock using common clk framework.
   ARM: at91: add PMC pll clocks support using common clk framework.
   ARM: at91: add PMC master clock support using common clk framework.
   ARM: at91: add PMC system clocks support using common clk framework.
   ARM: at91: add PMC peripheral clocks support using common clk
 framework.
   ARM: at91: add PMC programmable clocks support using common clk
 framework.
   ARM: at91: add PMC utmi clock support using common clk framework.
   ARM: at91: add PMC usb clock support using common clk framework.
   ARM: at91: add PMC smd clock support using common clk framework.
   ARM: at91: add PMC clk device tree binding doc.
   ARM: at91: move to common clk framework.
   ARM: at91: move at91rm9200 SoC to common clk framework.
   ARM: at91: move at91sam9260 SoC to common clk framework.
   ARM: at91: move at91sam9263 SoC to common clk framework.
   ARM: at91: move at91sam9263 SoC to common clk framework.
   ARM: at91: move at91sam9g45 SoC to common clk framework.
   ARM: at91: move at91sam9n12 SoC to common clk framework.
   ARM: at91: move at91sam9rl SoC to common clk framework.
   ARM: at91: move at91sam9x5 SoCs to common clk framework.
   ARM: at91: move at91sam9 SoCs to common clk framework.
   ARM: at91: move sama5d3 SoCs to common clk framework.
   ARM: at91: move at91rm9200 non dt boards to common clk framework.
   ARM: at91: move at91sam9 non dt boards to common clk framework.
   ARM: at91: move pit timer to common clk framework.
   ARM: at91/tc/clocksource: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   at_hdmac: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   ASoC: atmel-ssc: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   mmc: atmel-mci: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   pwm: atmel-tcb: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   tty: atmel_serial: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   usb: gadget: at91_udc: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   drivers/usb/host/ehci-atmel.c: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   USB: ohci-at91: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   ARM: at91/avr32/atmel_lcdfb: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   ARM: at91/dt: move at91rm9200 SoC to clk framework.
   ARM: at91/dt: move at91sam9260 SoC to common clk framework.
   ARM: at91/dt: move at91sam9263 SoC to common clk framework.
   ARM: at91/dt: move at91sam9g45 SoC to common clk framework.
   ARM: at91/dt: move at91sam9n12 SoC to common clk framework.
   ARM: at91/dt: move at91sam9x5 SoCs to common clk framework.
   ARM: at91/dt: move at91sam9g20 SoC to common clk framework.
   ARM: at91/dt: move sama5d3 SoCs to common clk framework.
   ARM: at91/dt: move at91sam9260/sam9g20 boards to common clk
 framework.
   ARM: 

Re: Chipidea usb otg support for IMX/MXS (device functionality)

2013-06-07 Thread maxime.rip...@free-electrons.com
Hi Hector,

On Thu, May 30, 2013 at 06:17:47PM +0200, Hector Palacios wrote:
 Dear Maxime,
 
 On 05/29/2013 09:50 AM, maxime.rip...@free-electrons.com wrote:
 Hi,
 
 On Wed, May 29, 2013 at 07:11:30AM +, Chen Peter-B29397 wrote:
 
 Hello,
 
 Am I right in assuming that the MXS USB on-the-go port does not currently
 support the
 device (gadget) functionality?
 Anybody out there working on that?
 
 
 As far as I know, Maxime Ripard may already let the chipidea durl-role 
 function
 work ok at mx28. It may need my chipidea otg patch
 
 https://github.com/hzpeterchen/linux-usb.git
 
 Indeed, I've been using the patchset Add tested id switch and vbus
 connect detect support for Chipidea from Peter for quite some time on
 top of 3.9 and it works like a charm for the gadget mode on an MX28
 platform.
 
 BTW, Peter, I've seen that these patches are still not merged in 3.10,
 is there a reason for that? do you plan on sending a version rebased on
 top of 3.10 some time in the future? I tried to do the rebasing myself,
 but the chipidea driver seems to have changed quite heavily, which makes
 the process quite difficult when you don't know what you're doing :)
 
 I guess you didn't get rid of the 'possible circular locking
 dependency' you talked about at [1], right?

Indeed

 I experimented the same and also a BUG [2] after cable reconnection.
 Despite those, I ran a simple test of serial, ethernet, and
 mass_storage gadgets and they worked fine.

I never experienced the BUG you're mentionning, everything was working
fine except the circular dependency.

 I didn't use the new properties (phy_type, dr_mode...) in the DT of
 my mx28 platform, did you?

Neither did I.

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


Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote:
 From: Greg Kroah-Hartman gre...@linuxfoundation.org

[...]

 --- a/drivers/usb/serial/usb-serial.c
 +++ b/drivers/usb/serial/usb-serial.c
 @@ -37,6 +37,7 @@
  #include linux/usb.h
  #include linux/usb/serial.h
  #include linux/kfifo.h
 +#include linux/idr.h
  #include pl2303.h
  
  #define DRIVER_AUTHOR Greg Kroah-Hartman gre...@linuxfoundation.org
 @@ -49,72 +50,75 @@
 drivers depend on it.
  */
  
 -static struct usb_serial *serial_table[SERIAL_TTY_MINORS];
 +static DEFINE_IDR(serial_minors);
  static DEFINE_MUTEX(table_lock);
  static LIST_HEAD(usb_serial_driver_list);
  
  /*
 - * Look up the serial structure.  If it is found and it hasn't been
 + * Look up the serial port structure.  If it is found and it hasn't been
   * disconnected, return with its disc_mutex held and its refcount

Second sentence needs to be updated as well as it is the disc_mutex and
refcount of the owning usb_serial struct we're referring to.

   * incremented.  Otherwise return NULL.
   */
 -struct usb_serial *usb_serial_get_by_index(unsigned index)
 +struct usb_serial_port *usb_serial_port_get_by_minor(unsigned minor)
  {
 - struct usb_serial *serial;
 + struct usb_serial *serial = NULL;
 + struct usb_serial_port *port;
  
   mutex_lock(table_lock);
 - serial = serial_table[index];
 + port = idr_find(serial_minors, minor);
 + if (!port)
 + goto exit;
  
 - if (serial) {
 - mutex_lock(serial-disc_mutex);
 - if (serial-disconnected) {
 - mutex_unlock(serial-disc_mutex);
 - serial = NULL;
 - } else {
 - kref_get(serial-kref);
 - }
 + serial = port-serial;
 + mutex_lock(serial-disc_mutex);
 + if (serial-disconnected) {
 + mutex_unlock(serial-disc_mutex);
 + serial = NULL;

You want to set port rather than serial to NULL here now.

 + } else {
 + kref_get(serial-kref);
   }
 +exit:
   mutex_unlock(table_lock);
 - return serial;
 + return port;
  }
  
 -static struct usb_serial *get_free_serial(struct usb_serial *serial,
 - int num_ports, unsigned int *minor)
 +static int get_free_port(struct usb_serial_port *port)
  {
 - unsigned int i, j;
 - int good_spot;
 -
 - dev_dbg(serial-interface-dev, %s %d\n, __func__, num_ports);
 + int i;
  
 - *minor = 0;
   mutex_lock(table_lock);
 - for (i = 0; i  SERIAL_TTY_MINORS; ++i) {
 - if (serial_table[i])
 - continue;
 + i = idr_alloc(serial_minors, port, 0, 0, GFP_KERNEL);
 + if (i  0)
 + goto exit;
 + port-minor = i;
 +exit:
 + mutex_unlock(table_lock);
 + return i;
 +}
  
 - good_spot = 1;
 - for (j = 1; j = num_ports-1; ++j)
 - if ((i+j = SERIAL_TTY_MINORS) || (serial_table[i+j])) {
 - good_spot = 0;
 - i += j;
 - break;
 - }
 - if (good_spot == 0)
 - continue;
 +static int get_free_serial(struct usb_serial *serial, int num_ports)
 +{
 + unsigned int i;
 + unsigned int j;
 + int x;
  
 - *minor = i;
 - j = 0;
 - dev_dbg(serial-interface-dev, %s - minor base = %d\n, 
 __func__, *minor);
 - for (i = *minor; (i  (*minor + num_ports))  (i  
 SERIAL_TTY_MINORS); ++i, ++j) {
 - serial_table[i] = serial;
 - serial-port[j]-minor = i;
 - serial-port[j]-port_number = i - *minor;
 - }
 - mutex_unlock(table_lock);
 - return serial;
 + dev_dbg(serial-interface-dev, %s %d\n, __func__, num_ports);
 +
 + for (i = 0; i  num_ports; ++i) {
 + x = get_free_port(serial-port[i]);
 + if (x  0)
 + goto error;
 + serial-port[i]-port_number = i;
   }

What do you think about removing get_free_port altogether and simply
call idr_alloc directly in the loop above instead? This would have the
benefit of only acquiring the table_lock once per device, which would
also prevent the possibility of higher port numbers receiving smaller
minors (e.g. due to a parallel disconnect).

 + serial-minors_reserved = 1;
 + return 0;
 +error:
 + /* unwind the already allocated minors */
 + mutex_lock(table_lock);
 + for (j = 0; j  i; ++j)
 + idr_remove(serial_minors, serial-port[j]-minor);
   mutex_unlock(table_lock);
 - return NULL;
 + return x;
  }

[...]

 --- a/include/linux/usb/serial.h
 +++ b/include/linux/usb/serial.h
 @@ -21,7 +21,6 @@
  
  #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */
  #define SERIAL_TTY_MINORS254 /* loads of devices :) */
 -#define 

Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Fri, Jun 07, 2013 at 11:40:25AM +0200, Johan Hovold wrote:
 On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote:
  From: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 [...]
 
   /* Functions needed by other parts of the usbserial core */
  -extern struct usb_serial *usb_serial_get_by_index(unsigned int minor);
  +extern struct usb_serial_port *usb_serial_port_get_by_minor(unsigned int 
  minor);
 
 As Tobias already noted, this breaks the USB console driver. However, it
 looks like the call in that driver is not really needed and that
 therefore usb_serial_port_get_by_minor need not be exported at all.

Forget that last sentence. It is still needed, of course.

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


Re: [PATCH v2 0/3] Increase the number of USB to serial devices we can support at once

2013-06-07 Thread Tobias Winter
On 06/07/2013 08:00 AM, Tobias Winter wrote:
   CC  drivers/usb/serial/console.o
 drivers/usb/serial/console.c: In function ‘usb_console_setup’:
 drivers/usb/serial/console.c:111:2: error: implicit declaration of
 function ‘usb_serial_get_by_index’ [-Werror=implicit-function-declaration]
 drivers/usb/serial/console.c:111:9: warning: assignment makes pointer
 from integer without a cast [enabled by default]
 drivers/usb/serial/console.c:122:40: error: ‘struct usb_serial’ has no
 member named ‘minor’
 cc1: some warnings being treated as errors
 make[4]: *** [drivers/usb/serial/console.o] Error 1
 make[3]: *** [drivers/usb/serial] Error 2
 make[2]: *** [drivers/usb] Error 2
 make[1]: *** [drivers] Error 2
 make[1]: Leaving directory `/root/usb.git'
 make: *** [debian/stamp/build/kernel] Error 2

Despite that broken driver, I just gave it a try and the patchset works
as expected.

Thanks

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


Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Johan Hovold
On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote:
 From: Greg Kroah-Hartman gre...@linuxfoundation.org

 @@ -1040,11 +1044,10 @@ static int usb_serial_probe(struct usb_i
*/
   serial-disconnected = 1;
  
 - if (get_free_serial(serial, num_ports, minor) == NULL) {
 + if (get_free_serial(serial, num_ports)) {
   dev_err(ddev, No more free serial devices\n);
   goto probe_error;
   }
 - serial-minor = minor;

This gives a warning as minor is no longer initialised, but is still
used to initialise the console a bit further down.

usb_serial_console_init(minor);

Should probably just drop minor, and use serial-port[0]-minor instead.

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


Re: [RFC 00/50] ARM: at91: move to common clk framework

2013-06-07 Thread Gregory CLEMENT
On 06/07/2013 11:32 AM, boris brezillon wrote:
 On 07/06/2013 11:22, Nicolas Ferre wrote:
 On 07/06/2013 10:34, Boris BREZILLON :
 Hello,

 This patch series is a proposal to move at91 clock implementation
 to common clk framework.

 Before discussion begins I would like to give my kudos to you Boris! 
 This is huge work and I thank you for it: It is so great!

 I am sure that Jean-Christophe will have his idea on that because he 
 told me that he thought a little bit about that, but I am sure that we 
 will come to a quick and seamlessly integration soon.

 (Hey, I know it is not technical email, but I am so exited to see this 
 happen that the noise worth it! ;-))
 I received several notifications about filtered mails.
 Could you tell me if you received the whole series ?

I have just received this email. But since few days (or weeks) I have observed
a big latency on the LAKML. Sometime my emails were in the LAKML after 3 or 4
hours.

 And do you know why this could have been filtered ?

There is a filter which prevent to hijack a thread by changing the topic.
of course it is a problem for the patch set sent with git send-email. So for
this there is an exception if you have the word PATCH in your topic. But
it doesn't work with the work RFC. Maybe it is the word you have chosen. If
you are in this case then you can use [PATCH RFC ]

Regards

 
 

 Most of the clock provided by the PMC (Power Management Controller) are
 implemented :
 - main clock (main oscillator)
 - pll clocks
 - master clock
 - programmable clocks
 - utmi clock
 - peripheral clocks
 - system clocks

 This implementation is compatible with device tree: the goal is
 to define the whole clock tree in the device tree (all currently
 available dt SoCs and boards are patched to support dt clocks).
 Please feel free to comment the dt bindinds (I'm not sure about the
 name I choose or the position of clock nodes: children of pmc node).

 I removed the register_clocks function in SoC supporting dt boards only:
 - at91sam9x5 SoCs
 - at91sam9n12 SoC
 - sama5d3 SoCs

 This patch series also update at91 drivers calling clk_enable/disable
 instead of the preferred clk_prepare_enable/disable_unprepare functions.


 I know there are a lot of cleanup in progress for at91 arch, so 
 please tell
 me if you think this transition to common clk framework should wait.

 This patch series has been tested on Kizbox (sam9g20 SoC) board using 
 device
 tree. It compiles for other SoCs and both with and without dt 
 support, but it
 has not been tested.

 The clocks rate/parent change has not been tested.

 Best Regards,
 Boris

 Boris BREZILLON (50):
ARM: at91: move arch/arm/mach-at91/include/mach/at91_pmc.h to
  include/linux/clk/at91.h
ARM: at91: add PMC main clock using common clk framework.
ARM: at91: add PMC pll clocks support using common clk framework.
ARM: at91: add PMC master clock support using common clk framework.
ARM: at91: add PMC system clocks support using common clk framework.
ARM: at91: add PMC peripheral clocks support using common clk
  framework.
ARM: at91: add PMC programmable clocks support using common clk
  framework.
ARM: at91: add PMC utmi clock support using common clk framework.
ARM: at91: add PMC usb clock support using common clk framework.
ARM: at91: add PMC smd clock support using common clk framework.
ARM: at91: add PMC clk device tree binding doc.
ARM: at91: move to common clk framework.
ARM: at91: move at91rm9200 SoC to common clk framework.
ARM: at91: move at91sam9260 SoC to common clk framework.
ARM: at91: move at91sam9263 SoC to common clk framework.
ARM: at91: move at91sam9263 SoC to common clk framework.
ARM: at91: move at91sam9g45 SoC to common clk framework.
ARM: at91: move at91sam9n12 SoC to common clk framework.
ARM: at91: move at91sam9rl SoC to common clk framework.
ARM: at91: move at91sam9x5 SoCs to common clk framework.
ARM: at91: move at91sam9 SoCs to common clk framework.
ARM: at91: move sama5d3 SoCs to common clk framework.
ARM: at91: move at91rm9200 non dt boards to common clk framework.
ARM: at91: move at91sam9 non dt boards to common clk framework.
ARM: at91: move pit timer to common clk framework.
ARM: at91/tc/clocksource: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
at_hdmac: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
ASoC: atmel-ssc: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
mmc: atmel-mci: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
pwm: atmel-tcb: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
tty: atmel_serial: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
usb: gadget: at91_udc: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.

Re: [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code

2013-06-07 Thread Sergei Shtylyov

Hello.

On 07-06-2013 12:06, Simon Horman wrote:


Here's the set of 9 patches against the Simon Horman's 'renesas.git' repo,
'renesas-next-20130528' tag.  It was created to fix the shortcomings in the
R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches have
to touch both subtrees). The patches were conceived with the complete
bisectability goal in mind.



[1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 
code
[2/9] ehci-platform: add pre_setup() method to platform data
[3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
[4/9] phy-rcar-usb: remove EHCI internal buffer setup
[5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
[6/9] phy-rcar-usb: correct base address
[7/9] phy-rcar-usb: add platform data
[8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
[9/9] phy-rcar-usb: handle platform data



The patchset is completely ready to be merged now.



Can I confirm that the plan is for me to merge this code?


   Yes, that was the plan.


If so, I should be able to do so next week.


WBR, Sergei

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


Re: [RFC v2] xhci: fix dma mask setup in xhci.c

2013-06-07 Thread Mathias Nyman

On 06/07/2013 01:54 AM, Sarah Sharp wrote:

On Thu, Jun 06, 2013 at 09:37:51PM +0300, Andy Shevchenko wrote:

On Thu, Jun 6, 2013 at 5:21 PM, Xenia Ragiadakouburzalod...@gmail.com  wrote:

This patch adds a check on whether the host machine
supports the xHC DMA address mask and sets the DMA
mask for coherent DMA address allocation via an
explicit call to dma_set_coherent_mask().

According to DMA-API-HOWTO, if coherent DMA address
mask has not been set explicitly via dma_set_coherent_mask(),
and the driver calls dma_alloc_coherent() or
dma_pool_create() to allocate consistent DMA memory
blocks, the consistent DMA mapping interface will
return by default DMA addresses which are 32-bit
addressable.

Hence, if 64-bit DMA mapping is supported, it
is appropriate to call dma_set_coherent_mask()
with DMA_BIT_MASK(64) to take advantage of it.

Also, according to DMA-API-HOWTO, dma_set_coherent_mask()
is guaranteed to set successfully the same or a smaller
mask as dma_set_mask().


It looks for me overcomplicated.


Why?


We have *dma_mask and dma_coherent mask in the struct device.
First question, who is allocating memory for dma_mask?


The xHCI driver is allocating memory for the host hardware structures,
and the USB core is using the DMA mask of the host controller in order
to move USB buffers into bounce buffers as necessary.

The xHCI driver allocates memory from both DMA pools and with kmalloc.
We need both calls to dma_set_coherent_mask() and
dma_set_coherent_mask() to get 64-bit DMA addresses for both types of
memory.


Second, in case of dma_mask == NULL, dma_set_mask fails with -EIO. It
doesn't mean we have no support of this one. How do you handle this
case?


When would the dma_mask be NULL?  Note that xHCI PCI hosts *must* be
able to support DMA.


I think it's pretty simple to set dma_coherent_mask and then apply its
address to the dma_mask, because you set the same values anyway.


I'm not quite understanding what you want to do.  (I'll blame lack of
sleep, sorry.)  Can you write some pseudo code for me?



Andy explained his concern in more detail to me irl.

The beef is that the dma_mask is a pointer while dma_coherent_mask is a 
u64 value in struct device, and dma_set_mask() fails if dev-dma_mask 
doesn't point anywhere.


This is not a problem for PCI enumerated devices because PCI probe sets 
a default 32bit mask and makes the dma_mask of all new PCI devices point 
to this value.


For non-pci enumerated devices the device dma_mask may be NULL and 
dma_set_mask() may fail even if dma is supported on the host machine.


for example ehci-platform.c solves this by adding:

if (!dev-dev.dma_mask)
dev-dev.dma_mask = dev-dev.coherent_dma_mask;
if (!dev-dev.coherent_dma_mask)
dev-dev.coherent_dma_mask = DMA_BIT_MASK(32);

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


Re: [RFC 00/50] ARM: at91: move to common clk framework

2013-06-07 Thread boris brezillon

On 07/06/2013 11:22, Nicolas Ferre wrote:

On 07/06/2013 10:34, Boris BREZILLON :

Hello,

This patch series is a proposal to move at91 clock implementation
to common clk framework.


Before discussion begins I would like to give my kudos to you Boris! 
This is huge work and I thank you for it: It is so great!


I am sure that Jean-Christophe will have his idea on that because he 
told me that he thought a little bit about that, but I am sure that we 
will come to a quick and seamlessly integration soon.


(Hey, I know it is not technical email, but I am so exited to see this 
happen that the noise worth it! ;-))

I received several notifications about filtered mails.
Could you tell me if you received the whole series ?
And do you know why this could have been filtered ?





Most of the clock provided by the PMC (Power Management Controller) are
implemented :
- main clock (main oscillator)
- pll clocks
- master clock
- programmable clocks
- utmi clock
- peripheral clocks
- system clocks

This implementation is compatible with device tree: the goal is
to define the whole clock tree in the device tree (all currently
available dt SoCs and boards are patched to support dt clocks).
Please feel free to comment the dt bindinds (I'm not sure about the
name I choose or the position of clock nodes: children of pmc node).

I removed the register_clocks function in SoC supporting dt boards only:
- at91sam9x5 SoCs
- at91sam9n12 SoC
- sama5d3 SoCs

This patch series also update at91 drivers calling clk_enable/disable
instead of the preferred clk_prepare_enable/disable_unprepare functions.


I know there are a lot of cleanup in progress for at91 arch, so 
please tell

me if you think this transition to common clk framework should wait.

This patch series has been tested on Kizbox (sam9g20 SoC) board using 
device
tree. It compiles for other SoCs and both with and without dt 
support, but it

has not been tested.

The clocks rate/parent change has not been tested.

Best Regards,
Boris

Boris BREZILLON (50):
   ARM: at91: move arch/arm/mach-at91/include/mach/at91_pmc.h to
 include/linux/clk/at91.h
   ARM: at91: add PMC main clock using common clk framework.
   ARM: at91: add PMC pll clocks support using common clk framework.
   ARM: at91: add PMC master clock support using common clk framework.
   ARM: at91: add PMC system clocks support using common clk framework.
   ARM: at91: add PMC peripheral clocks support using common clk
 framework.
   ARM: at91: add PMC programmable clocks support using common clk
 framework.
   ARM: at91: add PMC utmi clock support using common clk framework.
   ARM: at91: add PMC usb clock support using common clk framework.
   ARM: at91: add PMC smd clock support using common clk framework.
   ARM: at91: add PMC clk device tree binding doc.
   ARM: at91: move to common clk framework.
   ARM: at91: move at91rm9200 SoC to common clk framework.
   ARM: at91: move at91sam9260 SoC to common clk framework.
   ARM: at91: move at91sam9263 SoC to common clk framework.
   ARM: at91: move at91sam9263 SoC to common clk framework.
   ARM: at91: move at91sam9g45 SoC to common clk framework.
   ARM: at91: move at91sam9n12 SoC to common clk framework.
   ARM: at91: move at91sam9rl SoC to common clk framework.
   ARM: at91: move at91sam9x5 SoCs to common clk framework.
   ARM: at91: move at91sam9 SoCs to common clk framework.
   ARM: at91: move sama5d3 SoCs to common clk framework.
   ARM: at91: move at91rm9200 non dt boards to common clk framework.
   ARM: at91: move at91sam9 non dt boards to common clk framework.
   ARM: at91: move pit timer to common clk framework.
   ARM: at91/tc/clocksource: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   at_hdmac: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   ASoC: atmel-ssc: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   mmc: atmel-mci: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   pwm: atmel-tcb: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   tty: atmel_serial: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   usb: gadget: at91_udc: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   drivers/usb/host/ehci-atmel.c: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   USB: ohci-at91: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   ARM: at91/avr32/atmel_lcdfb: replace clk_enable/disable with
 clk_prepare_enable/disable_unprepare.
   ARM: at91/dt: move at91rm9200 SoC to clk framework.
   ARM: at91/dt: move at91sam9260 SoC to common clk framework.
   ARM: at91/dt: move at91sam9263 SoC to common clk framework.
   ARM: at91/dt: move at91sam9g45 SoC to common clk framework.
   ARM: at91/dt: move at91sam9n12 SoC to common clk framework.
   ARM: at91/dt: move at91sam9x5 SoCs to common clk framework.
  

[PATCH] USB: serial/ftdi_sio.c Fix kernel oops

2013-06-07 Thread Lotfi Manseur
Handle null termios in ftdi_set_termios(), introduced in
commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
This has been corrected in the mainline by
commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
a816e3113b63753c330ca4751ea1d208e93e3015.

This is to be fixed in longterm 2.6.32.60 and 3.4.47.
This bug has been found with coccinelle.

Signed-off-by: Lotfi Manseur lotfi.mans...@imag.fr
Signed-off-by: Nicolas Palix nicolas.pa...@imag.fr
---
 drivers/usb/serial/ftdi_sio.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c374beb..615bd9e 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2364,7 +2364,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
 
cflag = termios-c_cflag;
 
-   if (old_termios-c_cflag == termios-c_cflag
+   if (old_termios
+old_termios-c_cflag == termios-c_cflag
 old_termios-c_ispeed == termios-c_ispeed
 old_termios-c_ospeed == termios-c_ospeed)
goto no_c_cflag_changes;
@@ -2373,7 +2374,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
   ftdi_sio_read_bulk_callback  - need to examine what this means -
   don't see any problems yet */
 
-   if ((old_termios-c_cflag  (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
+   if (old_termios 
+   (old_termios-c_cflag  (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
(termios-c_cflag  (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)))
goto no_data_parity_stop_changes;
 
-- 
1.7.9.5

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


Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops

2013-06-07 Thread Willy Tarreau
On Fri, Jun 07, 2013 at 03:14:32PM +0200, Lotfi Manseur wrote:
 Handle null termios in ftdi_set_termios(), introduced in
 commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
 This has been corrected in the mainline by
 commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
 a816e3113b63753c330ca4751ea1d208e93e3015.
 
 This is to be fixed in longterm 2.6.32.60 and 3.4.47.
 This bug has been found with coccinelle.

Thank you Lofti, I have queued it now.

Best regards,
Willy

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


Re: [RFC][PATCH 1/7] USB: OHCI: make ohci-exynos a separate driver

2013-06-07 Thread Arnd Bergmann
On Friday 07 June 2013 11:33:27 Manjunath Goudar wrote:
 
  #if!IS_ENABLED(CONFIG_USB_OHCI_HCD_PCI)  \
 !IS_ENABLED(CONFIG_USB_OHCI_HCD_PLATFORM)  \
 +   !IS_ENABLED(CONFIG_USB_OHCI_EXYNOS)  \
 !defined(PLATFORM_DRIVER) \
 !defined(OMAP1_PLATFORM_DRIVER)   \
 !defined(OMAP3_PLATFORM_DRIVER)   \
 @@ -1269,7 +1265,6 @@ MODULE_LICENSE (GPL);
 !defined(SM501_OHCI_DRIVER)  \
 !defined(TMIO_OHCI_DRIVER)  \
 !defined(S3C2410_PLATFORM_DRIVER)  \
 -   !defined(EXYNOS_PLATFORM_DRIVER)  \
 !defined(EP93XX_PLATFORM_DRIVER)  \
 !defined(AT91_PLATFORM_DRIVER)  \
 !defined(NXP_PLATFORM_DRIVER)  \

Hi Manjunath,

please note that Greg just merged my patch to remove this entire list and
the #error statement. The next time you rebase your patch, you will have
to remove this hunk in each of your patches.

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


Re: [RFC][PATCH 3/7] USB: OHCI: make ohci-omap3 a separate driver

2013-06-07 Thread Arnd Bergmann
On Friday 07 June 2013 11:33:29 Manjunath Goudar wrote:
 +   /*
 +   * RemoteWakeupConnected has to be set explicitly before
 +   * calling ohci_run. The reset value of RWC is 0.
 +   */

Just nitpicking, but you still use the wrong commenting style
occasionally. The '*' characters should always be aligned
vertically, like

   /*
* RemoteWakeupConnected has to be set explicitly before
* calling ohci_run. The reset value of RWC is 0.
*/

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


Re: [RFC][PATCH 7/7] USB: OHCI: make ohci-s3c2410 a separate driver

2013-06-07 Thread Arnd Bergmann
On Friday 07 June 2013 11:33:33 Manjunath Goudar wrote:
 
 +   ohci_setup(hcd);
 s3c2410_start_hc(dev, hcd);
  
 -   ohci_hcd_init(hcd_to_ohci(hcd));
 -

I'm not sure about this part: s3c2410_start_hc is where the clock gets
enabled, presumable we are not supposed to touch the ohci registers
before it gets called, so ohci_init() being called implicitly
by ohci_setup() seems like a bad idea.

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


Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops

2013-06-07 Thread Sergei Shtylyov

Hello.

On 06/07/2013 05:14 PM, Lotfi Manseur wrote:


Handle null termios in ftdi_set_termios(), introduced in
commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
This has been corrected in the mainline by
commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
a816e3113b63753c330ca4751ea1d208e93e3015.


   You should also give the summary lines of all mentioned commits in 
parens.



This is to be fixed in longterm 2.6.32.60 and 3.4.47.
This bug has been found with coccinelle.

Signed-off-by: Lotfi Manseur lotfi.mans...@imag.fr
Signed-off-by: Nicolas Palix nicolas.pa...@imag.fr


WBR, Sergei

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


Re: Linux USB file storage gadget with new UDC

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, victor yeo wrote:

 The hardware handles Set Address request, and i can see the address of
 the USB gadget being shown in Windows host. Here i attach the gadget
 driver log for the Device Descriptor Test - Addressed State. The
 test just failed after Get Configuration request.

I can't tell what's wrong.  You will have to use a USB bus analyzer.

 Another question, in ep0_complete():
 if (req-status == 0  req-context)
 ((fsg_routine_t) (req-context))(fsg);
 
 Is req-context pointing to a function in UDC driver?

No, it points to a function in g_file_storage.  The context pointer 
gets set in only place, in class_setup_req():

fsg-ep0req-context = received_cbi_adsc;

Alan Stern

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


Re: usbutils 006 release

2013-06-07 Thread Alan Stern
On Thu, 6 Jun 2013, Greg KH wrote:

 On Mon, Jul 09, 2012 at 11:22:22AM -0400, Alan Stern wrote:
  On Fri, 6 Jul 2012, Greg KH wrote:
  
   Here's the 006 release of usbutils.
   
   Some USB 3.0 updates, a new usb.ids file update, and a number of other
   fixes and updates for annoying problems that people had reported.  Full
   shortlog information is below if people are curious.
   
   The package can be downladed from kernel.org:
   http://www.kernel.org/pub/linux/utils/usb/usbutils/
   
   We've switched over to using git for development now, which makes things
   much easier than the old cvs tree.  The tree can be found on both
   kernel.org and github.com if you want to fork it and send us changes
   easier:
 http://git.kernel.org/?p=linux/kernel/git/gregkh/usbutils.git
  
  This link doesn't work for me.  Are you sure the repository is 
  installed at git.kernel.org?
 
 It wasn't, sorry, I've pushed it there now, and should show up in a few
 hours.

A mere eleven months late...  :-)

Alan Stern

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


[RFC PATCH 01/50] ARM: at91: move at91_pmc.h to include/linux/clk/at91.h

2013-06-07 Thread Boris BREZILLON
This patch moves at91_pmc.h header from machine specific directory
(arch/arm/mach-at91/include/mach/at91_pmc.h) to clk include directory
(include/linux/clk/at91.h).
We need this to avoid reference to machine specific headers in clk
drivers.
 

Signed-off-by: Boris BREZILLON b.brezil...@overkiz.com
---
 arch/arm/mach-at91/at91rm9200.c|2 +-
 arch/arm/mach-at91/at91sam9260.c   |2 +-
 arch/arm/mach-at91/at91sam9261.c   |2 +-
 arch/arm/mach-at91/at91sam9263.c   |2 +-
 arch/arm/mach-at91/at91sam9g45.c   |2 +-
 arch/arm/mach-at91/at91sam9n12.c   |2 +-
 arch/arm/mach-at91/at91sam9rl.c|2 +-
 arch/arm/mach-at91/at91sam9x5.c|2 +-
 arch/arm/mach-at91/clock.c |2 +-
 arch/arm/mach-at91/pm.c|2 +-
 arch/arm/mach-at91/pm_slowclock.S  |2 +-
 arch/arm/mach-at91/sama5d3.c   |2 +-
 arch/arm/mach-at91/setup.c |2 +-
 drivers/usb/gadget/atmel_usba_udc.c|2 +-
 .../mach/at91_pmc.h = include/linux/clk/at91.h|2 +-
 15 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index d193a40..6ea6de7 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -11,13 +11,13 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include asm/system_misc.h
 #include mach/at91rm9200.h
-#include mach/at91_pmc.h
 #include mach/at91_st.h
 #include mach/cpu.h
 
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index a8ce245..df32768 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -11,6 +11,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -20,7 +21,6 @@
 #include mach/cpu.h
 #include mach/at91_dbgu.h
 #include mach/at91sam9260.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 25efb5a..8a63b81 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -11,6 +11,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -19,7 +20,6 @@
 #include asm/system_misc.h
 #include mach/cpu.h
 #include mach/at91sam9261.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index f44ffd2..77b3c24 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -11,6 +11,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -18,7 +19,6 @@
 #include asm/mach/map.h
 #include asm/system_misc.h
 #include mach/at91sam9263.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 8b7fce0..31a1304 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -12,13 +12,13 @@
 
 #include linux/module.h
 #include linux/dma-mapping.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include asm/system_misc.h
 #include mach/at91sam9g45.h
-#include mach/at91_pmc.h
 #include mach/cpu.h
 
 #include at91_aic.h
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
index 13cdbcd..f9ff4d2 100644
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ b/arch/arm/mach-at91/at91sam9n12.c
@@ -8,12 +8,12 @@
 
 #include linux/module.h
 #include linux/dma-mapping.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include mach/at91sam9n12.h
-#include mach/at91_pmc.h
 #include mach/cpu.h
 
 #include board.h
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index f77fae5..6fbda1a 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -10,6 +10,7 @@
  */
 
 #include linux/module.h
+#include linux/clk/at91.h
 
 #include asm/proc-fns.h
 #include asm/irq.h
@@ -19,7 +20,6 @@
 #include mach/cpu.h
 #include mach/at91_dbgu.h
 #include mach/at91sam9rl.h
-#include mach/at91_pmc.h
 
 #include at91_aic.h
 #include at91_rstc.h
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index e631fec..83fc6b3 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -8,12 +8,12 @@
 
 #include linux/module.h
 #include linux/dma-mapping.h
+#include linux/clk/at91.h
 
 #include asm/irq.h
 #include asm/mach/arch.h
 #include asm/mach/map.h
 #include 

[RESEND RFC PATCH 00/50] ARM: at91: move to common clk framework

2013-06-07 Thread Boris BREZILLON
Hello,

Sorry for the noise, the first submission has been filtered.

This patch series is a proposal to move at91 clock implementation
to common clk framework.

Most of the clock provided by the PMC (Power Management Controller) are
implemented :
- main clock (main oscillator)
- pll clocks
- master clock
- programmable clocks
- utmi clock
- peripheral clocks
- system clocks

This implementation is compatible with device tree: the goal is
to define the whole clock tree in the device tree (all currently
available dt SoCs and boards are patched to support dt clocks).
Please feel free to comment the dt bindinds (I'm not sure about the
name I choose or the position of clock nodes: children of pmc node).

I removed the register_clocks function in SoC supporting dt boards only:
- at91sam9x5 SoCs
- at91sam9n12 SoC
- sama5d3 SoCs

This patch series also update at91 drivers calling clk_enable/disable
instead of the preferred clk_prepare_enable/disable_unprepare functions.


I know there are a lot of cleanup in progress for at91 arch, so please tell
me if you think this transition to common clk framework should wait.

This patch series has been tested on Kizbox (sam9g20 SoC) board using device
tree. It compiles for other SoCs and both with and without dt support, but it
has not been tested.

The clocks rate/parent change has not been tested.

Best Regards,
Boris

Boris BREZILLON (50):
  ARM: at91: move at91_pmc.h to include/linux/clk/at91.h
  ARM: at91: add PMC main clock
  ARM: at91: add PMC pll clocks
  ARM: at91: add PMC master clock
  ARM: at91: add PMC system clocks
  ARM: at91: add PMC peripheral clocks
  ARM: at91: add PMC programmable clocks
  ARM: at91: add PMC utmi clock support
  ARM: at91: add PMC usb clock support
  ARM: at91: add PMC smd clock support
  ARM: at91: add PMC clk device tree binding doc
  ARM: at91: move to common clk framework
  ARM: at91: move at91rm9200 SoC to new at91 clk implem
  ARM: at91: move at91sam9260 SoC to new at91 clk implem
  ARM: at91: move at91sam9263 SoC to new at91 clk implem
  ARM: at91: move at91sam9263 SoC to new at91 clk implem
  ARM: at91: move at91sam9g45 SoC to new at91 clk implem
  ARM: at91: move at91sam9n12 SoC to new at91 clk implem
  ARM: at91: move at91sam9rl SoC to new at91 clk implem
  ARM: at91: move at91sam9x5 SoCs to new at91 clk implem
  ARM: at91: move at91sam9 SoCs to new at91 clk implem
  ARM: at91: move sama5d3 SoCs to new at91 clk implem
  ARM: at91: move at91rm9200 boards to new at91 clk implem
  ARM: at91: move at91sam9 boards to new at91 clk implem
  ARM: at91: move pit timer to common clk framework
  ARM: at91/tc/clocksource: prepare clk before calling enable
  at_hdmac: prepare clk before calling enable
  ASoC: atmel-ssc: prepare clk before calling enable
  mmc: atmel-mci: prepare clk before calling enable
  pwm: atmel-tcb: prepare clk before calling enable
  tty: atmel_serial: prepare clk before calling enable
  usb: gadget: at91_udc: prepare clk before calling enable
  ehci-atmel.c: prepare clk before calling enable
  USB: ohci-at91: prepare clk before calling enable
  at91/avr32/atmel_lcdfb: prepare clk before calling enable
  ARM: at91/dt: move at91rm9200 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9260 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9263 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9g45 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9n12 SoC to new at91 clk implem
  ARM: at91/dt: move at91sam9x5 SoCs to new at91 clk implem
  ARM: at91/dt: move at91sam9g20 SoC to new at91 clk implem
  ARM: at91/dt: move sama5d3 SoCs to to new at91 clk implem
  ARM: at91/dt: move sam9260/sam9g20 boards to new at91 clk implem
  ARM: at91/dt: move rm9200 boards to new at91 clk implem
  ARM: at91/dt: move sam9263 boards to new at91 clk implem
  ARM: at91/dt: move sam9g45 boards to new at91 clk implem
  ARM: at91/dt: move sam9n12 boards to new at91 clk implem
  ARM: at91/dt: move sam9x5 boards to new at91 clk implem
  ARM: at91/dt: move sama5d3 boards to new at91 clk implem

 .../devicetree/bindings/clock/at91-clock.txt   |  247 +
 arch/arm/boot/dts/animeo_ip.dts|   17 +-
 arch/arm/boot/dts/at91-ariag25.dts |   17 +-
 arch/arm/boot/dts/at91rm9200.dtsi  |  133 +++
 arch/arm/boot/dts/at91rm9200ek.dts |   17 +-
 arch/arm/boot/dts/at91sam9260.dtsi |  144 ++-
 arch/arm/boot/dts/at91sam9263.dtsi |  135 +++
 arch/arm/boot/dts/at91sam9263ek.dts|   17 +-
 arch/arm/boot/dts/at91sam9g15.dtsi |   11 +
 arch/arm/boot/dts/at91sam9g20.dtsi |   37 +
 arch/arm/boot/dts/at91sam9g20ek_common.dtsi|   17 +-
 arch/arm/boot/dts/at91sam9g25.dtsi |3 +
 arch/arm/boot/dts/at91sam9g35.dtsi |   23 +
 arch/arm/boot/dts/at91sam9g45.dtsi |  157 
 arch/arm/boot/dts/at91sam9m10g45ek.dts |   17 +-
 

Re: [RFC v2] xhci: fix dma mask setup in xhci.c

2013-06-07 Thread Sarah Sharp
Adding Felipe.

Xenia, Felipe is the USB gadget maintainer, and also added code for
non-PCI xHCI hosts.  Felipe, Xenia is my summer intern through the FOSS
Outreach Program for Women: http://kernelnewbies.org/OPWIntro

Felipe, we're discussing the fact that the xHCI host currently does not
set up 64-bit coherent DMA, so we get 64-bit addresses for USB buffers,
but not xHCI data structures.  Xenia has a patch to fix it, which can be
found here: http://marc.info/?l=linux-usbm=137052855612729w=2

Andy thinks the patch has issues with non-PCI xHCI hosts.

On Fri, Jun 07, 2013 at 03:00:47PM +0300, Mathias Nyman wrote:
 Andy explained his concern in more detail to me irl.
 
 The beef is that the dma_mask is a pointer while dma_coherent_mask
 is a u64 value in struct device, and dma_set_mask() fails if
 dev-dma_mask doesn't point anywhere.
 
 This is not a problem for PCI enumerated devices because PCI probe
 sets a default 32bit mask and makes the dma_mask of all new PCI
 devices point to this value.
 
 For non-pci enumerated devices the device dma_mask may be NULL and
 dma_set_mask() may fail even if dma is supported on the host
 machine.
 
 for example ehci-platform.c solves this by adding:
 
 if (!dev-dev.dma_mask)
 dev-dev.dma_mask = dev-dev.coherent_dma_mask;
 if (!dev-dev.coherent_dma_mask)
 dev-dev.coherent_dma_mask = DMA_BIT_MASK(32);

So it sounds like xhci_plat_setup() in xhci-plat.c needs to do something
similar before it calls xhci_gen_setup().  Felipe, do you agree?

It's funny that the code worked before.  Perhaps setting the dma_mask
pointer should be a separate patch for stable?

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


Re: [RFC][PATCH 1/7] USB: OHCI: make ohci-exynos a separate driver

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, Manjunath Goudar wrote:

 Separate the  Samsung OHCI EXYNOS host controller driver from ohci-hcd
 host code so that it can be built as a separate driver module.
 This work is part of enabling multi-platform kernels on ARM.

 -static void exynos_ohci_phy_enable(struct exynos_ohci_hcd *exynos_ohci)
 +static void exynos_ohci_phy_enable(struct platform_device *pdev)
  {
 - struct platform_device *pdev = to_platform_device(exynos_ohci-dev);
 + struct exynos_ohci_hcd *exynos_ohci = platform_get_drvdata(pdev);

This is wrong.  platform_get_drvdata() will return the hcd, not the 
exynos_ohci_hcd structure.

 @@ -37,9 +51,9 @@ static void exynos_ohci_phy_enable(struct exynos_ohci_hcd 
 *exynos_ohci)
   exynos_ohci-pdata-phy_init(pdev, USB_PHY_TYPE_HOST);
  }
  
 -static void exynos_ohci_phy_disable(struct exynos_ohci_hcd *exynos_ohci)
 +static void exynos_ohci_phy_disable(struct platform_device *pdev)
  {
 - struct platform_device *pdev = to_platform_device(exynos_ohci-dev);
 + struct exynos_ohci_hcd *exynos_ohci = platform_get_drvdata(pdev);

Same problem here.

 @@ -121,15 +83,18 @@ static int exynos_ohci_probe(struct platform_device 
 *pdev)
   if (!pdev-dev.coherent_dma_mask)
   pdev-dev.coherent_dma_mask = DMA_BIT_MASK(32);
  
 - exynos_ohci = devm_kzalloc(pdev-dev, sizeof(struct exynos_ohci_hcd),
 - GFP_KERNEL);
 - if (!exynos_ohci)
 + hcd = usb_create_hcd(exynos_ohci_hc_driver,
 + pdev-dev, dev_name(pdev-dev));
 + if (!hcd) {
 + dev_err(pdev-dev, Unable to create HCD\n);
   return -ENOMEM;
  
   if (of_device_is_compatible(pdev-dev.of_node,
   samsung,exynos5440-ohci))
   goto skip_phy;
  
 + }

This close brace belongs with the previous if statement.

 @@ -146,7 +111,6 @@ static int exynos_ohci_probe(struct platform_device *pdev)
  
  skip_phy:
  
 - exynos_ohci-dev = pdev-dev;
  
   hcd = usb_create_hcd(exynos_ohci_hc_driver, pdev-dev,
   dev_name(pdev-dev));

This needs to be deleted, because it was done already.

Manjunath, I have already asked you to proof-read your patches before 
posting them.  Please do so.  New patches should _not_ have this kind 
of error.

 @@ -192,13 +155,11 @@ skip_phy:
   }
  
   if (exynos_ohci-otg)
 - exynos_ohci-otg-set_host(exynos_ohci-otg,
 - exynos_ohci-hcd-self);
 + exynos_ohci-otg-set_host(exynos_ohci-otg, hcd-self);
  
 - exynos_ohci_phy_enable(exynos_ohci);
 + exynos_ohci_phy_enable(pdev);

This call will not work, because you don't set pdev's platform_data
until later.  The call to platform_set_drvdata() must be moved before
this line.

  
 - ohci = hcd_to_ohci(hcd);
 - ohci_hcd_init(ohci);
 + ohci_setup(hcd);

There's no need to call ohci_setup(), because it will get called anyway
as the .reset member of the ohci_hc_driver structure.

Alan Stern

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


Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Greg KH
On Fri, Jun 07, 2013 at 12:00:47PM +0200, Johan Hovold wrote:
 On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote:
  From: Greg Kroah-Hartman gre...@linuxfoundation.org
 
  @@ -1040,11 +1044,10 @@ static int usb_serial_probe(struct usb_i
   */
  serial-disconnected = 1;
   
  -   if (get_free_serial(serial, num_ports, minor) == NULL) {
  +   if (get_free_serial(serial, num_ports)) {
  dev_err(ddev, No more free serial devices\n);
  goto probe_error;
  }
  -   serial-minor = minor;
 
 This gives a warning as minor is no longer initialised, but is still
 used to initialise the console a bit further down.
 
   usb_serial_console_init(minor);
 
 Should probably just drop minor, and use serial-port[0]-minor instead.

Ah crap, I knew I was going to have to convert the console code, but I
just forgot about it as I didn't have it selected so I didn't get any
build errors...

I'll go fix that up and do a v3 of the patches...

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


Re: [PATCH v2 0/3] Increase the number of USB to serial devices we can support at once

2013-06-07 Thread Greg KH
On Fri, Jun 07, 2013 at 11:55:59AM +0200, Tobias Winter wrote:
 On 06/07/2013 08:00 AM, Tobias Winter wrote:
CC  drivers/usb/serial/console.o
  drivers/usb/serial/console.c: In function ‘usb_console_setup’:
  drivers/usb/serial/console.c:111:2: error: implicit declaration of
  function ‘usb_serial_get_by_index’ [-Werror=implicit-function-declaration]
  drivers/usb/serial/console.c:111:9: warning: assignment makes pointer
  from integer without a cast [enabled by default]
  drivers/usb/serial/console.c:122:40: error: ‘struct usb_serial’ has no
  member named ‘minor’
  cc1: some warnings being treated as errors
  make[4]: *** [drivers/usb/serial/console.o] Error 1
  make[3]: *** [drivers/usb/serial] Error 2
  make[2]: *** [drivers/usb] Error 2
  make[1]: *** [drivers] Error 2
  make[1]: Leaving directory `/root/usb.git'
  make: *** [debian/stamp/build/kernel] Error 2
 
 Despite that broken driver, I just gave it a try and the patchset works
 as expected.

Thanks for testing, I forgot to update the console code, as no one sane
every runs it :)

I'll go fix that up now...

thanks,

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


Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops

2013-06-07 Thread Greg Kroah-Hartman
On Fri, Jun 07, 2013 at 03:14:32PM +0200, Lotfi Manseur wrote:
 Handle null termios in ftdi_set_termios(), introduced in
 commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
 This has been corrected in the mainline by
 commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
 a816e3113b63753c330ca4751ea1d208e93e3015.

Then why shouldn't we just include those commit instead of your patch,
which looks much different from these?

I'd much rather take the originals, not something else.

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


Re: [RFC][PATCH 2/7] USB: OHCI: make ohci-omap a separate driver

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, Manjunath Goudar wrote:

 Separate the  TI OHCI OMAP1/2 host controller driver from ohci-hcd
 host code so that it can be built as a separate driver module.
 This work is part of enabling multi-platform kernels on ARM.

 @@ -71,6 +77,10 @@ static struct clk *usb_dc_ck;
  static int host_enabled;
  static int host_initialized;

These two variables aren't used for anything.  You should get rid of 
them.

 @@ -201,8 +211,14 @@ static int ohci_omap_init(struct usb_hcd *hcd)
   ohci_to_hcd(ohci)-self.otg_port = config-otg;
   /* default/minimum OTG power budget:  8 mA */
   ohci_to_hcd(ohci)-power_budget = 8;
 + ohci-hc_control = OHCI_CTRL_RWC;
 + writel(OHCI_CTRL_RWC, ohci-regs-control);
   }
  
 + if (config-rwc) {
 + ohci-hc_control = OHCI_CTRL_RWC;
 + writel(OHCI_CTRL_RWC, ohci-regs-control);
 + }

It's better to have two tests.  Remove the two lines added to the
previous if block, and change this test to

if (config-otg || config-rwc) {

 @@ -281,14 +298,6 @@ static int ohci_omap_init(struct usb_hcd *hcd)
   return 0;
  }
  
 -static void ohci_omap_stop(struct usb_hcd *hcd)
 -{
 - dev_dbg(hcd-self.controller, stopping USB Controller\n);
 - ohci_stop(hcd);
 - omap_ohci_clock_power(0);

This last line seems to have gotten lost.  You need to add it to 
usb_hcd_omap_remove().

 @@ -354,8 +362,7 @@ static int usb_hcd_omap_probe (const struct hc_driver 
 *driver,
   goto err2;
   }
  
 - ohci = hcd_to_ohci(hcd);
 - ohci_hcd_init(ohci);
 + ohci_setup(hcd);

Not needed, since you call ohci_setup() from within ohci_omap_reset().

Alan Stern

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


Re: [RFC][PATCH 3/7] USB: OHCI: make ohci-omap3 a separate driver

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, Manjunath Goudar wrote:

 Separate the  TI OHCI OMAP3 host controller driver from ohci-hcd
 host code so that it can be built as a separate driver module.
 This work is part of enabling multi-platform kernels on ARM.

 @@ -185,7 +118,16 @@ static int ohci_hcd_omap3_probe(struct platform_device 
 *pdev)
   pm_runtime_enable(dev);
   pm_runtime_get_sync(dev);
  
 - ohci_hcd_init(hcd_to_ohci(hcd));
 + ohci = hcd_to_ohci(hcd);
 + /*
 + * RemoteWakeupConnected has to be set explicitly before
 + * calling ohci_run. The reset value of RWC is 0.
 + */
 + ohci-hc_control = OHCI_CTRL_RWC;
 + writel(OHCI_CTRL_RWC, ohci-regs-control);
 + dev_dbg(hcd-self.controller, starting OHCI controller\n);
 +
 + ohci_setup(hcd);

Don't call ohci_setup().

Apart from that (and the comment format), this is okay.

Alan Stern

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


Re: [PATCH v2 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Greg KH
On Fri, Jun 07, 2013 at 11:40:25AM +0200, Johan Hovold wrote:
 On Thu, Jun 06, 2013 at 10:31:21AM -0700, Greg KH wrote:
  From: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 [...]
 
  --- a/drivers/usb/serial/usb-serial.c
  +++ b/drivers/usb/serial/usb-serial.c
  @@ -37,6 +37,7 @@
   #include linux/usb.h
   #include linux/usb/serial.h
   #include linux/kfifo.h
  +#include linux/idr.h
   #include pl2303.h
   
   #define DRIVER_AUTHOR Greg Kroah-Hartman gre...@linuxfoundation.org
  @@ -49,72 +50,75 @@
  drivers depend on it.
   */
   
  -static struct usb_serial *serial_table[SERIAL_TTY_MINORS];
  +static DEFINE_IDR(serial_minors);
   static DEFINE_MUTEX(table_lock);
   static LIST_HEAD(usb_serial_driver_list);
   
   /*
  - * Look up the serial structure.  If it is found and it hasn't been
  + * Look up the serial port structure.  If it is found and it hasn't been
* disconnected, return with its disc_mutex held and its refcount
 
 Second sentence needs to be updated as well as it is the disc_mutex and
 refcount of the owning usb_serial struct we're referring to.

Good point, now updated.

* incremented.  Otherwise return NULL.
*/
  -struct usb_serial *usb_serial_get_by_index(unsigned index)
  +struct usb_serial_port *usb_serial_port_get_by_minor(unsigned minor)
   {
  -   struct usb_serial *serial;
  +   struct usb_serial *serial = NULL;
  +   struct usb_serial_port *port;
   
  mutex_lock(table_lock);
  -   serial = serial_table[index];
  +   port = idr_find(serial_minors, minor);
  +   if (!port)
  +   goto exit;
   
  -   if (serial) {
  -   mutex_lock(serial-disc_mutex);
  -   if (serial-disconnected) {
  -   mutex_unlock(serial-disc_mutex);
  -   serial = NULL;
  -   } else {
  -   kref_get(serial-kref);
  -   }
  +   serial = port-serial;
  +   mutex_lock(serial-disc_mutex);
  +   if (serial-disconnected) {
  +   mutex_unlock(serial-disc_mutex);
  +   serial = NULL;
 
 You want to set port rather than serial to NULL here now.

Good eye, now fixed.

  +   } else {
  +   kref_get(serial-kref);
  }
  +exit:
  mutex_unlock(table_lock);
  -   return serial;
  +   return port;
   }
   
  -static struct usb_serial *get_free_serial(struct usb_serial *serial,
  -   int num_ports, unsigned int *minor)
  +static int get_free_port(struct usb_serial_port *port)
   {
  -   unsigned int i, j;
  -   int good_spot;
  -
  -   dev_dbg(serial-interface-dev, %s %d\n, __func__, num_ports);
  +   int i;
   
  -   *minor = 0;
  mutex_lock(table_lock);
  -   for (i = 0; i  SERIAL_TTY_MINORS; ++i) {
  -   if (serial_table[i])
  -   continue;
  +   i = idr_alloc(serial_minors, port, 0, 0, GFP_KERNEL);
  +   if (i  0)
  +   goto exit;
  +   port-minor = i;
  +exit:
  +   mutex_unlock(table_lock);
  +   return i;
  +}
   
  -   good_spot = 1;
  -   for (j = 1; j = num_ports-1; ++j)
  -   if ((i+j = SERIAL_TTY_MINORS) || (serial_table[i+j])) {
  -   good_spot = 0;
  -   i += j;
  -   break;
  -   }
  -   if (good_spot == 0)
  -   continue;
  +static int get_free_serial(struct usb_serial *serial, int num_ports)
  +{
  +   unsigned int i;
  +   unsigned int j;
  +   int x;
   
  -   *minor = i;
  -   j = 0;
  -   dev_dbg(serial-interface-dev, %s - minor base = %d\n, 
  __func__, *minor);
  -   for (i = *minor; (i  (*minor + num_ports))  (i  
  SERIAL_TTY_MINORS); ++i, ++j) {
  -   serial_table[i] = serial;
  -   serial-port[j]-minor = i;
  -   serial-port[j]-port_number = i - *minor;
  -   }
  -   mutex_unlock(table_lock);
  -   return serial;
  +   dev_dbg(serial-interface-dev, %s %d\n, __func__, num_ports);
  +
  +   for (i = 0; i  num_ports; ++i) {
  +   x = get_free_port(serial-port[i]);
  +   if (x  0)
  +   goto error;
  +   serial-port[i]-port_number = i;
  }
 
 What do you think about removing get_free_port altogether and simply
 call idr_alloc directly in the loop above instead? This would have the
 benefit of only acquiring the table_lock once per device, which would
 also prevent the possibility of higher port numbers receiving smaller
 minors (e.g. due to a parallel disconnect).

That's a good idea.  I've also renamed this function to allocate_minors
as that's what it really is doing.

thanks,

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


[PATCH v3 2/3] USB: serial: make minor allocation dynamic

2013-06-07 Thread Greg KH
From: Greg Kroah-Hartman gre...@linuxfoundation.org

This moves the allocation of minor device numbers from a static array to
be dynamic, using the idr interface.  This means that you could
potentially get gaps in a minor number range for a single USB serial
device with multiple ports, but all should still work properly.

We remove the 'minor' field from the usb_serial structure, as it no
longer makes any sense for it (use the field in the usb_serial_port
structure if you really want to know this number), and take the fact
that we were overloading a number in this field to determine if we had
initialized the minor numbers or not, and just use a flag variable
instead.

Note, we still have the limitation of 255 USB to serial devices in the
system, as that is all we are registering with the TTY layer at this
point in time.

Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
Changes v2 - v3:
  - fixed up comments about usb_serial_get_by_minor()
  - fixed error case in usb_serial_get_by_minor()
  - folded get_free_port() into get_free_serial()
  - renamed get_free_serial() to allocate_minors()
  - fixed console.c build breakage
  - properly pass in minor port number to usb_serial_console_init()


 drivers/staging/serqt_usb2/serqt_usb2.c |   15 +---
 drivers/usb/serial/ark3116.c|2 
 drivers/usb/serial/console.c|6 -
 drivers/usb/serial/f81232.c |2 
 drivers/usb/serial/io_edgeport.c|2 
 drivers/usb/serial/io_ti.c  |2 
 drivers/usb/serial/mos7720.c|2 
 drivers/usb/serial/mos7840.c|7 -
 drivers/usb/serial/opticon.c|2 
 drivers/usb/serial/pl2303.c |2 
 drivers/usb/serial/quatech2.c   |2 
 drivers/usb/serial/ssu100.c |2 
 drivers/usb/serial/ti_usb_3410_5052.c   |2 
 drivers/usb/serial/usb-serial.c |  119 ++--
 drivers/usb/serial/usb_wwan.c   |2 
 drivers/usb/serial/whiteheat.c  |2 
 include/linux/usb/serial.h  |6 -
 17 files changed, 80 insertions(+), 97 deletions(-)

--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -906,7 +906,7 @@ static int qt_open(struct tty_struct *tt
qt_submit_urb_from_open(serial, port);
}
 
-   dev_dbg(port-dev, serial number is %d\n, port-serial-minor);
+   dev_dbg(port-dev, minor number is %d\n, port-minor);
dev_dbg(port-dev,
Bulkin endpoint is %d\n, port-bulk_in_endpointAddress);
dev_dbg(port-dev,
@@ -1002,7 +1002,7 @@ static void qt_close(struct usb_serial_p
status = 0;
 
tty = tty_port_tty_get(port-port);
-   index = tty-index - serial-minor;
+   index = port-port_number;
 
qt_port = qt_get_port_private(port);
port0 = qt_get_port_private(serial-port[0]);
@@ -1129,12 +1129,11 @@ static int qt_ioctl(struct tty_struct *t
 {
struct usb_serial_port *port = tty-driver_data;
struct quatech_port *qt_port = qt_get_port_private(port);
-   struct usb_serial *serial = get_usb_serial(port, __func__);
unsigned int index;
 
dev_dbg(port-dev, %s cmd 0x%04x\n, __func__, cmd);
 
-   index = tty-index - serial-minor;
+   index = port-port_number;
 
if (cmd == TIOCMIWAIT) {
while (qt_port != NULL) {
@@ -1180,7 +1179,7 @@ static void qt_set_termios(struct tty_st
int baud, divisor, remainder;
int status;
 
-   index = tty-index - port-serial-minor;
+   index = port-port_number;
 
switch (cflag  CSIZE) {
case CS5:
@@ -1296,7 +1295,7 @@ static void qt_break(struct tty_struct *
u16 index, onoff;
unsigned int result;
 
-   index = tty-index - serial-minor;
+   index = port-port_number;
 
qt_port = qt_get_port_private(port);
 
@@ -1325,7 +1324,7 @@ static inline int qt_real_tiocmget(struc
int status;
unsigned int index;
 
-   index = tty-index - serial-minor;
+   index = port-port_number;
status =
BoxGetRegister(port-serial, index, MODEM_CONTROL_REGISTER, mcr);
if (status = 0) {
@@ -1364,7 +1363,7 @@ static inline int qt_real_tiocmset(struc
int status;
unsigned int index;
 
-   index = tty-index - serial-minor;
+   index = port-port_number;
status =
BoxGetRegister(port-serial, index, MODEM_CONTROL_REGISTER, mcr);
if (status  0)
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -413,7 +413,7 @@ static int ark3116_ioctl(struct tty_stru
/* XXX: Some of these values are probably wrong. */
memset(serstruct, 0, sizeof(serstruct));
serstruct.type = PORT_16654;
-   serstruct.line = port-serial-minor;
+   serstruct.line = port-minor;
serstruct.port = 

[RFC PATCH 32/50] usb: gadget: at91_udc: prepare clk before calling enable

2013-06-07 Thread Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON b.brezil...@overkiz.com
---
 drivers/usb/gadget/at91_udc.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 073b938..ad03b6b 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -870,8 +870,8 @@ static void clk_on(struct at91_udc *udc)
if (udc-clocked)
return;
udc-clocked = 1;
-   clk_enable(udc-iclk);
-   clk_enable(udc-fclk);
+   clk_prepare_enable(udc-iclk);
+   clk_prepare_enable(udc-fclk);
 }
 
 static void clk_off(struct at91_udc *udc)
@@ -880,8 +880,8 @@ static void clk_off(struct at91_udc *udc)
return;
udc-clocked = 0;
udc-gadget.speed = USB_SPEED_UNKNOWN;
-   clk_disable(udc-fclk);
-   clk_disable(udc-iclk);
+   clk_disable_unprepare(udc-fclk);
+   clk_disable_unprepare(udc-iclk);
 }
 
 /*
@@ -1782,12 +1782,12 @@ static int at91udc_probe(struct platform_device *pdev)
}
 
/* don't do anything until we have both gadget driver and VBUS */
-   clk_enable(udc-iclk);
+   clk_prepare_enable(udc-iclk);
at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
at91_udp_write(udc, AT91_UDP_IDR, 0x);
/* Clear all pending interrupts - UDP may be used by bootloader. */
at91_udp_write(udc, AT91_UDP_ICR, 0x);
-   clk_disable(udc-iclk);
+   clk_disable_unprepare(udc-iclk);
 
/* request UDC and maybe VBUS irqs */
udc-udp_irq = platform_get_irq(pdev, 0);
-- 
1.7.9.5

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


[RFC PATCH 34/50] USB: ohci-at91: prepare clk before calling enable

2013-06-07 Thread Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON b.brezil...@overkiz.com
---
 drivers/usb/host/ohci-at91.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index a0cb44f..329d277 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -41,17 +41,17 @@ extern int usb_disabled(void);
 
 static void at91_start_clock(void)
 {
-   clk_enable(hclk);
-   clk_enable(iclk);
-   clk_enable(fclk);
+   clk_prepare_enable(hclk);
+   clk_prepare_enable(iclk);
+   clk_prepare_enable(fclk);
clocked = 1;
 }
 
 static void at91_stop_clock(void)
 {
-   clk_disable(fclk);
-   clk_disable(iclk);
-   clk_disable(hclk);
+   clk_disable_unprepare(fclk);
+   clk_disable_unprepare(iclk);
+   clk_disable_unprepare(hclk);
clocked = 0;
 }
 
-- 
1.7.9.5

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


[RFC PATCH 33/50] ehci-atmel.c: prepare clk before calling enable

2013-06-07 Thread Boris BREZILLON
Replace clk_enable/disable with clk_prepare_enable/disable_unprepare to
avoid common clk framework warnings.

Signed-off-by: Boris BREZILLON b.brezil...@overkiz.com
---
 drivers/usb/host/ehci-atmel.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 6642009..015ce6e 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -37,15 +37,15 @@ static int clocked;
 
 static void atmel_start_clock(void)
 {
-   clk_enable(iclk);
-   clk_enable(fclk);
+   clk_prepare_enable(iclk);
+   clk_prepare_enable(fclk);
clocked = 1;
 }
 
 static void atmel_stop_clock(void)
 {
-   clk_disable(fclk);
-   clk_disable(iclk);
+   clk_disable_unprepare(fclk);
+   clk_disable_unprepare(iclk);
clocked = 0;
 }
 
-- 
1.7.9.5

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


[PATCH] USB: cdc-acm: remove unneeded spin_lock_irqsave/restore on write path

2013-06-07 Thread Greg Kroah-Hartman

From: Greg Kroah-Hartman gre...@linuxfoundation.org

When writing data we were:
lock
do some work
unlock
call function
lock
do some work
unlock
return
return

It turns out, that function was only ever called in the one place, so
instead of locking/unlocking for no good reason, just inline the
function and only grab the lock once.

This has sped up the pathological case of sending 1 byte packets to a
loop-back cdc-acm device from 49600 bytes per second to 50100 bytes a
second on my workstation.  A tiny increase yes, but noticable, and now
the spinlock isn't the hottest thing on the perf graph anymore.  Yes, we
are still waiting for the hardware for the most part, but getting rid of
a spin_lock_irqsave() call for every packet is still a good thing.

And we end up deleting lines of code, always a win overall.

This was found by using a Teensy 3.0 device and the test program and
firmware located at:
http://www.pjrc.com/teensy/benchmark_usb_serial_receive.html

Reported-by: Paul Stoffregen p...@pjrc.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/class/cdc-acm.c |   51 +++-
 1 file changed, 18 insertions(+), 33 deletions(-)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -216,38 +216,6 @@ static int acm_start_wb(struct acm *acm,
return rc;
 }
 
-static int acm_write_start(struct acm *acm, int wbn)
-{
-   unsigned long flags;
-   struct acm_wb *wb = acm-wb[wbn];
-   int rc;
-
-   spin_lock_irqsave(acm-write_lock, flags);
-   if (!acm-dev) {
-   wb-use = 0;
-   spin_unlock_irqrestore(acm-write_lock, flags);
-   return -ENODEV;
-   }
-
-   dev_vdbg(acm-data-dev, %s - susp_count %d\n, __func__,
-   acm-susp_count);
-   usb_autopm_get_interface_async(acm-control);
-   if (acm-susp_count) {
-   if (!acm-delayed_wb)
-   acm-delayed_wb = wb;
-   else
-   usb_autopm_put_interface_async(acm-control);
-   spin_unlock_irqrestore(acm-write_lock, flags);
-   return 0;   /* A white lie */
-   }
-   usb_mark_last_busy(acm-dev);
-
-   rc = acm_start_wb(acm, wb);
-   spin_unlock_irqrestore(acm-write_lock, flags);
-
-   return rc;
-
-}
 /*
  * attributes exported through sysfs
  */
@@ -653,13 +621,30 @@ static int acm_tty_write(struct tty_stru
}
wb = acm-wb[wbn];
 
+   if (!acm-dev) {
+   wb-use = 0;
+   spin_unlock_irqrestore(acm-write_lock, flags);
+   return -ENODEV;
+   }
+
count = (count  acm-writesize) ? acm-writesize : count;
dev_vdbg(acm-data-dev, %s - write %d\n, __func__, count);
memcpy(wb-buf, buf, count);
wb-len = count;
spin_unlock_irqrestore(acm-write_lock, flags);
 
-   stat = acm_write_start(acm, wbn);
+   usb_autopm_get_interface_async(acm-control);
+   if (acm-susp_count) {
+   if (!acm-delayed_wb)
+   acm-delayed_wb = wb;
+   else
+   usb_autopm_put_interface_async(acm-control);
+   spin_unlock_irqrestore(acm-write_lock, flags);
+   return count;   /* A white lie */
+   }
+   usb_mark_last_busy(acm-dev);
+
+   stat = acm_start_wb(acm, wb);
if (stat  0)
return stat;
return count;
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH 4/7] USB: OHCI: make ohci-spear a separate driver

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, Manjunath Goudar wrote:

 Separate the  TI OHCI SPEAr host controller driver from ohci-hcd
 host code so that it can be built as a separate driver module.
 This work is part of enabling multi-platform kernels on ARM.

 @@ -151,16 +98,24 @@ static int spear_ohci_hcd_drv_probe(struct 
 platform_device *pdev)
   goto err_put_hcd;
   }
  
 - ohci_p = (struct spear_ohci *)hcd_to_ohci(hcd);
 - ohci_p-clk = usbh_clk;
 - spear_start_ohci(ohci_p);
 - ohci_hcd_init(hcd_to_ohci(hcd));
 + sohci_p = to_spear_ohci(hcd);
 + sohci_p-clk = usbh_clk;
 + hcd_to_ohci(hcd)-regs = hcd-regs;

This line isn't needed.  It is one of the first things that ohci_init() 
does.

 +
 + ohci_setup(hcd);

Don't call ohci_setup().

 + clk_prepare_enable(sohci_p-clk);
 +
 + ohci = hcd_to_ohci(hcd);
 +
 +#ifdef DEBUG
 + ohci_dump(ohci, 1);
 +#endif

I suspect this debugging stuff isn't needed any more.  You can get rid 
of it.

 @@ -188,13 +143,13 @@ static int spear_ohci_hcd_drv_suspend(struct 
 platform_device *dev,
  {
   struct usb_hcd *hcd = platform_get_drvdata(dev);
   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 - struct spear_ohci *ohci_p = to_spear_ohci(hcd);
 + struct spear_ohci *sohci_p = to_spear_ohci(hcd);
  
   if (time_before(jiffies, ohci-next_statechange))
   msleep(5);
   ohci-next_statechange = jiffies;
  
 - spear_stop_ohci(ohci_p);
 + clk_disable_unprepare(sohci_p-clk);
   return 0;
  }

This routine needs to call ohci_suspend() just before the 
clk_disable_unprepare().  I don't know how that got left out, but it 
looks like the same problem exists in several of the ohci glue files.  
I guess they should all be fixed at once, in a separate patch.

  
 @@ -202,13 +157,13 @@ static int spear_ohci_hcd_drv_resume(struct 
 platform_device *dev)
  {
   struct usb_hcd *hcd = platform_get_drvdata(dev);
   struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 - struct spear_ohci *ohci_p = to_spear_ohci(hcd);
 + struct spear_ohci *sohci_p = to_spear_ohci(hcd);
  
   if (time_before(jiffies, ohci-next_statechange))
   msleep(5);
   ohci-next_statechange = jiffies;
  
 - spear_start_ohci(ohci_p);
 +  clk_prepare_enable(sohci_p-clk);

You got an extra space character after the tab.

Alan Stern

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


Re: [PATCH] USB: cdc-acm: remove unneeded spin_lock_irqsave/restore on write path

2013-06-07 Thread Sergei Shtylyov

Hello.

On 06/07/2013 10:32 PM, Greg Kroah-Hartman wrote:


From: Greg Kroah-Hartman gre...@linuxfoundation.org

When writing data we were:
lock
do some work
unlock
call function
lock
do some work
unlock
return
return

It turns out, that function was only ever called in the one place, so
instead of locking/unlocking for no good reason, just inline the
function and only grab the lock once.

This has sped up the pathological case of sending 1 byte packets to a
loop-back cdc-acm device from 49600 bytes per second to 50100 bytes a
second on my workstation.  A tiny increase yes, but noticable, and now
the spinlock isn't the hottest thing on the perf graph anymore.  Yes, we
are still waiting for the hardware for the most part, but getting rid of
a spin_lock_irqsave() call for every packet is still a good thing.

And we end up deleting lines of code, always a win overall.

This was found by using a Teensy 3.0 device and the test program and
firmware located at:
http://www.pjrc.com/teensy/benchmark_usb_serial_receive.html

Reported-by: Paul Stoffregen p...@pjrc.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
  drivers/usb/class/cdc-acm.c |   51 
+++-
  1 file changed, 18 insertions(+), 33 deletions(-)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c

[...]

@@ -653,13 +621,30 @@ static int acm_tty_write(struct tty_stru
}
wb = acm-wb[wbn];
  
+	if (!acm-dev) {

+   wb-use = 0;
+   spin_unlock_irqrestore(acm-write_lock, flags);
+   return -ENODEV;
+   }
+
count = (count  acm-writesize) ? acm-writesize : count;
dev_vdbg(acm-data-dev, %s - write %d\n, __func__, count);
memcpy(wb-buf, buf, count);
wb-len = count;
spin_unlock_irqrestore(acm-write_lock, flags);
  
-	stat = acm_write_start(acm, wbn);

+   usb_autopm_get_interface_async(acm-control);
+   if (acm-susp_count) {
+   if (!acm-delayed_wb)
+   acm-delayed_wb = wb;
+   else
+   usb_autopm_put_interface_async(acm-control);
+   spin_unlock_irqrestore(acm-write_lock, flags);


   But you've already dropped it above the *if* and not taken again?


+   return count;   /* A white lie */
+   }
+   usb_mark_last_busy(acm-dev);
+
+   stat = acm_start_wb(acm, wb);
if (stat  0)
return stat;
return count;



WBR, Sergei

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


Re: [PATCH] USB: cdc-acm: remove unneeded spin_lock_irqsave/restore on write path

2013-06-07 Thread Greg Kroah-Hartman
On Fri, Jun 07, 2013 at 10:38:30PM +0400, Sergei Shtylyov wrote:
 Hello.
 
 On 06/07/2013 10:32 PM, Greg Kroah-Hartman wrote:
 
 From: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 When writing data we were:
  lock
  do some work
  unlock
  call function
  lock
  do some work
  unlock
  return
  return
 
 It turns out, that function was only ever called in the one place, so
 instead of locking/unlocking for no good reason, just inline the
 function and only grab the lock once.
 
 This has sped up the pathological case of sending 1 byte packets to a
 loop-back cdc-acm device from 49600 bytes per second to 50100 bytes a
 second on my workstation.  A tiny increase yes, but noticable, and now
 the spinlock isn't the hottest thing on the perf graph anymore.  Yes, we
 are still waiting for the hardware for the most part, but getting rid of
 a spin_lock_irqsave() call for every packet is still a good thing.
 
 And we end up deleting lines of code, always a win overall.
 
 This was found by using a Teensy 3.0 device and the test program and
 firmware located at:
  http://www.pjrc.com/teensy/benchmark_usb_serial_receive.html
 
 Reported-by: Paul Stoffregen p...@pjrc.com
 Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 ---
   drivers/usb/class/cdc-acm.c |   51 
  +++-
   1 file changed, 18 insertions(+), 33 deletions(-)
 
 --- a/drivers/usb/class/cdc-acm.c
 +++ b/drivers/usb/class/cdc-acm.c
 [...]
 @@ -653,13 +621,30 @@ static int acm_tty_write(struct tty_stru
  }
  wb = acm-wb[wbn];
 +if (!acm-dev) {
 +wb-use = 0;
 +spin_unlock_irqrestore(acm-write_lock, flags);
 +return -ENODEV;
 +}
 +
  count = (count  acm-writesize) ? acm-writesize : count;
  dev_vdbg(acm-data-dev, %s - write %d\n, __func__, count);
  memcpy(wb-buf, buf, count);
  wb-len = count;
  spin_unlock_irqrestore(acm-write_lock, flags);
 -stat = acm_write_start(acm, wbn);
 +usb_autopm_get_interface_async(acm-control);
 +if (acm-susp_count) {
 +if (!acm-delayed_wb)
 +acm-delayed_wb = wb;
 +else
 +usb_autopm_put_interface_async(acm-control);
 +spin_unlock_irqrestore(acm-write_lock, flags);
 
But you've already dropped it above the *if* and not taken again?

Oops, it needs to move down a bit further, let me respin this...

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


Re: [RFC][PATCH 5/7] USB: OHCI: export ohci_hub_control and ohci_hub_status_data

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, Manjunath Goudar wrote:

 In order to make ohci-at91 and ohci-s3c2410 as a separate driver,
 ohci_hub_control and ohci_hub_status_data symbol needs to be exported.
 This work is part of enabling multi-platform kernels on ARM.

No, we are not going to export those two routines.  You can copy the 
approach used by Stephen Warren in the ehci-tegra conversion.

Alan Stern

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


[PATCH v2] USB: cdc-acm: remove unneeded spin_lock_irqsave/restore on write path

2013-06-07 Thread Greg Kroah-Hartman
From: Greg Kroah-Hartman gre...@linuxfoundation.org

When writing data we were:
lock
do some work
unlock
call function
lock
do some work
unlock
return
return

It turns out, that function was only ever called in the one place, so
instead of locking/unlocking for no good reason, just inline the
function and only grab the lock once.

This has sped up the pathological case of sending 1 byte packets to a
loop-back cdc-acm device from 49600 bytes per second to 50100 bytes a
second on my workstation.  A tiny increase yes, but noticable, and now
the spinlock isn't the hottest thing on the perf graph anymore.  Yes, we
are still waiting for the hardware for the most part, but getting rid of
a spinlock_irq_save() call for every packet is still a good thing.

And we end up deleting lines of code, always a win overall.

This was found by using a Teensy 3.0 device and the test program and
firmware located at:
http://www.pjrc.com/teensy/benchmark_usb_serial_receive.html

Reported-by: Paul Stoffregen p...@pjrc.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 Changes v1 - v2:
   - move unlock farther down the call to where it needed to be.


 drivers/usb/class/cdc-acm.c |   52 
 1 file changed, 19 insertions(+), 33 deletions(-)

--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -216,38 +216,6 @@ static int acm_start_wb(struct acm *acm,
return rc;
 }
 
-static int acm_write_start(struct acm *acm, int wbn)
-{
-   unsigned long flags;
-   struct acm_wb *wb = acm-wb[wbn];
-   int rc;
-
-   spin_lock_irqsave(acm-write_lock, flags);
-   if (!acm-dev) {
-   wb-use = 0;
-   spin_unlock_irqrestore(acm-write_lock, flags);
-   return -ENODEV;
-   }
-
-   dev_vdbg(acm-data-dev, %s - susp_count %d\n, __func__,
-   acm-susp_count);
-   usb_autopm_get_interface_async(acm-control);
-   if (acm-susp_count) {
-   if (!acm-delayed_wb)
-   acm-delayed_wb = wb;
-   else
-   usb_autopm_put_interface_async(acm-control);
-   spin_unlock_irqrestore(acm-write_lock, flags);
-   return 0;   /* A white lie */
-   }
-   usb_mark_last_busy(acm-dev);
-
-   rc = acm_start_wb(acm, wb);
-   spin_unlock_irqrestore(acm-write_lock, flags);
-
-   return rc;
-
-}
 /*
  * attributes exported through sysfs
  */
@@ -653,13 +621,31 @@ static int acm_tty_write(struct tty_stru
}
wb = acm-wb[wbn];
 
+   if (!acm-dev) {
+   wb-use = 0;
+   spin_unlock_irqrestore(acm-write_lock, flags);
+   return -ENODEV;
+   }
+
count = (count  acm-writesize) ? acm-writesize : count;
dev_vdbg(acm-data-dev, %s - write %d\n, __func__, count);
memcpy(wb-buf, buf, count);
wb-len = count;
+
+   usb_autopm_get_interface_async(acm-control);
+   if (acm-susp_count) {
+   if (!acm-delayed_wb)
+   acm-delayed_wb = wb;
+   else
+   usb_autopm_put_interface_async(acm-control);
+   spin_unlock_irqrestore(acm-write_lock, flags);
+   return count;   /* A white lie */
+   }
+   usb_mark_last_busy(acm-dev);
+
+   stat = acm_start_wb(acm, wb);
spin_unlock_irqrestore(acm-write_lock, flags);
 
-   stat = acm_write_start(acm, wbn);
if (stat  0)
return stat;
return count;
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC][PATCH 6/7] USB: OHCI: make ohci-at91 a separate driver

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, Manjunath Goudar wrote:

 Separate the  TI OHCI Atmel host controller driver from ohci-hcd
 host code so that it can be built as a separate driver module.
 This work is part of enabling multi-platform kernels on ARM.

 --- a/drivers/usb/host/Kconfig
 +++ b/drivers/usb/host/Kconfig
 @@ -411,6 +411,14 @@ config USB_OHCI_HCD_SPEAR
Enables support for the on-chip OHCI controller on
ST SPEAr chips.
  
 +config USB_OHCI_HCD_AT91
 +tristate  Support for Atmel on-chip OHCI USB controller
 +depends on USB_OHCI_HCD  ARCH_AT91
 +default y
 +---help---
 +  Enables support for the on-chip OHCI controller on
 +  Atmel chips.

Notice the depends on line you added here?

 diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
 index a0cb44f..b4a88a6 100644
 --- a/drivers/usb/host/ohci-at91.c
 +++ b/drivers/usb/host/ohci-at91.c
 @@ -13,16 +13,25 @@
...
  #ifndef CONFIG_ARCH_AT91
  #error CONFIG_ARCH_AT91 must be defined.
  #endif

As a result of the depends on line, this test will never succeed.  
You can remove these three lines.

 @@ -111,6 +126,8 @@ static void usb_hcd_at91_remove (struct usb_hcd *, struct 
 platform_device *);
  static int usb_hcd_at91_probe(const struct hc_driver *driver,
   struct platform_device *pdev)
  {
 + struct at91_usbh_data   *board;

Tab character where it should be a space.

 + struct ohci_hcd *ohci;
   int retval;
   struct usb_hcd *hcd = NULL;
  
 @@ -163,8 +180,11 @@ static int usb_hcd_at91_probe(const struct hc_driver 
 *driver,
   goto err5;
   }
  
 + board = hcd-self.controller-platform_data;
 + ohci = hcd_to_ohci(hcd);
 + ohci-num_ports = board-ports;
   at91_start_hc(pdev);
 - ohci_hcd_init(hcd_to_ohci(hcd));
 + ohci_setup(hcd);

Don't call ohci_setup().

 @@ -727,3 +672,37 @@ static struct platform_driver ohci_hcd_at91_driver = {
   .of_match_table = of_match_ptr(at91_ohci_dt_ids),
   },
  };
 +
 +static int __init ohci_at91_init(void)
 +{
 + if (usb_disabled())
 + return -ENODEV;
 +
 + pr_info(%s:  DRIVER_DESC \n, hcd_name);
 + ohci_init_driver(ohci_at91_hc_driver, NULL);
 +
 + /*
 + * The Atmel HW has some unusual quirks, which require Atmel-specific
 + * workarounds. We override certain hc_driver functions here to
 + * achieve that. We explicitly do not enhance ohci_driver_overrides to
 + * allow this more easily, since this is an unusual case, and we don't
 + * want to encourage others to override these functions by making it
 + * too easy.
 + */
 +
 + ohci_at91_hc_driver.hub_status_data = ohci_at91_hub_status_data;
 + ohci_at91_hc_driver.hub_control = ohci_at91_hub_control;

Since the hub_status_data and hub_control routines aren't going to be
exported, you can't do it like this.  Instead, save the values of
ohci_at91_hc_driver.hub_status_data and ohci_at91_hc_driver.hub_control
before overwriting them.

Alan Stern

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


Re: [PATCH] USB: serial/ftdi_sio.c Fix kernel oops

2013-06-07 Thread Willy Tarreau
On Fri, Jun 07, 2013 at 10:30:09AM -0700, Greg Kroah-Hartman wrote:
 On Fri, Jun 07, 2013 at 03:14:32PM +0200, Lotfi Manseur wrote:
  Handle null termios in ftdi_set_termios(), introduced in
  commit 552f6bf1bb0eda0011c0525dd587aa9e7ba5b846
  This has been corrected in the mainline by
  commits c515598e0f5769916c31c00392cc2bfe6af74e55 and
  a816e3113b63753c330ca4751ea1d208e93e3015.
 
 Then why shouldn't we just include those commit instead of your patch,
 which looks much different from these?
 
 I'd much rather take the originals, not something else.

Indeed. I've checked, and the second commit was just cosmetic (silence
a warning reported by sparse for ptr == 0 introduced in the first one).

The context is minimally different (original commit introduces a jump
to a label whose context has changed). I tend to think that the merged
fix has less changes of being incorrectly applied, but given their
triviality we could very well merge the original ones instead, and
keep initial authorship BTW.

Willy

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


Re: [RFC][PATCH 7/7] USB: OHCI: make ohci-s3c2410 a separate driver

2013-06-07 Thread Alan Stern
On Fri, 7 Jun 2013, Manjunath Goudar wrote:

 Separate the Samsung OHCI S3C host controller driver from ohci-hcd
 host code so that it can be built as a separate driver module.
 This work is part of enabling multi-platform kernels on ARM.

 @@ -371,10 +384,9 @@ static int usb_hcd_s3c2410_probe(const struct hc_driver 
 *driver,
   goto err_put;
   }
  
 + ohci_setup(hcd);

Don't call ohci_setup().

 @@ -532,4 +480,36 @@ static struct platform_driver ohci_hcd_s3c2410_driver = {
   },
  };
  
 +static int __init ohci_s3c_init(void)
 +{
 + if (usb_disabled())
 + return -ENODEV;
 +
 + pr_info(%s:  DRIVER_DESC \n, hcd_name);
 + ohci_init_driver(ohci_s3c2410_hc_driver, NULL);
 +
 + /*
 + * The Samsung HW has some unusual quirks, which require Sumsung-specific
 + * workarounds. We override certain hc_driver functions here to
 + * achieve that. We explicitly do not enhance ohci_driver_overrides to
 + * allow this more easily, since this is an unusual case, and we don't
 + * want to encourage others to override these functions by making it
 + * too easy.
 + */
 +
 + ohci_s3c2410_hc_driver.hub_status_data  = ohci_s3c2410_hub_status_data;
 + ohci_s3c2410_hc_driver.hub_control  = ohci_s3c2410_hub_control;

Like in ohci-at91, save the pointers before overwriting them.

Alan Stern

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


Re: [RFC 00/50] ARM: at91: move to common clk framework

2013-06-07 Thread boris brezillon

On 07/06/2013 12:14, Gregory CLEMENT wrote:

On 06/07/2013 11:32 AM, boris brezillon wrote:

On 07/06/2013 11:22, Nicolas Ferre wrote:

On 07/06/2013 10:34, Boris BREZILLON :

Hello,

This patch series is a proposal to move at91 clock implementation
to common clk framework.

Before discussion begins I would like to give my kudos to you Boris!
This is huge work and I thank you for it: It is so great!

I am sure that Jean-Christophe will have his idea on that because he
told me that he thought a little bit about that, but I am sure that we
will come to a quick and seamlessly integration soon.

(Hey, I know it is not technical email, but I am so exited to see this
happen that the noise worth it! ;-))

I received several notifications about filtered mails.
Could you tell me if you received the whole series ?

I have just received this email. But since few days (or weeks) I have observed
a big latency on the LAKML. Sometime my emails were in the LAKML after 3 or 4
hours.


And do you know why this could have been filtered ?

There is a filter which prevent to hijack a thread by changing the topic.
of course it is a problem for the patch set sent with git send-email. So for
this there is an exception if you have the word PATCH in your topic. But
it doesn't work with the work RFC. Maybe it is the word you have chosen. If
you are in this case then you can use [PATCH RFC ]

Thanks for the tip. It did the trick.

Best Regards,

Boris

Regards




Most of the clock provided by the PMC (Power Management Controller) are
implemented :
- main clock (main oscillator)
- pll clocks
- master clock
- programmable clocks
- utmi clock
- peripheral clocks
- system clocks

This implementation is compatible with device tree: the goal is
to define the whole clock tree in the device tree (all currently
available dt SoCs and boards are patched to support dt clocks).
Please feel free to comment the dt bindinds (I'm not sure about the
name I choose or the position of clock nodes: children of pmc node).

I removed the register_clocks function in SoC supporting dt boards only:
- at91sam9x5 SoCs
- at91sam9n12 SoC
- sama5d3 SoCs

This patch series also update at91 drivers calling clk_enable/disable
instead of the preferred clk_prepare_enable/disable_unprepare functions.


I know there are a lot of cleanup in progress for at91 arch, so
please tell
me if you think this transition to common clk framework should wait.

This patch series has been tested on Kizbox (sam9g20 SoC) board using
device
tree. It compiles for other SoCs and both with and without dt
support, but it
has not been tested.

The clocks rate/parent change has not been tested.

Best Regards,
Boris

Boris BREZILLON (50):
ARM: at91: move arch/arm/mach-at91/include/mach/at91_pmc.h to
  include/linux/clk/at91.h
ARM: at91: add PMC main clock using common clk framework.
ARM: at91: add PMC pll clocks support using common clk framework.
ARM: at91: add PMC master clock support using common clk framework.
ARM: at91: add PMC system clocks support using common clk framework.
ARM: at91: add PMC peripheral clocks support using common clk
  framework.
ARM: at91: add PMC programmable clocks support using common clk
  framework.
ARM: at91: add PMC utmi clock support using common clk framework.
ARM: at91: add PMC usb clock support using common clk framework.
ARM: at91: add PMC smd clock support using common clk framework.
ARM: at91: add PMC clk device tree binding doc.
ARM: at91: move to common clk framework.
ARM: at91: move at91rm9200 SoC to common clk framework.
ARM: at91: move at91sam9260 SoC to common clk framework.
ARM: at91: move at91sam9263 SoC to common clk framework.
ARM: at91: move at91sam9263 SoC to common clk framework.
ARM: at91: move at91sam9g45 SoC to common clk framework.
ARM: at91: move at91sam9n12 SoC to common clk framework.
ARM: at91: move at91sam9rl SoC to common clk framework.
ARM: at91: move at91sam9x5 SoCs to common clk framework.
ARM: at91: move at91sam9 SoCs to common clk framework.
ARM: at91: move sama5d3 SoCs to common clk framework.
ARM: at91: move at91rm9200 non dt boards to common clk framework.
ARM: at91: move at91sam9 non dt boards to common clk framework.
ARM: at91: move pit timer to common clk framework.
ARM: at91/tc/clocksource: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
at_hdmac: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
ASoC: atmel-ssc: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
mmc: atmel-mci: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
pwm: atmel-tcb: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
tty: atmel_serial: replace clk_enable/disable with
  clk_prepare_enable/disable_unprepare.
usb: gadget: at91_udc: replace clk_enable/disable with
  

Re: [RFC v2] xhci: fix dma mask setup in xhci.c

2013-06-07 Thread Felipe Balbi
Hi,

On Fri, Jun 07, 2013 at 10:19:23AM -0700, Sarah Sharp wrote:
 Adding Felipe.
 
 Xenia, Felipe is the USB gadget maintainer, and also added code for
 non-PCI xHCI hosts.  Felipe, Xenia is my summer intern through the FOSS
 Outreach Program for Women: http://kernelnewbies.org/OPWIntro

Hey, cool Sarah :-)

Welcome Xenia :-)

 Felipe, we're discussing the fact that the xHCI host currently does not
 set up 64-bit coherent DMA, so we get 64-bit addresses for USB buffers,
 but not xHCI data structures.  Xenia has a patch to fix it, which can be
 found here: http://marc.info/?l=linux-usbm=137052855612729w=2
 
 Andy thinks the patch has issues with non-PCI xHCI hosts.

Looking at the patch, I don't see why it would have any issues, unless
some HW engineer flipped the wrong bits in hcc_params, but that would be
a silicon bug anyway.

I don't have access to anything to test right now (on vacations, last
day :-( ) but I'll see if anyone from TI can help testing that patch.

Maybe Kishon can help us out  here ? Kishon, could you spend a few
minutes testing Xenia's patch on OMAP5 to make sure nothing goes wrong
with that platform.

Again, I can't see how it would fail.

 On Fri, Jun 07, 2013 at 03:00:47PM +0300, Mathias Nyman wrote:
  Andy explained his concern in more detail to me irl.
  
  The beef is that the dma_mask is a pointer while dma_coherent_mask
  is a u64 value in struct device, and dma_set_mask() fails if
  dev-dma_mask doesn't point anywhere.
  
  This is not a problem for PCI enumerated devices because PCI probe
  sets a default 32bit mask and makes the dma_mask of all new PCI
  devices point to this value.
  
  For non-pci enumerated devices the device dma_mask may be NULL and
  dma_set_mask() may fail even if dma is supported on the host
  machine.
  
  for example ehci-platform.c solves this by adding:
  
  if (!dev-dev.dma_mask)
  dev-dev.dma_mask = dev-dev.coherent_dma_mask;
  if (!dev-dev.coherent_dma_mask)
  dev-dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
 So it sounds like xhci_plat_setup() in xhci-plat.c needs to do something
 similar before it calls xhci_gen_setup().  Felipe, do you agree?

(now, after reading the whole thing...)

I'll agree with that :)

 It's funny that the code worked before.  Perhaps setting the dma_mask
 pointer should be a separate patch for stable?

sounds like a good plan to me :-)

-- 
balbi


signature.asc
Description: Digital signature


EHCI: read status register is very slow in ehci_irq

2013-06-07 Thread Ming Lei
Hi,

I found on my machine(lenovo T410), most of time only reading the status
register in the entry of ehci_irq may take 2~4 microseconds, and sometimes
it is extremely slow and the read can consume  100 microseconds.

I measure the time by adding two trace events around the below line in
entry of ehci_irq().

 status = ehci_readl(ehci, ehci-regs-status)

Looks it should be a platform-dependent issue and I didn't
observe that on some arm platform.

Could anyone give a hint about the problem?

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