Re: [PATCH V2] usb: xhci: add support for performing fake doorbell

2016-11-20 Thread Rafał Miłecki
Hi Mathias,

On 17 October 2016 at 22:30, Rafał Miłecki  wrote:
> From: Rafał Miłecki 
>
> Broadcom's Northstar XHCI controllers seem to need a special start
> procedure to work correctly. There isn't any official documentation of
> this, the problem is that controller doesn't detect any connected
> devices with default setup. Moreover connecting USB device to controller
> that doesn't run properly can cause SoC's watchdog issues.
>
> A workaround that was successfully tested on multiple devices is to
> perform a fake doorbell. This patch adds code for doing this and enables
> it on BCM4708 family.
>
> Signed-off-by: Rafał Miłecki 
> ---
> V2: Enable quirk for brcm,bcm4708 machines instead of adding separated binding
> for it. Thanks Rob for your comment on this.

Do you think you can pick & push this one? V2 follows Rob's suggestion
and he has some DT knowledge for sure, so I guess it should be OK.
--
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: Issue with Telit LE922 and cdc_mbim

2016-11-20 Thread Daniele Palmas
Hi Bjørn,

2016-11-16 9:50 GMT+01:00 Daniele Palmas :
> Hi Bjørn,
>
> 2016-11-15 19:56 GMT+01:00 Bjørn Mork :
>> Daniele Palmas  writes:
>>
>>> The problem is in cdc_ncm, function cdc_ncm_bind_common, line
>>>
>>> usleep_range(1, 2);
>>>
>>> It seems that LE922 needs an higher timeout; changing the line to
>>>
>>> usleep_range(7, 8);
>>>
>>> makes the modem to work fine.
>>
>> Extremely interesting!  As you probably noticed, that delay was recently
>> added as a workaround for the same problem on Sierra Wireless EM7455
>> modems.  I believe these are based on the Qualcomm MDM9230.  Which
>> chipset is the LE922 based on?  Is it also one of the newer Qualcom
>> chips?
>
> Yes, it is based on one of latest QC chipsets.
>
>>
>>
>>> I will submit a patch for this.
>>
>> Thanks. It would also be great if you could trigger some investigation
>> into the actual firmware issue.  It looks like the firmware returns
>> control to the driver before it's actually ready at this point of
>> initialisation.
>>
>
> Yeah, for sure I will ask for some investigation also on the firmware
> side, even though I don't have many expectations for this.
>
> It seems that, if the modem is attached to the host and then turned
> on, the previous delay is not enough. And then there seems also to be
> constraints on the application side (e.g. ModemManager).
>
> Currently I'm not going to submit a patch until things are more clear.

it turned out that resetting the interface in cdc_ncm_init after
getting the NTB parameters removes the need for the sleep, making the
modem to work fine.

I wonder if this is an acceptable solution and can be applied also for MC7455.

Regards,
Daniele

>
> Thanks for your help,
> Daniele
>
>>
>>
>>
>> Bjørn
--
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/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-20 Thread kbuild test robot
Hi Baolin,

