[PATCH v4] usb: host: ohci-pxa27x: Handle return value of clk_prepare_enable

2017-06-26 Thread Arvind Yadav
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
 drivers/usb/host/ohci-pxa27x.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 79efde8f..21c010f 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -274,14 +274,16 @@ static inline void pxa27x_reset_hc(struct pxa27x_ohci 
*pxa_ohci)
 
 static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, struct device *dev)
 {
-   int retval = 0;
+   int retval;
struct pxaohci_platform_data *inf;
uint32_t uhchr;
struct usb_hcd *hcd = dev_get_drvdata(dev);
 
inf = dev_get_platdata(dev);
 
-   clk_prepare_enable(pxa_ohci->clk);
+   retval = clk_prepare_enable(pxa_ohci->clk);
+   if (retval)
+   return retval;
 
pxa27x_reset_hc(pxa_ohci);
 
@@ -296,8 +298,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, 
struct device *dev)
if (inf->init)
retval = inf->init(dev);
 
-   if (retval < 0)
+   if (retval < 0) {
+   clk_disable_unprepare(pxa_ohci->clk);
return retval;
+   }
 
if (cpu_is_pxa3xx())
pxa3xx_u2d_start_hc(>self);
-- 
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


[PATCH] usb: host: ohci-pxa27x: Handle return value of clk_prepare_enable

2017-06-26 Thread Arvind Yadav
clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav 
---
Changes in v3:
  Change log correction. Add change log below '---'.

Changes in v2:
  Remove useless initialization of retval.

 drivers/usb/host/ohci-pxa27x.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 79efde8f..21c010f 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -274,14 +274,16 @@ static inline void pxa27x_reset_hc(struct pxa27x_ohci 
*pxa_ohci)
 
 static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, struct device *dev)
 {
-   int retval = 0;
+   int retval;
struct pxaohci_platform_data *inf;
uint32_t uhchr;
struct usb_hcd *hcd = dev_get_drvdata(dev);
 
inf = dev_get_platdata(dev);
 
-   clk_prepare_enable(pxa_ohci->clk);
+   retval = clk_prepare_enable(pxa_ohci->clk);
+   if (retval)
+   return retval;
 
pxa27x_reset_hc(pxa_ohci);
 
@@ -296,8 +298,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *pxa_ohci, 
struct device *dev)
if (inf->init)
retval = inf->init(dev);
 
-   if (retval < 0)
+   if (retval < 0) {
+   clk_disable_unprepare(pxa_ohci->clk);
return retval;
+   }
 
if (cpu_is_pxa3xx())
pxa3xx_u2d_start_hc(>self);
-- 
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


Re: Linux USB-Serial and DSR flow control

2017-06-26 Thread Zaerc

Thanks Johan!

TL;DR: I'm delighted to report that it *does* work with 4.12.0-rc7

Below I've tried to answer your questions best as I could, probably moot 
now but it's the least I can do for wasting your time on something that 
was already fixed.  And if you think it could be useful, I'd be more 
then happy to send you one of my little boards (for testing or 
whatever), they're intended as an alternative for FTDI cables.


Cheers,
Zaerc.


On 2017-06-26 10:31, Johan Hovold wrote:

On Sun, Jun 25, 2017 at 08:44:02PM +0200, Zaerc wrote:

Hello everyone,

Sorry to bother you, I'll try to keep it brief.  I am making an
USB-serial adapter using an Atmel (Microchip) ATMega16u2 with a LUFA
based firmware, which gives me a nice working ttyACM0 device.

However I am running into some trouble implementing DSR/DTR hardware
flow control.  The DTR signal (output) can be set and cleared, no
problem there.  The DSR signal (input) however does not seem to get
reported back eventhough with usbmon I can see the device sending it 
to

the host.


Please provide the relevant bits from such a trace (e.g. an interrupt
message with some context).



I hope this is what you mean:

DSR ready (going low):

98e6cfd6e900 435591757 C Ii:4:003:2 0:128 8 = a120 0200
98e6cfd6e900 435591786 S Ii:4:003:2 -115:128 8 <
98e6cfd6e900 435623754 C Ii:4:003:2 0:128 2 = 0200
98e6cfd6e900 435623776 S Ii:4:003:2 -115:128 8 <

DSR not ready (going high):

98e6cfd6e900 444007755 C Ii:4:003:2 0:128 8 = a120 0200
98e6cfd6e900 444007778 S Ii:4:003:2 -115:128 8 <
98e6cfd6e900 444039758 C Ii:4:003:2 0:128 2 = 
98e6cfd6e900 444039779 S Ii:4:003:2 -115:128 8 <



I have mainly tested with gtkterm on a few different (more or less)
recent linux kernels.  To add insult to injury (just kidding) it works
on windows (7 tested with RealTerm), so it seems my device should 
behave

like it is supposed to.  I have also tried it with a real serial port
(ttS0, DSR/DTR and RTS/CTS) and an FTDI cable (ttyUSB0, RTS/CTS only)
and gtkterm can see the signals just fine with those.


Which is the most recent kernel you've tried? Some changes in this area
went into 4.12 (adding support for fragmented notifications), but I
guess you haven't tried that yet?



The most recent version I tried (before sending this message) was the 
current Debian Sid kernel:


Linux Behemoth 4.11.0-1-amd64 #1 SMP Debian 4.11.6-1 (2017-06-19) x86_64 
GNU/Linux


