1. 25 1月, 2012 1 次提交
  2. 24 1月, 2012 15 次提交
    • S
      usb: dwc3: unmap the proper number of sg entries · c09d6b51
      Sebastian Andrzej Siewior 提交于
      num_sgs contains the number of sgs assigned by the gadget.
      num_mapped_sgs contains the number of mapped sgs which may differ from
      the gadget's values. For dma_unmap_sg() we have to provide the value
      which was returned by dma_map_sg().
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c09d6b51
    • G
      usb: musb: fix shutdown while usb gadget is in use · 24307cae
      Grazvydas Ignotas 提交于
      If we shutdown without stopping the gadget first or removing the cable,
      gadget manages to configure itself again:
      
      root@pandora /root# poweroff
      The system is going down NOW!
      Requesting system poweroff
      [   47.714385] musb-hm halted.
      [   48.120697]  gadget: suspend
      [   48.123748]  gadget: reset config
      [   48.127227]  gadget: ecm deactivated
      [   48.130981] usb0: gether_disconnect
      [   48.281799]  gadget: high-speed config #1: CDC Ethernet (ECM)
      [   48.287872]  gadget: init ecm
      [   48.290985]  gadget: notify connect false
      [   48.295288]  gadget: notify speed 425984000
      
      This is not only unwanted, it's also happening on half-unitialized
      state, after musb_shutdown() has returned, which sometimes causes
      hardware to fail to work after reboot. Let's better properly stop
      gadget on shutdown too.
      
      This patch moves musb_gadget_cleanup out of musb_free(), which has 2
      callsites: probe error path and musb_remove. On probe error path it was
      superflous since musb_gadget_cleanup is called explicitly there, and
      musb_remove() calls musb_shutdown(), so cleanup will get called as before.
      Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      24307cae
    • F
      usb: gadget: f_mass_storage: Use "bool" instead of "int" in fsg_module_parameters · 4b5203f1
      Fabio Estevam 提交于
      Fix the following build warnings:
      
       CC [M]  drivers/usb/gadget/acm_ms.o
      drivers/usb/gadget/acm_ms.c: In function ‘__check_ro’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_removable’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_cdrom’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_nofua’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_stall’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
        CC [M]  drivers/usb/gadget/mass_storage.o
      drivers/usb/gadget/mass_storage.c: In function ‘__check_ro’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_removable’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_cdrom’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_nofua’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_stall’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      
      Declare the fsg_module_parameters fields as "bool" so that they can match the types
      passed in FSG_MODULE_PARAM_ARRAY macro.
      
      Since commit 493c90ef (module_param: check that bool parameters really are bool.),
      moduleparam.h was changed in a way that the "bool" parameter type now really
      requires "bool" type and no longer allows "unsigned int".
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4b5203f1
    • S
      usb: gadget: check for streams only for SS udcs · c74c9300
      Sebastian Andrzej Siewior 提交于
      Currently the UASP gadget fails to bind on an UDC which does not provide
      stream support. This is true for all udc in tree except for dummy and
      dwc3 since they don't support SuperSpeed.
      There is no need to test for the availability of stream support on those
      UDCs because we will never even try to use them. I think it is sane to
      assume that StreamSupport is always available on SuperSpeed since it is
      one of the key features.
      The host side will only allocate on SS so this part is also fine.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c74c9300
    • P
      usb: gadget: fsl_udc: fix the usage of udc->max_ep · 118d63f7
      Peter Chen 提交于
      The max_ep is the number of endpoint * 2.
      
      But in dtd_complete_irq, it does again * 2, it will deference wrong memory
      after scanning max_ep - 1.
      
      The another similar problem is at USB_REQ_SET_FEATURE (the pipe number
      should be 0 and max_ep - 1).
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Signed-off-by: NMatthieu castet <matthieu.castet@parrot.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      118d63f7
    • F
      drivers: usb: otg: Fix dependencies for some OTG drivers · a37670b1
      Fabio Estevam 提交于
      Fix the following build warning:
      
      warning: (USB_LANGWELL_OTG && FSL_USB2_OTG && USB_MV_OTG) selects USB_OTG which has unmet direct dependencies (USB_SUPPORT && USB && EXPERIMENTAL && USB_SUSPEND)
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      a37670b1
    • J
      usb: renesas: silence uninitialized variable report in usbhsg_recip_run_handle() · 7983bc74
      Jesper Juhl 提交于
      In drivers/usb/renesas_usbhs/mod_gadget.c::usbhsg_recip_run_handle()
      the Coverity Prevent checker currently flags a warning about possibly
      uninitialized use of 'ret' i usbhsg_recip_run_handle(). It does this
      since it assumes we take one of the non-default branches in the switch
      and then subsequently take the false branch in the 'if (func)' case
      below. This exact scenario will never happen, but Coverity can't see
      that for some reason. This patch initializes 'ret' to '0' when it is
      declared which should shut up this report and won't really hurt - so
      why not? At least then it's clear that 'ret' is always initialized..
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      7983bc74
    • P
      usb: gadget: SS Isoc endpoints use comp_desc->bMaxBurst too · 9e878a6b
      Paul Zimmerman 提交于
      SuperSpeed Isoc endpoints also use the bMaxBurst value from the
      companion descriptor. See section 9.6.7 in the USB 3.0 spec.
      Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      9e878a6b
    • A
      usb: gadget: storage: endian fix · a8501639
      Andiry Xu 提交于
      Fix some endian issues for storage gadgets.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      a8501639
    • F
      usb: dwc3: ep0: fix compile warning · 1a0955fe
      Felipe Balbi 提交于
      commit 34c60a7 (usb: dwc3: ep0: tidy up Pending
      Request handling) introduced a compile warning
      by leaving an unused variable.
      
      This patch fixes that warning:
      
      drivers/usb/dwc3/ep0.c: In function ‘__dwc3_gadget_ep0_queue’:
      drivers/usb/dwc3/ep0.c:129:8: warning: unused variable ‘type’
      [-Wunused-variable]
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      1a0955fe
    • S
      usb: musb: davinci: fix build breakage · 006896fc
      Sekhar Nori 提交于
      Commit 0020afb3 (ARM: mach-davinci:
      remove mach/memory.h) removed mach/memory.h for DaVinci which broke
      DaVinci MUSB build.
      
      mach/memory.h is not actually needed in davinci.c, so remove it.
      While at it, also remove some more machine specific inclulde
      files which are not needed for build.
      
      Tested on DM644x EVM using USB card reader.
      
      Cc: stable@vger.kernel.org # v3.2
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      006896fc
    • A
      usb: gadget: langwell: don't call gadget's disconnect() · 37fd3710
      Alexander Shishkin 提交于
      UDC core will call disconnect() and unbind() for us upon the gadget
      removal, so we should not do it ourselves. Otherwise, a composite
      gadget will explode, for example. Others might too.
      
      This was introduced during conversion to new style gadget in 2c7f0989
      (usb: gadget: langwell: convert to new style).
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: stable@vger.kernel.org # v3.2
      Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: linux-usb@vger.kernel.org
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      37fd3710
    • A
      usb: gadget: langwell: drop langwell_otg support · 28bd6222
      Alexander Shishkin 提交于
      Since there is no working (or even compilable) OTG_TRANSCEIVER support
      for this driver, remove the dead code which depends on it at compile
      time.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: stable@vger.kernel.org # v2.6.31+
      Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: linux-usb@vger.kernel.org
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      28bd6222
    • A
      usb: otg: kill langwell_otg driver · c1084a56
      Alexander Shishkin 提交于
      The way this driver was added by f0ae849d (usb: Add Intel Langwell USB
      OTG Transceiver Driver) never even compiled together with langwell_udc,
      and that's the only way for it to be useful.
      Signed-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: stable@vger.kernel.org # v2.6.31+
      Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: linux-usb@vger.kernel.org
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      c1084a56
    • F
      usb: dwc3: ep0: tidy up Pending Request handling · 68d8a781
      Felipe Balbi 提交于
      The way our code was written, we should never have
      a DWC3_EP_PENDING_REQUEST flag set out of a Data Phase
      and the code in __dwc3_gadget_ep0_queue() did not
      reflect that situation properly.
      
      Tidy up that case to avoid any possible mistakes
      when starting requests for IRQs which are long
      gone.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      68d8a781
  3. 20 1月, 2012 10 次提交
  4. 19 1月, 2012 14 次提交