- 22 Sep, 2022 21 commits
-
-
Michael Grzeschik authored
The uvc_format_desc, GUID defines and the uvc_format_by_guid helper is also useful for the uvc gadget stack. This patch moves them to a common header. Tested-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Link: https://lore.kernel.org/r/20220909221335.15033-3-m.grzeschik@pengutronix.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Grzeschik authored
The functions uvc_simplify_fraction and uvc_fraction_to_interval are generic helpers which are also useful for other v4l2 drivers. This patch moves them to v4l2-common. Tested-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Link: https://lore.kernel.org/r/20220909221335.15033-2-m.grzeschik@pengutronix.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Richard Acayan authored
The Snapdragon 670 has DWC3 USB support. Add a compatible to reflect that. Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Richard Acayan <mailingradian@gmail.com> Link: https://lore.kernel.org/r/20220922024656.178529-3-mailingradian@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Richard Acayan authored
The Snapdragon 670 uses the QUSB driver for USB 2.0. Document the compatible used in the device tree. Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Richard Acayan <mailingradian@gmail.com> Link: https://lore.kernel.org/r/20220922024656.178529-2-mailingradian@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Krzysztof Kozlowski authored
All Qualcomm SoC DWC3 USB devices have a qcom,dwc3 fallback, thus there is no need to keep the list of compatibles growing. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220921084654.118230-1-krzysztof.kozlowski@linaro.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wesley Cheng authored
DWC3_EP_DELAYED_STOP is utilized to defer issuing the end transfer command until the subsequent SETUP stage, in order to avoid end transfer timeouts. During cable disconnect scenarios, __dwc3_gadget_ep_disable() is responsible for ensuring endpoints have no active transfers pending. Since dwc3_remove_request() can now exit early if the EP delayed stop is set, avoid clearing all DEP flags, otherwise the transition back into the SETUP stage won't issue an endxfer command. Fixes: 2b2da657 ("usb: dwc3: Avoid unmapping USB requests if endxfer is not complete") Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> Link: https://lore.kernel.org/r/20220919231213.21364-1-quic_wcheng@quicinc.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tadeusz Struk authored
Syzbot found an issue in usbmon module, where the user space client can corrupt the monitor's internal memory, causing the usbmon module to crash the kernel with segfault, UAF, etc. The reproducer mmaps the /dev/usbmon memory to user space, and overwrites it with arbitrary data, which causes all kinds of issues. Return an -EPERM error from mon_bin_mmap() if the flag VM_WRTIE is set. Also clear VM_MAYWRITE to make it impossible to change it to writable later. Cc: "Dmitry Vyukov" <dvyukov@google.com> Cc: stable <stable@kernel.org> Fixes: 6f23ee1f ("USB: add binary API to usbmon") Suggested-by: PaX Team <pageexec@freemail.hu> # for the VM_MAYRITE portion Link: https://syzkaller.appspot.com/bug?id=2eb1f35d6525fa4a74d75b4244971e5b1411c95a Reported-by: syzbot+23f57c5ae902429285d7@syzkaller.appspotmail.com Signed-off-by: Tadeusz Struk <tadeusz.struk@linaro.org> Link: https://lore.kernel.org/r/20220919215957.205681-1-tadeusz.struk@linaro.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Johan Jonker authored
Add rockchip,rk3128-usb compatible string. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/dfb657ab-85e5-ac47-810d-133c7e8dd823@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Iskren Chernev authored
SM6115 has 6 clocks and 2 interrupts. Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220919180618.1840194-5-iskren.chernev@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Liang He authored
In anx7411_typec_switch_probe(), we should call of_get_child_by_name() instead of of_find_node_by_name() as of_find_xxx API will decrease the refcount of the 'from' argument. Fixes: fe6d8a9c ("usb: typec: anx7411: Add Analogix PD ANX7411 support") Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Signed-off-by: Liang He <windhl@126.com> Link: https://lore.kernel.org/r/20220915092209.4009273-1-windhl@126.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Xiu Jianfeng authored
Add missing _init/__exit annotations to module init/exit funcs. Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Link: https://lore.kernel.org/r/20220917084413.23957-1-xiujianfeng@huawei.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Christophe JAILLET authored
SPDX-License-Identifier have been added in commit 5fd54ace ("USB: add SPDX identifiers to all remaining files in drivers/usb/") There is no point in keeping the now redundant license text. Remove it. Acked-by: Minas Harutyunyan <hminas@synopsys.com> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/030a7e187d707f8734a492cda7a6b54d459c4bb3.1662788747.git.christophe.jaillet@wanadoo.frSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Kushagra Verma authored
Fixes the following two typos: 1. reinitate -> reinitiate 2. revison -> revision Signed-off-by: Kushagra Verma <kushagra765@outlook.com> Link: https://lore.kernel.org/r/HK0PR01MB280110FAB74B4B2ACE32EA5FF8479@HK0PR01MB2801.apcprd01.prod.exchangelabs.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Albert Briscoe authored
When opts->pnp_string is changed with configfs, new memory is allocated for the string. It does not, however, update dev->pnp_string, even though the memory is freed. When rquesting the string, the host then gets old or corrupted data rather than the new string. The ieee 1284 id string should be allowed to change while the device is connected. The bug was introduced in commit fdc01cc2 ("usb: gadget: printer: Remove pnp_string static buffer"), which changed opts->pnp_string from a char[] to a char*. This patch changes dev->pnp_string from a char* to a char** pointing to opts->pnp_string. Fixes: fdc01cc2 ("usb: gadget: printer: Remove pnp_string static buffer") Signed-off-by: Albert Briscoe <albertsbriscoe@gmail.com> Link: https://lore.kernel.org/r/20220911223753.20417-1-albertsbriscoe@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
xhci used to test if link power management (LPM) capable USB2 devices really could enter and exit L1 state link state. Failed devices were added to a lpm_failed_dev list. This feature was removed 9 years ago in commit de68bab4 ("usb: Don't enable USB 2.0 Link PM by default.") but lpm_failed_dev member was still left. Remove it now. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20220921123450.671459-7-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
The u32 command was added to struct xhci_hcd over 10 years ago in commit 9777e3ce ("USB: xHCI: bus power management implementation") It wasn't even used back then, so remove it. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20220921123450.671459-6-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mathias Nyman authored
Show the completion code of a unsuccessful "enable slot" command. Add it in a human readable form to the existing error message. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20220921123450.671459-5-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Mario Limonciello authored
commit 8b328f80 ("xhci: re-initialize the HC during resume if HCE was set") introduced a new warning message when the host controller error was set and re-initializing. This is expected behavior on some designs which already set `xhci->broken_suspend` so the new warning is alarming to some users. Modify the code to only show the warning if this was a surprising behavior to the XHCI driver. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216470 Fixes: 8b328f80 ("xhci: re-initialize the HC during resume if HCE was set") Reported-by: Artem S. Tashkinov <aros@gmx.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20220921123450.671459-4-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Rafael Mendonca authored
If DbC is already in use, then the allocated memory for the xhci_dbc struct doesn't get freed before returning NULL, which leads to a memleak. Fixes: 53467594 ("xhci: dbc: refactor xhci_dbc_init()") Cc: stable@vger.kernel.org Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20220921123450.671459-3-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jianglei Nie authored
xhci_alloc_stream_info() allocates stream context array for stream_info ->stream_ctx_array with xhci_alloc_stream_ctx(). When some error occurs, stream_info->stream_ctx_array is not released, which will lead to a memory leak. We can fix it by releasing the stream_info->stream_ctx_array with xhci_free_stream_ctx() on the error path to avoid the potential memory leak. Signed-off-by: Jianglei Nie <niejianglei2021@163.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20220921123450.671459-2-mathias.nyman@linux.intel.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Greg Kroah-Hartman authored
Merge tag 'usb-serial-6.1-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: "USB-serial updates for 6.1-rc1 Here are the USB-serial updates for 6.1-rc1, including: - a fix for a very long-standing FTDI SIO regression - a long-overdue cleanup of the FTDI type handling - support for new FTDI HP and HA devices Included are also various clean ups. All have been in linux-next with no reported issues." * tag 'usb-serial-6.1-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: ftdi_sio: clean up driver prefix USB: serial: ftdi_sio: move driver structure USB: serial: ftdi_sio: clean up attribute visibility logic USB: serial: console: move mutex_unlock() before usb_serial_put() USB: serial: ftdi_sio: convert to use dev_groups USB: serial: ftdi_sio: add support for HP and HA devices USB: serial: ftdi_sio: simplify divisor handling USB: serial: ftdi_sio: assume hi-speed type USB: serial: ftdi_sio: clean up baudrate request USB: serial: ftdi_sio: clean up attribute handling USB: serial: ftdi_sio: clean up modem-status handling USB: serial: ftdi_sio: tighten device-type detection USB: serial: ftdi_sio: rename channel index USB: serial: ftdi_sio: include FT2232D in type string USB: serial: ftdi_sio: rename chip types USB: serial: ftdi_sio: drop redundant chip type comments USB: serial: ftdi_sio: clean up chip type enum USB: serial: ftdi_sio: fix 300 bps rate for SIO
-
- 20 Sep, 2022 3 commits
-
-
Johan Hovold authored
Drop the "sio" infix from the few remaining definitions and symbol names that still had it. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Move the definition of the USB serial driver structure to the end of the file where it is used and drop the now redundant forward declarations. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Clean up the attribute visibility logic by defaulting to attributes being visible and explicitly listing the exceptions. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
-
- 19 Sep, 2022 2 commits
-
-
Liang He authored
While in current version there is no use-after-free as USB serial core holds another reference when the console is registered, we should better unlock before dropping the reference in usb_console_setup(). Fixes: 7bd032dc ("USB serial: update the console driver") Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Johan Hovold <johan@kernel.org>
-
Jiasheng Jiang authored
The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> [ johan: rebase on type rework, make groups static, clean up, amend commit message ] Signed-off-by: Johan Hovold <johan@kernel.org>
-
- 15 Sep, 2022 13 commits
-
-
Amireddy mallikarjuna reddy authored
Add the product IDs for the USB-to-Serial devices FT2233HP, FT2232HP, FT4233HP, FT4232HP, FT233HP, FT232HP, and FT4232HA. Also include BCD values so that the chip type can be determined. Signed-off-by: Amireddy mallikarjuna reddy <mallikarjuna.reddy@ftdichip.com> Link: https://lore.kernel.org/r/ac28f2c5eba23a645b3b9299c224f2755a233eef.1658385786.git.mallikarjuna.reddy@ftdichip.com [ johan: rebase on type-handling rework, drop "Q" from automotive type name ] Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
In preparation for adding further Hi-Speed types, assume the device type is Hi-Speed unless it's an explicitly listed legacy type when determining divisors. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
In preparation for adding further Hi-Speed types, assume a 120 MHz clock and set the channel index by default and instead override these values as needed for legacy types. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Multi-channel devices need to encode the channel selector in their control requests and newer single-channel chip types use the same request format. Set the channel index also for these single-channel types so that the index can be used to determine the baudrate request format instead of listing types explicitly. Note that FT232H and FTX accept either 0 or 1 as selector for their single channel, presumably for backward compatibility reasons. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
The driver exposes two attributes for all chip types but FT232A, which doesn't have a configurable latency timer, and SIO, which (probably) doesn't support the event-char mechanism either. Explicitly test for the exceptions rather than list each and every supported device type in the attribute helpers. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
All chip types but the original SIO (FT8U100AX) return a two-byte modem status and there's no need to explicitly list every other type in the handler. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Clean up and tighten the device-type detection, which is based on bcdDevice. Don't make assumptions about unknown (future) types (currently assumed to be either FT2232C or FT-X depending on bNumInterfaces) and instead log an error and refuse to bind so that we can add proper support when needed. Note that the bcdDevice values have been provided by FTDI. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Multi-channel devices require a channel selector to be included in control requests. Replace "interface" with the less ambiguous "channel", which is the terminology used for newer devices, in the corresponding defines and variables. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Include the updated D-version in the type string for the FT2232C type. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Shorten the chip type enum and string representation for A, B and R chip types so that they don't include the IC package type in the name. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Drop redundant chip type comments. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
Clean up the chip type enum by dropping the explicit values and moving the definition to the implementation to make it easier to add further types. Signed-off-by: Johan Hovold <johan@kernel.org>
-
Johan Hovold authored
The 300 bps rate of SIO devices has been mapped to 9600 bps since 2003... Let's fix the regression. Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold <johan@kernel.org>
-
- 09 Sep, 2022 1 commit
-
-
Dongliang Mu authored
Smatch reports the following warning: drivers/usb/misc/usb3503.c:267 usb3503_probe() warn: 'hub->clk' from clk_prepare_enable() not released on lines: 240,246,252 Fix this by adding a flag to indicate if hub->clk is prepared or not and invoke clk_disable_unprepare in the error handling. Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Link: https://lore.kernel.org/r/20220908055903.3550723-1-dzm91@hust.edu.cnSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-