And you guessed right, but after your reply I got off my lazy behind 
(haven't had to compile my own for over a decade) and now I have tried:


Linux Behemoth 4.12.0-rc7 #1 SMP Tue Jun 27 00:37:46 CEST 2017 x86_64 
GNU/Linux


With that gtkterm and sct (Serial Com Tester) do see the DSR line 
changing, problem solved!  I didn't reckon there was active development 
going on in this area, which just goes to show: assumption is the mother 
of all fsckups...




Also what is the lsusb -v output for your device?



zaerc@Behemoth:~$ lsusb -v
...
Bus 004 Device 002: ID 03eb:204b Atmel Corp. LUFA USB to Serial Adapter 
Project

Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   1.10
  bDeviceClass2 Communications
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize0 8
  idVendor   0x03eb Atmel Corp.
  idProduct  0x204b LUFA USB to Serial Adapter Project
  bcdDevice0.01
  iManufacturer   1
  iProduct2
  iSerial   220
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   62
bNumInterfaces  2
bConfigurationValue 1
iConfiguration  0
bmAttributes 0xc0
  Self Powered
MaxPower  100mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 2 Communications
  bInterfaceSubClass  2 Abstract (modem)
  bInterfaceProtocol  1 AT-commands (v.25ter)
  iInterface  0
  CDC Header:
bcdCDC   1.10
  CDC ACM:
bmCapabilities   0x06
  sends break
  line coding and serial state
  CDC Union:
bMasterInterface0
bSlaveInterface 1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0008  1x 8 bytes
bInterval 255
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting

Re: [PATCH 2/3] usb: gadget: f_uac*: Reduce code duplication

2017-06-26 Thread kbuild test robot
Hi Julian,

[auto build test ERROR on balbi-usb/next]
[also build test ERROR on next-20170626]
[cannot apply to v4.12-rc7]
[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/Julian-Scheel/usb-gadget-f_uac1-Fix-endpoint-reading/20170626-202843
base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
config: arm-imx_v6_v7_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

>> drivers/usb/gadget/legacy/audio.c:24:20: fatal error: u_uac2.h: No such file 
>> or directory
#include "u_uac2.h"
   ^
   compilation terminated.

vim +24 drivers/usb/gadget/legacy/audio.c

c6994e6f drivers/usb/gadget/audio.cBryan Wu  2009-06-03 
 18  #define DRIVER_DESC"Linux USB Audio Gadget"
132fcb46 drivers/usb/gadget/audio.cJassi Brar2012-02-02 
 19  #define DRIVER_VERSION "Feb 2, 2012"
c6994e6f drivers/usb/gadget/audio.cBryan Wu  2009-06-03 
 20  
7d16e8d3 drivers/usb/gadget/audio.cSebastian Andrzej Siewior 2012-09-10 
 21  USB_GADGET_COMPOSITE_OPTIONS();
c6994e6f drivers/usb/gadget/audio.cBryan Wu  2009-06-03 
 22  
0591bc23 drivers/usb/gadget/legacy/audio.c Ruslan Bilovol2017-06-18 
 23  #ifndef CONFIG_GADGET_UAC1
065a107c drivers/usb/gadget/legacy/audio.c Andrzej Pietrasiewicz 2014-07-22 
@24  #include "u_uac2.h"
065a107c drivers/usb/gadget/legacy/audio.c Andrzej Pietrasiewicz 2014-07-22 
 25  
ad94ac0c drivers/usb/gadget/legacy/audio.c Andrzej Pietrasiewicz 2014-07-22 
 26  /* Playback(USB-IN) Default Stereo - Fl/Fr */
065a107c drivers/usb/gadget/legacy/audio.c Andrzej Pietrasiewicz 2014-07-22 
 27  static int p_chmask = UAC2_DEF_PCHMASK;

:: The code at line 24 was first introduced by commit
:: 065a107cdd70f0621011424009b3ecd4e42481b1 usb: gadget: f_uac2: use 
defined constants as defaults

:: TO: Andrzej Pietrasiewicz <andrze...@samsung.com>
:: CC: Felipe Balbi <ba...@ti.com>

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


.config.gz
Description: application/gzip


Re: [PATCH v3 1/1] usb:host:xhci support option to disable the xHCI USB2 HW LPM

2017-06-26 Thread Rob Herring
On Fri, Jun 23, 2017 at 10:02:12AM +0700, Thang Q. Nguyen wrote:
> XHCI specification 1.1 does not require xHCI-compliant controllers
> to always enable hardware USB2 LPM. However, the current xHCI
> driver always enable it when seeing HLC=1.
> This patch supports an option for users to control disabling
> USB2 Hardware LPM via DT/ACPI attribute.
> This option is needed in case user would like to disable this
> feature. For example, their xHCI controller has its USB2 HW LPM
> broken.
> 
> Signed-off-by: Tung Nguyen 
> Signed-off-by: Thang Q. Nguyen 
> ---
> Changes since v2:
>  - Change code to disable HW LPM as an option for user which
>is set via ACPI/DT.
> Changes since v1:
>  - Update DT/ACPI attribute and corresponding codes from HLE to LPM to
>be consistent with other attribute names.
> ---
>  Documentation/devicetree/bindings/usb/usb-xhci.txt |1 +
>  drivers/usb/host/xhci-plat.c   |3 +++
>  drivers/usb/host/xhci.c|3 +++
>  drivers/usb/host/xhci.h|1 +
>  4 files changed, 8 insertions(+), 0 deletions(-)

Acked-by: Rob Herring 
--
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


BUG: usb: dwc2: gadget: DTXFSTSn are actually endpoint indexed

2017-06-26 Thread Jimmy Perchet

Hello,

According to DWC2 databook( 3.20a in my case), DTXFSTSn registers are
indexed by endpoint number. This can be verified by comparing "fifo" and
"regdump" in debugfs (as long as the configuration is not trivial).
Therefore, in my humble opinion, the commit ad674a1524 ("usb: dwc2: gadget:
use ep->fifo_index in context of FIFO registers") wrongly changes DTXFSTSn
indexation.

Best Regards,
Jimmy Perchet
--
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] net: usb: asix88179_178a: Add support for the Belkin B2B128

2017-06-26 Thread Andrew F. Davis
The Belkin B2B128 is a USB 3.0 Hub + Gigabit Ethernet Adapter, the
Ethernet adapter uses the ASIX AX88179 USB 3.0 to Gigabit Ethernet
chip supported by this driver, add the USB ID for the same.

This patch is based on work by Geoffrey Tran 
who has indicated they would like this upstreamed by someone more
familiar with the upstreaming process.

Signed-off-by: Andrew F. Davis 
---
 drivers/net/usb/ax88179_178a.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index 51cf60092a18..4037ab27734a 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1722,6 +1722,18 @@ static const struct driver_info lenovo_info = {
.tx_fixup = ax88179_tx_fixup,
 };
 
+static const struct driver_info belkin_info = {
+   .description = "Belkin USB Ethernet Adapter",
+   .bind   = ax88179_bind,
+   .unbind = ax88179_unbind,
+   .status = ax88179_status,
+   .link_reset = ax88179_link_reset,
+   .reset  = ax88179_reset,
+   .flags  = FLAG_ETHER | FLAG_FRAMING_AX,
+   .rx_fixup = ax88179_rx_fixup,
+   .tx_fixup = ax88179_tx_fixup,
+};
+
 static const struct usb_device_id products[] = {
 {
/* ASIX AX88179 10/100/1000 */
@@ -1751,6 +1763,10 @@ static const struct usb_device_id products[] = {
/* Lenovo OneLinkDock Gigabit LAN */
USB_DEVICE(0x17ef, 0x304b),
.driver_info = (unsigned long)_info,
+}, {
+   /* Belkin B2B128 USB 3.0 Hub + Gigabit Ethernet Adapter */
+   USB_DEVICE(0x050d, 0x0128),
+   .driver_info = (unsigned long)_info,
 },
{ },
 };
-- 
2.13.0

--
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: [bug report] usbip: vhci-hcd: Set the vhci structure up to work

2017-06-26 Thread Shuah Khan
Hi Yuyang Du,

On 06/26/2017 12:14 AM, Yuyang Du wrote:
> Sorry. CC related people.
> 
> On Mon, Jun 26, 2017 at 12:04:54PM +0800, Yuyang Du wrote:
>> Hi Dan,
>>
>> Thanks for the report. A patch to fix the bug follows:
>>
>> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
>> index 64c3860..2c4b2fd 100644
>> --- a/drivers/usb/usbip/vhci_hcd.c
>> +++ b/drivers/usb/usbip/vhci_hcd.c
>> @@ -1301,7 +1301,7 @@ static struct hc_driver vhci_hc_driver = {
>>  
>>  static int vhci_hcd_probe(struct platform_device *pdev)
>>  {
>> -struct vhci *vhci;
>> +struct vhci *vhci = *((void 
>> **)dev_get_platdata(>dev));
>>  struct usb_hcd  *hcd_hs;
>>  struct usb_hcd  *hcd_ss;
>>  int ret;
>>
>> Thanks,
>> Yuyang

I am assuming you are planning to send a proper patch for this problem
that can be applied.

thanks,
-- Shuah

>>
>> On Fri, Jun 23, 2017 at 01:46:01PM +0300, Dan Carpenter wrote:
>>> Hello Yuyang Du,
>>>
>>> The patch 03cd00d538a6: "usbip: vhci-hcd: Set the vhci structure up
>>> to work" from Jun 8, 2017, leads to the following static checker
>>> warning:
>>>
>>> drivers/usb/usbip/vhci_hcd.c:1355 vhci_hcd_probe()
>>> error: potentially dereferencing uninitialized 'vhci'.
>>>
>>> drivers/usb/usbip/vhci_hcd.c
>>>   1340  ret = usb_add_hcd(hcd_ss, 0, 0);
>>>   1341  if (ret) {
>>>   1342  pr_err("usb_add_hcd ss failed %d\n", ret);
>>>   1343  goto put_usb3_hcd;
>>>   1344  }
>>>   1345  
>>>   1346  usbip_dbg_vhci_hc("bye\n");
>>>   1347  return 0;
>>>   1348  
>>>   1349  put_usb3_hcd:
>>>   1350  usb_put_hcd(hcd_ss);
>>>   1351  remove_usb2_hcd:
>>>   1352  usb_remove_hcd(hcd_hs);
>>>   1353  put_usb2_hcd:
>>>   1354  usb_put_hcd(hcd_hs);
>>>   1355  vhci->vhci_hcd_hs = NULL;
>>> ^
>>>   1356  vhci->vhci_hcd_ss = NULL;
>>> ^
>>> vhci is never initialized.
>>>
>>>   1357  return ret;
>>>   1358  }
>> --
>> 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
> 
> 

--
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/5] dt-bindings: phy-hisi-inno-usb2: add support for hisi-inno-usb2 phy

2017-06-26 Thread Rob Herring
On Wed, Jun 21, 2017 at 05:00:42PM +0800, Jiancheng Xue wrote:
> Add support for hisi-inno-usb2 phy.
> 
> Signed-off-by: Jiancheng Xue 
> ---
>  .../devicetree/bindings/phy/phy-hisi-inno-usb2.txt | 36 
> ++
>  1 file changed, 36 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt 
> b/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt
> new file mode 100644
> index 000..21f8208
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/phy/phy-hisi-inno-usb2.txt
> @@ -0,0 +1,36 @@
> +HiSilicon INNO USB2 PHY
> +---
> +Required properties:
> +- compatible: Should be one of the following strings:
> + "hisilicon,inno-usb2-phy",
> + "hisilicon,hi3798cv200-usb2-phy",
> +- #phy-cells: Must be 0
> +- hisilicon,peripheral-syscon: Phandle of syscon used to control phy.
> +- clocks: Phandle and clock specifier pair for reference clock utmi_refclk.
> +- resets: List of phandle and reset specifier pairs for each reset signal in
> +reset-names.
> +- reset-names: Should be "por_rst" and "test_rst". The test_rst only
> +exists in some of SOCs, so it is optional.

_rst is redundant.

> +
> +Phy node can include up to four subnodes. Each subnode represents one port.
> +The required properties of port node are as follows:
> +- clocks: Phandle and clock specifier pair for utmi_clock.
> +- resets: List of phandle and reset specifier pairs for port reset and utmi 
> reset.
> +- reset-names: List of reset signal names. Should be "port_rst" and 
> "utmi_rst"
> +
> +Refer to phy/phy-bindings.txt for the generic PHY binding properties
> +
> +Example:
> +usb_phy: phy {
> +  compatible = "hisilicon,inno_usb2_phy";

Doesn't match the above compatible.

> +  #phy-cells = <0>;
> +  hisilicon,peripheral-syscon = <_ctrl>;
> +  clocks = < USB2_REF_CLK>;
> +  resets = < 0xb4 2>;
> +  reset-names = "por_rst";
> +  port0 {

port@0 and provide a reg property.

> +  clocks = < USB2_UTMI0_CLK>;
> +  resets = < 0xb4 5>, < 0xb4 1>;
> +  reset-names = "port_rst", "utmi_rst";
> +  };
> +  };
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
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 1/4] usb: Add Aspeed SoC USB controllers to device-tree

2017-06-26 Thread Sergei Shtylyov

On 06/26/2017 05:46 PM, Benjamin Herrenschmidt wrote:


  arch/arm/boot/dts/aspeed-g4.dtsi | 15 +++
  arch/arm/boot/dts/aspeed-g5.dtsi | 22 ++
  2 files changed, 37 insertions(+)


If the patch only changes .dtsi files, the subject needs to be  smth like
"ARM: dts: aspeed: add USB controllers to device tree" -- this is not a USB
patch per se.


Hrm ok, doesn't matter much but I'll grant you that :)


   Note that I didn't invent the subject prefix "ARM: dts: " -- that's what's 
requested by the arm-soc people (Olof/Arnd/etc) on LAKML.



That said, I sent it to the USB list on purpose. It enables the use of
UHCI which will only work following a patch that is in usb-next, so to
avoid complicated sync between trees, it makes more sense to have this
patch in usb-next too.


   I figured it, let's see what Greg says...


Cheers,
Ben.


MBR, 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 1/4] usb: Add Aspeed SoC USB controllers to device-tree

