Re: usb: dwc2: gadget: Fix memory leak in dwc2_gadget_init()

2018-05-21 Thread Felipe Balbi
Hi, Grigor Tovmasyan writes: > Hi Felipe, > > Please drop this patch from your next branch. > I will provide another fix based on Marek's suggestion. this time I'll rebase my 'next' branch. Next time, make sure this doesn't happen anymore as I like my 'next' to be immutable. -- balbi signat

Re: [PATCH v2 2/3] usb: gadget: uvc: remove delay usb status phase

2018-05-21 Thread Laurent Pinchart
Hi Paul, Thank you for the patch. On Tuesday, 24 April 2018 23:59:35 EEST Paul Elder wrote: > The completion of the usb status phase doesn't need to be delayed > from uvc_function_set_alt to uvc_v4l2_streamon/off. > Remove USB_GADGET_DELAYED_STATUS and usb_composite_setup_delay from > these two,

RE: [PATCH/RFC] usb: gadget: function: printer: avoid wrong list handling in printer_write()

2018-05-21 Thread Yoshihiro Shimoda
Hi, > From: Felipe Balbi, Sent: Monday, May 21, 2018 3:57 PM > > Hi, > > Yoshihiro Shimoda writes: > > The usb_ep_queue() in printer_write() is possible to call req->complete(). > > In that case, since tx_complete() calls list_add(&req->list, &dev->tx_reqs), > > printer_write() should not call

RE: [PATCH/RFC] usb: gadget: function: printer: avoid wrong list handling in printer_write()

