aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2022-06-24usb: musb: mpfs: Fix error codes in probe()Dan Carpenter1-1/+4
These error paths return success but they need to return a negative error code. Fixes: 7a96b6ea90a4 ("usb: musb: Add support for PolarFire SoC's musb controller") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/YrVmLEc/FOEzNdzj@kili Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-23xhci-pci: Allow host runtime PM as default for Intel Meteor Lake xHCIUtkarsh Patel1-1/+3
Meteor Lake TCSS(Type-C Subsystem) xHCI needs to be runtime suspended whenever possible to allow the TCSS hardware block to enter D3cold and thus save energy. Cc: [email protected] Signed-off-by: Utkarsh Patel <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-23xhci-pci: Allow host runtime PM as default for Intel Raptor Lake xHCITanveer Alam1-1/+3
In the same way as Intel Alder Lake TCSS (Type-C Subsystem) the Raptor Lake TCSS xHCI needs to be runtime suspended whenever possible to allow the TCSS hardware block to enter D3cold and thus save energy. Cc: [email protected] Signed-off-by: Tanveer Alam <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-23xhci: turn off port power in shutdownMathias Nyman3-3/+16
If ports are not turned off in shutdown then runtime suspended self-powered USB devices may survive in U3 link state over S5. During subsequent boot, if firmware sends an IPC command to program the port in DISCONNECT state, it will time out, causing significant delay in the boot time. Turning off roothub port power is also recommended in xhci specification 4.19.4 "Port Power" in the additional note. Cc: [email protected] Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-23xhci: Keep interrupt disabled in initialization until host is running.Hongyu Xie1-13/+22
irq is disabled in xhci_quiesce(called by xhci_halt, with bit:2 cleared in USBCMD register), but xhci_run(called by usb_add_hcd) re-enable it. It's possible that you will receive thousands of interrupt requests after initialization for 2.0 roothub. And you will get a lot of warning like, "xHCI dying, ignoring interrupt. Shouldn't IRQs be disabled?". This amount of interrupt requests will cause the entire system to freeze. This problem was first found on a device with ASM2142 host controller on it. [tidy up old code while moving it, reword header -Mathias] Cc: [email protected] Signed-off-by: Hongyu Xie <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-23Merge tag 'usb-serial-5.19-rc4' of ↵Greg Kroah-Hartman2-12/+23
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.19-rc4 Here are some new modem device ids and support for further PL2303 device types. All but the final commit (RM500K device id) have been in linux-next and with no reported issues. * tag 'usb-serial-5.19-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Quectel RM500K module support USB: serial: option: add Quectel EM05-G modem USB: serial: pl2303: add support for more HXN (G) types USB: serial: option: add Telit LE910Cx 0x1250 composition
2022-06-23USB: serial: option: add Quectel RM500K module supportMacpaul Lin1-0/+2
Add usb product id of the Quectel RM500K module. RM500K provides 2 mandatory interfaces to Linux host after enumeration. - /dev/ttyUSB5: this is a serial interface for control path. User needs to write AT commands to this device node to query status, set APN, set PIN code, and enable/disable the data connection to 5G network. - ethX: this is the data path provided as a RNDIS devices. After the data connection has been established, Linux host can access 5G data network via this interface. "RNDIS": RNDIS + ADB + AT (/dev/ttyUSB5) + MODEM COMs usb-devices output for 0x7001: T: Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=7001 Rev=00.01 S: Manufacturer=MediaTek Inc. S: Product=USB DATA CARD S: SerialNumber=869206050009672 C: #Ifs=10 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=ff Driver=rndis_host E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=125us I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I: If#= 9 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=8a(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms Co-developed-by: Ballon Shi <[email protected]> Signed-off-by: Ballon Shi <[email protected]> Signed-off-by: Macpaul Lin <[email protected]> Cc: [email protected] Signed-off-by: Johan Hovold <[email protected]>
2022-06-22Merge branch 'staging-octeon' of ↵Greg Kroah-Hartman4-0/+5598
gitolite.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging into usb-next This merges the movement of the octeon-usb driver out of drivers/staging/ into drivers/usb. Signed-off-by: Greg Kroah-Hartman <[email protected]> * 'staging-octeon' of gitolite.kernel.org:/pub/scm/linux/kernel/git/gregkh/staging: staging: octeon-usb: move driver out of staging
2022-06-22USB: serial: use kmemdup instead of kmalloc + memcpySlark Xiao3-9/+3
For code neat purpose, we can use kmemdup to replace kmalloc + memcpy. Signed-off-by: Slark Xiao <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
2022-06-22USB: serial: option: add Quectel EM05-G modemYonglin Tan1-0/+3
The EM05-G modem has 2 USB configurations that are configurable via the AT command AT+QCFG="usbnet",[ 0 | 2 ] which make the modem enumerate with the following interfaces, respectively: "RMNET" : AT + DIAG + NMEA + Modem + QMI "MBIM" : MBIM + AT + DIAG + NMEA + Modem The detailed description of the USB configuration for each mode as follows: RMNET Mode -------------- T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 21 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=030a Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms MBIM Mode -------------- T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 16 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=030a Rev= 3.18 S: Manufacturer=Quectel S: Product=Quectel EM05-G C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00 I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim E: Ad=89(I) Atr=03(Int.) MxPS= 64 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Yonglin Tan <[email protected]> Cc: [email protected] Signed-off-by: Johan Hovold <[email protected]>
2022-06-22USB: serial: pl2303: add support for more HXN (G) typesJohan Hovold1-12/+17
Add support for further HXN (G) type devices (GT variant, GL variant, GS variant and GR) and document the bcdDevice mapping. Note that the TA and TB types use the same bcdDevice as some GT and GE variants, respectively, but that the HX status request can be used to determine which is which. Also note that we currently do not distinguish between the various HXN (G) types in the driver but that this may change eventually (e.g. when adding GPIO support). Reported-by: Charles Yeh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] # 5.13 Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
2022-06-22usb: dwc2: host: add TPL supportAmelie Delaunay1-0/+3
The Target Peripheral List (TPL) is used to identify targeted devices during Embedded Host compliance testing. The user can add "tpl-support" in the device tree to enable it. Signed-off-by: Amelie Delaunay <[email protected]> Signed-off-by: Fabrice Gasnier <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: host: ehci-platform: add TPL supportAmelie Delaunay1-0/+2
The Target Peripheral List (TPL) is used to identify targeted devices during Embedded Host compliance testing. The user can add "tpl-support" in the device tree to enable it. Acked-by: Alan Stern <[email protected]> Signed-off-by: Amelie Delaunay <[email protected]> Signed-off-by: Fabrice Gasnier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: host: ohci-platform: add TPL supportAmelie Delaunay1-0/+3
The Target Peripheral List (TPL) is used to identify targeted devices during Embedded Host compliance testing. The user can add "tpl-support" in the device tree to enable it. Acked-by: Alan Stern <[email protected]> Signed-off-by: Amelie Delaunay <[email protected]> Signed-off-by: Fabrice Gasnier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21staging: octeon-usb: move driver out of stagingArtur Bujdoso4-0/+5598
The Octeon usb driver has been in staging for a long time and used in Ubiquiti routers for a while now. It's been built and then tested on real hardware with several usb devices and it is proven to be stable and ready to be moved to its proper place in the kernel tree. Move it to drivers/usb/host and adjust its Makefile, Kconfig and defconfig dependencies. Many thanks to the developers who made it happen. Signed-off-by: Artur Bujdoso <[email protected]> Link: https://lore.kernel.org/r/Yo0HBIlSXOBM+//9@crux Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: chipidea: ci_hdrc_imx: use dev_err_probe()Alexander Stein1-16/+7
Use dev_err_probe() to simplify handling errors in ci_hdrc_imx_probe() Acked-by: Peter Chen <[email protected]> Signed-off-by: Alexander Stein <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: chipidea: udc: implement get_frameMichael Grzeschik3-0/+17
The chipidea udc core is capable of reading the current frame index from hardware. This patch adds the get_frame callback to the driver. Acked-by: Peter Chen <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: host: ehci-q: Fix ehci_submit_single_step_set_feature annotation typoHyunwoo Kim1-1/+1
I found the "argument" typo. It seems that "argument" is more correct than "arguement". Signed-off-by: Hyunwoo Kim <[email protected]> Link: https://lore.kernel.org/r/20220621064242.GA698757@ubuntu Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21USB: storage: Fix typo in commentXiang wangx1-1/+1
Delete the redundant word 'the'. Signed-off-by: Xiang wangx <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21USB: ohci-sm501: Fix typo in commentXiang wangx1-1/+1
Delete the redundant word 'the'. Signed-off-by: Xiang wangx <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: musb: core: drop redundant checksSergey Shtylyov1-14/+2
In musb_{save|restore}_context() the expression '&musb->endpoints[i]' just cannot be NULL, so the checks have no sense at all -- after dropping them, the local variables 'hw_ep' are no longer necessary, so drop them as well. Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool. Signed-off-by: Sergey Shtylyov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: renesas: Fix refcount leak bugLiang He1-0/+4
In usbhs_rza1_hardware_init(), of_find_node_by_name() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: host: ohci-ppc-of: Fix refcount leak bugLiang He1-0/+1
In ohci_hcd_ppc_of_probe(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Acked-by: Alan Stern <[email protected]> Signed-off-by: Liang He <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: typec: mux: Allow muxes to specify mode-switchPrashant Malani1-2/+6
Loosen the typec_mux_match() requirements so that searches where an alt mode is not specified, but the target mux device lists the "mode-switch" property, return a success. This is helpful in Type C port drivers which would like to get a pointer to the mux switch associated with a Type C port, but don't want to specify a particular alt mode. Signed-off-by: Prashant Malani <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Nícolas F. R. A. Prado <[email protected]> Tested-by: Nícolas F. R. A. Prado <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: dwc3: qcom: Keep power domain on to retain controller statusSandeep Maheswaram1-7/+21
If dwc3 is wakeup capable, keep the power domain always ON so that wakeup from system suspend can be supported. Otherwise, keep the power domain ON only during runtime suspend to support wakeup from runtime suspend. Reviewed-by: Pavankumar Kondeti <[email protected]> Signed-off-by: Sandeep Maheswaram <[email protected]> Signed-off-by: Krishna Kurapati <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: dwc3: qcom: Configure wakeup interrupts during suspendSandeep Maheswaram1-10/+62
Configure DP/DM line interrupts based on the USB2 device attached to the root hub port. When HS/FS device is connected, configure the DP line as falling edge to detect both disconnect and remote wakeup scenarios. When LS device is connected, configure DM line as falling edge to detect both disconnect and remote wakeup. When no device is connected, configure both DP and DM lines as rising edge to detect HS/HS/LS device connect scenario. Reviewed-by: Pavankumar Kondeti <[email protected]> Reviewed-by: Matthias Kaehlcke <[email protected]> Signed-off-by: Sandeep Maheswaram <[email protected]> Signed-off-by: Krishna Kurapati <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: dwc3: qcom: Add helper functions to enable,disable wake irqsSandeep Maheswaram1-32/+26
Adding helper functions to enable,disable wake irqs to make the code simple and readable. Reviewed-by: Matthias Kaehlcke <[email protected]> Reviewed-by: Pavankumar Kondeti <[email protected]> Signed-off-by: Sandeep Maheswaram <[email protected]> Signed-off-by: Krishna Kurapati <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: dwc3: core: Host wake up support from system suspendSandeep Maheswaram1-6/+3
Check wakeup-source property for dwc3 core node to set the wakeup capability. Drop the device_init_wakeup call from runtime suspend and resume. If the dwc3 is wakeup capable, don't power down the USB PHY(s). The glue drivers are expected to take care of configuring the additional wakeup settings if needed based on the dwc3 wakeup capability status. In some SOC designs, powering off the PHY is resulting in higher leakage, so this patch save power on such boards. Reviewed-by: Pavankumar Kondeti <[email protected]> Signed-off-by: Sandeep Maheswaram <[email protected]> Signed-off-by: Krishna Kurapati <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: dwc3: core: Deprecate GCTL.CORESOFTRESETThinh Nguyen1-1/+2
Synopsys IP DWC_usb32 and DWC_usb31 version 1.90a and above deprecated GCTL.CORESOFTRESET. The DRD mode switching flow is updated to remove the GCTL soft reset. Add version checks to prevent using deprecated setting in mode switching flow. Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/9df529fde6e55f5508321b6bc26e92848044ef2b.1655338967.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: musb: Add support for PolarFire SoC's musb controllerConor Dooley3-1/+278
Add support for Microchips's PolarFire SoC's musb controller in host, peripheral and otg mode. Tested-by: Valentina Fernandez <[email protected]> Signed-off-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: gadget: Remove unnecessary print function dev_err()Jiapeng Chong1-1/+0
The print function dev_err() is redundant because platform_get_irq() already prints an error. This was found by coccicheck: ./drivers/usb/gadget/udc/aspeed_udc.c:1546:2-9: line 1546 is redundant because platform_get_irq() already prints an error. Acked-by: Neal Liu <[email protected]> Signed-off-by: Jiapeng Chong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: gadget: ast2600: Fix a couple of spelling mistakesColin Ian King1-2/+2
There are a couple of spelling mistakes, one in a dev_warn message and another in a SETUP_DBG message. Fix these and remove an extraneous white space too. Acked-by: Neal Liu <[email protected]> Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: gadget: aspeed_udc: cleanup loop in ast_dma_descriptor_setup()Dan Carpenter1-13/+11
The "chunk >= 0" condition does not work because count is a u32. Also, really we shouldn't enter the loop when "chunk" is zero. Once that condition is fixed then there is no need for the "last" variable. I reversed the "if (chunk <= ep->chunk_max)" as well. The new loop is much simpler. Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/Yq2SvM2bbrtSd1H9@kili Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: gadget: aspeed_udc: fix missing spin_unlock_irqrestore in ast_udc_ep_queueZheng Bin1-1/+2
ast_udc_ep_queue misses spin_unlock_irqrestore in an error path, this patch fixes that. Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver") Reviewed-by: Neal Liu <[email protected]> Signed-off-by: Zheng Bin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: typec: wcove: Drop wrong dependency to INTEL_SOC_PMICAndy Shevchenko1-1/+0
Intel SoC PMIC is a generic name for all PMICs that are used on Intel platforms. In particular, INTEL_SOC_PMIC kernel configuration option refers to Crystal Cove PMIC, which has never been a part of any Intel Broxton hardware. Drop wrong dependency from Kconfig. Note, the correct dependency is satisfied via ACPI PMIC OpRegion driver, which the Type-C depends on. Fixes: d2061f9cc32d ("usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY") Reported-by: Hans de Goede <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: gadget: uvc: fix list double add in uvcg_video_pumpDan Vacura1-0/+3
A panic can occur if the endpoint becomes disabled and the uvcg_video_pump adds the request back to the req_free list after it has already been queued to the endpoint. The endpoint complete will add the request back to the req_free list. Invalidate the local request handle once it's been queued. <6>[ 246.796704][T13726] configfs-gadget gadget: uvc: uvc_function_set_alt(1, 0) <3>[ 246.797078][ T26] list_add double add: new=ffffff878bee5c40, prev=ffffff878bee5c40, next=ffffff878b0f0a90. <6>[ 246.797213][ T26] ------------[ cut here ]------------ <2>[ 246.797224][ T26] kernel BUG at lib/list_debug.c:31! <6>[ 246.807073][ T26] Call trace: <6>[ 246.807180][ T26] uvcg_video_pump+0x364/0x38c <6>[ 246.807366][ T26] process_one_work+0x2a4/0x544 <6>[ 246.807394][ T26] worker_thread+0x350/0x784 <6>[ 246.807442][ T26] kthread+0x2ac/0x320 Fixes: f9897ec0f6d3 ("usb: gadget: uvc: only pump video data if necessary") Cc: [email protected] Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Dan Vacura <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21usb: gadget: Fix non-unique driver names in raw-gadget driverAlan Stern1-16/+46
In a report for a separate bug (which has already been fixed by commit 5f0b5f4d50fa "usb: gadget: fix race when gadget driver register via ioctl") in the raw-gadget driver, the syzbot console log included error messages caused by attempted registration of a new driver with the same name as an existing driver: > kobject_add_internal failed for raw-gadget with -EEXIST, don't try to register things with the same name in the same directory. > UDC core: USB Raw Gadget: driver registration failed: -17 > misc raw-gadget: fail, usb_gadget_register_driver returned -17 These errors arise because raw_gadget.c registers a separate UDC driver for each of the UDC instances it creates, but these drivers all have the same name: "raw-gadget". Until recently this wasn't a problem, but when the "gadget" bus was added and UDC drivers were registered on this bus, it became possible for name conflicts to cause the registrations to fail. The reason is simply that the bus code in the driver core uses the driver name as a sysfs directory name (e.g., /sys/bus/gadget/drivers/raw-gadget/), and you can't create two directories with the same pathname. To fix this problem, the driver names used by raw-gadget are made distinct by appending a unique ID number: "raw-gadget.N", with a different value of N for each driver instance. And to avoid the proliferation of error handling code in the raw_ioctl_init() routine, the error return paths are refactored into the common pattern (goto statements leading to cleanup code at the end of the routine). Link: https://lore.kernel.org/all/[email protected]/ Fixes: fc274c1e9973 "USB: gadget: Add a new bus for gadgets" CC: Andrey Konovalov <[email protected]> CC: <[email protected]> Reported-and-tested-by: [email protected] Reviewed-by: Andrey Konovalov <[email protected]> Acked-by: Hillf Danton <[email protected]> Signed-off-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-21Revert "usb: dwc3: Remove the checks of -ENOSYS"Thinh Nguyen1-2/+2
This reverts commit df22ecc41b54def624735b83784857e708bd1502. If CONFIG_GENERIC_PHY is not enabled, then the devm_phy_get() returns -ENOSYS. Don't remove this check. Fixes: df22ecc41b54 ("usb: dwc3: Remove the checks of -ENOSYS") Cc: Kushagra Verma <[email protected]> Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/eb1df7ef954b5af093c0528982db52a41df18615.1655255152.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-20USB: ACPI: Replace usb_acpi_find_port() with acpi_find_child_by_adr()Rafael J. Wysocki1-17/+1
Instead of walking the list of children of an ACPI device directly in order to find the child matching a given bus address, use acpi_find_child_by_adr() for this purpose. Also notice that if acpi_find_child_by_adr() doesn't find a matching child, acpi_find_child_device() will not find it too, so directly replace usb_acpi_find_port() in usb_acpi_get_companion_for_port() with acpi_find_child_by_adr() and drop it entirely. Apart from simplifying the code, this will help to eliminate the children list head from struct acpi_device as it is redundant and it is used in questionable ways in some places (in particular, locking is needed for walking the list pointed to it safely, but it is often missing). Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]>
2022-06-20USB: serial: option: add Telit LE910Cx 0x1250 compositionCarlo Lobrano1-0/+1
Add support for the following Telit LE910Cx composition: 0x1250: rmnet, tty, tty, tty, tty Reviewed-by: Daniele Palmas <[email protected]> Signed-off-by: Carlo Lobrano <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Johan Hovold <[email protected]>
2022-06-20Merge v5.19-rc3 into usb-nextGreg Kroah-Hartman12-54/+80
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: gadget: add Aspeed ast2600 udc driverNeal Liu3-0/+1610
Aspeed udc is compliant with USB2.0, supports USB High Speed and Full Speed, backward compatible with USB1.1. Supports independent DMA channel for each generic endpoint. Supports 32/256 stages descriptor mode for all generic endpoints. This driver supports full functionality including single/multiple stages descriptor mode, and exposes 1 UDC gadget driver. Signed-off-by: Neal Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: Avoid extra usb SET_SEL requests when enabling link power managementMathias Nyman1-39/+21
The host needs to tell the device the exit latencies using the SET_SEL request before device initiated link powermanagement can be enabled. The exit latency values do not change after enumeration, it's enough to set them once. So do like Windows 10 and issue the SET_SEL request once just before setting the configuration. This is also the sequence described in USB 3.2 specs "9.1.2 Bus enumeration". SET_SEL is issued once before the Set Configuration request, and won't be cleared by the Set Configuration, Set Interface or ClearFeature (STALL) requests. Only warm reset, hot reset, set Address 0 clears the exit latencies. See USB 3.2 section 9.4.14 Table 9-10 Device parameters and events Add udev->lpm_devinit_allow, and set it if SET_SEL was successful. If not set, then don't try to enable device initiated LPM We used to issue a SET_SEL request every time lpm is enabled for either U1 or U2 link states, meaning a SET_SEL was issued twice after every Set Configuration and Set Interface requests, easily accumulating to over 15 SET_SEL requets during a USB3 webcam enumeration. Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: dwc3: Fix typos in KconfigKushagra Verma1-2/+2
Fixes the following 2 typos in Kconfig: 1. is -> as 2. progammed -> programmed Signed-off-by: Kushagra Verma <[email protected]> Link: https://lore.kernel.org/r/HK0PR01MB280151A3B2CF6C3E4DC2F9CAF8D39@HK0PR01MB2801.apcprd01.prod.exchangelabs.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: dwc3: Fix a repeated word checkpatch warningKushagra Verma1-1/+1
Fixes a repeated word checkpatch warning in ep0.c by removing the repeated 'only' word. Signed-off-by: Kushagra Verma <[email protected]> Link: https://lore.kernel.org/r/HK0PR01MB2801996E815208393170010FF8D39@HK0PR01MB2801.apcprd01.prod.exchangelabs.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: dwc3: Fix bare use of unsigned checkpatch warningKushagra Verma1-2/+2
Fixes the bare use of unsigned warning from checkpatch.pl in core.c by changing 'unsigned' to 'unsigned int'. Signed-off-by: Kushagra Verma <[email protected]> Link: https://lore.kernel.org/r/HK0PR01MB280160BCA168FA9FE159F02AF8D39@HK0PR01MB2801.apcprd01.prod.exchangelabs.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: typec: tcpm: Register USB Power Delivery CapabilitiesHeikki Krogerus1-1/+141
Register both the port and partner USB Power Delivery Capabilities so they are exposed to the user space. Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: typec: USB Power Delivery helpers for ports and partnersHeikki Krogerus2-0/+153
All the USB Type-C Connector Class devices are protected, so the drivers can not directly access them. This will adds a few helpers that can be used to link the ports and partners to the correct USB Power Delivery objects. For ports a new optional sysfs attribute file is also added that can be used to select the USB Power Delivery capabilities that the port will advertise to the partner. Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: typec: Separate USB Power Delivery from USB Type-CHeikki Krogerus3-1/+739
Introducing a small device class for USB Power Delivery. The idea with it is that we do not mix any more USB Power Delivery information into the USB Type-C connectors only. This separation will make it possible to register USB Power Delivery devices also from other places, for example from USB Type-C Bridges (see USB Type-C Bridge Specification). The device class will not always deal with only the messages and objects that were negotiated with the partner, but instead messages and objects that can be used in the negotiation. That allows the USB PD devices to be shared and reconfigured. The ports can decide which objects are to be advertised to the partner before the contract is negotiated. It is also possible to allow the user space to make that decision if needed. Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-06-12usb: hub: port: add sysfs entry to switch port powerMichael Grzeschik3-19/+106
In some cases the port of an hub needs to be disabled or switched off and on again. E.g. when the connected device needs to be re-enumerated. Or it needs to be explicitly disabled while the rest of the usb tree stays working. For this purpose this patch adds an sysfs switch to enable/disable the port on any hub. In the case the hub is supporting power switching, the power line will be disabled to the connected device. When the port gets disabled, the associated device gets disconnected and removed from the logical usb tree. No further device will be enumerated on that port until the port gets enabled again. Reviewed-by: Alan Stern <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>