2017-06-26 Thread Benjamin Herrenschmidt
On Mon, 2017-06-26 at 12:45 +0300, Sergei Shtylyov wrote:
> 
> >   arch/arm/boot/dts/aspeed-g4.dtsi | 15 +++
> >   arch/arm/boot/dts/aspeed-g5.dtsi | 22 ++
> >   2 files changed, 37 insertions(+)
> 
> If the patch only changes .dtsi files, the subject needs to be  smth like 
> "ARM: dts: aspeed: add USB controllers to device tree" -- this is not a USB 
> patch per se.

Hrm ok, doesn't matter much but I'll grant you that :)

That said, I sent it to the USB list on purpose. It enables the use of
UHCI which will only work following a patch that is in usb-next, so to
avoid complicated sync between trees, it makes more sense to have this
patch in usb-next too.

Cheers,
Ben.
--
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 1/4] usb: Add Aspeed SoC USB controllers to device-tree

2017-06-26 Thread Sergei Shtylyov

Hello.

On 6/25/2017 11:18 PM, Benjamin Herrenschmidt wrote:


Now that the necessary tweaks for the Aspeed variant of UHCI
are supported, this adds the USB controllers to the DT
template of the AST24xx and AST25xx SoCs.

The EHCI works with the current unmodified driver.