2018-05-21 Thread Felipe Balbi
Hi, Yoshihiro Shimoda writes: > Hi, > >> From: Felipe Balbi, Sent: Monday, May 21, 2018 3:57 PM >> >> Hi, >> >> Yoshihiro Shimoda writes: >> > The usb_ep_queue() in printer_write() is possible to call req->complete(). >> > In that case, since tx_complete() calls list_add(&req->list, >> > &d

Re: [PATCH v2 1/3] usb: gadget: uvc: synchronize streamon/off with uvc_function_set_alt

2018-05-21 Thread Laurent Pinchart
Hi Paul, Thank you for the patch. On Tuesday, 24 April 2018 23:59:34 EEST Paul Elder wrote: > Down the call stack from the ioctl handler for VIDIOC_STREAMON, > uvc_video_alloc_requests contains a BUG_ON, which in the high level, > triggers when VIDIOC_STREAMON ioctl is issued without VIDIOC_STREA

Re: [PATCH v2 3/3] usb: gadget: uvc: disable stream when disconnected

2018-05-21 Thread Laurent Pinchart
Hi Paul, Thank you for the patch. On Tuesday, 24 April 2018 23:59:36 EEST Paul Elder wrote: > Down the call stack from the ioctl handler for VIDIOC_STREAMON, > uvc_video_alloc_requests contains a BUG_ON, which in the high level, > triggers when VIDIOC_STREAMON ioctl is issued without VIDIOC_STREA

Re: [PATCH v2 0/3] usb: gadget: uvc: fix racing between uvc_function_set_alt and streamon/off

2018-05-21 Thread Laurent Pinchart
Hi Paul, On Tuesday, 24 April 2018 23:59:33 EEST Paul Elder wrote: > Down the call stack from the ioctl handler for VIDIOC_STREAMON, > uvc_video_alloc_requests contains a BUG_ON, which in the high level, > triggers when VIDIOC_STREAMON ioctl is issued without VIDIOC_STREAMOFF > being issued previo

Re: Some questions about the UVC gadget

2018-05-21 Thread Laurent Pinchart
Hello Kelly, Sorry for the late reply, your e-mail got buried in my inbox :-/ On Friday, 23 February 2018 05:36:55 EEST Kelly Huang wrote: > Dear Mr.Pinchart, > > > I'm afraid the Linux UVC gadget driver doesn't support H.264. While H.264 > > support could be implemented using UVC 1.1, I wouldn'

Re: [PATCH v2 2/3] xhci: Add quirk to zero 64bit registers on Renesas PCIe controllers

2018-05-21 Thread Mathias Nyman
On 18.05.2018 19:29, Marc Zyngier wrote: Some Renesas controllers get into a weird state if they are reset while programmed with 64bit addresses (they will preserve the top half of the address in internal, non visible registers). You end up with half the address coming from the kernel, and the o

[GIT PULL] USB for v4.18 merge window

2018-05-21 Thread Felipe Balbi
Hi Greg, Here's my pull request for v4.18 merge window. Let me know if you want anything to be changed. For the rest of the week I'll have very scarce access to email, so replies may be delayed. Cheers The following changes since commit 6d08b06e67cd117f6992c46611dfb4ce267cd71e: Linux 4.17-r

[PATCH 0/3] usb: gadget: uvc: Expose UAPI & miscellaneous cleanups

2018-05-21 Thread Laurent Pinchart
Hello, Here are a few miscellaneous patches prompted by drive-by fixes. The first patch moves the definition of the UVC function userspace API to a public header in include/uapi/ for consumption by userspace. This should remove the need to manually copy the file when compiling userspace applicati

[PATCH 3/3] usb: gadget: uvc: Move trace parameter to function module

2018-05-21 Thread Laurent Pinchart
The trace module parameter controls output of debugging messages in the UVC function driver. Move it from the webcam module to the UVC function module where it belongs. This allows ConfigFS-based UVC gadgets to control tracing. Signed-off-by: Laurent Pinchart --- drivers/usb/gadget/function/f_uv

[PATCH 2/3] usb: gadget: uvc: Minimize #include in headers

2018-05-21 Thread Laurent Pinchart
In order to speed up compilation, only include the headers that are strictly required within other headers. To that end, use forward structure declaration and move #include statements to .c file as appropriate. While at it, sort headers alphabetically, and remove unneeded __KERNEL__ guards. Signe

[PATCH 1/3] usb: gadget: uvc: Move userspace API definition to public header

2018-05-21 Thread Laurent Pinchart
The UVC gadget userspace API (V4L2 events and custom ioctls) is defined in a header internal to the kernel. Move it to a new public header to make it accessible to userspace. The UVC_INTF_CONTROL and UVC_INTF_STREAMING macros are not used, so remove them in the process. Signed-off-by: Laurent Pin

Re: [PATCH v4] NFC: pn533: don't send USB data off of the stack

2018-05-21 Thread Johan Hovold
On Sun, May 20, 2018 at 03:19:46PM +0200, Greg Kroah-Hartman wrote: > It's amazing that this driver ever worked, but now that x86 doesn't > allow USB data to be sent off of the stack, it really does not work at > all. Fix this up by properly allocating the data for the small > "commands" that get

Re: [PATCH] usbserial: pl2303 tx xon/xoff flow control

2018-05-21 Thread Johan Hovold
On Sun, May 20, 2018 at 02:22:27AM +0200, Florian Zumbiehl wrote: > Before I investigated how to implement this patch I just saw that s/w flow > control "didn't work", but my assumption was that that was due to buffering > latencies, not because the kernel just ignored the request. But then, > cha

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-05-21 Thread Minas Harutyunyan
Hi John, On 5/19/2018 4:49 AM, John Stultz wrote: > In 4.17-rc, commit 03ea6d6e9e1f ("usb: dwc2: Enable power down") > caused the HiKey board to not correctly handle switching between > usb-gadget and usb-host mode. > > Unplugging the OTG port would result in: > [ 42.240973] dwc2 f72c.usb:

RE: [PATCH/RFC] usb: gadget: function: printer: avoid wrong list handling in printer_write()

2018-05-21 Thread Yoshihiro Shimoda
Hi, > From: Felipe Balbi, Sent: Monday, May 21, 2018 5:05 PM > seems like it would be better to just move this like before > usb_ep_queue(): > > modified drivers/usb/gadget/function/f_printer.c > @@ -631,19 +631,19 @@ printer_write(struct file *fd, const char __user *buf, > size_t len, loff_t

[PATCH] usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub

2018-05-21 Thread William Wu
The dwc2_get_ls_map() use ttport to reference into the bitmap if we're on a multi_tt hub. But the bitmaps index from 0 to (hub->maxchild - 1), while the ttport index from 1 to hub->maxchild. This will cause invalid memory access when the number of ttport is hub->maxchild. Without this patch, I can

RE: [PATCH/RFC] usb: gadget: function: printer: avoid wrong list handling in printer_write()

2018-05-21 Thread Felipe Balbi
Hi, Yoshihiro Shimoda writes: > Hi, > >> From: Felipe Balbi, Sent: Monday, May 21, 2018 5:05 PM > >> seems like it would be better to just move this like before >> usb_ep_queue(): >> >> modified drivers/usb/gadget/function/f_printer.c >> @@ -631,19 +631,19 @@ printer_write(struct file *fd, c

Re: [PATCH v2] usbserial: pl2303 tx xon/xoff flow control

2018-05-21 Thread Johan Hovold
On Sun, May 20, 2018 at 02:23:12AM +0200, Florian Zumbiehl wrote: > Support hardware-level Xon/Xoff flow control in transmit direction with > pl2303. > > I only know how to get the hardware to do IXON/!IXANY with ^S/^Q as control > characters, so I preserve the old behaviour for all other cases. >

[PATCH] tty: add missing const to termios hw-change helper

2018-05-21 Thread Johan Hovold
Add missing const qualifiers to the termios hw-change helper parameters, which is used by few USB serial drivers. This specifically allows the pl2303 driver to use const arguments in one of its helper as well. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Johan Hovold --- Greg, are you

RE: [PATCH/RFC] usb: gadget: function: printer: avoid wrong list handling in printer_write()

2018-05-21 Thread Yoshihiro Shimoda
Hi, > From: Felipe Balbi, Sent: Monday, May 21, 2018 7:19 PM > > Hi, > > Yoshihiro Shimoda writes: > > Hi, > > > >> From: Felipe Balbi, Sent: Monday, May 21, 2018 5:05 PM > > > >> seems like it would be better to just move this like before > >> usb_ep_queue(): > >> > >> modified drivers/usb/

[PATCH v2] usb: gadget: function: printer: avoid wrong list handling in printer_write()

2018-05-21 Thread Yoshihiro Shimoda
When printer_write() calls usb_ep_queue(), a udc driver (e.g. renesas_usbhs driver) may call usb_gadget_giveback_request() in the udc .queue ops immediately. Then, printer_write() calls list_add(&req->list, &dev->tx_reqs_active) wrongly. After that, if we do unbind the printer driver, WARN_ON() hap

[PATCH v1 0/4] usb: dwc2: Make dwc2 endianness agnostic

2018-05-21 Thread Gevorg Sahakyan
This series contains patches which are make dwc2 core endianness agnostic Changes from v0: Moved dwc2_check_core_endianness() call after devm_ioremap_resource() to avoid ioread32() call on null pointer. Gevorg Sahakyan (4): usb: dwc2: Move dwc2_readl/writel functions after hsotg structure u

[PATCH v1 1/4] usb: dwc2: Move dwc2_readl/writel functions after hsotg structure

2018-05-21 Thread Gevorg Sahakyan
Moved dwc2_readl/writel functions after hsotg declaration for adding hsotg structure to dwc2_readl/writel function prototypes. Signed-off-by: Gevorg Sahakyan --- drivers/usb/dwc2/core.h | 108 1 file changed, 54 insertions(+), 54 deletions(-) dif

[PATCH v1 4/4] usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.

2018-05-21 Thread Gevorg Sahakyan
Declared dwc2_check_core_endianness() function for dynamicly check core endianness. Added needs_byte_swap flag to hsotg structure, and depending on flag swap value inside dwc2_readl/writel functions. Signed-off-by: Gevorg Sahakyan --- drivers/usb/dwc2/core.h | 22 -- driv

[PATCH v1 3/4] usb: dwc2: replace ioread32/iowrite32_rep with dwc2_readl/writel_rep

2018-05-21 Thread Gevorg Sahakyan
dwc2_readl_rep/dwc2_writel_rep functions using readl/writel in a loop. Signed-off-by: Gevorg Sahakyan --- drivers/usb/dwc2/core.h | 61 ++- drivers/usb/dwc2/gadget.c | 6 ++--- 2 files changed, 26 insertions(+), 41 deletions(-) diff --git a/drivers

[PATCH 01/33] usb: phy: use match_string() helper

2018-05-21 Thread Yisheng Xie
match_string() returns the index of an array for a matching string, which can be used intead of open coded variant. Cc: linux-usb@vger.kernel.org Cc: Felipe Balbi Cc: Greg Kroah-Hartman Signed-off-by: Yisheng Xie --- drivers/usb/phy/of.c | 12 +--- 1 file changed, 5 insertions(+), 7 de

[PATCH] usb: typec: Fix htmldocs warning

2018-05-21 Thread Heikki Krogerus
Fix htmldocs warning: drivers/usb/typec/mux.c:186: warning: Function parameter or member 'mux' not described in 'typec_mux_unregister' Reported-by: kbuild test robot Fixes: bdecb33af34f ("usb: typec: API for controlling USB Type-C Multiplexers") Signed-off-by: Heikki Krogerus --- drivers/usb/

Re: [PATCH v2] usb: gadget: function: printer: avoid wrong list handling in printer_write()

2018-05-21 Thread Felipe Balbi
Hi Greg, Yoshihiro Shimoda writes: > When printer_write() calls usb_ep_queue(), a udc driver (e.g. > renesas_usbhs driver) may call usb_gadget_giveback_request() in > the udc .queue ops immediately. Then, printer_write() calls > list_add(&req->list, &dev->tx_reqs_active) wrongly. After that, > i

Re: [PATCH] usb: xhci: force all memory allocations to node

2018-05-21 Thread Adam Wallis
On 5/16/2018 2:02 AM, Greg Kroah-Hartman wrote: > On Tue, May 15, 2018 at 04:51:53PM -0400, Adam Wallis wrote: > > Ok, fair enough, I was hoping that "modern" systems would have better > NUMA memory interconnects. I guess that isn't the case still :( Things will keep improving, I'm sure. Mathia

Re: [RFC PATCH 1/7] usb: typec: Generalize mux mode names

2018-05-21 Thread Heikki Krogerus
On Fri, May 18, 2018 at 07:26:40AM +0200, Mats Karrman wrote: > On 2018-05-17 13:50, Heikki Krogerus wrote: > > > On Wed, May 16, 2018 at 11:11:02PM +0200, Mats Karrman wrote: > > > On 05/16/2018 01:43 PM, Heikki Krogerus wrote: > > > > > > > On Tue, May 15, 2018 at 11:24:07PM +0200, Mats Karrman

Re: [PATCH v5 05/14] usb: typec: add API to get typec basic port power and data config

2018-05-21 Thread Heikki Krogerus
Hi Jun, Sorry for the delay. On Thu, May 17, 2018 at 02:41:31PM +, Jun Li wrote: > Hi > > -Original Message- > > From: Heikki Krogerus [mailto:heikki.kroge...@linux.intel.com] > > Sent: 2018??5??17?? 22:24 > > To: Jun Li > > Cc: Mats Karrman ; robh...@kernel.org; > > gre...@linuxfoun

Re: [PATCH] typec: tcpm: Provide of_node pointer as part of psy_cfg

2018-05-21 Thread Heikki Krogerus
Hi Adam, On Wed, May 16, 2018 at 05:00:46PM +0100, Adam Thomson wrote: > For supply registration, provide of_node pointer of the port device, > via the power_supply_config structure, to allow other psy drivers > to add us as a supplier using the 'power-supplies' DT property. > > Signed-off-by: Ad

[PATCH 00/18] xhci features for usb-next

2018-05-21 Thread Mathias Nyman
Hi Greg This series adds support for HiSilicon STB xHCI, reworks the xhci driver port structures, and adds ports to debugfs -Mathias Jianguo Sun (2): dt-bindings: usb: add bindings doc for HiSilicon STB xHCI host controller xhci: hisilicon: support HiSilicon STB xHCI host controller Lu

[PATCH 05/18] xhci: set hcd pointers for xhci usb2 and usb3 roothub structures

2018-05-21 Thread Mathias Nyman
Allows us to know the correct hcd a xhci roothub and its ports belong to. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 711da33..f614ba1 100644 --- a/drivers/usb/host/xhci.c +

[PATCH 02/18] dt-bindings: usb: add bindings doc for HiSilicon STB xHCI host controller

2018-05-21 Thread Mathias Nyman
From: Jianguo Sun This commit adds bindings doc for HiSilicon STB xHCI host controller. Signed-off-by: Jianguo Sun Signed-off-by: Mathias Nyman --- .../bindings/usb/hisilicon,histb-xhci.txt | 45 ++ 1 file changed, 45 insertions(+) create mode 100644 Documentati

[PATCH 03/18] xhci: hisilicon: support HiSilicon STB xHCI host controller

2018-05-21 Thread Mathias Nyman
From: Jianguo Sun This commit adds support for HiSilicon STB xHCI host controller. There are two xHCI host controllers on HiSilicon STB SoCs. Each one requires additional configuration before exposing interface compliant with xHCI. Reviewed-by: Chunfeng Yun Signed-off-by: Jianguo Sun Signed-of

[PATCH 01/18] usb: xhci: dbc: Add SPDX identifiers to dbc files

2018-05-21 Thread Mathias Nyman
From: Lu Baolu Update the xhci dbc files with the correct SPDX license identifiers. Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver") Cc: Philippe Ombredanne Signed-off-by: Lu Baolu Reviewed-by: Philippe Ombredanne Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-dbgca

[PATCH 04/18] xhci: Create new structures to store xhci port information

2018-05-21 Thread Mathias Nyman
Current way of having one array telling only the port speed, and then two separate arrays with mmio addresses for usb2 and usb3 ports requeres helper functions to transate hw to hcd, and hcd to hw port numbers, and is hard to expand. Instead create a structure describing a port, including the mmi

[PATCH 06/18] xhci: Add helper to get xhci roothub from hcd

2018-05-21 Thread Mathias Nyman
quick way to get the xhci roothub and thus all the ports belonging to a certain hcd Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-hub.c | 9 + drivers/usb/host/xhci.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-

[PATCH 17/18] xhci: debugfs: add usb ports to xhci debugfs

2018-05-21 Thread Mathias Nyman
Add ports/portxx/portsc for each xHC hardware usb port to debugfs. Showing the content of the port status and control register for each port (PORTSC) Portxx is numbered starting from 1 for historical reasons to better match port numbering shown by lsusb and other places. Ports in debugfs are in t

[PATCH 15/18] xhci-mtk: use xhci hub structures to get number of ports in roothubs

2018-05-21 Thread Mathias Nyman
Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mtk-sch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index eea7360..fa33d6e 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhc

[PATCH 12/18] xhci: change xhci_test_and_clear_bit() to use new port structure

2018-05-21 Thread Mathias Nyman
Don't use pointers to port array and port index as function parameters in xhci_test_and_clear_bit(), just use a pointer to the right port structure. xhci_test_and_clear_bit() was the last port_array user in xhci_get_port_status() and handle_port_status(), so remove the port_array from them as well

[PATCH 10/18] xhci: rename faked_port_index to hcd_portnum

2018-05-21 Thread Mathias Nyman
hcd_portnum is a better desctiption than faked_port_index, and is in line with the name the port structure uses. No functional changes Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 41 +++-- 1 file changed, 19 insertions(+), 22 deletions(-)

[PATCH 07/18] xhci: xhci-hub: use new port structures to get port address instead of port array

2018-05-21 Thread Mathias Nyman
Use the new port structures for functions in xhci-hub.c to get port mmio address of portsc register instead of the port array xhci_get_port_io_addr() is no longer needeed and is removed. Plan is to get rid of the mmio port array completely. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci

[PATCH 08/18] xhci: xhci-hub: use new port structures for cas and wake mask functions.

2018-05-21 Thread Mathias Nyman
Use port structures instead of mmio port arrays for xhci_port_missing_cas_quirk() and xhci_set_remote_wake_mask() in xhci-hub.c Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-hub.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/usb/hos

[PATCH 13/18] xhci: use port structures instead of port arrays in xhci.c functions

2018-05-21 Thread Mathias Nyman
get rid of port iomem arrays and use port structures in the following functions: xhci_find_raw_port_number() xhci_disable_port_wake_on_bits() xhci_set_usb2_hardware_lpm() xhci_all_ports_seen_u0() compliance_mode_recovery() Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 50 +++

[PATCH 14/18] xhci: xhci-hub: use port structure members instead of xhci_get_ports()

2018-05-21 Thread Mathias Nyman
xhci_get_ports() is one of the last functions using port_arrays in xhci-hub.c. We get the same data directly from hub and port structures instead, so convert and remove both xhci_get_ports() and port_arrays from all function that no longer need it. Signed-off-by: Mathias Nyman --- drivers/usb/ho

[PATCH 09/18] xhci: xhci-ring: use port structures for port event handler

2018-05-21 Thread Mathias Nyman
use port structures in the port event handler. Getting the right hcd and hcd portnumber from the hardware port number is a lot easier with port structures, and allows us to remove a lot of the previous code, including the find_faked_portnum_from_hw_index() function Signed-off-by: Mathias Nyman --

[PATCH 16/18] xhci: xhci-mem: remove port_arrays and the code initializing them

2018-05-21 Thread Mathias Nyman
As we are now using the new port strtuctes the port_arrays are no longer needed, remove them completely Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 100 +--- drivers/usb/host/xhci.h | 8 2 files changed, 11 insertions(+), 97 d

[PATCH 11/18] xhci: change xhci_set_link_state() to work with port structures

2018-05-21 Thread Mathias Nyman
Remove old iomem port array and index as parameters, just send a ponter to a port strucure instread Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-hub.c | 34 -- drivers/usb/host/xhci-ring.c | 3 +-- drivers/usb/host/xhci.h | 4 ++-- 3 files change

[PATCH 18/18] xhci: debugfs: add debugfs interface to enable compliance mode for a port

2018-05-21 Thread Mathias Nyman
Enable compliance transition for a port by writing "compliance" to the ports portsc file in debugfs. port must be "Not-connected" and Link must be in RxDetect state to enable compliance mode. Only needed for host that have CTC flag set. Allows state transitioning to compliance at 1st LFPS timeout.

[PATCH 05/14] usb: musb: remove duplicated quirks flag

2018-05-21 Thread Bin Liu
Both musb_io and musb_platform_ops in struct musb define a quirks flag for the same purpose. Let's remove the one in struct musb_io, and use that in struct musb_platform_ops instead. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_core.c | 10 -- drivers/usb/musb/musb_cppi41.c | 4 +

[PATCH 02/14] usb: musb: remove readl/writel from struct musb_platform_ops

2018-05-21 Thread Bin Liu
Now Blackfin support is removed, we no longer need function pointers for musb_readl() and musb_writel(). Signed-off-by: Bin Liu --- drivers/usb/musb/musb_core.c | 34 -- drivers/usb/musb/musb_core.h | 4 drivers/usb/musb/musb_io.h | 4 ++-- 3 files change

[PATCH 04/14] usb: musb: remove some register access wrapper functions

2018-05-21 Thread Bin Liu
The following wrappers were defined because of Blackfin support. Now Blackfin support is removed, these wrappers are no longer needed, so remove them. musb_write_txfifosz musb_write_txfifoadd musb_write_rxfifosz musb_write_rxfifoadd musb_write_ulpi_buscontro

[PATCH 00/14] musb patches for v4.18-rc1

2018-05-21 Thread Bin Liu
Hi Greg, Here are the musb patches for v4.18 rc1, mainly cleaning up the drivers after BLACKFIN arch support is deleted, also having one patch from Johan to prepare the USB PHY framework further work. Please let me know if any change is needed. Regards, -Bin. Bin Liu (13): usb: musb: mer

[PATCH 10/14] usb: musb: remove references to default_a of struct usb_otg

2018-05-21 Thread Bin Liu
musb drivers do not use the otg fsm framework, so referencing to otg->default_a doesn't have any effect, so remove the references. But tusb6010 glue driver uses it locally to control the vbus power, so keep the references in tusb6010 only. Signed-off-by: Bin Liu --- drivers/usb/musb/am35x.c

[PATCH 06/14] usb: musb: dsps: remove duplicated get_musb_port_mode()

2018-05-21 Thread Bin Liu
musb_core already has musb_get_mode(), so remove the duplicate from musb_dsps.c. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_dsps.c | 21 + 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 6a6

[PATCH 12/14] USB: musb: dsps: propagate device-tree node

2018-05-21 Thread Bin Liu
From: Johan Hovold To be able to use DSPS-based controllers with device-tree descriptions of the USB topology, we need to associate the glue device's device-tree node with the child controller device. Note that this can also be used to eventually let USB core manage generic phys. Also note that

[PATCH 07/14] usb: musb: remove duplicated port mode enum

2018-05-21 Thread Bin Liu
include/linux/usb/musb.h already defines enum for musb port mode, so remove the duplicate in musb_core.h and use the definition in musb.h. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_core.c| 8 drivers/usb/musb/musb_core.h| 8 +--- drivers/usb/musb/musb_dsps.c| 6 ++

[PATCH 11/14] usb: musb: disable otg protocol support

2018-05-21 Thread Bin Liu
As decided in the discussion [1] we are deleting the otg protocol support from the musb drivers. First this patch disables the flags for enabling the otg protocols. We will later gradually delete the otg protocol code from the musb drivers. [1] https://www.spinics.net/lists/linux-usb/msg167003.ht

[PATCH 14/14] usb: musb: gadget: fix to_musb_ep() to not return NULL

2018-05-21 Thread Bin Liu
UDC core ensures the usb_ep parameter passed in is not NULL, so checking if (ep != NULL) is pointless. Convert to_musb_ep() to a simple macro to not directly return NULL to avoid warnings from code static analysis tools. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_gadget.h | 5 + 1 fil

[PATCH 08/14] usb: musb: remove unused members in struct musb_hdrc_config

2018-05-21 Thread Bin Liu
The following members in struct musb_hdrc_config are not used, so remove them. soft_con utm_16 big_endian mult_bulk_tx mult_bulk_rx high_iso_tx high_iso_rx dma dma_channels dyn_fifo_size vendor_ctrl vendor_stat vendor_req dma_req_chan musb_hdrc_eps_bits Signed-off-by: Bin Liu --- drivers/usb/mu

[PATCH 03/14] usb: musb: remove adjust_channel_params() callback from musb_platform_ops

2018-05-21 Thread Bin Liu
Now Blackfin support is removed, nobody uses adjust_channel_params() any more, so remove it from struct musb_platform_ops. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_core.h | 4 drivers/usb/musb/musbhsdma.c | 8 2 files changed, 12 deletions(-) diff --git a/drivers/usb/musb/

[PATCH 09/14] usb: musb: break the huge isr musb_stage0_irq() into small functions

2018-05-21 Thread Bin Liu
musb_stage0_irq() is 400+ lines long. Break its interrupt events handling into each individual functions to make it easy to read. Signed-off-by: Bin Liu --- drivers/usb/musb/musb_core.c | 730 +++ 1 file changed, 384 insertions(+), 346 deletions(-) diff -

[PATCH 01/14] usb: musb: merge musbhsdma.h into musbhsdma.c

2018-05-21 Thread Bin Liu
Now Blackfin support is removed, header musbhsdma.h is only included in musbhsdma.c. So let's merge the content in musbhsdma.h to musbhsdma.c and delete musbhsdma.h. Signed-off-by: Bin Liu --- drivers/usb/musb/musbhsdma.c | 66 +++- drivers/usb/musb/musbhsdma.

[PATCH 13/14] usb: musb: gadget: fix to_musb_request() to not return NULL

2018-05-21 Thread Bin Liu
The gadget function drivers should ensure the usb_request parameter passed in is not NULL. UDC core doesn't check if it is NULL, so MUSB driver shouldn't have to check it either. Convert to_musb_request() to a simple macro to not directly return NULL to avoid warnings from code static analysis too

Re: [PATCH] usb: xhci: force all memory allocations to node

2018-05-21 Thread Mathias Nyman
On 21.05.2018 15:56, Adam Wallis wrote: On 5/16/2018 2:02 AM, Greg Kroah-Hartman wrote: On Tue, May 15, 2018 at 04:51:53PM -0400, Adam Wallis wrote: Ok, fair enough, I was hoping that "modern" systems would have better NUMA memory interconnects. I guess that isn't the case still :( Things wi

RE: [PATCH] typec: tcpm: Provide of_node pointer as part of psy_cfg

2018-05-21 Thread Adam Thomson
Hi Heikki, On 21 May 2018 14:20, Heikki Krogerus wrote: > On Wed, May 16, 2018 at 05:00:46PM +0100, Adam Thomson wrote: > > For supply registration, provide of_node pointer of the port device, > > via the power_supply_config structure, to allow other psy drivers > > to add us as a supplier using

Re: [PATCH] typec: tcpm: Provide of_node pointer as part of psy_cfg

2018-05-21 Thread Heikki Krogerus
On Mon, May 21, 2018 at 01:58:16PM +, Adam Thomson wrote: > Hi Heikki, > > On 21 May 2018 14:20, Heikki Krogerus wrote: > > > On Wed, May 16, 2018 at 05:00:46PM +0100, Adam Thomson wrote: > > > For supply registration, provide of_node pointer of the port device, > > > via the power_supply_con

RE: [PATCH] typec: tcpm: Provide of_node pointer as part of psy_cfg

2018-05-21 Thread Adam Thomson
On 21 May 2018 15:56, Heikki Krogerus wrote: > On Mon, May 21, 2018 at 01:58:16PM +, Adam Thomson wrote: > > Hi Heikki, > > > > On 21 May 2018 14:20, Heikki Krogerus wrote: > > > > > On Wed, May 16, 2018 at 05:00:46PM +0100, Adam Thomson wrote: > > > > For supply registration, provide of_node

Re: [PATCH] tty: add missing const to termios hw-change helper

2018-05-21 Thread Greg Kroah-Hartman
On Mon, May 21, 2018 at 01:08:44PM +0200, Johan Hovold wrote: > Add missing const qualifiers to the termios hw-change helper parameters, > which is used by few USB serial drivers. This specifically allows the > pl2303 driver to use const arguments in one of its helper as well. > > Cc: Greg Kroah-H

Re: [PATCH] usb: xhci: force all memory allocations to node

2018-05-21 Thread Adam Wallis
On 5/21/2018 9:53 AM, Mathias Nyman wrote: > On 21.05.2018 15:56, Adam Wallis wrote: > Not sure if if there's any benefit in allocating the scratchpad structures > from > a closer node, or any harm? xhci driver doesn't really access scratchpad that > frequently. I don't see how it would hurt and

Re: [PATCH v2 0/2] Re: usb-storage: Add quirks to make G-Technology "G-Drive" work

2018-05-21 Thread Alan Stern
On Fri, 18 May 2018, Alexander Kappner wrote: > v2 of this patch implements the FL_ALWAYS_SYNC flag in the UAS driver, and > then > adds the flag as quirks for the device at issue. This allows the G-Drive to > work > under both UAS and usb-storage. > > Alexander Kappner (2): > [usb-storage] A

Re: [PATCH] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-05-21 Thread John Stultz
On Mon, May 21, 2018 at 1:45 AM, Minas Harutyunyan wrote: > Hi John, > > On 5/19/2018 4:49 AM, John Stultz wrote: >> In 4.17-rc, commit 03ea6d6e9e1f ("usb: dwc2: Enable power down") >> caused the HiKey board to not correctly handle switching between >> usb-gadget and usb-host mode. >> >> Unpluggin

[PATCH v2] usb: dwc2: Fix HiKey regression caused by power_down feature

2018-05-21 Thread John Stultz
In 4.17-rc, commit 03ea6d6e9e1f ("usb: dwc2: Enable power down") caused the HiKey board to not correctly handle switching between usb-gadget and usb-host mode. Unplugging the OTG port would result in: [ 42.240973] dwc2 f72c.usb: dwc2_restore_host_registers: no host registers to restore [

Re: [PATCH 06/12] usb: usbtmc: Add vendor specific/asynchronous read/write ioctls

2018-05-21 Thread guido
Zitat von Greg KH : On Fri, May 18, 2018 at 02:48:11PM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Thu, May 17, 2018 at 07:03:30PM +0200, Guido Kiener wrote: > > +/* > > + * usbtmc_message->flags: > > + */ > > +#define USBTMC_FLAG_ASYNC0x0001 > > +#define USBT

Re: [PATCH 02/12] usb: usbtmc: Support Read Status Byte with SRQ per file handle

2018-05-21 Thread guido
Zitat von Greg KH : @@ -122,7 +141,7 @@ static int usbtmc_open(struct inode *inode, struct file *filp) { struct usb_interface *intf; struct usbtmc_device_data *data; - int retval = 0; + struct usbtmc_file_data *file_data; intf = usb_find_interface(&usbtmc

Re: Not enough bandwidth with Magewell XI100DUSB-HDMI

2018-05-21 Thread Curt Meyers
On 05/16/2018 04:55 AM, Mathias Nyman wrote: On 15.05.2018 12:22, Michael Tretter wrote: Hi Mathias, On Tue, 10 Apr 2018 18:22:03 +0300, Mathias Nyman wrote: On 09.04.2018 11:21, Michael Tretter wrote: On Tue, 20 Feb 2018 15:29:28 +0200, Mathias Nyman wrote: On 16.02.2018 15:28, Michael Tre

Re: [PATCH 05/12] usb: usbtmc: Add ioctl for generic requests on control pipe

2018-05-21 Thread guido
Zitat von Greg KH : On Fri, May 18, 2018 at 01:32:51PM +, gu...@kiener-muenchen.de wrote: Zitat von Greg KH : > On Thu, May 17, 2018 at 07:03:29PM +0200, Guido Kiener wrote: > > Add USBTMC_IOCTL_CTRL_REQUEST to send arbitrary requests on the > > control pipe. Used by specific applicatio

Re: [PATCH 01/33] usb: phy: use match_string() helper

2018-05-21 Thread Andy Shevchenko
On Mon, May 21, 2018 at 2:57 PM, Yisheng Xie wrote: > match_string() returns the index of an array for a matching string, > which can be used intead of open coded variant. > - int err, i; > + int ret; int err; would still work. -- With Best Regards, Andy Shevchenko -- To unsubscri

Re: [PATCH] usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub

2018-05-21 Thread Doug Anderson
Hi, On Mon, May 21, 2018 at 3:12 AM, William Wu wrote: > The dwc2_get_ls_map() use ttport to reference into the > bitmap if we're on a multi_tt hub. But the bitmaps index > from 0 to (hub->maxchild - 1), while the ttport index from > 1 to hub->maxchild. This will cause invalid memory access > whe