[PATCH net-next] net: usb: cdc-phonet: use struct_size() in alloc_netdev()

2019-02-07 Thread Gustavo A. R. Silva
One of the more common cases of allocation size calculations is finding the size of a structure that has a zero-sized array at the end, along with memory for some number of elements for that array. For example: struct foo { int stuff; void *entry[]; }; instance = alloc(sizeof(struct foo)

[CFT][PATCH] signal/usb: Replace kill_pid_info_as_cred with kill_pid_usb_asyncio

2019-02-07 Thread Eric W. Biederman
The usb support for asyncio encoded one of it's values in the wrong field. It should have used si_value but instead used si_addr which is not present in the _rt union member of struct siginfo. The result is a POSIX and glibc incompatible encoding of fields in struct siginfo with si_code of SI_A

[PATCH v2] xhci: Drop superfluous initialization in xhci_queue_ctrl_tx()

2019-02-07 Thread Andrey Smirnov
Simplify field's initialization by directly assigning its final value instead of initializing the variable to sero and then bitwise or-ing it. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- Changes since

[PATCH v2] xhci: Use __ffs() to find page size in xhci_mem_init()

2019-02-07 Thread Andrey Smirnov
Get page size order using __ffs() instead of open coding it with a loop. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- Changes since [v1]: - Code changed to use __ffs() - Added check for page_s

[PATCH v2] xhci: Convert xhci_handshake() to use readl_poll_timeout_atomic()

2019-02-07 Thread Andrey Smirnov
Xhci_handshake() implements the algorithm already captured by readl_poll_timeout_atomic(). Convert the former to use the latter to avoid repetition. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- Changes

Re: Fwd: composite device fails to reset "suspended" flag

2019-02-07 Thread Frank Mori Hess
On Wed, Feb 6, 2019 at 5:16 PM Frank Mori Hess wrote: > > Hi Minas, > > On Tue, Feb 5, 2019 at 5:22 AM Minas Harutyunyan > wrote: > > Could you please try patch submitted by me today:"[PATCH] usb: dwc2: > > gadget: Consider VBUS discharge time in disconnect flow" > > I should be able to try it to

Re: [PATCH 01/18] MIPS: lantiq: pass struct device to DMA API functions

2019-02-07 Thread Paul Burton
Hi Christoph, On Fri, Feb 01, 2019 at 09:47:44AM +0100, Christoph Hellwig wrote: > The DMA API generally relies on a struct device to work properly, and > only barely works without one for legacy reasons. Pass the easily > available struct device from the platform_device to remedy this. > > Also

RE: [PATCH 4/5] usb: typec: ucsi: Preliminary support for alternate modes

2019-02-07 Thread Michael Hsu
Hi Heikki, > -Original Message- > From: Heikki Krogerus > Sent: Thursday, February 7, 2019 5:16 AM > To: Michael Hsu > Cc: Greg Kroah-Hartman ; Ajay Gupta > ; linux-usb@vger.kernel.org > Subject: Re: [PATCH 4/5] usb: typec: ucsi: Preliminary support for alternate > modes > > Hi Michael,

Re: [PATCH] xhci: Drop superfluous initialization in xhci_queue_ctrl_tx()

2019-02-07 Thread Andrey Smirnov
On Thu, Feb 7, 2019 at 8:44 AM Sergei Shtylyov wrote: > > Hello! > > On 07.02.2019 3:03, Andrey Smirnov wrote: > > > Simplify filed's initialization by directly assigning its final value > > field's. > Oops, missed that. Will fix in v2. Thanks, Andrey Smirnov

Re: [PATCH] xhci: Use ffs() to find page size in xhci_mem_init()

2019-02-07 Thread Andrey Smirnov
On Thu, Feb 7, 2019 at 1:00 AM Mathias Nyman wrote: > > On 07.02.2019 02:03, Andrey Smirnov wrote: > > Get page size order using ffs() instead of open coding it with a loop. > > > > Signed-off-by: Andrey Smirnov > > Cc: Mathias Nyman > > Cc: Greg Kroah-Hartman > > Cc: linux-usb@vger.kernel.org

Re: [PATCH] xhci: Convert xhci_handshake() to use readl_poll_timeout()

2019-02-07 Thread Andrey Smirnov
On Thu, Feb 7, 2019 at 12:27 AM Mathias Nyman wrote: > > On 07.02.2019 02:03, Andrey Smirnov wrote: > > Xhci_handshake() implements the algorithm already captured by > > readl_poll_timeout(). Convert the former to use the latter to avoid > > repetition. > > readl_poll_timeout() doesn't really work

Re: [PATCH] usb: dwc3: haps: Workaround matching VID PID

2019-02-07 Thread Thinh Nguyen
Hi Felipe, Felipe Balbi wrote: > Hi, > > Thinh Nguyen writes: >> i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and >> PID as this USB controller. The system may incorrectly match this driver >> to that PCIe controller. To workaround this, specifically use class type >> USB w

[PATCH v5 1/2] usb: typec: ucsi: add get_fw_info function

2019-02-07 Thread Ajay Gupta
From: Ajay Gupta Function is to get the details of ccg firmware and device version. It will be useful in debugging and also during firmware update. Signed-off-by: Ajay Gupta --- Changes from v4 to v5 - None drivers/usb/typec/ucsi/ucsi_ccg.c | 66 ++- 1 file

[PATCH v5 2/2] usb: typec: ucsi: add firmware flashing support

2019-02-07 Thread Ajay Gupta
From: Ajay Gupta CCGx has two copies of the firmware in addition to the bootloader. If the device is running FW1, FW2 can be updated with the new version. Dual firmware mode allows the CCG device to stay in a PD contract and support USB PD and Type-C functionality while a firmware update is in pr

[PATCH v5 0/2] Add support for firmware update on Cypres CCGx

2019-02-07 Thread Ajay Gupta
Hi Heikki These changes adds support for updating firmware on Cypress CCGx controller. New version (v5) has fixes from Oliver Neukum I have tested them on NVIDIA GPU card. Firmware binary pull-request is posted to linux-firmware.git at [1]. Please help review this set. Thanks Ajay [1] https:/

RE: [PATCH v4 2/2] usb: typec: ucsi: add firmware flashing support

2019-02-07 Thread Ajay Gupta
Hi Oliver, > > CCGx has two copies of the firmware in addition to the bootloader. > > If the device is running FW1, FW2 can be updated with the new version. > > Dual firmware mode allows the CCG device to stay in a PD contract and > > support USB PD and Type-C functionality while a firmware update

Re: [PATCH] xhci: Drop superfluous initialization in xhci_queue_ctrl_tx()

2019-02-07 Thread Sergei Shtylyov
Hello! On 07.02.2019 3:03, Andrey Smirnov wrote: Simplify filed's initialization by directly assigning its final value field's. instead of initializing the variable to sero and then bitwise or-ing it. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-us

Re: [PATCH 2/2] drivers: xhci: Add quirk to reset xHCI port PHY

2019-02-07 Thread Srinath Mannam
Hi Mathias, Thanks for review, please see my comments below inline. On Thu, Feb 7, 2019 at 8:32 PM Mathias Nyman wrote: > > On 05.02.2019 08:18, Srinath Mannam wrote: > > Add a quirk to reset xHCI port PHY on port disconnect event. > > Stingray USB HS PHY has an issue, that USB High Speed device

Re: [PATCH 2/2] drivers: xhci: Add quirk to reset xHCI port PHY

2019-02-07 Thread Mathias Nyman
On 05.02.2019 08:18, Srinath Mannam wrote: Add a quirk to reset xHCI port PHY on port disconnect event. Stingray USB HS PHY has an issue, that USB High Speed device detected at Full Speed after the same port has connected to Full speed device. This problem can be resolved with that port PHY reset

Re: [PATCH] USB: serial: cp210x: Add ID for Ingenico 3070

2019-02-07 Thread Johan Hovold
On Wed, Feb 06, 2019 at 09:14:13PM +0500, Ivan Mironov wrote: > Here is how this device appears in kernel log: > > usb 3-1: new full-speed USB device number 18 using xhci_hcd > usb 3-1: New USB device found, idVendor=0b00, idProduct=3070 > usb 3-1: New USB device strings: Mfr=1,

Re: [PATCH v2] USB: serial: cp210x: add minimun baud rate for CP2105 SCI

2019-02-07 Thread Johan Hovold
On Wed, Feb 06, 2019 at 09:56:15AM +0100, Johanna Abrahamsson wrote: > From: Johanna Abrahamsson > > This patch adds minimum baud rate to the cp210x driver. > > According to the datasheet for CP2105, the SCI supports 2400 as the > lowest baud rate. As this is not heeded in the current code, an e

Re: [regression] USB power management failure to suspend / high CPU usage

2019-02-07 Thread Mathias Nyman
On 04.02.2019 18:30, Eric Blau wrote: On Mon, Feb 4, 2019 at 10:49 AM Mathias Nyman wrote: On 04.02.2019 17:27, Alan Stern wrote: I would prefer to see the underlying cause for this problem figured out. Why is the USB3 port stuck in polling mode? Is it a hardware issue or a software bug?

Re: [PATCH] USB: serial: cp210x: Fix GPIO in autosuspend

2019-02-07 Thread Johan Hovold
On Wed, Feb 06, 2019 at 09:43:36PM +, Karoly Pados wrote: > Uhm, yes, sorry, it kind of went out of my head. I am doing a lot of > travelling lately (in the past 48 hours I've been on 3 airplanes), and > I had travels on earlier weeks too, mixed with some project releases > and family celebrati

Re: [PATCH 4/5] usb: typec: ucsi: Preliminary support for alternate modes

2019-02-07 Thread Heikki Krogerus
Hi Michael, On Wed, Feb 06, 2019 at 10:36:22PM +, Michael Hsu wrote: > Your existing patch matches the SVID and then requires one-for-one ordering in > case either alt mode table has multiple mode entries for a particular SVID. And we'll fix that, but that does not solve the issue that I'm ta

Re: [PATCH] xhci: Use ffs() to find page size in xhci_mem_init()

2019-02-07 Thread Mathias Nyman
On 07.02.2019 12:58, Felipe Balbi wrote: Hi, Mathias Nyman writes: Get page size order using ffs() instead of open coding it with a loop. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- drivers/u

Re: [PATCH v4 2/2] usb: typec: ucsi: add firmware flashing support

2019-02-07 Thread Oliver Neukum
On Mi, 2019-02-06 at 13:39 -0800, Ajay Gupta wrote: > From: Ajay Gupta Hi, > > CCGx has two copies of the firmware in addition to the bootloader. > If the device is running FW1, FW2 can be updated with the new version. > Dual firmware mode allows the CCG device to stay in a PD contract and > su

[PATCH v4 4/4] phy: qualcomm: usb: Add SuperSpeed PHY driver

2019-02-07 Thread Jorge Ramirez-Ortiz
Controls Qualcomm's SS phy 1.0.0 implemented in the QCS404 and some other Qualcomm platforms. Based on Sriharsha Allenki's original code. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/phy/qualcomm/Kconfig | 11 + drivers/phy/qualcomm/Makefile | 1 + drivers/phy/qualcomm/

[PATCH v4 3/4] dt-bindings: Add Qualcomm USB SuperSpeed PHY bindings

2019-02-07 Thread Jorge Ramirez-Ortiz
Binding description for Qualcomm's Synopsys 1.0.0 SuperSpeed phy controller embedded in QCS404. Based on Sriharsha Allenki's original definitions. Signed-off-by: Jorge Ramirez-Ortiz --- .../bindings/phy/qcom,snps-usb-ssphy.txt | 79 +++ 1 file changed, 79 insertions(+) cr

[PATCH v4 1/4] dt-bindings: phy: remove qcom-dwc3-usb-phy

2019-02-07 Thread Jorge Ramirez-Ortiz
This binding is not used by any driver. Signed-off-by: Jorge Ramirez-Ortiz --- .../bindings/phy/qcom-dwc3-usb-phy.txt| 37 --- 1 file changed, 37 deletions(-) delete mode 100644 Documentation/devicetree/bindings/phy/qcom-dwc3-usb-phy.txt diff --git a/Documentation/devic

[PATCH v4 2/4] dt-bindings: connector: Add vbus-supply property

2019-02-07 Thread Jorge Ramirez-Ortiz
Some phys might need to control their VBUS regulators while not being supplied by them. If such support is required, use the vbus-supply property in the connector to retrieve the regulator. Signed-off-by: Jorge Ramirez-Ortiz --- Documentation/devicetree/bindings/connector/usb-connector.txt | 4 +

[PATCH v4 0/4] USB SS PHY for Qualcomm's QCS404

2019-02-07 Thread Jorge Ramirez-Ortiz
This set adds USB SS PHY support to Qualcomm's QCS404 SoC The PHY is implemented using Synopsys' SS PHY IP The code is losely based on Sriharsha Allenki's original implementation. v2: enable OTG mode detection move vdd voltage levels to driver use bulk_ control interfaces ss-phy-bindings

Re: [PATCH] usb: dwc3: haps: Workaround matching VID PID

2019-02-07 Thread Felipe Balbi
Hi, Thinh Nguyen writes: > i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and > PID as this USB controller. The system may incorrectly match this driver > to that PCIe controller. To workaround this, specifically use class type > USB with PCI device ID to prevent incorrect d

Re: [PATCH] usb: dwc2: gadget: Consider VBUS discharge time in disconnect flow

2019-02-07 Thread Felipe Balbi
Hi, Minas Harutyunyan writes: > diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c > index 68ad75a7460d..eab1da4c0beb 100644 > --- a/drivers/usb/dwc2/gadget.c > +++ b/drivers/usb/dwc2/gadget.c > @@ -3689,6 +3689,14 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw) > i

Re: [PATCH 1/6] dt-bindings: usb: xhci-tegra: Add Tegra186 support

2019-02-07 Thread Thierry Reding
On Fri, Jan 25, 2019 at 12:30:08PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Extend the bindings to cover the set of features found in Tegra186. > > Signed-off-by: Thierry Reding > --- > .../devicetree/bindings/usb/nvidia,tegra124-xusb.txt | 4 > 1 file changed, 4 i

Re: [PATCH] xhci: Use ffs() to find page size in xhci_mem_init()

2019-02-07 Thread Felipe Balbi
Hi, Mathias Nyman writes: Get page size order using ffs() instead of open coding it with a loop. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- drivers/us

Re: [PATCH] xhci: Use ffs() to find page size in xhci_mem_init()

2019-02-07 Thread Mathias Nyman
On 07.02.2019 11:06, Felipe Balbi wrote: Hi, Mathias Nyman writes: On 07.02.2019 02:03, Andrey Smirnov wrote: Get page size order using ffs() instead of open coding it with a loop. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: li

Re: [PATCH] xhci: Use ffs() to find page size in xhci_mem_init()

2019-02-07 Thread Felipe Balbi
Hi, Mathias Nyman writes: > On 07.02.2019 02:03, Andrey Smirnov wrote: >> Get page size order using ffs() instead of open coding it with a loop. >> >> Signed-off-by: Andrey Smirnov >> Cc: Mathias Nyman >> Cc: Greg Kroah-Hartman >> Cc: linux-usb@vger.kernel.org >> Cc: linux-ker...@vger.kernel

Re: [PATCH] xhci: Use ffs() to find page size in xhci_mem_init()

2019-02-07 Thread Mathias Nyman
On 07.02.2019 02:03, Andrey Smirnov wrote: Get page size order using ffs() instead of open coding it with a loop. Signed-off-by: Andrey Smirnov Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- drivers/usb/host/xhci-mem.c | 6 +-

Re: [PATCH] xhci: Convert xhci_handshake() to use readl_poll_timeout()

2019-02-07 Thread Felipe Balbi
Hi, Mathias Nyman writes: > On 07.02.2019 02:03, Andrey Smirnov wrote: >> Xhci_handshake() implements the algorithm already captured by >> readl_poll_timeout(). Convert the former to use the latter to avoid >> repetition. > > readl_poll_timeout() doesn't really work here as it might sleep. > > i

Re: [PATCH] xhci: Convert xhci_handshake() to use readl_poll_timeout()

2019-02-07 Thread Mathias Nyman
On 07.02.2019 02:03, Andrey Smirnov wrote: Xhci_handshake() implements the algorithm already captured by readl_poll_timeout(). Convert the former to use the latter to avoid repetition. readl_poll_timeout() doesn't really work here as it might sleep. iopoll.h: /** * readx_poll_timeout - Perio