This patch doesn't enable them by default on any board specific
.dts yet. This will be done when we have the necessary clock/reset
and pinmux support. In the meantime though, this will work if
u-boot configures things properly.

Signed-off-by: Benjamin Herrenschmidt 
---
  arch/arm/boot/dts/aspeed-g4.dtsi | 15 +++
  arch/arm/boot/dts/aspeed-g5.dtsi | 22 ++
  2 files changed, 37 insertions(+)


   If the patch only changes .dtsi files, the subject needs to be  smth like 
"ARM: dts: aspeed: add USB controllers to device tree" -- this is not a USB 
patch per se.


[...]

MBR, 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 4/4] usb/gadget: Add driver for Aspeed SoC virtual hub

2017-06-26 Thread Benjamin Herrenschmidt
On Mon, 2017-06-26 at 13:12 +0800, kbuild test robot wrote:
> Hi Benjamin,
> 
> [auto build test WARNING on robh/for-next]
> [also build test WARNING on v4.12-rc6]
> [cannot apply to balbi-usb/next next-20170623]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]

Hrm... I wouldn't worry about these as this IP only exists on 32-bit
SoC's, but if you're adamant then I'll look into putting the gory
horrible format strings in a respin...

> url:
> https://github.com/0day-ci/linux/commits/Benjamin-Herrenschmidt/usb-Add-Aspeed-SoC-USB-controllers-to-device-tree/20170626-124044
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git 
> for-next
> config: tile-allyesconfig (attached as .config)
> compiler: tilegx-linux-gcc (GCC) 4.6.2
> reproduce:
> wget 
> https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=tile 
> 
> All warnings (new ones prefixed by >>):
> 
>drivers/usb/gadget/udc/aspeed-vhub/ep0.c: In function 
> 'ast_vhub_ep0_do_send':
> > > drivers/usb/gadget/udc/aspeed-vhub/ep0.c:196:2: warning: format '%d' 
> > > expects argument of type 'int', but argument 6 has type 'size_t' 
> > > [-Wformat]
> 
>drivers/usb/gadget/udc/aspeed-vhub/ep0.c: In function 
> 'ast_vhub_ep0_do_receive':
>drivers/usb/gadget/udc/aspeed-vhub/ep0.c:230:2: warning: format '%d' 
> expects argument of type 'int', but argument 6 has type 'size_t' [-Wformat]
>drivers/usb/gadget/udc/aspeed-vhub/ep0.c:230:2: warning: format '%d' 
> expects argument of type 'int', but argument 7 has type 'size_t' [-Wformat]
>drivers/usb/gadget/udc/aspeed-vhub/ep0.c:234:3: warning: format '%d' 
> expects argument of type 'int', but argument 6 has type 'size_t' [-Wformat]
> --
>drivers/usb/gadget/udc/aspeed-vhub/epn.c: In function 
> 'ast_vhub_epn_kick_desc':
> > > drivers/usb/gadget/udc/aspeed-vhub/epn.c:209:14: warning: cast from 
> > > pointer to integer of different size [-Wpointer-to-int-cast]
> 
>drivers/usb/gadget/udc/aspeed-vhub/epn.c: In function 'ast_vhub_epn_queue':
> > > drivers/usb/gadget/udc/aspeed-vhub/epn.c:378:2: warning: format '%x' 
> > > expects argument of type 'unsigned int', but argument 7 has type 
> > > 'dma_addr_t' [-Wformat]
> 
> vim +196 drivers/usb/gadget/udc/aspeed-vhub/ep0.c
> 
>180ep->ep0.state = ep0_state_status;
>181writel(VHUB_EP0_RX_BUFF_RDY, ep->ep0.ctlstat);
>182ast_vhub_done(ep, req, 0);
>183return;
>184}
>185
>186/*
>187 * Next chunk cropped to max packet size. Also check if 
> this
>188 * is the last packet
>189 */
>190chunk = req->req.length - req->req.actual;
>191if (chunk > ep->ep.maxpacket)
>192chunk = ep->ep.maxpacket;
>193else if ((chunk < ep->ep.maxpacket) || !req->req.zero)
>194req->last_desc = 1;
>195
>  > 196EPVDBG(ep, "send chunk=%d last=%d, req->act=%d mp=%d\n",
>197   chunk, req->last_desc, req->req.actual, 
> ep->ep.maxpacket);
>198
>199/*
>200 * Copy data if any (internal requests already have data
>201 * in the EP buffer)
>202 */
>203if (chunk && req->req.buf)
>204memcpy(ep->buf, req->req.buf + req->req.actual, 
> chunk);
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
--
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-Serial and DSR flow control