[auto build test ERROR on next-20161117]
[cannot apply to balbi-usb/next usb/usb-testing v4.9-rc6 v4.9-rc5 v4.9-rc4 
v4.9-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Baolin-Wang/usb-host-plat-Enable-xhci-plat-runtime-PM/20161121-143535
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/usb/dwc3/host.c: In function 'dwc3_host_suspend':
>> drivers/usb/dwc3/host.c:158:10: error: implicit declaration of function 
>> 'pm_children_suspended' [-Werror=implicit-function-declaration]
 while (!pm_children_suspended(xhci) && --cnt > 0)
 ^
   cc1: some warnings being treated as errors

vim +/pm_children_suspended +158 drivers/usb/dwc3/host.c

   152  int ret, cnt = DWC3_HOST_SUSPEND_COUNT;
   153  
   154  /*
   155   * We need make sure the children of the xHCI device had been 
into
   156   * suspend state, or we will suspend xHCI device failed.
   157   */
 > 158  while (!pm_children_suspended(xhci) && --cnt > 0)
   159  msleep(DWC3_HOST_SUSPEND_TIMEOUT);
   160  
   161  if (cnt <= 0) {

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH v2 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-20 Thread Baolin Wang
For some mobile devices with strict power management, we also want to suspend
the host when the slave is detached for power saving. Thus we add the host
suspend/resume functions to support this requirement.

Signed-off-by: Baolin Wang 
---
Changes since v1:
 - Add pm_runtime.h head file to avoid kbuild error.
---
 drivers/usb/dwc3/Kconfig |7 ++
 drivers/usb/dwc3/core.c  |   26 +-
 drivers/usb/dwc3/core.h  |   15 +
 drivers/usb/dwc3/host.c  |   54 ++
 4 files changed, 101 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index a45b4f1..47bb2f3 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -47,6 +47,13 @@ config USB_DWC3_DUAL_ROLE
 
 endchoice
 
+config USB_DWC3_HOST_SUSPEND
+   bool "Choose if the DWC3 host (xhci) can be suspend/resume"
+   depends on USB_DWC3_HOST=y || USB_DWC3_DUAL_ROLE=y
+   help
+ We can suspend the host when the slave is detached for power saving,
+ and resume the host when one slave is attached.
+
 comment "Platform Glue Driver Support"
 
 config USB_DWC3_OMAP
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 9a4a5e4..7ad4bc3 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1091,6 +1091,7 @@ static int dwc3_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(dev);
pm_runtime_set_autosuspend_delay(dev, DWC3_DEFAULT_AUTOSUSPEND_DELAY);
pm_runtime_enable(dev);
+   pm_suspend_ignore_children(dev, true);
ret = pm_runtime_get_sync(dev);
if (ret < 0)
goto err1;
@@ -1215,15 +1216,27 @@ static int dwc3_remove(struct platform_device *pdev)
 static int dwc3_suspend_common(struct dwc3 *dwc)
 {
unsigned long   flags;
+   int ret;
 
switch (dwc->dr_mode) {
case USB_DR_MODE_PERIPHERAL:
+   spin_lock_irqsave(>lock, flags);
+   dwc3_gadget_suspend(dwc);
+   spin_unlock_irqrestore(>lock, flags);
+   break;
case USB_DR_MODE_OTG:
+   ret = dwc3_host_suspend(dwc);
+   if (ret)
+   return ret;
+
spin_lock_irqsave(>lock, flags);
dwc3_gadget_suspend(dwc);
spin_unlock_irqrestore(>lock, flags);
break;
case USB_DR_MODE_HOST:
+   ret = dwc3_host_suspend(dwc);
+   if (ret)
+   return ret;
default:
/* do nothing */
break;
@@ -1245,12 +1258,23 @@ static int dwc3_resume_common(struct dwc3 *dwc)
 
switch (dwc->dr_mode) {
case USB_DR_MODE_PERIPHERAL:
+   spin_lock_irqsave(>lock, flags);
+   dwc3_gadget_resume(dwc);
+   spin_unlock_irqrestore(>lock, flags);
+   break;
case USB_DR_MODE_OTG:
+   ret = dwc3_host_resume(dwc);
+   if (ret)
+   return ret;
+
spin_lock_irqsave(>lock, flags);
dwc3_gadget_resume(dwc);
spin_unlock_irqrestore(>lock, flags);
-   /* FALLTHROUGH */
+   break;
case USB_DR_MODE_HOST:
+   ret = dwc3_host_resume(dwc);
+   if (ret)
+   return ret;
default:
/* do nothing */
break;
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index b585a30..db41908 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -1226,4 +1226,19 @@ static inline void dwc3_ulpi_exit(struct dwc3 *dwc)
 { }
 #endif
 
+#if IS_ENABLED(CONFIG_USB_DWC3_HOST_SUSPEND)
+int dwc3_host_suspend(struct dwc3 *dwc);
+int dwc3_host_resume(struct dwc3 *dwc);
+#else
+static inline int dwc3_host_suspend(struct dwc3 *dwc)
+{
+   return 0;
+}
+
+static inline int dwc3_host_resume(struct dwc3 *dwc)
+{
+   return 0;
+}
+#endif
+
 #endif /* __DRIVERS_USB_DWC3_CORE_H */
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index ed82464..20e84fc 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -16,9 +16,13 @@
  */
 
 #include 
+#include 
 
 #include "core.h"
 
+#define DWC3_HOST_SUSPEND_COUNT100
+#define DWC3_HOST_SUSPEND_TIMEOUT  100
+
 static int dwc3_host_get_irq(struct dwc3 *dwc)
 {
struct platform_device  *dwc3_pdev = to_platform_device(dwc->dev);
@@ -130,3 +134,53 @@ void dwc3_host_exit(struct dwc3 *dwc)
  dev_name(>xhci->dev));
platform_device_unregister(dwc->xhci);
 }
+
+#ifdef CONFIG_USB_DWC3_HOST_SUSPEND
+int dwc3_host_suspend(struct dwc3 *dwc)
+{
+   struct device *xhci = >xhci->dev;
+   int ret, cnt = DWC3_HOST_SUSPEND_COUNT;
+
+   /*
+* We need make sure the children of the xHCI device had been into
+* suspend 

[PATCH v2 1/2] usb: host: plat: Enable xhci plat runtime PM

2016-11-20 Thread Baolin Wang
Enable the xhci plat runtime PM for parent device to suspend/resume xhci.

Signed-off-by: Baolin Wang 
---
Changes since v1:
 - No updates.
---
 drivers/usb/host/xhci-plat.c |   37 -
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index ed56bf9..13f86ad 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -246,6 +246,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
if (ret)
goto dealloc_usb2_hcd;
 
+   pm_runtime_set_active(>dev);
+   pm_runtime_enable(>dev);
+
return 0;
 
 
@@ -274,6 +277,7 @@ static int xhci_plat_remove(struct platform_device *dev)
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
struct clk *clk = xhci->clk;
 
+   pm_runtime_disable(>dev);
usb_remove_hcd(xhci->shared_hcd);
usb_phy_shutdown(hcd->usb_phy);
 
@@ -311,14 +315,37 @@ static int xhci_plat_resume(struct device *dev)
 
return xhci_resume(xhci, 0);
 }
+#endif /* CONFIG_PM_SLEEP */
+
+#ifdef CONFIG_PM
+static int xhci_plat_runtime_suspend(struct device *dev)
+{
+   struct usb_hcd  *hcd = dev_get_drvdata(dev);
+   struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+
+   return xhci_suspend(xhci, device_may_wakeup(dev));
+}
+
+static int xhci_plat_runtime_resume(struct device *dev)
+{
+   struct usb_hcd  *hcd = dev_get_drvdata(dev);
+   struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+
+   return xhci_resume(xhci, 0);
+}
+
+static int xhci_plat_runtime_idle(struct device *dev)
+{
+   return 0;
+}
+#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops xhci_plat_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)
+
+   SET_RUNTIME_PM_OPS(xhci_plat_runtime_suspend, xhci_plat_runtime_resume,
+  xhci_plat_runtime_idle)
 };
-#define DEV_PM_OPS (_plat_pm_ops)
-#else
-#define DEV_PM_OPS NULL
-#endif /* CONFIG_PM */
 
 static const struct acpi_device_id usb_xhci_acpi_match[] = {
/* XHCI-compliant USB Controller */
@@ -332,7 +359,7 @@ static int xhci_plat_resume(struct device *dev)
.remove = xhci_plat_remove,
.driver = {
.name = "xhci-hcd",
-   .pm = DEV_PM_OPS,
+   .pm = _plat_pm_ops,
.of_match_table = of_match_ptr(usb_xhci_of_match),
.acpi_match_table = ACPI_PTR(usb_xhci_acpi_match),
},
-- 
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 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-11-20 Thread Baolin Wang
On 18 November 2016 at 21:14, kbuild test robot  wrote:
> Hi Baolin,
>
> [auto build test ERROR on next-20161117]
> [cannot apply to balbi-usb/next usb/usb-testing v4.9-rc5 v4.9-rc4 v4.9-rc3 
> v4.9-rc5]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
>
> url:
> https://github.com/0day-ci/linux/commits/Baolin-Wang/usb-host-plat-Enable-xhci-plat-runtime-PM/20161118-202029
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All errors (new ones prefixed by >>):
>
>drivers/usb/dwc3/host.c: In function 'dwc3_host_suspend':
>>> drivers/usb/dwc3/host.c:157:10: error: implicit declaration of function 
>>> 'pm_children_suspended' [-Werror=implicit-function-declaration]
>  while (!pm_children_suspended(xhci) && --cnt > 0)
>  ^
>cc1: some warnings being treated as errors
>
> vim +/pm_children_suspended +157 drivers/usb/dwc3/host.c
>
>151  int ret, cnt = DWC3_HOST_SUSPEND_COUNT;
>152
>153  /*
>154   * We need make sure the children of the xHCI device had been 
> into
>155   * suspend state, or we will suspend xHCI device failed.
>156   */
>  > 157  while (!pm_children_suspended(xhci) && --cnt > 0)
>158  msleep(DWC3_HOST_SUSPEND_TIMEOUT);
>159
>160  if (cnt <= 0) {

I will send out new patch to fix this building error.

-- 
Baolin.wang
Best Regards
--
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 v3 10/10] ARM: dts: da850: add usb device node

2016-11-20 Thread David Lechner

On 11/07/2016 02:39 PM, Axel Haslam wrote:

This adds the ohci device node for the da850 soc.
It also enables it for the omapl138 hawk board.

Signed-off-by: Axel Haslam 
---
 arch/arm/boot/dts/da850-lcdk.dts | 8 
 arch/arm/boot/dts/da850.dtsi | 8 
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/da850-lcdk.dts b/arch/arm/boot/dts/da850-lcdk.dts
index 7b8ab21..aaf533e 100644
--- a/arch/arm/boot/dts/da850-lcdk.dts
+++ b/arch/arm/boot/dts/da850-lcdk.dts
@@ -86,6 +86,14 @@
};
 };

+_phy {
+   status = "okay";
+};
+
+ {
+   status = "okay";
+};
+
  {
pinctrl-names = "default";
pinctrl-0 = <_rxtx_pins>;
diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 2534aab..50e86da 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -405,6 +405,14 @@
>;
status = "disabled";
};
+   ohci: usb@0225000 {


In commit 2957e36e76c836b167e5e0c1edb578d8a9bd7af6 in the linux-davinci 
tree, the alias for the musb device is usb0. So, I think we should use 
usb1 here instead of ohci - or change the usb0 alias to musb.


https://git.kernel.org/cgit/linux/kernel/git/nsekhar/linux-davinci.git/commit/?h=v4.10/dt=2957e36e76c836b167e5e0c1edb578d8a9bd7af6


+   compatible = "ti,da830-ohci";
+   reg = <0x225000 0x1000>;
+   interrupts = <59>;
+   phys = <_phy 1>;
+   phy-names = "usb-phy";
+   status = "disabled";
+   };
gpio: gpio@226000 {
compatible = "ti,dm6441-gpio";
gpio-controller;



--
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 5/5] usb: dwc2: fix kernel-doc for dwc2_set_param

2016-11-20 Thread Stefan Wahren
Since there is no parameter @value replace it with @legacy.

Fixes: 05ee799f202 ("usb: dwc2: Move gadget settings into core_params")
Signed-off-by: Stefan Wahren 
---
 drivers/usb/dwc2/params.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 11fe68a..10407cb 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -320,7 +320,7 @@ static void dwc2_set_core_param(void *param, u8 size, u64 
value)
  * @size: The size of the core parameter in bytes, or 0 for bool.
  *
  * This function looks up @property and sets the @param to that value.
- * If the property doesn't exist it uses the passed-in @value. It will
+ * If the property doesn't exist it uses the passed-in @legacy value. It will
  * verify that the value falls between @min and @max. If it doesn't,
  * it will output an error and set the parameter to either @def or,
  * failing that, to @min.
-- 
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 2/5] usb: dwc2: fix dwc2_get_device_property for u8 and u16

2016-11-20 Thread Stefan Wahren
According to the Devicetree ePAPR [1] the datatypes u8 and u16 are
not defined. So using device_property_read_u16() would result in
a partial read of a 32-bit big-endian integer which is not intended.
So we better read the complete 32-bit value. This fixes a regression
on bcm2835 where the values for g-rx-fifo-size and g-np-tx-fifo-size
always read as zero:

  Invalid value 0 for param g-rx-fifo-size
  Invalid value 0 for param g-np-tx-fifo-size

[1] - http://elinux.org/images/c/cf/Power_ePAPR_APPROVED_v1.1.pdf

Fixes: 05ee799f202 ("usb: dwc2: Move gadget settings into core_params")
Signed-off-by: Stefan Wahren 
---
 drivers/usb/dwc2/params.c |   12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index fd5f7f8..2c7b624 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -247,8 +247,6 @@
 static void dwc2_get_device_property(struct dwc2_hsotg *hsotg,
 char *property, u8 size, u64 *value)
 {
-   u8 val8;
-   u16 val16;
u32 val32;
 
switch (size) {
@@ -256,17 +254,7 @@ static void dwc2_get_device_property(struct dwc2_hsotg 
*hsotg,
*value = device_property_read_bool(hsotg->dev, property);
break;
case 1:
-   if (device_property_read_u8(hsotg->dev, property, ))
-   return;
-
-   *value = val8;
-   break;
case 2:
-   if (device_property_read_u16(hsotg->dev, property, ))
-   return;
-
-   *value = val16;
-   break;
case 4:
if (device_property_read_u32(hsotg->dev, property, ))
return;
-- 
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 0/5] usb: dwc2: fix parameter handling

2016-11-20 Thread Stefan Wahren
This patch series fixes several parameter handling issues
found on bcm2835 in gadget mode. It's based on Felipe's USB next.

Stefan Wahren (5):
  usb: dwc2: Do not set host parameter in peripheral mode
  usb: dwc2: fix dwc2_get_device_property for u8 and u16
  usb: dwc2: fix default value for DMA support
  usb: dwc2: gadget: fix default value for gadget-dma-desc
  usb: dwc2: fix kernel-doc for dwc2_set_param

 drivers/usb/dwc2/params.c |   32 ++--
 1 file changed, 10 insertions(+), 22 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


[PATCH 3/5] usb: dwc2: fix default value for DMA support

2016-11-20 Thread Stefan Wahren
The current defaults for DMA results on a non-DMA platform in a unnecessary
error message:

  Invalid value 0 for param gadget-dma

So fix this by using dma_capable as default value.

Fixes: 9962b62f1be ("usb: dwc2: Deprecate g-use-dma binding")
Signed-off-by: Stefan Wahren 
---
 drivers/usb/dwc2/params.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 2c7b624..30b954e 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -1088,7 +1088,7 @@ static void dwc2_set_gadget_dma(struct dwc2_hsotg *hsotg)
/* Buffer DMA */
dwc2_set_param_bool(hsotg, >g_dma,
false, "gadget-dma",
-   true, false,
+   dma_capable, false,
dma_capable);
 
/* DMA Descriptor */
@@ -1118,7 +1118,7 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
 
dwc2_set_param_bool(hsotg, >host_dma,
false, "host-dma",
-   true, false,
+   dma_capable, false,
dma_capable);
dwc2_set_param_host_rx_fifo_size(hsotg,
params->host_rx_fifo_size);
-- 
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 1/5] usb: dwc2: Do not set host parameter in peripheral mode

2016-11-20 Thread Stefan Wahren
Since commit "usb: dwc2: Improve handling of host and device hwparams" the
host mode specific hardware parameter aren't initialized in peripheral mode
from the register settings anymore. So we better do not set them in this
case which avoids the following warnings on bcm2835:

  256 invalid for host_nperio_tx_fifo_size. Check HW configuration.
  512 invalid for host_perio_tx_fifo_size. Check HW configuration.

Fixes: 55e1040e424b ("usb: dwc2: Improve handling of host and device hwparams")
Signed-off-by: Stefan Wahren 
---
 drivers/usb/dwc2/params.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index a786256..fd5f7f8 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -1132,6 +1132,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
false, "host-dma",
true, false,
dma_capable);
+   dwc2_set_param_host_rx_fifo_size(hsotg,
+   params->host_rx_fifo_size);
+   dwc2_set_param_host_nperio_tx_fifo_size(hsotg,
+   params->host_nperio_tx_fifo_size);
+   dwc2_set_param_host_perio_tx_fifo_size(hsotg,
+   params->host_perio_tx_fifo_size);
}
dwc2_set_param_dma_desc_enable(hsotg, params->dma_desc_enable);
dwc2_set_param_dma_desc_fs_enable(hsotg, params->dma_desc_fs_enable);
@@ -1140,12 +1146,6 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg,
params->host_support_fs_ls_low_power);
dwc2_set_param_enable_dynamic_fifo(hsotg,
params->enable_dynamic_fifo);
-   dwc2_set_param_host_rx_fifo_size(hsotg,
-   params->host_rx_fifo_size);
-   dwc2_set_param_host_nperio_tx_fifo_size(hsotg,
-   params->host_nperio_tx_fifo_size);
-   dwc2_set_param_host_perio_tx_fifo_size(hsotg,
-   params->host_perio_tx_fifo_size);
dwc2_set_param_max_transfer_size(hsotg,
params->max_transfer_size);
dwc2_set_param_max_packet_count(hsotg,
-- 
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 4/5] usb: dwc2: gadget: fix default value for gadget-dma-desc

