1. 23 Oct, 2019 3 commits
    • Chunfeng Yun's avatar
      usb: mtu3: fix race condition about delayed_status · f3088e6a
      Chunfeng Yun authored
      usb_composite_setup_continue() may be called before composite_setup()
      return USB_GADGET_DELAYED_STATUS, then the controller driver will
      delay status stage after composite_setup() finish, but the class driver
      don't ask the controller to continue delayed status anymore, this will
      cause control transfer timeout.
      
      happens when use mass storage (also enabled other class driver):
      
      cpu1:                               cpu2
      handle_setup(SET_CONFIG) //gadget driver
        unlock (g->lock)
        gadget_driver->setup()
          composite_setup()
            lock(cdev->lock)
              set_config()
                fsg_set_alt() // maybe some times due to many class are enabled
                  raise FSG_STATE_CONFIG_CHANGE
                  return USB_GADGET_DELAYED_STATUS
                                          handle_exception()
                                          usb_composite_setup_continue()
            unlock(cdev->lock)
                                            lock(cdev->lock)
                                              ep0_queue()
                                                lock (g->lock)
                                                //no delayed status, nothing todo
                                                unlock (g->lock)
                                            unlock(cdev->lock)
          return USB_GADGET_DELAYED_STATUS // composite_setup
        lock (g->lock)
      get USB_GADGET_DELAYED_STATUS //handle_setup [1]
      
      Try to fix the race condition as following:
      After the driver gets USB_GADGET_DELAYED_STATUS at [1], if we find
      there is a usb_request in ep0 request list, it means composite already
      asked us to continue delayed status by usb_composite_setup_continue(),
      so we skip request about delayed_status by composite_setup() and still
      do status stage.
      Signed-off-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      f3088e6a
    • Nagarjuna Kristam's avatar
      usb: gadget: Add UDC driver for tegra XUSB device mode controller · 49db4272
      Nagarjuna Kristam authored
      This patch adds UDC driver for tegra XUSB 3.0 device mode controller.
      XUSB device mode controller supports SS, HS and FS modes
      
      Based on work by:
        Mark Kuo <mkuo@nvidia.com>
        Hui Fu <hfu@nvidia.com>
        Andrew Bresticker <abrestic@chromium.org>
      Signed-off-by: default avatarNagarjuna Kristam <nkristam@nvidia.com>
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      49db4272
    • Thinh Nguyen's avatar
      usb: dwc3: debug: Remove newline printout · 038761ce
      Thinh Nguyen authored
      The newline from the unknown link state tracepoint doesn't follow the
      other tracepoints, and it looks unsightly. Let's remove it.
      Signed-off-by: default avatarThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      038761ce
  2. 22 Oct, 2019 37 commits