1. 02 6月, 2017 9 次提交
    • J
      usb: gadget: function: f_fs: Let ffs_epfile_ioctl wait for enable. · 222155de
      Jerry Zhang 提交于
      This allows users to make an ioctl call as the first action on a
      connection. Ex, some functions might want to get endpoint size
      before making any i/os.
      
      Previously, calling ioctls before read/write would depending on the
      timing of endpoints being enabled.
      
      ESHUTDOWN is now a possible return value and ENODEV is not, so change
      docs accordingly.
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NJerry Zhang <zhangjerry@google.com>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      222155de
    • S
      usb: gadget: remove redundant self assignment · 8a8b161d
      Stefan Agner 提交于
      The assignment ret = ret is redundant and can be removed.
      Reviewed-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Reviewed-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      8a8b161d
    • F
      usb: dwc3: trace: decode ctrl request · af32423a
      Felipe Balbi 提交于
      Instead of *always* dumping raw ctrl bytes, let's decode standard
      requests which will make the lives of those debugging DWC3 quite a bit
      easier.
      
      Output will now look like so:
      
      irq/34-dwc3-1594  [000] d..1   107.573081: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   107.573694: dwc3_ctrl_req: Set Address(Addr = 01)
      irq/34-dwc3-1594  [000] d..1   107.588319: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   107.588816: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
      irq/34-dwc3-1594  [000] d..1   107.589191: dwc3_ctrl_req: Set Configuration(Config = 3)
      irq/34-dwc3-1594  [000] d..1   107.589846: dwc3_ctrl_req: Get BOS Descriptor(Index = 0, Length = 5)
      irq/34-dwc3-1594  [000] d..1   107.590146: dwc3_ctrl_req: Get BOS Descriptor(Index = 0, Length = 22)
      irq/34-dwc3-1594  [000] d..1   107.590546: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
      irq/34-dwc3-1594  [000] d..1   107.590840: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 69)
      irq/34-dwc3-1594  [000] d..1   107.591138: dwc3_ctrl_req: Get Configuration Descriptor(Index = 1, Length = 9)
      irq/34-dwc3-1594  [000] d..1   107.591541: dwc3_ctrl_req: Get Configuration Descriptor(Index = 1, Length = 32)
      irq/34-dwc3-1594  [000] d..1   107.591834: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   114.701005: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   114.721080: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   114.722709: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   114.728979: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   114.730544: dwc3_ctrl_req: Get Device Qualifier Descriptor(Index = 0, Length = 10)
      irq/34-dwc3-1594  [000] d..1   115.776018: dwc3_ctrl_req: Get Configuration Descriptor(Index = 0, Length = 9)
      irq/34-dwc3-1594  [000] d..1   115.776760: dwc3_ctrl_req: Set Configuration(Config = 0)
      irq/34-dwc3-1594  [000] d..1   115.777676: dwc3_ctrl_req: Get Configuration(Length = 1)
      irq/34-dwc3-1594  [000] d..1   115.924797: dwc3_ctrl_req: Get Device Descriptor(Index = 0, Length = 18)
      irq/34-dwc3-1594  [000] d..1   115.929025: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
      irq/34-dwc3-1594  [000] d..1   115.929566: dwc3_ctrl_req: Get String Descriptor(Index = 1, Length = 500)
      irq/34-dwc3-1594  [000] d..1   115.930911: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
      irq/34-dwc3-1594  [000] d..1   115.931528: dwc3_ctrl_req: Get String Descriptor(Index = 2, Length = 500)
      irq/34-dwc3-1594  [000] d..1   115.932950: dwc3_ctrl_req: Get String Descriptor(Index = 0, Length = 500)
      irq/34-dwc3-1594  [000] d..1   115.933533: dwc3_ctrl_req: Get String Descriptor(Index = 3, Length = 500)
      
      Note that Class and Vendor requests won't be decoded for obvious
      reasons. Those will be printed as a raw sequence of bytes.
      
      This patch has been tested against a normal host (both Linux and
      Windows) and USB30CV Chapter 9 tests.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      af32423a
    • F
      usb: dwc3: debug: remove static char buffer from dwc3_decode_event() · 3587f36a
      Felipe Balbi 提交于
      Instead, we can require caller to pass a buffer for the function to
      use. This cleans things quite a bit.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      3587f36a
    • F
      usb: dwc3: trace: rely on __string() and __assign_str() · e42f09b8
      Felipe Balbi 提交于
      Instead of going for a 512 byte buffer and using snprintf(), let's
      rely on helps __string() and __assign_str() where possible.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      e42f09b8
    • F
      usb: dwc3: gadget: slight cleanup to dwc3_process_event_entry() · dfc5e805
      Felipe Balbi 提交于
      No functional changes, just a slight readability improvement.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      dfc5e805
    • F
      usb: dwc3: debugfs: slightly improve output of trb_ring · 436841d5
      Felipe Balbi 提交于
      Instead of printing out enqueue and dequeue pointer value as a header
      to the output, let's mark the TRBs in question with 'E' and 'D'. The
      output looks slightly easier to read.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      436841d5
    • F
      usb: dwc3: update documentation · bfad65ee
      Felipe Balbi 提交于
      No functional changes, just making sure we can use these for ReST docs
      later.
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      bfad65ee
    • F
      usb: dwc3: replace %p with %pK · 04fb365c
      Felipe Balbi 提交于
      %p will leak kernel pointers, so let's not expose the information on
      dmesg and instead use %pK. %pK will only show the actual addresses if
      explicitly enabled under /proc/sys/kernel/kptr_restrict.
      
      Cc: <stable@vger.kernel.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      04fb365c
  2. 17 5月, 2017 10 次提交
  3. 16 5月, 2017 2 次提交
    • A
      USB: f_mass_storage: improve memory barriers and synchronization · 225785ae
      Alan Stern 提交于
      This patch reworks the way f_mass_storage.c handles memory barriers
      and synchronization:
      
      	The driver now uses a wait_queue instead of doing its own
      	task-state manipulations (even though only one task will ever
      	use the wait_queue).
      
      	The thread_wakeup_needed variable is removed.  It was only a
      	source of trouble; although it was what the driver tested to
      	see whether it should wake up, what we really wanted to see
      	was whether a USB transfer had completed.
      
      	All the explicit memory barriers scattered throughout the
      	driver are replaced by a few calls to smp_load_acquire() and
      	smp_store_release().
      
      	The inreq_busy and outreq_busy fields are removed.  In their
      	place, the driver keeps track of the current I/O direction by
      	splitting BUF_STATE_BUSY into two states: BUF_STATE_SENDING
      	and BUF_STATE_RECEIVING.
      
      	The buffer states are no longer protected by a lock.  Mutual
      	exclusion isn't needed; the state is changed only by the
      	driver's main thread when it owns the buffer, and only by the
      	request completion routine when the gadget core owns the buffer.
      
      	The do_write() and throw_away_data() routines were reorganized
      	to make efficient use of the new sleeping mechanism.  This
      	resulted in the removal of one indentation level in those
      	routines, making the patch appear to be more more complicated
      	than it really is.
      
      	In a few places, the driver allowed itself to be frozen although
      	it really shouldn't have (in the middle of executing a SCSI
      	command).  Those places have been fixed.
      
      	The logic in the exception handler for aborting transfers and
      	waiting for them to stop has been simplified.
      Tested-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      225785ae
    • A
      USB: f_mass_storage: improve async notification handling · 78db441d
      Alan Stern 提交于
      This patch makes several adjustments to the way f_mass_storage.c
      handles its internal state and asynchronous notifications (AKA
      exceptions):
      
      	A number of states weren't being used for anything.
      	They are removed.
      
      	The FSG_STATE_IDLE state was renamed to FSG_STATE_NORMAL,
      	because it now applies whenever the gadget is operating
      	normally, not just when the gadget is idle.
      
      	The FSG_STATE_RESET state was renamed to
      	FSG_STATE_PROTOCOL_RESET, indicating that it represents a
      	Bulk-Only Transport protocol reset and not a general USB
      	reset.
      
      	When a signal arrives, it's silly for the signal handler to
      	send itself another signal!  Now it takes care of everything
      	inline.
      
      Along with an assortment of other minor changes in the same category.
      Tested-by: NThinh Nguyen <thinhn@synopsys.com>
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
      78db441d
  4. 27 4月, 2017 1 次提交
    • A
      usb: host: xhci: remove #ifdef around PM functions · d852ed98
      Arnd Bergmann 提交于
      The #ifdef is slightly wrong as it doesn't cover the xhci_priv_resume_quirk()
      function, causing a harmless warning:
      
      drivers/usb/host/xhci-plat.c:58:12: error: 'xhci_priv_resume_quirk' defined but not used [-Werror=unused-function]
       static int xhci_priv_resume_quirk(struct usb_hcd *hcd)
      
      A simpler way to do this correctly is to use __maybe_unused annotations
      that let the compiler silently drop the functions when there is no
      reference.
      
      Fixes: b0c69b4b ("usb: host: plat: Enable xHCI plat runtime PM")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d852ed98
  5. 26 4月, 2017 4 次提交
  6. 20 4月, 2017 8 次提交
  7. 19 4月, 2017 2 次提交
  8. 18 4月, 2017 4 次提交