2016-11-20 Thread Stefan Wahren
The current default for gadget DMA descriptor results on bcm2835 in a
unnecessary error message:

  Invalid value 1 for param gadget-dma-desc

So fix this by using hw->dma_desc_enable as default value.

Fixes: dec4b55677e ("usb: dwc2: gadget: Add descriptor DMA parameter")
Signed-off-by: Stefan Wahren 
---
 drivers/usb/dwc2/params.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 30b954e..11fe68a 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -1094,7 +1094,7 @@ static void dwc2_set_gadget_dma(struct dwc2_hsotg *hsotg)
/* DMA Descriptor */
dwc2_set_param_bool(hsotg, >g_dma_desc, false,
"gadget-dma-desc",
-   p->g_dma, false,
+   !!hw->dma_desc_enable, false,
!!hw->dma_desc_enable);
 }
 
-- 
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 0/6] musb-fixes for v4.9-rc6

2016-11-20 Thread Bin Liu
On Thu, Nov 17, 2016 at 04:26:17PM +0100, Greg KH wrote:
> On Thu, Nov 17, 2016 at 08:38:29AM -0600, Bin Liu wrote:
> > On Thu, Nov 17, 2016 at 10:20:10AM +0100, Johan Hovold wrote:
> > > [ +CC: Tony ]
> > > 
> > > On Thu, Nov 17, 2016 at 08:10:55AM +0100, Greg Kroah-Hartman wrote:
> > > > On Wed, Nov 16, 2016 at 01:21:21PM -0600, Bin Liu wrote:
> > > > > Hi Greg,
> > > > > 
> > > > > Hope this is not too late for -rc6. This set fixes a long standing 
> > > > > musb
> > > > > regression introduced in v4.8.  Please let me know if any change is 
> > > > > needed.
> > > > 
> > > > As these were bugs in 4.8 (i.e. not a regression due to changes in
> > > > 4.9-rc1), can we just wait for 4.10-rc1 for these patches?
> > > 
> > > I believe that may have been a typo as this series fixes a number of
> > > regressions in 4.9. Most of the patches have either or both of
> > > 
> > > Fixes: 467d5c980709 ("usb: musb: Implement session bit based runtime
> > > PM for musb-core")
> > > Fixes: 65b3f50ed6fa ("usb: musb: Add PM runtime support for MUSB DSPS
> > > 
> > > that went into 4.9, or are prerequisite clean ups (patch 1/6).
> > > 
> > > The exception being patch 4/6 that claims to fix a commit in 4.7.
> > 
> > This is all correct, thanks for clarification Johan. My faulty memory
> > told me those two patches got merged in v4.8 cycle, my bad, I should
> > double check it before writing the message.
> > 
> > Greg, considering v4.9 will be a LTS, it would be great if these fixes
> > got merged in v4.9-rc6 or -rc7.
> 
> Ok, all now queued up, thanks,
> 
> greg k-h

Thanks.

-Bin.
--
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 v5 0/2] platform: Add DT support for DA8xx

2016-11-20 Thread Sekhar Nori
On Wednesday 16 November 2016 04:37 PM, Alexandre Bailon wrote:
> This add and enable the usb otg for da850 and da850-lcdk.
> This series depends on "driver: dd DT support for DA8xx" patch set.

I see that Bin has already applied this.

> If this series is applied before the "usb: musb: da8xx: Fix few issues" patch
> set then the usb driver will always retrun -ENODEV.

And this seems to be applied too. So I am going ahead and applying this
series.

For future, please add some information on which device you are
referring to in the subject line. Reading the subject line for the
cover-letter, there is no way to know what exactly is being worked on here.

Thanks,
Sekhar
--
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: OHCI: use dma_pool_zalloc

2016-11-20 Thread shashi bhusan
We should use new API dma_pool_zalloc instead of dma_pool_alloc/memset.

Signed-off-by: Shashi Bhusan 
---
 drivers/usb/host/ohci-mem.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/host/ohci-mem.c b/drivers/usb/host/ohci-mem.c
index c9e315c..ed8a762 100644
--- a/drivers/usb/host/ohci-mem.c
+++ b/drivers/usb/host/ohci-mem.c
@@ -88,10 +88,9 @@ static void ohci_mem_cleanup (struct ohci_hcd *ohci)
dma_addr_t  dma;
struct td   *td;

-   td = dma_pool_alloc (hc->td_cache, mem_flags, );
+   td = dma_pool_zalloc (hc->td_cache, mem_flags, );
if (td) {
/* in case hc fetches it, make it look dead */
-   memset (td, 0, sizeof *td);
td->hwNextTD = cpu_to_hc32 (hc, dma);
td->td_dma = dma;
/* hashed in td_fill */
@@ -122,9 +121,8 @@ static void ohci_mem_cleanup (struct ohci_hcd *ohci)
dma_addr_t  dma;
struct ed   *ed;

-   ed = dma_pool_alloc (hc->ed_cache, mem_flags, );
+   ed = dma_pool_zalloc (hc->ed_cache, mem_flags, );
if (ed) {
-   memset (ed, 0, sizeof (*ed));
INIT_LIST_HEAD (>td_list);
ed->dma = dma;
}
--
1.9.1

--
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


STRICTLY CONFIDENTIAL

2016-11-20 Thread Acct. Dept.
I have important transaction for you as next of kin to claim US$18.37m  Mail me 
on my private email:   chimwia...@gmail.com
 so I can send you more details

Thanks

Mr.Chim Wai Kim










MOVE TO INBOX===

DISCLAIMER: This email and any files it contains are confidential and intended 
for the use of the recipient(s) only. If you are not the intended recipient you 
should notify the sender immediately and destroy the material from your system. 



--
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