Skip to content
  1. May 13, 2011
  2. May 07, 2011
  3. May 02, 2011
    • Jarkko Nikula's avatar
      usb: musb: gadget: Fix out-of-sync runtime pm calls · cdefce16
      Jarkko Nikula authored
      
      
      If cable is not connected to peripheral only board when initializing the
      gadget driver, then runtime pm calls are out-of-sync and the musb cannot
      idle with omap2430.c. This was noted on Nokia N900 where musb prevented the
      CPU to be able to enter deeper retention idle state.
      
      This was working in 2.6.38 before runtime pm conversions but there musb
      smart standby/idle modes were configured statically where they are now
      updated runtime depending on use and cable status.
      
      Reason for out-of-sync is that runtime pm is activated in function
      musb_gadget.c: usb_gadget_probe_driver but suspended only in OTG mode if
      cable is not connected when initializing. In peripheral only mode this leads
      to out-of-sync runtime pm since runtime pm remain active and is activated
      another time in omap2430.c: musb_otg_notifications for VBUS Connect event
      and thus cannot suspend for VBUS Disconnect event since the use count remains
      active.
      
      Fix this by moving cable status check and pm_runtime_put call in
      usb_gadget_probe_driver out of is_otg_enabled block.
      
      Signed-off-by: default avatarJarkko Nikula <jhnikula@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      cdefce16
    • Jarkko Nikula's avatar
      usb: musb: omap2430: Fix retention idle on musb peripheral only boards · 383cf4e8
      Jarkko Nikula authored
      
      
      Recent runtime pm and hwmod conversions for 2.6.39 broke the musb peripheral
      mode OMAP retention idle on boards where the board mode in struct
      musb_hdrc_platform_data is set to MUSB_PERIPHERAL.
      
      These conversions changed the way how the OTG_SYSCONFIG register is
      configured and used in runtime. Before 2.6.39 smart standby/idle modes were
      activated statically in OTG_SYSCONFIG. Those modes allow that the musb is
      able to idle when peripheral device is not connected to host.
      
      In 2.6.39 the OTG_SYSCONFIG is updated runtime depending on VBUS status.
      No standby/idle modes are used when device is connected and force
      standby/idle when disconnected.
      
      Unfortunately VBUS disconnect event that handles the disconnect case lets
      the peripheral musb to idle only when board mode is MUSB_OTG. Fix this by
      checking the peripheral mode also.
      
      Signed-off-by: default avatarJarkko Nikula <jhnikula@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      383cf4e8
  4. Apr 13, 2011
    • Johan Hovold's avatar
      usb: musb: omap2430: fix build failure · 36a52c00
      Johan Hovold authored
      
      
      Fix build failure introduced by commit
      7acc6197 (usb: musb: Idle path retention
      and offmode support for OMAP3) when building without gadget
      support.
      
        CC      drivers/usb/musb/omap2430.o
      drivers/usb/musb/omap2430.c: In function ‘musb_otg_notifications’:
      drivers/usb/musb/omap2430.c:262: error: ‘struct musb’ has no member named ‘gadget_driver’
      
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      36a52c00
    • Mike Frysinger's avatar
      USB: musb: blackfin: work around anomaly 05000450 · 13254307
      Mike Frysinger authored
      
      
      DMA mode 1 data corruption anomaly on Blackfin systems.  This issue is
      specific to the Blackfin silicon as the bug appears to be related to the
      connection of the musb ip to the bus/dma fabric.
      
      Data corruption when using USB DMA mode 1. (Issue manager 17-01-0105)
      DMA mode 1 allows large size transfers to generate a single interrupt
      at the end of the entire transfer.  The transfer is split up in packets
      of length specified in the Maximum Packet Size field for that endpoint.
      If the transfer size is not an integer multiple of the Maximum Packet
      Size, a short packet will be present at the end of the transfer.
      
      Under certain conditions this packet may be corrupted in the USB FIFO.
      
      Workaround:
      Use DMA mode 1 to transfer (n* Maximum Packet Size) and schedule DMA
      mode 0 to transfer the short packet.
      
      As an example if your transfer size is 33168 bytes and Maximum Packet
      Size equals 512, schedule [33168 - (33168 mod 512)] in DMA mode 1 and
      the remainder (33168 mod 512) in DMA mode 0.
      
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      13254307
    • Hema HK's avatar
      usb: musb: Fix the crash issue during reboot · 4f9edd2d
      Hema HK authored
      
      
      Below crash observed with commit 7acc6197
      (usb: musb: Idle path retention and offmode support for OMAP3)
      during board reboot.
      
      The musb clock was disabled when musb_shutdown() was called by
      platform_drv_shutdown in which there are register accesses.
      call pm_runtime_get_sync() and pm_runtime_put_sync() in the
      musb_shutdown function.
      
      / # [  172.368774] Unhandled fault: imprecise external abort (0x1406) at 0x400f0000
      [  172.376190] Internal error: : 1406 [#1] SMP
      [  172.380554] last sysfs file: /sys/devices/platform/omap/omap_i2c.4/i2c-4/i2c-dev/i2c-4/dev
      [  172.389221] Modules linked in:
      [  172.392456] CPU: 0    Tainted: G        W    (2.6.38-06671-geddecbb #33)
      [  172.399475] PC is at do_raw_spin_unlock+0x50/0xc0
      [  172.404418] LR is at _raw_spin_unlock_irqrestore+0x24/0x44
      [  172.410186] pc : [<c069bfdc>]    lr : [<c085a7f8>]    psr: 60000093
      [  172.410186] sp : ee993e40  ip : c0d00240  fp : bea9cf14
      [  172.422241] r10: 00000000  r9 : ee992000  r8 : c04b2fa8
      [  172.427703] r7 : 00000000  r6 : c0fa46c0  r5 : ef966124  r4 : ef966124
      [  172.434539] r3 : ef92cbc0  r2 : ef92cbc0  r1 : 00000000  r0 : ef966124
      [  172.441406] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      [  172.448974] Control: 10c5387d  Table: ae8d804a  DAC: 00000015
      [  172.454986] Process init (pid: 1094, stack limit = 0xee9922f8)
      [  172.461120] Stack: (0xee993e40 to 0xee994000)
      [  172.465667] 3e40: a0000013 c085a7f8 ef966124 a0000013 c0fa46c0 c0761ab4 c0761a70 ef95c008
      [  172.474273] 3e60: ef95c014 c06e2fd0 c06e2fbc c06dea90 00000000 01234567 28121969 c04fccb4
      [  172.482849] 3e80: 00000000 c04fcd04 c0a302bc c04fce44 c0a02600 00000001 00000000 c085cd04
      [  172.491424] 3ea0: 00000000 00000002 c09ea000 c085afc0 ee993f24 00000000 00040001 00000445
      [  172.499999] 3ec0: a8eb9d34 00000027 00000000 00000000 00000000 c0a56a4c 00000000 00000000
      [  172.508575] 3ee0: 00000002 60000093 00000000 c0519aac 00000002 00000080 00000000 c0550420
      [  172.517150] 3f00: 00000000 00000002 ee970000 c0a56a3c c0a56a20 00000002 c0a56a3c 00000000
      [  172.525726] 3f20: c0a56a3c 0000000a c1580e00 c0a56a20 00000002 c0a56a3c c1580e00 c0a56a20
      [  172.534301] 3f40: ef92cbc0 c05173a0 00000001 ef92cbc0 c0576190 c04e3174 20000013 c0517324
      [  172.542877] 3f60: ef815c00 ee90b720 c04e3174 c0576190 00000001 ef92cbc0 c04b2f00 ffffffff
      [  172.551483] 3f80: 00000058 c0517324 00000000 00000000 ffffffff 00000000 00000000 ffffffff
      [  172.560058] 3fa0: 00000058 c04b2de0 00000000 00000000 fee1dead 28121969 01234567 00000000
      [  172.568634] 3fc0: 00000000 00000000 ffffffff 00000058 00000000 00000001 400aa000 bea9cf14
      [  172.577209] 3fe0: 000ea148 bea9c958 000aa750 40225728 60000010 fee1dead 00000000 00000000
      [  172.585784] [<c069bfdc>] (do_raw_spin_unlock+0x50/0xc0) from [<c085a7f8>] (_raw_spin_unlock_irqrestore+0x24/0x44)
      [  172.596588] [<c085a7f8>] (_raw_spin_unlock_irqrestore+0x24/0x44) from [<c0761ab4>] (musb_shutdown+0x44/0x88)
      [  172.606933] [<c0761ab4>] (musb_shutdown+0x44/0x88) from [<c06e2fd0>] (platform_drv_shutdown+0x14/0x18)
      [  172.616699] [<c06e2fd0>] (platform_drv_shutdown+0x14/0x18) from [<c06dea90>] (device_shutdown+0x74/0xb4)
      [  172.626647] [<c06dea90>] (device_shutdown+0x74/0xb4) from [<c04fccb4>] (kernel_restart_prepare+0x24/0x38)
      [  172.636688] [<c04fccb4>] (kernel_restart_prepare+0x24/0x38) from [<c04fcd04>] (kernel_restart+0xc/0x48)
      [  172.646545] [<c04fcd04>] (kernel_restart+0xc/0x48) from [<c04fce44>] (sys_reboot+0xfc/0x1d8)
      [  172.655426] [<c04fce44>] (sys_reboot+0xfc/0x1d8) from [<c04b2de0>] (ret_fast_syscall+0x0/0x3c)
      [  172.664459] Code: e3c3303f e594200c e593300c e1520003 (0a000002)
      [  172.670867] ------------[ cut here ]------------
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      4f9edd2d
    • Felipe Balbi's avatar
      usb: musb: gadget: check the correct list_head · 3d5ad13e
      Felipe Balbi authored
      
      
      We are now using our own list_head, so we should
      be checking against that, not the gadget driver's
      list_head.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      3d5ad13e
    • Felipe Balbi's avatar
      usb: musb: temporarily make it bool · 7a180e70
      Felipe Balbi authored
      
      
      Due to the recent changes to musb's glue layers,
      we can't compile musb-hdrc as a module - compilation
      will break due to undefined symbol musb_debug. In
      order to fix that, we need a big re-work of the
      debug support on the MUSB driver.
      
      Because that would mean a lot of new code coming
      into the -rc series, it's best to defer that to
      next merge window and for now just disable module
      support for MUSB.
      
      Once we get the refactor of the debugging support
      done, we can simply revert this patch and things
      will go back to normal again.
      
      Cc: stable@kernel.org # v2.6.38
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7a180e70
    • Dan Carpenter's avatar
      USB: musb: dereferencing an iomem pointer · 2e10f5e7
      Dan Carpenter authored
      
      
      "tx_ram" points to io memory.  We can't dereference it directly.  Sparse
      complains about this: "drivers/usb/musb/cppi_dma.c:1205:25: warning:
      dereference of noderef expression"
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      2e10f5e7
    • Dan Carpenter's avatar
      USB: musb: silence printk format warning · 2fbcf3fa
      Dan Carpenter authored
      
      
      Gcc gives the following warnings:
      
      drivers/usb/musb/cppi_dma.c: In function ‘cppi_next_tx_segment’:
      drivers/usb/musb/cppi_dma.c:600: warning: format ‘%x’ expects type ‘unsigned int’, but argument 8 has type ‘dma_addr_t’
      drivers/usb/musb/cppi_dma.c: In function ‘cppi_next_rx_segment’:
      drivers/usb/musb/cppi_dma.c:822: warning: format ‘%x’ expects type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’
      drivers/usb/musb/cppi_dma.c: In function ‘cppi_rx_scan’:
      drivers/usb/musb/cppi_dma.c:1042: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 4 has type ‘dma_addr_t’
      drivers/usb/musb/cppi_dma.c:1114: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’
      
      dma_addr_t is sometimes 32 bit and sometimes 64.  We normally cast them
      to unsigned long long for printk().
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      2fbcf3fa
    • Dan Carpenter's avatar
      USB: musb: using 0 instead of NULL · aca7f353
      Dan Carpenter authored
      
      
      Sparse complains (and rightly so):
      drivers/usb/musb/cppi_dma.c:1458:33:
      	warning: Using plain integer as NULL pointer
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      aca7f353
    • Dan Carpenter's avatar
      USB: musb: add missing unlock in cppi_interrupt() · ec63bf6c
      Dan Carpenter authored
      
      
      We should unlock before returning here.
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      ec63bf6c
    • Mian Yousaf Kaukab's avatar
      usb: musb: ux500: copy dma mask from platform device to musb device · 87266064
      Mian Yousaf Kaukab authored
      
      
      musb code checks dma mask before calling dma hooks.
      
      Signed-off-by: default avatarMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      87266064
    • Mian Yousaf Kaukab's avatar
      usb: musb: clear AUTOSET while clearing DMAENAB · 100d4a9d
      Mian Yousaf Kaukab authored
      
      
      On the completion of tx dma, dma is disabled by clearing MUSB_TXCSR_DMAENAB in
      TXCSR. If MUSB_TXCSR_AUTOSET was set in txstate() it will remain set although
      it is not needed in PIO mode. Clear it as soon as it is not needed.
      
      Signed-off-by: default avatarMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      100d4a9d
  5. Mar 29, 2011
  6. Mar 23, 2011
  7. Mar 14, 2011
    • John Youn's avatar
      USB 3.0 Hub Changes · dbe79bbe
      John Youn authored
      
      
      Update the USB core to deal with USB 3.0 hubs.  These hubs have a slightly
      different hub descriptor than USB 2.0 hubs, with a fixed (rather than
      variable length) size.  Change the USB core's hub descriptor to have a
      union for the last fields that differ.  Change the host controller drivers
      that access those last fields (DeviceRemovable and PortPowerCtrlMask) to
      use the union.
      
      Translate the new version of the hub port status field into the old
      version that khubd understands.  (Note: we need to fix it to translate the
      roothub's port status once we stop converting it to USB 2.0 hub status
      internally.)
      
      Add new code to handle link state change status.  Send out new control
      messages that are needed for USB 3.0 hubs, like Set Hub Depth.
      
      This patch is a modified version of the original patch submitted by John
      Youn.  It's updated to reflect the removal of the "bitmap" #define, and
      change the hub descriptor accesses of a couple new host controller
      drivers.
      
      Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Cc: Tony Olech <tony.olech@elandigitalsystems.com>
      Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
      Cc: Max Vozeler <mvz@vozeler.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Cc: Rodolfo Giometti <giometti@linux.it>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Anton Vorontsov <avorontsov@mvista.com>
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Cc: Lothar Wassmann <LW@KARO-electronics.de>
      Cc: Olav Kongas <ok@artecdesign.ee>
      Cc: Martin Fuzzey <mfuzzey@gmail.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      dbe79bbe
  8. Mar 01, 2011
    • Huzaifa Sidhpurwala's avatar
      usb: musb: tusb: Fix possible null pointer dereference in tusb6010_omap.c · c88ba39c
      Huzaifa Sidhpurwala authored
      
      
      tusb_dma was being dereferenced when it was nul
      
      Signed-off-by: default avatarHuzaifa Sidhpurwala <huzaifas@redhat.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      c88ba39c
    • Hema HK's avatar
      usb: musb: OMAP3xxx: Fix device detection in otg & host mode · 70045c57
      Hema HK authored
      
      
      In OMAP3xxx with OTG mode or host only mode, When the device
      is inserted after the gadget driver loading the enumeration was not
      through. This is because the mentor controller will start sensing the
      ID PIN only after setting the session bit.
      So after ID-GND, need to set the session bit for mentor to get it
      configured as A device.
      
      This is a fix to set the session bit again in ID_GND notification handler.
      Tested with OMAP3630Zoom3 platform.
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      70045c57
    • Hema HK's avatar
      usb: musb: Idle path retention and offmode support for OMAP3 · 7acc6197
      Hema HK authored
      
      
      This patch supports the retention and offmode support in the idle path for
      musb driver using runtime pm APIs.
      
      This is restricted to support offmode and retention only when device not
      connected.When device/cable connected with gadget driver loaded,configured
      to no idle/standby which will not allow the core transition to retention
      or off.
      
      There is no context save/restore done by hardware for musb in OMAP3
      and OMAP4,driver has to take care of saving and restoring the context
      during offmode.
      
      Musb has a requirement of configuring sysconfig register to force
      idle/standby mode and set the ENFORCE bit in module STANDBY register
      for retention and offmode support.
      
      Runtime pm and hwmod frameworks will take care of configuring to force
      idle/standby when pm_runtime_put_sync is called and back to no
      idle/standby when pm_runeime_get_sync is called.
      
      Compile, boot tested and also tested the retention in the idle path on
      OMAP3630Zoom3. And tested the global suspend/resume with offmode enabled.
      Usb basic functionality tested on OMAP4430SDP.
      
      There is some problem with idle path offmode in mainline, I could not test
      with offmode. But I have tested this patch with resetting the controller
      in the idle path when wakeup from retention just to make sure that the
      context is lost, and restore path is working fine.
      
      Removed .suspend/.resume fnction pointers and functions because there
      is no need of having these functions as all required work is done
      at runtime in the driver.
      
      There is no need to call the runtime pm api with glue driver device
      as glue layer device is the parent of musb core device, when runtime apis
      are called for the child, parent device runtime functionality
      will be invoked.
      
      Design overview:
      
      pm_runtime_get_sync: When called with musb core device takes care of
      enabling the clock, calling runtime callback function of omap2430 glue
      layer, runtime call back of musb driver and configure the musb sysconfig
      to no idle/standby
      
      pm_runtime_put: Takes care of calling runtime callback function of omap2430
      glue layer, runtime call back of musb driver, Configure the musb sysconfig
      to force idle/standby and disable the clock.
      
      During musb driver load: Call pm_runtime_get_sync.
      
      End of musb driver load: Call pm_runtime_put
      
      During gadget driver load: Call pm_runtime_get_sync,
      End of gadget driver load: Call pm_runtime_put if there is no device
      or cable is connected.
      
      During unload of the gadget driver:Call pm_runtime_get_sync if cable/device
      is not connected.
      End of the gadget driver unload : pm_runtime_put
      
      During unload of musb driver : Call pm_runtime_get_sync
      End of unload: Call pm_runtime_put
      
      On connect of usb cable/device -> transceiver notification(VBUS and ID-GND):
      pm_runtime_get_sync only if the gadget driver loaded.
      
      On disconnect of the cable/device -> Disconnect Notification:
      pm_runtime_put if the gadget driver is loaded.
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      7acc6197
    • Hema HK's avatar
      usb: musb: Remove platform context save/restore API · da68ccec
      Hema HK authored
      
      
      For OMAP3 and OMAP4 for offmode and retention support, musb
      sysconfig is configured to force idle and standby with ENABLE_FORCE bit
      of OTG_FORCESTNDBY set.
      And on wakeup configure to no ilde/standby with resetting the ENABLE_FORCE
      bit. There is not need to save and restore of this register anymore
      so removed omap2430_save_context/omap2430_restore_context functions.
      and also removed otg_forcestandby member of musb_context_registers
      structure
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      da68ccec
    • Felipe Balbi's avatar
      usb: musb: gadget: fix list_head usage · 4cbbf084
      Felipe Balbi authored
      
      
      commit ad1adb89
      (usb: musb: gadget: do not poke with gadget's list_head)
      fixed a bug in musb where it was corrupting the list_head
      which is supposed to be used by gadget drivers. While
      doing that, I forgot to fix the usage in musb_gadget_dequeue()
      method. Fix that.
      
      Reported-by: default avatarPavol Kurina <pavol.kurina@emsys.de>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      4cbbf084
  9. Feb 24, 2011
  10. Feb 21, 2011
  11. Feb 18, 2011
    • Hema HK's avatar
      usb: musb: OMAP4430: Fix usb device detection if connected during boot · 002eda13
      Hema HK authored
      OMAP4430 is embedded with UTMI PHY. This PHY does not support the
      OTG features like ID pin detection and VBUS detection. This function
      is exported to an external companion chip TWL6030. Software must retrieve
      the OTG HNP and SRP status from the TWL6030 and configure the bits inside
      the control module that drive the related USBOTGHS UTMI interface signals.
      It must also read back the UTMI signals needed to configure the TWL6030
      OTG module.
      
      Can find more details in the TRM[1].
      [1]:http://focus.ti.com/pdfs/wtbu/OMAP4430_ES2.0_Public_TRM_vJ.pdf
      
      
      
      In OMAP4430 musb driver VBUS and ID notifications are received from the
      transceiver driver. If the cable/device is connected during boot,
      notifications from transceiver driver will be missed till musb driver
      is loaded.
      Patch to configure the transceiver in the platform_enable/disable
      functions and enable the vbus in the gadget driver based on the
      last_event of the otg_transceiver.
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      002eda13
  12. Feb 17, 2011
    • Hema HK's avatar
      usb: musb: Using runtime pm APIs for musb. · 207b0e1f
      Hema HK authored
      
      
      Calling runtime pm APIs pm_runtime_put_sync() and pm_runtime_get_sync()
      for enabling/disabling the clocks, sysconfig settings.
      
      Enable clock, configure no-idle/standby when active and configure force idle/standby
      and disable clock when idled. This is taken care by the runtime framework when
      driver calls the pm_runtime_get_sync and pm_runtime_put_sync APIs.
      Need to configure MUSB into force standby and force idle mode when usb not used
      
      Signed-off-by: default avatarHema HK <hemahk@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Cc: Cousson, Benoit <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      207b0e1f
    • Felipe Balbi's avatar
      usb: musb: gadget: do not poke with gadget's list_head · ad1adb89
      Felipe Balbi authored
      
      
      struct usb_request's list_head is supposed to be
      used only by gadget drivers, but musb is abusing
      that. Give struct musb_request its own list_head
      and prevent musb from poking into other driver's
      business.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      ad1adb89
    • Felipe Balbi's avatar
      usb: musb: gadget: beautify usb_gadget_probe_driver()/usb_gadget_unregister_driver · 63eed2b5
      Felipe Balbi authored
      
      
      Just a few cosmetic fixes to usb_gadget_probe_driver()
      and usb_gadget_unregister_driver().
      
      Decreased a few indentation levels with goto statements.
      
      While at that, also add the missing call to musb_stop().
      If we don't have OTG, there's no point of leaving
      MUSB prepared for operation if a gadget driver fails
      to probe. The same is valid for usb_gadget_unregister_driver(),
      since we are removing the gadget driver and we don't have
      OTG, we can completely unconfigure MUSB.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      63eed2b5
    • Felipe Balbi's avatar
      usb: musb: do not error out if Kconfig doesn't match board mode · 75a14b14
      Felipe Balbi authored
      
      
      During development, even though board is wired
      to e.g. OTG, we might want to compile host-only
      or peripheral-only configurations.
      
      Let's allow that to happen.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      75a14b14
    • Johan Hovold's avatar
      USB: musb: omap2430: fix kernel panic on reboot · 19b9a83e
      Johan Hovold authored
      
      
      Cancel idle timer in musb_platform_exit.
      
      The idle timer could trigger after clock had been disabled leading to
      kernel panic when MUSB_DEVCTL is accessed in musb_do_idle on 2.6.37.
      
      The fault below is no longer triggered on 2.6.38-rc4 (clock is disabled
      later, and only if compiled as a module, and the offending memory access
      has moved) but the timer should be cancelled nonetheless.
      
      Rebooting... musb_hdrc musb_hdrc: remove, state 4
      usb usb1: USB disconnect, address 1
      musb_hdrc musb_hdrc: USB bus 1 deregistered
      Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060
      Internal error: : 1028 [#1] PREEMPT
      last sysfs file: /sys/kernel/uevent_seqnum
      Modules linked in:
      CPU: 0    Not tainted  (2.6.37+ #6)
      PC is at musb_do_idle+0x24/0x138
      LR is at musb_do_idle+0x18/0x138
      pc : [<c02377d8>]    lr : [<c02377cc>]    psr: 80000193
      sp : cf2bdd80  ip : cf2bdd80  fp : c048a20c
      r10: c048a60c  r9 : c048a40c  r8 : cf85e110
      r7 : cf2bc000  r6 : 40000113  r5 : c0489800  r4 : cf85e110
      r3 : 00000004  r2 : 00000006  r1 : fa0ab000  r0 : cf8a7000
      Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: 8faac019  DAC: 00000015
      Process reboot (pid: 769, stack limit = 0xcf2bc2f0)
      Stack: (0xcf2bdd80 to 0xcf2be000)
      dd80: 00000103 c0489800 c02377b4 c005fa34 00000555 c0071a8c c04a3858 cf2bdda8
      dda0: 00000555 c048a00c cf2bdda8 cf2bdda8 1838beb0 00000103 00000004 cf2bc000
      ddc0: 00000001 00000001 c04896c8 0000000a 00000000 c005ac14 00000001 c003f32c
      dde0: 00000000 00000025 00000000 cf2bc000 00000002 00000001 cf2bc000 00000000
      de00: 00000001 c005ad08 cf2bc000 c002e07c c03ec039 ffffffff fa200000 c0033608
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff c0033c04 00000000 01234567 fee1dead 00000000 c006627c
      de80: 00000001 c00662c8 28121969 c00663ec cfa38c40 cf9f6a00 cf2bded0 cf9f6a0c
      dea0: 00000000 cf92f000 00008914 c02cd284 c04a55c8 c028b398 c00715c0 becf24a8
      dec0: 30687465 00000000 00000000 00000000 00000002 1301a8c0 00000000 00000000
      dee0: 00000002 1301a8c0 00000000 00000000 c0450494 cf527920 00011f10 cf2bdf08
      df00: 00011f10 cf2bdf10 00011f10 cf2bdf18 c00f0b44 c004f7e8 cf2bdf18 cf2bdf18
      df20: 00011f10 cf2bdf30 00011f10 cf2bdf38 cf401300 cf486100 00000008 c00d2b28
      df40: 00011f10 cf401300 00200200 c00d3388 00011f10 cfb63a88 cfb63a80 c00c2f08
      df60: 00000000 00000000 cfb63a80 00000000 cf0a3480 00000006 c0033c04 cfb63a80
      df80: 00000000 c00c0104 00000003 cf0a3480 cfb63a80 00000000 00000001 00000004
      dfa0: 00000058 c0033a80 00000000 00000001 fee1dead 28121969 01234567 00000000
      dfc0: 00000000 00000001 00000004 00000058 00000001 00000001 00000000 00000001
      dfe0: 4024d200 becf2cb0 00009210 4024d218 60000010 fee1dead 00000000 00000000
      [<c02377d8>] (musb_do_idle+0x24/0x138) from [<c005fa34>] (run_timer_softirq+0x1a8/0x26)
      [<c005fa34>] (run_timer_softirq+0x1a8/0x26c) from [<c005ac14>] (__do_softirq+0x88/0x13)
      [<c005ac14>] (__do_softirq+0x88/0x138) from [<c005ad08>] (irq_exit+0x44/0x98)
      [<c005ad08>] (irq_exit+0x44/0x98) from [<c002e07c>] (asm_do_IRQ+0x7c/0xa0)
      [<c002e07c>] (asm_do_IRQ+0x7c/0xa0) from [<c0033608>] (__irq_svc+0x48/0xa8)
      Exception stack(0xcf2bde20 to 0xcf2bde68)
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff
      [<c0033608>] (__irq_svc+0x48/0xa8) from [<c004f7d8>] (sub_preempt_count+0x0/0xb8)
      Code: ebf86030 e5940098 e594108c e5902010 (e5d13060)
      ---[ end trace 3689c0d808f9bf7c ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      19b9a83e
    • Johan Hovold's avatar
      usb: musb: omap2430: fix kernel panic on reboot · b193b412
      Johan Hovold authored
      
      
      Cancel idle timer in musb_platform_exit.
      
      The idle timer could trigger after clock had been disabled leading to
      kernel panic when MUSB_DEVCTL is accessed in musb_do_idle on 2.6.37.
      
      The fault below is no longer triggered on 2.6.38-rc4 (clock is disabled
      later, and only if compiled as a module, and the offending memory access
      has moved) but the timer should be cancelled nonetheless.
      
      Rebooting... musb_hdrc musb_hdrc: remove, state 4
      usb usb1: USB disconnect, address 1
      musb_hdrc musb_hdrc: USB bus 1 deregistered
      Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060
      Internal error: : 1028 [#1] PREEMPT
      last sysfs file: /sys/kernel/uevent_seqnum
      Modules linked in:
      CPU: 0    Not tainted  (2.6.37+ #6)
      PC is at musb_do_idle+0x24/0x138
      LR is at musb_do_idle+0x18/0x138
      pc : [<c02377d8>]    lr : [<c02377cc>]    psr: 80000193
      sp : cf2bdd80  ip : cf2bdd80  fp : c048a20c
      r10: c048a60c  r9 : c048a40c  r8 : cf85e110
      r7 : cf2bc000  r6 : 40000113  r5 : c0489800  r4 : cf85e110
      r3 : 00000004  r2 : 00000006  r1 : fa0ab000  r0 : cf8a7000
      Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: 8faac019  DAC: 00000015
      Process reboot (pid: 769, stack limit = 0xcf2bc2f0)
      Stack: (0xcf2bdd80 to 0xcf2be000)
      dd80: 00000103 c0489800 c02377b4 c005fa34 00000555 c0071a8c c04a3858 cf2bdda8
      dda0: 00000555 c048a00c cf2bdda8 cf2bdda8 1838beb0 00000103 00000004 cf2bc000
      ddc0: 00000001 00000001 c04896c8 0000000a 00000000 c005ac14 00000001 c003f32c
      dde0: 00000000 00000025 00000000 cf2bc000 00000002 00000001 cf2bc000 00000000
      de00: 00000001 c005ad08 cf2bc000 c002e07c c03ec039 ffffffff fa200000 c0033608
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff c0033c04 00000000 01234567 fee1dead 00000000 c006627c
      de80: 00000001 c00662c8 28121969 c00663ec cfa38c40 cf9f6a00 cf2bded0 cf9f6a0c
      dea0: 00000000 cf92f000 00008914 c02cd284 c04a55c8 c028b398 c00715c0 becf24a8
      dec0: 30687465 00000000 00000000 00000000 00000002 1301a8c0 00000000 00000000
      dee0: 00000002 1301a8c0 00000000 00000000 c0450494 cf527920 00011f10 cf2bdf08
      df00: 00011f10 cf2bdf10 00011f10 cf2bdf18 c00f0b44 c004f7e8 cf2bdf18 cf2bdf18
      df20: 00011f10 cf2bdf30 00011f10 cf2bdf38 cf401300 cf486100 00000008 c00d2b28
      df40: 00011f10 cf401300 00200200 c00d3388 00011f10 cfb63a88 cfb63a80 c00c2f08
      df60: 00000000 00000000 cfb63a80 00000000 cf0a3480 00000006 c0033c04 cfb63a80
      df80: 00000000 c00c0104 00000003 cf0a3480 cfb63a80 00000000 00000001 00000004
      dfa0: 00000058 c0033a80 00000000 00000001 fee1dead 28121969 01234567 00000000
      dfc0: 00000000 00000001 00000004 00000058 00000001 00000001 00000000 00000001
      dfe0: 4024d200 becf2cb0 00009210 4024d218 60000010 fee1dead 00000000 00000000
      [<c02377d8>] (musb_do_idle+0x24/0x138) from [<c005fa34>] (run_timer_softirq+0x1a8/0x26)
      [<c005fa34>] (run_timer_softirq+0x1a8/0x26c) from [<c005ac14>] (__do_softirq+0x88/0x13)
      [<c005ac14>] (__do_softirq+0x88/0x138) from [<c005ad08>] (irq_exit+0x44/0x98)
      [<c005ad08>] (irq_exit+0x44/0x98) from [<c002e07c>] (asm_do_IRQ+0x7c/0xa0)
      [<c002e07c>] (asm_do_IRQ+0x7c/0xa0) from [<c0033608>] (__irq_svc+0x48/0xa8)
      Exception stack(0xcf2bde20 to 0xcf2bde68)
      de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
      de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
      de60: 60000013 ffffffff
      [<c0033608>] (__irq_svc+0x48/0xa8) from [<c004f7d8>] (sub_preempt_count+0x0/0xb8)
      Code: ebf86030 e5940098 e594108c e5902010 (e5d13060)
      ---[ end trace 3689c0d808f9bf7c ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      b193b412
    • Felipe Balbi's avatar
      usb: musb: fix build breakage · 5990378b
      Felipe Balbi authored
      
      
      commit 06624818
      (usb: musb: disable double buffering when it's broken),
      introduced a compile error when gadget API is disabled.
      
      Fix it.
      
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      5990378b
  13. Feb 04, 2011
  14. Feb 01, 2011
    • Mian Yousaf Kaukab's avatar
      usb: musb: introduce api for dma code to check compatibility with usb request · 5f5761cb
      Mian Yousaf Kaukab authored
      
      
      Gadget MUSB driver handles dma mappings in musb_gadget_queue(). Where as it is
      possible for  dma code to reject the usb request later at ->channel_program()
      called from txstate()/rxstate()
      
      For example ->channel_program in tusb6010_omap.c:
      
      static int tusb_omap_dma_program(struct dma_channel *channel, u16 packet_sz,
              u8 rndis_mode, dma_addr_t dma_addr, u32 len)
      {
      ...
      	if (unlikely(dma_addr & 0x1) || (len < 32) || (len > packet_sz))
      		return false;
      ...
      	if (dma_addr & 0x2)
      		return false;
      ...
      }
      
      In this case, usb request will be handled in PIO mode which renders dma mapping
      operations unnecessary.
      
      This patch adds an api to allow dma code to indicate incompatibility with usb
      request. Gadget musb driver call this api, if available, before dma mappings to
      avoid any unnecessary mapping operations.
      
      Signed-off-by: default avatarMian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      5f5761cb
Loading