2017-06-26 Thread Johan Hovold
On Sun, Jun 25, 2017 at 08:44:02PM +0200, Zaerc wrote:
> Hello everyone,
> 
> Sorry to bother you, I'll try to keep it brief.  I am making an 
> USB-serial adapter using an Atmel (Microchip) ATMega16u2 with a LUFA 
> based firmware, which gives me a nice working ttyACM0 device.
> 
> However I am running into some trouble implementing DSR/DTR hardware 
> flow control.  The DTR signal (output) can be set and cleared, no 
> problem there.  The DSR signal (input) however does not seem to get 
> reported back eventhough with usbmon I can see the device sending it to 
> the host.

Please provide the relevant bits from such a trace (e.g. an interrupt
message with some context).

> I have mainly tested with gtkterm on a few different (more or less) 
> recent linux kernels.  To add insult to injury (just kidding) it works 
> on windows (7 tested with RealTerm), so it seems my device should behave 
> like it is supposed to.  I have also tried it with a real serial port 
> (ttS0, DSR/DTR and RTS/CTS) and an FTDI cable (ttyUSB0, RTS/CTS only) 
> and gtkterm can see the signals just fine with those.

Which is the most recent kernel you've tried? Some changes in this area
went into 4.12 (adding support for fragmented notifications), but I
guess you haven't tried that yet?

Also what is the lsusb -v output for your device?

> Any advice, pointers or help you could give me would be greatly 
> appreciated.  And I'd be happy to provide more specific details as it 
> will be open hard/soft-ware anyway (designed to be made in a fablab by 
> anyone actually).

