Skip to content
  1. Feb 12, 2022
  2. Feb 11, 2022
  3. Feb 08, 2022
  4. Feb 01, 2022
  5. Jan 31, 2022
    • Pavel Hofman's avatar
      usb: gadget: f_uac2: Define specific wTerminalType · 54321841
      Pavel Hofman authored
      
      
      Several users have reported that their Win10 does not enumerate UAC2
      gadget with the existing wTerminalType set to
      UAC_INPUT_TERMINAL_UNDEFINED/UAC_INPUT_TERMINAL_UNDEFINED, e.g.
      https://github.com/raspberrypi/linux/issues/4587#issuecomment-926567213.
      While the constant is officially defined by the USB terminal types
      document, e.g. XMOS firmware for UAC2 (commonly used for Win10) defines
      no undefined output terminal type in its usbaudio20.h header.
      
      Therefore wTerminalType of EP-IN is set to
      UAC_INPUT_TERMINAL_MICROPHONE and wTerminalType of EP-OUT to
      UAC_OUTPUT_TERMINAL_SPEAKER for the UAC2 gadget.
      
      Signed-off-by: default avatarPavel Hofman <pavel.hofman@ivitera.com>
      Cc: stable <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20220131071813.7433-1-pavel.hofman@ivitera.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      54321841
    • Adam Ford's avatar
      usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition · 459702ee
      Adam Ford authored
      The support the external role switch a variety of situations were
      addressed, but the transition from USB_ROLE_HOST to USB_ROLE_NONE
      leaves the host up which can cause some error messages when
      switching from host to none, to gadget, to none, and then back
      to host again.
      
       xhci-hcd ee000000.usb: Abort failed to stop command ring: -110
       xhci-hcd ee000000.usb: xHCI host controller not responding, assume dead
       xhci-hcd ee000000.usb: HC died; cleaning up
       usb 4-1: device not accepting address 6, error -108
       usb usb4-port1: couldn't allocate usb_device
      
      After this happens it will not act as a host again.
      Fix this by releasing the host mode when transitioning to USB_ROLE_NONE.
      
      Fixes: 0604160d
      
       ("usb: gadget: udc: renesas_usb3: Enhance role switch support")
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: default avatarAdam Ford <aford173@gmail.com>
      Link: https://lore.kernel.org/r/20220128223603.2362621-1-aford173@gmail.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      459702ee
    • Jann Horn's avatar
      usb: raw-gadget: fix handling of dual-direction-capable endpoints · 292d2c82
      Jann Horn authored
      Under dummy_hcd, every available endpoint is *either* IN or OUT capable.
      But with some real hardware, there are endpoints that support both IN and
      OUT. In particular, the PLX 2380 has four available endpoints that each
      support both IN and OUT.
      
      raw-gadget currently gets confused and thinks that any endpoint that is
      usable as an IN endpoint can never be used as an OUT endpoint.
      
      Fix it by looking at the direction in the configured endpoint descriptor
      instead of looking at the hardware capabilities.
      
      With this change, I can use the PLX 2380 with raw-gadget.
      
      Fixes: f2c2e717
      
       ("usb: gadget: add raw-gadget interface")
      Cc: stable <stable@vger.kernel.org>
      Tested-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
      Reviewed-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
      Signed-off-by: default avatarJann Horn <jannh@google.com>
      Link: https://lore.kernel.org/r/20220126205214.2149936-1-jannh@google.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      292d2c82
    • Tommaso Merciai's avatar
      usb: usb251xb: add boost-up property support · 5c2b9c61
      Tommaso Merciai authored
      
      
      Add support for boost-up register of usb251xb hub.
      boost-up property control USB electrical drive strength
      This register can be set:
      
       - Normal mode -> 0x00
       - Low         -> 0x01
       - Medium      -> 0x10
       - High        -> 0x11
      
      (Normal Default)
      
      References:
       - http://www.mouser.com/catalog/specsheets/2514.pdf p29
      
      Reviewed-by: default avatarRichard Leitner <richard.leitner@linux.dev>
      Signed-off-by: default avatarTommaso Merciai <tomm.merciai@gmail.com>
      Link: https://lore.kernel.org/r/20220128181713.96856-1-tomm.merciai@gmail.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c2b9c61
    • Sean Anderson's avatar
      usb: ulpi: Call of_node_put correctly · 0a907ee9
      Sean Anderson authored
      of_node_put should always be called on device nodes gotten from
      of_get_*. Additionally, it should only be called after there are no
      remaining users. To address the first issue, call of_node_put if later
      steps in ulpi_register fail. To address the latter, call put_device if
      device_register fails, which will call ulpi_dev_release if necessary.
      
      Fixes: ef6a7bcf
      
       ("usb: ulpi: Support device discovery via DT")
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
      Link: https://lore.kernel.org/r/20220127190004.1446909-3-sean.anderson@seco.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0a907ee9
    • Sean Anderson's avatar
      usb: ulpi: Move of_node_put to ulpi_dev_release · 092f45b1
      Sean Anderson authored
      Drivers are not unbound from the device when ulpi_unregister_interface
      is called. Move of_node-freeing code to ulpi_dev_release which is called
      only after all users are gone.
      
      Fixes: ef6a7bcf
      
       ("usb: ulpi: Support device discovery via DT")
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: default avatarSean Anderson <sean.anderson@seco.com>
      Link: https://lore.kernel.org/r/20220127190004.1446909-2-sean.anderson@seco.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      092f45b1
    • Pawel Dembicki's avatar
      USB: serial: option: add ZTE MF286D modem · d48384c7
      Pawel Dembicki authored
      
      
      Modem from ZTE MF286D is an Qualcomm MDM9250 based 3G/4G modem.
      
      T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=5000 MxCh= 0
      D:  Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
      P:  Vendor=19d2 ProdID=1485 Rev=52.87
      S:  Manufacturer=ZTE,Incorporated
      S:  Product=ZTE Technologies MSM
      S:  SerialNumber=MF286DZTED000000
      C:* #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=896mA
      A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host
      E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
      E:  Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      E:  Ad=88(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
      E:  Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs
      E:  Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E:  Ad=89(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      
      Signed-off-by: default avatarPawel Dembicki <paweldembicki@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      d48384c7
    • Stephan Brunner's avatar
      USB: serial: ch341: add support for GW Instek USB2.0-Serial devices · fa77ce20
      Stephan Brunner authored
      
      
      Programmable lab power supplies made by GW Instek, such as the
      GPP-2323, have a USB port exposing a serial port to control the device.
      
      Stringing the supplied Windows driver, references to the ch341 chip are
      found. Binding the existing ch341 driver to the VID/PID of the GPP-2323
      ("GW Instek USB2.0-Serial" as per the USB product name) works out of the
      box, communication and control is now possible.
      
      This patch should work with any GPP series power supply due to
      similarities in the product line.
      
      Signed-off-by: default avatarStephan Brunner <s.brunner@stephan-brunner.net>
      Link: https://lore.kernel.org/r/4a47b864-0816-6f6a-efee-aa20e74bcdc6@stephan-brunner.net
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      fa77ce20
    • Udipto Goswami's avatar
      usb: f_fs: Fix use-after-free for epfile · ebe2b1ad
      Udipto Goswami authored
      Consider a case where ffs_func_eps_disable is called from
      ffs_func_disable as part of composition switch and at the
      same time ffs_epfile_release get called from userspace.
      ffs_epfile_release will free up the read buffer and call
      ffs_data_closed which in turn destroys ffs->epfiles and
      mark it as NULL. While this was happening the driver has
      already initialized the local epfile in ffs_func_eps_disable
      which is now freed and waiting to acquire the spinlock. Once
      spinlock is acquired the driver proceeds with the stale value
      of epfile and tries to free the already freed read buffer
      causing use-after-free.
      
      Following is the illustration of the race:
      
            CPU1                                  CPU2
      
         ffs_func_eps_disable
         epfiles (local copy)
      					ffs_epfile_release
      					ffs_data_closed
      					if (last file closed)
      					ffs_data_reset
      					ffs_data_clear
      					ffs_epfiles_destroy
      spin_lock
      dereference epfiles
      
      Fix this races by taking epfiles local copy & assigning it under
      spinlock and if epfiles(local) is null then update it in ffs->epfiles
      then finally destroy it.
      Extending the scope further from the race, protecting the ep related
      structures, and concurrent accesses.
      
      Fixes: a9e6f83c
      
       ("usb: gadget: f_fs: stop sleeping in ffs_func_eps_disable")
      Co-developed-by: default avatarUdipto Goswami <quic_ugoswami@quicinc.com>
      Reviewed-by: default avatarJohn Keeping <john@metanate.com>
      Signed-off-by: default avatarPratham Pratap <quic_ppratap@quicinc.com>
      Signed-off-by: default avatarUdipto Goswami <quic_ugoswami@quicinc.com>
      Link: https://lore.kernel.org/r/1643256595-10797-1-git-send-email-quic_ugoswami@quicinc.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebe2b1ad
    • Robert Hancock's avatar
      usb: dwc3: xilinx: fix uninitialized return value · b470947c
      Robert Hancock authored
      A previous patch to skip part of the initialization when a USB3 PHY was
      not present could result in the return value being uninitialized in that
      case, causing spurious probe failures. Initialize ret to 0 to avoid this.
      
      Fixes: 9678f336
      
       ("usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode")
      Cc: <stable@vger.kernel.org>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
      Link: https://lore.kernel.org/r/20220127221500.177021-1-robert.hancock@calian.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b470947c
  6. Jan 30, 2022