summaryrefslogtreecommitdiff
path: root/drivers/usb (follow)
Commit message (Collapse)AuthorAge
...
| | | * | | | | | | | | | | xhci: use default USB_RESUME_TIMEOUT when resuming ports.Mathias Nyman2016-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 7d3b016a6f5a0fa610dfd02b05654c08fa4ae514 upstream. USB2 host inititated resume, and system suspend bus resume need to use the same USB_RESUME_TIMEOUT as elsewhere. This resolves a device disconnect issue at system resume seen on Intel Braswell and Apollolake, but is in no way limited to those platforms. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | | USB: serial: ftdi_sio: add support for Infineon TriBoard TC2X7Stefan Tauner2016-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit ca006f785fbfd7a5c901900bd3fe2b26e946a1ee upstream. This adds support to ftdi_sio for the Infineon TriBoard TC2X7 engineering board for first-generation Aurix SoCs with Tricore CPUs. Mere addition of the device IDs does the job. Signed-off-by: Stefan Tauner <stefan.tauner@technikum-wien.at> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | | USB: serial: fix potential NULL-dereference at probeJohan Hovold2016-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 126d26f66d9890a69158812a6caa248c05359daa upstream. Make sure we have at least one port before attempting to register a console. Currently, at least one driver binds to a "dummy" interface and requests zero ports for it. Should such an interface also lack endpoints, we get a NULL-deref during probe. Fixes: e5b1e2062e05 ("USB: serial: make minor allocation dynamic") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | | usb: gadget: function: u_ether: don't starve tx request queueFelipe Balbi2016-11-10
| | | | |_|_|_|_|_|_|_|_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 6c83f77278f17a7679001027e9231291c20f0d8a upstream. If we don't guarantee that we will always get an interrupt at least when we're queueing our very last request, we could fall into situation where we queue every request with 'no_interrupt' set. This will cause the link to get stuck. The behavior above has been triggered with g_ether and dwc3. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | | | | | | | | | | Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-androidAlex Shi2016-10-18
| | |\| | | | | | | | | |
| | | * | | | | | | | | | Revert "usbtmc: convert to devm_kzalloc"Greg Kroah-Hartman2016-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit ab21b63e8aedfc73565dd9cdd51eb338341177cb upstream. This reverts commit e6c7efdcb76f11b04e3d3f71c8d764ab75c9423b. Turns out it was totally wrong. The memory is supposed to be bound to the kref, as the original code was doing correctly, not the device/driver binding as the devm_kzalloc() would cause. This fixes an oops when read would be called after the device was unbound from the driver. Reported-by: Ladislav Michl <ladis@linux-mips.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | USB: serial: cp210x: Add ID for a Juniper consoleKyle Jones2016-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit decc5360f23e9efe0252094f47f57f254dcbb3a9 upstream. Signed-off-by: Kyle Jones <kyle@kf5jwc.us> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | usb: misc: legousbtower: Fix NULL pointer deferenceGreg Kroah-Hartman2016-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 2fae9e5a7babada041e2e161699ade2447a01989 upstream. This patch fixes a NULL pointer dereference caused by a race codition in the probe function of the legousbtower driver. It re-structures the probe function to only register the interface after successfully reading the board's firmware ID. The probe function does not deregister the usb interface after an error receiving the devices firmware ID. The device file registered (/dev/usb/legousbtower%d) may be read/written globally before the probe function returns. When tower_delete is called in the probe function (after an r/w has been initiated), core dev structures are deleted while the file operation functions are still running. If the 0 address is mappable on the machine, this vulnerability can be used to create a Local Priviege Escalation exploit via a write-what-where condition by remapping dev->interrupt_out_buffer in tower_write. A forged USB device and local program execution would be required for LPE. The USB device would have to delay the control message in tower_probe and accept the control urb in tower_open whilst guest code initiated a write to the device file as tower_delete is called from the error in tower_probe. This bug has existed since 2003. Patch tested by emulated device. Reported-by: James Patrick-Evans <james@jmp-e.com> Tested-by: James Patrick-Evans <james@jmp-e.com> Signed-off-by: James Patrick-Evans <james@jmp-e.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | USB: serial: cp210x: fix hardware flow-control disableKonstantin Shkolnyy2016-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit a377f9e906af4df9071ba8ddba60188cb4013d93 upstream. A bug in the CRTSCTS handling caused RTS to alternate between CRTSCTS=0 => "RTS is transmit active signal" and CRTSCTS=1 => "RTS is used for receive flow control" instead of CRTSCTS=0 => "RTS is statically active" and CRTSCTS=1 => "RTS is used for receive flow control" This only happened after first having enabled CRTSCTS. Signed-off-by: Konstantin Shkolnyy <konstantin.shkolnyy@gmail.com> Fixes: 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control") [johan: reword commit message ] Signed-off-by: Johan Hovold <johan@kernel.org> [johan: backport to 4.4 ] Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()Dan Carpenter2016-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit f4693b08cc901912a87369c46537b94ed4084ea0 upstream. We can't assign -EINVAL to a u16. Fixes: 3948f0e0c999 ('usb: add Freescale QE/CPM USB peripheral controller driver') Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | usb: musb: fix DMA for host modeCristian Birsan2016-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 4c2ba0c67394514f3f75c660c9f5d02e66a7efd4 upstream. Commit ac33cdb16681 ("usb: musb: Remove ifdefs for musb_host_rx in musb_host.c part5") introduces a problem setting DMA host mode. The musb_advance_schedule() is called immediately after receiving an endpoint RX interrupt without waiting for the DMA transfer to complete. As a consequence when the dma complete interrupt arrives the in_qh member of hw_ep is already null an the musb_host_rx() exits on !urb error case. Fix the done condition that advances the musb schedule. Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com> Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com> Tested-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Felipe Balbi <balbi@kernel.org> Cc: Tony Lindgren <tony@atomide.com> Cc: Adam Ford <aford173@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | | usb: musb: Fix DMA desired mode for Mentor DMA engineCristian Birsan2016-10-07
| | | | |_|_|_|_|_|_|_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit bba40e6948b94cba71965285fbac31bd078c024a upstream. Commit 754fe4a92c07 ("usb: musb: Remove ifdefs for TX DMA for musb_host.c") introduces a problem setting the desired channel mode for the Mentor DMA engine. There is a case where an address is incorrectly assigned to the DMA channel desired mode when it should instead be assigned the actual mode value. This results in the value of channel->desired_mode not being correct. Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com> Signed-off-by: Joshua Henderson <joshua.henderson@microchip.com> Signed-off-by: Felipe Balbi <balbi@kernel.org> Cc: Adam Ford <aford173@gmail.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | * | | | | | | | | | Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-androidAlex Shi2016-10-11
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: kernel/cpuset.c
| | | * | | | | | | | | xhci: fix null pointer dereference in stop command timeout functionMathias Nyman2016-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit bcf42aa60c2832510b9be0f30c090bfd35bb172d upstream. The stop endpoint command has its own 5 second timeout timer. If the timeout function is triggered between USB3 and USB2 host removal it will try to call usb_hc_died(xhci_to_hcd(xhci)->primary_hcd) the ->primary_hcd will be set to NULL at USB3 hcd removal. Fix this by first checking if the PCI host is being removed, and also by using only xhci_to_hcd() as it will always return the primary hcd. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | USB: change bInterval default to 10 msAlan Stern2016-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 08c5cd37480f59ea39682f4585d92269be6b1424 upstream. Some full-speed mceusb infrared transceivers contain invalid endpoint descriptors for their interrupt endpoints, with bInterval set to 0. In the past they have worked out okay with the mceusb driver, because the driver sets the bInterval field in the descriptor to 1, overwriting whatever value may have been there before. However, this approach was never sanctioned by the USB core, and in fact it does not work with xHCI controllers, because they use the bInterval value that was present when the configuration was installed. Currently usbcore uses 32 ms as the default interval if the value in the endpoint descriptor is invalid. It turns out that these IR transceivers don't work properly unless the interval is set to 10 ms or below. To work around this mceusb problem, this patch changes the endpoint-descriptor parsing routine, making the default interval value be 10 ms rather than 32 ms. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Wade Berrier <wberrier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | usb: chipidea: udc: fix NULL ptr dereference in isr_setup_status_phaseClemens Gruber2016-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 6f3c4fb6d05e63c9c6d8968302491c3a5457be61 upstream. Problems with the signal integrity of the high speed USB data lines or noise on reference ground lines can cause the i.MX6 USB controller to violate USB specs and exhibit unexpected behavior. It was observed that USBi_UI interrupts were triggered first and when isr_setup_status_phase was called, ci->status was NULL, which lead to a NULL pointer dereference kernel panic. This patch fixes the kernel panic, emits a warning once and returns -EPIPE to halt the device and let the host get stalled. It also adds a comment to point people, who are experiencing this issue, to their USB hardware design. Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | usb: renesas_usbhs: fix clearing the {BRDY,BEMP}STS conditionYoshihiro Shimoda2016-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 519d8bd4b5d3d82c413eac5bb42b106bb4b9ec15 upstream. The previous driver is possible to stop the transfer wrongly. For example: 1) An interrupt happens, but not BRDY interruption. 2) Read INTSTS0. And than state->intsts0 is not set to BRDY. 3) BRDY is set to 1 here. 4) Read BRDYSTS. 5) Clear the BRDYSTS. And then. the BRDY is cleared wrongly. Remarks: - The INTSTS0.BRDY is read only. - If any bits of BRDYSTS are set to 1, the BRDY is set to 1. - If BRDYSTS is 0, the BRDY is set to 0. So, this patch adds condition to avoid such situation. (And about NRDYSTS, this is not used for now. But, avoiding any side effects, this patch doesn't touch it.) Fixes: d5c6a1e024dd ("usb: renesas_usbhs: fixup interrupt status clear method") Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| | | * | | | | | | | | USB: serial: simple: add support for another Infineon flashloaderDaniele Palmas2016-09-24
| | | | |_|_|_|_|_|_|/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit f190fd92458da3e869b4e2c6289e2c617490ae53 upstream. This patch adds support for Infineon flashloader 0x8087/0x0801. The flashloader is used in Telit LE940B modem family with Telit flashing application. Signed-off-by: Daniele Palmas <dnlplm@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | | | | | | | | | | Merge "USB: f_mtp: Perform vfs_write under mutex protection"Linux Build Service Account2017-03-03
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / / |/| | | | | | | | | |
| * | | | | | | | | | USB: f_mtp: Perform vfs_write under mutex protectionVijayavardhan Vennapusa2017-02-23
| | |_|_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use mutex protection to avoid request buffer freed while vfs_write or copy_to_user happening if disconnect occurs. Change-Id: Ie353b7495a8b7541f136d7e7ba3fc71db86987e8 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
* | | | | | | | | | Merge "usb: gadget: f_fs: Fix memory leak for ipc_log_context"Linux Build Service Account2017-03-01
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | usb: gadget: f_fs: Fix memory leak for ipc_log_contextHemant Kumar2017-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver is not calling ipc_log_context_destroy in driver cleanup which leaves the context allocated. Change-Id: Ic1a74b530836d142c9f1db2143b5700e8b6c3321 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
* | | | | | | | | | | Merge "USB: u_data_ipa: Fix pm_runtime_get/put() mismatch"Linux Build Service Account2017-03-01
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | USB: u_data_ipa: Fix pm_runtime_get/put() mismatchVijayavardhan Vennapusa2017-02-23
| | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If IPA driver is disabled or IPA driver can fail when tether_bridge_init() is called as part of connect_work. In this case, as part of connect_work, results in not decrementing pm_usage counter, which causes USB not entering low power mode. Fix the issue by decrementing pm_usage counter in error cases. Change-Id: I7fdb7a28e3e2da6d4c0b01e69e3551f81d000aa4 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
* | | | | | | | | | | Merge "USB: composite: Release spinlock before WARN()"Linux Build Service Account2017-03-01
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | USB: composite: Release spinlock before WARN()Vijayavardhan Vennapusa2017-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if WARN() is called under spinlock, it will lead crash due to watchdog timeout. Hence fix it by releasing spinlock before calling WARN(). And also check cdev->config is NULL or not before calling WARN(). Change-Id: Iebd00932b94164e9f40aa6126a2352437b1141ed Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
* | | | | | | | | | | | Merge "f_gsi: Don't reconfigure USB GSI eps multiple time with cable connect ↵Linux Build Service Account2017-03-01
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | case"
| * | | | | | | | | | | | f_gsi: Don't reconfigure USB GSI eps multiple time with cable connect caseMayank Rana2017-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dbca823c25bf ("f_gsi: Don't send end xfer command when USB is into U3 state") consolidated below usecases path for RNDIS: 1. USB RNDIS adaptor disable/enable case 2. USB RNDIS suspend/resume case 3. USB cable connect case Due to USB GSI endpoints are getting disabled as part of above usecase 1 i.e. adaptor disable, it is required to reconfigure and re-enable USB GSI endpoints when adaptor is enabled. USB GSI endpoints are re-configured but not re-enabled for above usecase 3 although it is already configured and enabled as pat of set_alt(1). Hence USB GSI endpoint are partially configured causing no USB data transfer between USB GSI and IPA GSI which fails IP address assignment. Fix this issue by making sure that USB GSI endpoints are not reconfigured in above usecase 3. CRs-Fixed: 1095920 Change-Id: I67068bac21274d715f61f9e5b83fae54e2c8e22d Signed-off-by: Mayank Rana <mrana@codeaurora.org>
* | | | | | | | | | | | | Merge "f_gsi: Don't send end xfer command when USB is into U3 state"Linux Build Service Account2017-03-01
|\| | | | | | | | | | | | | |_|_|_|/ / / / / / / / |/| | | | | | | | | | |
| * | | | | | | | | | | f_gsi: Don't send end xfer command when USB is into U3 stateMayank Rana2017-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is recommended to avoid sending end xfer command with USB GSI endpoint when USB is into U3 state (i.e. bus suspended) as USB controller may hang. USB GSI driver sends end xfer command with suspend implementation when remote wakeup is not allowed. Hence update IPA driver about remote wakeup status to suspend or disconnect IPA GSI channel whereas remove sending end xfer command to USB controller when remote wakeup is not allowed. CRs-Fixed: 1077546 Change-Id: I3ac3714ccaf4ac9f16c26f59b9550aa825483344 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
* | | | | | | | | | | | Merge "f_gsi: Make usb ipa wq as freezable workqueue"Linux Build Service Account2017-02-27
|\| | | | | | | | | | | | |/ / / / / / / / / / |/| | | | | | | | | |
| * | | | | | | | | | f_gsi: Make usb ipa wq as freezable workqueueMayank Rana2017-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB function driver uses usb_gadget_autopm_get() API to increments USB controller device's PM runtime usage and child count, and also expects that USB controller is resumed. Late suspend disables USB controller device's PM runtime functionality by incrementing disable_depth count and early resume enables it back once system is resumed. This results into pm_runtime_get_sync() returning -EACCESS when APPS is power collapsed and it is resuming due to USB bus resume case. usb_gadget_autopm_get() API is decrementing device's PM runtime usage count if it receives error value from pm_runtime_get_sync() API. USB function driver doesn't check return value which results into continuing USB operation. On next bus suspend, it decrements usage count although it was not incremented in previous resume case which makes PM runtime usage count negative. This can cause multiple issues as below: 1. USB bus resume may take more time causing host re-enumerating USB gadget device 2. Unclock register access on remote wakeup case 3. USB host mode enumeration may fail due to dwc3 device usage count is negative. Fix this issue by making usb ipa wq as freezable workqueue which will make sure that ipa_work_handler() work is executed only after system is resumed and USB controller device's PM runtime is enabled. CRs-Fixed: 1075002, 1074383 Change-Id: I300d1a0081fafcbef3c00c63cddd49be54a651e5 Signed-off-by: Mayank Rana <mrana@codeaurora.org>
| * | | | | | | | | | f_gsi: Fix error handling with usb_func_ep_queue() return valueMayank Rana2017-02-27
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usb_func_ep_queue() returns -EAGAIN if usb is function suspended and successfully remote wakeup is performed. This change fixes error handling with USB GSI function driver to make sure caller knows that request is actually queued or not from this context. This makes sure that USB request is queued once USB host has resumed USB bus. CRs-Fixed: 1033093 Change-Id: I3f3cb1b6b42530bfa93e0d4badacfe651b6bbb4c Signed-off-by: Mayank Rana <mrana@codeaurora.org>
* | | | | | | | | | Merge "usb: gadget: f_mass_storage: Allow USB LPM upon ep disable"Linux Build Service Account2017-02-27
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | usb: gadget: f_mass_storage: Allow USB LPM upon ep disableHemant Kumar2017-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upon cable disconnect, there is a possibility of USB LPM before file-storage thread run to completion. This causes ep dequeue to fail and results into thread to block for ever. Prevent this situation by incrementing power usage count on gadget parent upon ep enable and decrement it upon ep disable and allow USB LPM after that. Change-Id: Ic3633320de6ebef912bdaeac305b3dd0df3eb8e0 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
* | | | | | | | | | | Merge "usb: pd: Avoid buffer overrun during msg_rx"Linux Build Service Account2017-02-27
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | |
| * | | | | | | | | | usb: pd: Avoid buffer overrun during msg_rxJack Pham2017-02-13
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying the buffer to the rx_msg structure, ensure that we do not copy more than the payload buffer size. Guard the unknown len parameter within a min() check. Change-Id: I55feff0dbee59b680a42878a38da8e9742332008 Signed-off-by: Jack Pham <jackp@codeaurora.org>
* | | | | | | | | | Merge "USB: qusb: Add support to change TUNEX registers dynamically"Linux Build Service Account2017-02-21
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | USB: qusb: Add support to change TUNEX registers dynamicallyVijayavardhan Vennapusa2017-02-20
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add required support to change QUSB2PHY_PORT_TUNE1/2/3/4/5 registers dynamically for testing USB electrical complaince. Change-Id: Id84d460c8f8dc8cdedabe3887859d6b90acf7c3f Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
* | | | | | | | | | Merge "usb: pd: Skip decreasing current when requesting the same PPS"Linux Build Service Account2017-02-21
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | usb: pd: Skip decreasing current when requesting the same PPSJack Pham2017-02-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a PPS PDO is selected and a request is made for the same PDO at a different voltage, there is no need to suspend the current draw. This allows for more efficient charging as the charger does not have to ramp down / ramp back up its current limit. Change-Id: I2e5af41788b5297204a3f603a5375ec78020c919 Signed-off-by: Jack Pham <jackp@codeaurora.org>
* | | | | | | | | | | Merge "USB: gadget: Replace %pK with %p"Linux Build Service Account2017-02-21
|\ \ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | USB: gadget: Replace %pK with %pHemant Kumar2017-02-16
| | |_|/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 5f8f42688e30e ("usb: gadget: replace %p with %pK") modifies the %pM/m (MAC address format specifier) as %pKM/m in get_ether_addr_str() API. As a result this API returns zeroed out mac address. This API is used to show mac address of usb network interface using configfs attribute of function drivers. Hence replace %pK with %p in this helper API to show correct mac address information. Change-Id: Id3a0d779f458d2ce697cd8fe88f348380cf44a8f Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
* / | | | | | | | | | usb: gsi: Capture USB GSI endpoint operationsMayank Rana2017-02-17
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases it has been observed that after sending STARTXFER command with USB GSI IN endpoint, USB controller is accessing zero address resulting into bus error. This change captures USB GSI operation sequence in debug buffer which may help to understand race condition in terms of USB gadget events and USB GSI endpoint operations. Change-Id: Ia46877bb92ea0cc1d5f3712e5c70bb44232d5cfe Signed-off-by: Mayank Rana <mrana@codeaurora.org>
* | | | | | | | | | Merge "USB: gadget: Replace %pK with %pM"Linux Build Service Account2017-02-16
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | USB: gadget: Replace %pK with %pMArumuga Durai A2017-02-14
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 7d08f0c4e3b7c35e ("usb: gadget: replace %p with %pK") modifies the %pM (MAC address format specifier) as %pKM in usb drivers. when usb composition switch happens ecm function bind_config() access the invalid host's ethernet address and leads usb enumeration failure. Fix this by replace %pKM with %pM only for usb-eth module. Change-Id: I29364891fbdf381b5a6ea360ecdbe3ef237f24bd Signed-off-by: Arumuga Durai A <cadurai@codeaurora.org>
* | | | | | | | | | Merge "USB: phy-msm-qusb: Fix race conditions during fast PI/PO"Linux Build Service Account2017-02-15
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | USB: phy-msm-qusb: Fix race conditions during fast PI/POVijayavardhan Vennapusa2017-02-14
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During fast cable connect/disconnect, there is chance that set_suspend() called as part of USB entering low power mode and PMIC driver asking to remove pulldowns race each other. This could cause unclocked access and results in crash. Fix this issue by using mutex to avoid crash due to the race mentioned. Change-Id: I1babb545d40b8761774cbdd3a57258ed6bc77398 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
* | | | | | | | | | Merge "USB: u_data_ipa: Fix NULL pointer dereference before starting RX/TX"Linux Build Service Account2017-02-15
|\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | USB: u_data_ipa: Fix NULL pointer dereference before starting RX/TXVijayavardhan Vennapusa2017-02-14
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If disconnect happens before connect_work done, there is a chance that port_usb might be NULL before calling ipa_data_start_rx_tx(). This could cause crash if it happens. Fix it by taking to local variable under spin lock protection and check later before calling ipa_data_start_rx_tx() for queuing RX/TX requests to USB HW. Change-Id: I82d74e34bb4d29eac225d31dac67bf5d5bc39a79 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>