You should also try enabling debugging for the cdc-acm driver, which may
provide a hint about why this isn't working.

echo module cdc_acm +p > /sys/kernel/debug/dynamic_debug/control

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


[PATCH 0/3] USB Audio Gadget: Support multiple sampling rates

2017-06-26 Thread Julian Scheel
This patch series adds support for exposing multiple supported sampling rates
from UAC1 and UAC2 USB gadgets to the connected host. It is currently limited
to up to ten discrete sampling frequencies. The USB specification does not
actually limit this, but to avoid complex list handling I am using a static
array for now.
As the configfs bindings for f_uac1 and f_uac2 have been identical already, I
decided to move the shared code for this out of the functions first. This
avoids code duplication and simplifies the addition of the list parsing for
sampling rates.
The host can configure active sampling rate and the function adapts it's
internal active rate automatically. On playback/capture start the rate is
checked, so that the user recognizes rate mismatches. Furthermore the active
rate is exposed as an amixer control with change notifications, so that
users can check current rate upfront and get notified about updates.

Julian Scheel (3):
  usb: gadget: f_uac1: Fix endpoint reading
  usb: gadget: f_uac*: Reduce code duplication
  usb: gadget: f_uac*: Support multiple sampling rates

 Documentation/ABI/testing/configfs-usb-gadget-uac1 |   4 +-
 Documentation/usb/gadget-testing.txt   |   8 +-
 drivers/usb/gadget/function/f_uac1.c   | 258 +-
 drivers/usb/gadget/function/f_uac2.c   | 297 ++---
 drivers/usb/gadget/function/u_audio.c  | 116 +++-
 drivers/usb/gadget/function/u_audio.h  |   9 +-
 drivers/usb/gadget/function/u_uac.h| 178 
 drivers/usb/gadget/function/u_uac1.h   |  41 ---
 drivers/usb/gadget/function/u_uac2.h   |  44 ---
 9 files changed, 582 insertions(+), 373 deletions(-)
 create mode 100644 drivers/usb/gadget/function/u_uac.h
 delete mode 100644 drivers/usb/gadget/function/u_uac1.h
 delete mode 100644 drivers/usb/gadget/function/u_uac2.h

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


[PATCH 1/3] usb: gadget: f_uac1: Fix endpoint reading

2017-06-26 Thread Julian Scheel
The endpoint is stored in the lower byte of wIndex, according to USB
Audio 1.0 specification, section 5.2.1.1.

Signed-off-by: Julian Scheel 
---
 drivers/usb/gadget/function/f_uac1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/f_uac1.c 
b/drivers/usb/gadget/function/f_uac1.c
index 8656f84e17d9..b955913bd7ea 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -327,7 +327,7 @@ static int audio_set_endpoint_req(struct usb_function *f,
 {
struct usb_composite_dev *cdev = f->config->cdev;
int value = -EOPNOTSUPP;
-   u16 ep = le16_to_cpu(ctrl->wIndex);
+   u8  ep = le16_to_cpu(ctrl->wIndex) & 0xff;
u16 len = le16_to_cpu(ctrl->wLength);
u16 w_value = le16_to_cpu(ctrl->wValue);
 
@@ -363,7 +363,7 @@ static int audio_get_endpoint_req(struct usb_function *f,
 {
struct usb_composite_dev *cdev = f->config->cdev;
int value = -EOPNOTSUPP;
-   u8 ep = ((le16_to_cpu(ctrl->wIndex) >> 8) & 0xFF);
+   u8 ep = le16_to_cpu(ctrl->wIndex) & 0xff;
u16 len = le16_to_cpu(ctrl->wLength);
u16 w_value = le16_to_cpu(ctrl->wValue);
 
-- 
2.13.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


[PATCH 3/3] usb: gadget: f_uac*: Support multiple sampling rates

2017-06-26 Thread Julian Scheel
Implement support for multiple sampling rates in the USB Audio gadgets.
A list of sampling rates can be specified via configfs. All enabled
sampling rates are sent to the USB host on request. When the host
selects a sampling rate the internal active rate is updated. The
currently configured rates are exposed through amixer controls. Also on
pcm open from userspace the requested rated is checked against the
currently configured rate of the host.

Signed-off-by: Julian Scheel 
---
 Documentation/ABI/testing/configfs-usb-gadget-uac1 |   4 +-
 Documentation/usb/gadget-testing.txt   |   8 +-
 drivers/usb/gadget/function/f_uac1.c   | 120 +
 drivers/usb/gadget/function/f_uac2.c   | 146 +++--
 drivers/usb/gadget/function/u_audio.c  | 116 +++-
 drivers/usb/gadget/function/u_audio.h  |   9 +-
 drivers/usb/gadget/function/u_uac.h|  69 +-
 7 files changed, 393 insertions(+), 79 deletions(-)

diff --git a/Documentation/ABI/testing/configfs-usb-gadget-uac1 
b/Documentation/ABI/testing/configfs-usb-gadget-uac1
index abfe447c848f..ad2fa4a00918 100644
--- a/Documentation/ABI/testing/configfs-usb-gadget-uac1
+++ b/Documentation/ABI/testing/configfs-usb-gadget-uac1
@@ -5,10 +5,10 @@ Description:
The attributes:
 
c_chmask - capture channel mask
-   c_srate - capture sampling rate
+   c_srate - list of capture sampling rates (comma-separataed)
c_ssize - capture sample size (bytes)
p_chmask - playback channel mask
-   p_srate - playback sampling rate
+   p_srate - list of playback sampling rates (comma-separated)
p_ssize - playback sample size (bytes)
req_number - the number of pre-allocated request
for both capture and playback
diff --git a/Documentation/usb/gadget-testing.txt 
b/Documentation/usb/gadget-testing.txt
index fbc397d17e98..85878880 100644
--- a/Documentation/usb/gadget-testing.txt
+++ b/Documentation/usb/gadget-testing.txt
@@ -629,10 +629,10 @@ The function name to use when creating the function 
directory is "uac2".
 The uac2 function provides these attributes in its function directory:
 
c_chmask - capture channel mask
-   c_srate - capture sampling rate
+   c_srate - list of capture sampling rates (comma-separated)
c_ssize - capture sample size (bytes)
p_chmask - playback channel mask
-   p_srate - playback sampling rate
+   p_srate - list of playback sampling rates (comma-separated)
p_ssize - playback sample size (bytes)
req_number - the number of pre-allocated request for both capture
 and playback
@@ -790,10 +790,10 @@ The function name to use when creating the function 
directory is "uac1".
 The uac1 function provides these attributes in its function directory:
 
c_chmask - capture channel mask
-   c_srate - capture sampling rate
+   c_srate - list of capture sampling rates (comma-separated)
c_ssize - capture sample size (bytes)
p_chmask - playback channel mask
-   p_srate - playback sampling rate
+   p_srate - list of playback sampling rates (comma-separated)
p_ssize - playback sample size (bytes)
req_number - the number of pre-allocated request for both capture
 and playback
diff --git a/drivers/usb/gadget/function/f_uac1.c 
b/drivers/usb/gadget/function/f_uac1.c
index 7e5a9bd46bcf..6ae210a9ddfc 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -2,6 +2,7 @@
  * f_uac1.c -- USB Audio Class 1.0 Function (using u_audio API)
  *
  * Copyright (C) 2016 Ruslan Bilovol 
+ * Copyright (C) 2017 Julian Scheel 
  *
  * This driver doesn't expect any real Audio codec to be present
  * on the device - the audio streams are simply sinked to and
@@ -177,16 +178,18 @@ static struct uac1_as_header_descriptor as_in_header_desc 
= {
.wFormatTag =   UAC_FORMAT_TYPE_I_PCM,
 };
 
-DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(1);
+DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(UAC_MAX_RATES);
+#define uac_format_type_i_discrete_descriptor \
+   uac_format_type_i_discrete_descriptor_##UAC_MAX_RATES
 
-static struct uac_format_type_i_discrete_descriptor_1 as_out_type_i_desc = {
-   .bLength =  UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(1),
+static struct uac_format_type_i_discrete_descriptor as_out_type_i_desc = {
+   .bLength =  0, /* filled on rate setup */
.bDescriptorType =  USB_DT_CS_INTERFACE,
.bDescriptorSubtype =   UAC_FORMAT_TYPE,
.bFormatType =  UAC_FORMAT_TYPE_I,
.bSubframeSize =2,
.bBitResolution =   16,
-   .bSamFreqType = 1,
+   .bSamFreqType = 0, 

[PATCH 2/3] usb: gadget: f_uac*: Reduce code duplication

2017-06-26 Thread Julian Scheel
This replaces the dedicated headers for uac1 and uac2 functions with a
shared header for both of them. Apart from unifying the struct names,
further duplicated code for configfs setup is moved out of the function
files into the shared header.

Signed-off-by: Julian Scheel 
---
 drivers/usb/gadget/function/f_uac1.c | 142 +-
 drivers/usb/gadget/function/f_uac2.c | 161 ++-
 drivers/usb/gadget/function/u_uac.h  | 115 +
 drivers/usb/gadget/function/u_uac1.h |  41 -
 drivers/usb/gadget/function/u_uac2.h |  44 --
 5 files changed, 199 insertions(+), 304 deletions(-)
 create mode 100644 drivers/usb/gadget/function/u_uac.h
 delete mode 100644 drivers/usb/gadget/function/u_uac1.h
 delete mode 100644 drivers/usb/gadget/function/u_uac2.h

diff --git a/drivers/usb/gadget/function/f_uac1.c 
b/drivers/usb/gadget/function/f_uac1.c
index b955913bd7ea..7e5a9bd46bcf 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -21,18 +21,9 @@
 #include 
 
 #include "u_audio.h"
-#include "u_uac1.h"
+#include "u_uac.h"
 
-struct f_uac1 {
-   struct g_audio g_audio;
-   u8 ac_intf, as_in_intf, as_out_intf;
-   u8 ac_alt, as_in_alt, as_out_alt;   /* needed for get_alt() */
-};
-
-static inline struct f_uac1 *func_to_uac1(struct usb_function *f)
-{
-   return container_of(f, struct f_uac1, g_audio.func);
-}
+#define UAC1_OUT_EP_MAX_PACKET_SIZE 200
 
 /*
  * DESCRIPTORS ... most are static, but strings and full
@@ -435,7 +426,7 @@ static int f_audio_set_alt(struct usb_function *f, unsigned 
intf, unsigned alt)
struct usb_composite_dev *cdev = f->config->cdev;
struct usb_gadget *gadget = cdev->gadget;
struct device *dev = >dev;
-   struct f_uac1 *uac1 = func_to_uac1(f);
+   struct f_uac *uac1 = func_to_uac(f);
int ret = 0;
 
/* No i/f has more than 2 alt settings */
@@ -480,7 +471,7 @@ static int f_audio_get_alt(struct usb_function *f, unsigned 
intf)
struct usb_composite_dev *cdev = f->config->cdev;
struct usb_gadget *gadget = cdev->gadget;
struct device *dev = >dev;
-   struct f_uac1 *uac1 = func_to_uac1(f);
+   struct f_uac *uac1 = func_to_uac(f);
 
if (intf == uac1->ac_intf)
return uac1->ac_alt;
@@ -498,7 +489,7 @@ static int f_audio_get_alt(struct usb_function *f, unsigned 
intf)
 
 static void f_audio_disable(struct usb_function *f)
 {
-   struct f_uac1 *uac1 = func_to_uac1(f);
+   struct f_uac *uac1 = func_to_uac(f);
 
uac1->as_out_alt = 0;
uac1->as_in_alt = 0;
@@ -513,16 +504,16 @@ static int f_audio_bind(struct usb_configuration *c, 
struct usb_function *f)
 {
struct usb_composite_dev*cdev = c->cdev;
struct usb_gadget   *gadget = cdev->gadget;
-   struct f_uac1   *uac1 = func_to_uac1(f);
+   struct f_uac*uac1 = func_to_uac(f);
struct g_audio  *audio = func_to_g_audio(f);
-   struct f_uac1_opts  *audio_opts;
+   struct f_uac_opts   *audio_opts;
struct usb_ep   *ep = NULL;
struct usb_string   *us;
u8  *sam_freq;
int rate;
int status;
 
-   audio_opts = container_of(f->fi, struct f_uac1_opts, func_inst);
+   audio_opts = container_of(f->fi, struct f_uac_opts, func_inst);
 
us = usb_gstrings_attach(cdev, uac1_strings, ARRAY_SIZE(strings_uac1));
if (IS_ERR(us))
@@ -630,82 +621,27 @@ static int f_audio_bind(struct usb_configuration *c, 
struct usb_function *f)
 
 /*-*/
 
-static inline struct f_uac1_opts *to_f_uac1_opts(struct config_item *item)
-{
-   return container_of(to_config_group(item), struct f_uac1_opts,
-   func_inst.group);
-}
-
-static void f_uac1_attr_release(struct config_item *item)
-{
-   struct f_uac1_opts *opts = to_f_uac1_opts(item);
-
-   usb_put_function_instance(>func_inst);
-}
-
 static struct configfs_item_operations f_uac1_item_ops = {
-   .release= f_uac1_attr_release,
+   .release= f_uac_attr_release,
 };
 
-#define UAC1_ATTRIBUTE(name)   \
-static ssize_t f_uac1_opts_##name##_show(  \
- struct config_item *item, \
- char *page)   \
-{  \
-   struct f_uac1_opts *opts = to_f_uac1_opts(item);\
-   int result; \
- 

Re: BUG: Soft lockup calling xhci_free_streams in 4.12-rc6 when USB-C hub and SSD is connected

2017-06-26 Thread Mathias Nyman

On 26.06.2017 05:56, rocko r wrote:

Just to follow up, I've had no kernel lockups with that patch applied.



Great, Thanks
I'll make a proper patch out of it and send it forward

-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: [bug report] usbip: vhci-hcd: Set the vhci structure up to work

2017-06-26 Thread Yuyang Du
Sorry. CC related people.

On Mon, Jun 26, 2017 at 12:04:54PM +0800, Yuyang Du wrote:
> Hi Dan,
> 
> Thanks for the report. A patch to fix the bug follows:
> 
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index 64c3860..2c4b2fd 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -1301,7 +1301,7 @@ static struct hc_driver vhci_hc_driver = {
>  
>  static int vhci_hcd_probe(struct platform_device *pdev)
>  {
> - struct vhci *vhci;
> + struct vhci *vhci = *((void 
> **)dev_get_platdata(>dev));
>   struct usb_hcd  *hcd_hs;
>   struct usb_hcd  *hcd_ss;
>   int ret;
> 
> Thanks,
> Yuyang
> 
> On Fri, Jun 23, 2017 at 01:46:01PM +0300, Dan Carpenter wrote:
> > Hello Yuyang Du,
> > 
> > The patch 03cd00d538a6: "usbip: vhci-hcd: Set the vhci structure up
> > to work" from Jun 8, 2017, leads to the following static checker
> > warning:
> > 
> > drivers/usb/usbip/vhci_hcd.c:1355 vhci_hcd_probe()
> > error: potentially dereferencing uninitialized 'vhci'.
> > 
> > drivers/usb/usbip/vhci_hcd.c
> >   1340  ret = usb_add_hcd(hcd_ss, 0, 0);
> >   1341  if (ret) {
> >   1342  pr_err("usb_add_hcd ss failed %d\n", ret);
> >   1343  goto put_usb3_hcd;
> >   1344  }
> >   1345  
> >   1346  usbip_dbg_vhci_hc("bye\n");
> >   1347  return 0;
> >   1348  
> >   1349  put_usb3_hcd:
> >   1350  usb_put_hcd(hcd_ss);
> >   1351  remove_usb2_hcd:
> >   1352  usb_remove_hcd(hcd_hs);
> >   1353  put_usb2_hcd:
> >   1354  usb_put_hcd(hcd_hs);
> >   1355  vhci->vhci_hcd_hs = NULL;
> > ^
> >   1356  vhci->vhci_hcd_ss = NULL;
> > ^
> > vhci is never initialized.
> > 
> >   1357  return ret;
> >   1358  }
> --
> 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
--
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