1. 22 7月, 2015 1 次提交
    • P
      usb: chipidea: ehci_init_driver is intended to call one time · 2f01a33b
      Peter Chen 提交于
      The ehci_init_driver is used to initialize hcd APIs for each
      ehci controller driver, it is designed to be called only one time
      and before driver register is called. The current design will
      cause ehci_init_driver is called multiple times at probe process,
      it will cause hc_driver's initialization affect current running hcd.
      
      We run out NULL pointer dereference problem when one hcd is started
      by module_init, and the other is started by otg thread at SMP platform.
      The reason for this problem is ehci_init_driver will do memory copy
      for current uniform hc_driver, and this memory copy will do memset (as 0)
      first, so when the first hcd is running usb_add_hcd, and the second
      hcd may clear the uniform hc_driver's space (at ehci_init_driver),
      then the first hcd will meet NULL pointer at the same time.
      
      See below two logs:
      
      LOG_1:
      ci_hdrc ci_hdrc.0: EHCI Host Controller
      ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
      ci_hdrc ci_hdrc.1: doesn't support gadget
      Unable to handle kernel NULL pointer dereference at virtual address 00000014
      pgd = 80004000
      [00000014] *pgd=00000000
      Internal error: Oops: 805 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 0 PID: 108 Comm: kworker/u8:2 Not tainted 3.14.38-222193-g24b2734-dirty #25
      Workqueue: ci_otg ci_otg_work
      task: d839ec00 ti: d8400000 task.ti: d8400000
      PC is at ehci_run+0x4c/0x284
      LR is at _raw_spin_unlock_irqrestore+0x28/0x54
      pc : [<8041f9a0>]    lr : [<8070ea84>]    psr: 60000113
      sp : d8401e30  ip : 00000000  fp : d8004400
      r10: 00000001  r9 : 00000001  r8 : 00000000
      r7 : 00000000  r6 : d8419940  r5 : 80dd24c0  r4 : d8419800
      r3 : 8001d060  r2 : 00000000  r1 : 00000001  r0 : 00000000
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c53c7d  Table: 1000404a  DAC: 00000015
      Process kworker/u8:2 (pid: 108, stack limit = 0xd8400238)
      Stack: (0xd8401e30 to 0xd8402000)
      1e20:                                     d87523c0 d8401e48 66667562 d8419800
      1e40: 00000000 00000000 d8419800 00000000 00000000 00000000 d84198b0 8040fcdc
      1e60: 00000000 80dd320c d8477610 d8419c00 d803d010 d8419800 00000000 00000000
      1e80: d8004400 00000000 d8400008 80431494 80431374 d803d100 d803d010 d803d1ac
      1ea0: 00000000 80432428 804323d4 d803d100 00000001 80435eb8 80e0d0bc d803d100
      1ec0: 00000006 80436458 00000000 d803d100 80e92ec8 80436f44 d803d010 d803d100
      1ee0: d83fde00 8043292c d8752710 d803d1f4 d803d010 8042ddfc 8042ddb8 d83f3b00
      1f00: d803d1f4 80042b60 00000000 00000003 00000001 00000001 80054598 d83f3b00
      1f20: d8004400 d83f3b18 d8004414 d8400000 80e3957b 00000089 d8004400 80043814
      1f40: d839ec00 00000000 d83fcd80 d83f3b00 800436e4 00000000 00000000 00000000
      1f60: 00000000 80048f34 00000000 00000000 00000000 d83f3b00 00000000 00000000
      1f80: d8401f80 d8401f80 00000000 00000000 d8401f90 d8401f90 d8401fac d83fcd80
      1fa0: 80048e68 00000000 00000000 8000e538 00000000 00000000 00000000 00000000
      1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
      [<8041f9a0>] (ehci_run) from [<8040fcdc>] (usb_add_hcd+0x248/0x6e8)
      [<8040fcdc>] (usb_add_hcd) from [<80431494>] (host_start+0x120/0x2e4)
      [<80431494>] (host_start) from [<80432428>] (ci_otg_start_host+0x54/0xbc)
      [<80432428>] (ci_otg_start_host) from [<80435eb8>] (otg_set_protocol+0xa4/0xd0)
      [<80435eb8>] (otg_set_protocol) from [<80436458>] (otg_set_state+0x574/0xc58)
      [<80436458>] (otg_set_state) from [<80436f44>] (otg_statemachine+0x408/0x46c)
      [<80436f44>] (otg_statemachine) from [<8043292c>] (ci_otg_fsm_work+0x3c/0x190)
      [<8043292c>] (ci_otg_fsm_work) from [<8042ddfc>] (ci_otg_work+0x44/0x1c4)
      [<8042ddfc>] (ci_otg_work) from [<80042b60>] (process_one_work+0xf4/0x35c)
      [<80042b60>] (process_one_work) from [<80043814>] (worker_thread+0x130/0x3bc)
      [<80043814>] (worker_thread) from [<80048f34>] (kthread+0xcc/0xe4)
      [<80048f34>] (kthread) from [<8000e538>] (ret_from_fork+0x14/0x3c)
      Code: e5953018 e3530000 0a000000 e12fff33 (e5878014)
      
      LOG_2:
      ci_hdrc ci_hdrc.0: EHCI Host Controller
      ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
      ci_hdrc ci_hdrc.1: doesn't support gadget
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = 80004000
      [00000000] *pgd=00000000
      In Online 00:00ternal e      Offline rror: Oops: 80000005 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 0 PID: 108 Comm: kworker/u8:2 Not tainted 3.14.38-02007-g24b2734-dirty #127
      Workque Online 00:00ue: ci_o      Offline tg ci_otg_work
      Online 00:00task: d8      Offline 39ec00 ti: d83ea000 task.ti: d83ea000
      PC is at 0x0
      LR is at usb_add_hcd+0x248/0x6e8
      pc : [<00000000>]    lr : [<8040f644>]    psr: 60000113
      sp : d83ebe60  ip : 00000000  fp : d8004400
      r10: 00000001  r9 : 00000001  r8 : d85fd4b0
      r7 : 00000000  r6 : 00000000  r5 : 00000000  r4 : d85fd400
      r3 : 00000000  r2 : d85fd4f4  r1 : 80410178  r0 : d85fd400
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c53c7d  Table: 1000404a  DAC: 00000015
      Process kworker/u8:2 (pid: 108, stack limit = 0xd83ea238)
      Stack: (0xd83ebe60 to 0xd83ec000)
      be60: 00000000 80dd920c d8654e10 d85fd800 d803e010 d85fd400 00000000 00000000
      be80: d8004400 00000000 d83ea008 80430e34 80430d14 d803e100 d803e010 d803e1ac
      bea0: 00000000 80431dc8 80431d74 d803e100 00000001 80435858 80e130bc d803e100
      bec0: 00000006 80435df8 00000000 d803e100 80e98ec8 804368e4 d803e010 d803e100
      bee0: d86e8100 804322cc d86cf050 d803e1f4 d803e010 8042d79c 8042d758 d83cf900
      bf00: d803e1f4 80042b78 00000000 00000003 00000001 00000001 800545e8 d83cf900
      bf20: d8004400 d83cf918 d8004414 d83ea000 80e3f57b 00000089 d8004400 8004382c
      bf40: d839ec00 00000000 d8393780 d83cf900 800436fc 00000000 00000000 00000000
      bf60: 00000000 80048f50 80e019f4 00000000 0000264c d83cf900 00000000 00000000
      bf80: d83ebf80 d83ebf80 00000000 00000000 d83ebf90 d83ebf90 d83ebfac d8393780
      bfa0: 80048e84 00000000 00000000 8000e538 00000000 00000000 00000000 00000000
      bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ee66e85d 133ebd03
      [<804 Online 00:000f644>]       Offline (usb_add_hcd) from [<80430e34>] (host_start+0x120/0x2e4)
      [<80430e34>] (host_start) from [<80431dc8>] (ci_otg_start_host+0x54/0xbc)
      [<80431dc8>] (ci_otg_start_host) from [<80435858>] (otg_set_protocol+0xa4/0xd0)
      [<80435858>] (otg_set_protocol) from [<80435df8>] (otg_set_state+0x574/0xc58)
      [<80435df8>] (otg_set_state) from [<804368e4>] (otg_statemachine+0x408/0x46c)
      [<804368e4>] (otg_statemachine) from [<804322cc>] (ci_otg_fsm_work+0x3c/0x190)
      [<804322cc>] (ci_otg_fsm_work) from [<8042d79c>] (ci_otg_work+0x44/0x1c4)
      [<8042d79c>] (ci_otg_work) from [<80042b78>] (process_one_work+0xf4/0x35c)
      [<80042b78>] (process_one_work) from [<8004382c>] (worker_thread+0x130/0x3bc)
      [<8004382c>] (worker_thread) from [<80048f50>] (kthread+0xcc/0xe4)
      [<80048f50>] (kthread) from [<8000e538>] (ret_from_fork+0x14/0x3c)
      Code: bad PC value
      
      Cc: Jun Li <jun.li@freescale.com>
      Cc: <stable@vger.kernel.org>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      2f01a33b
  2. 10 6月, 2015 1 次提交
  3. 18 3月, 2015 3 次提交
    • L
      usb: chipidea: host: turn on vbus before add hcd if early vbus on is required · 65945917
      Li Jun 提交于
      If CI_HDRC_TURN_VBUS_EARLY_ON is set, turn on vbus before adding hcd, so it
      will not set reg_vbus of ehci_ci_priv, then vbus will not be handled by ehci core.
      Signed-off-by: NLi Jun <jun.li@freescale.com>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      65945917
    • P
      usb: chipidea: host: add .bus_suspend quirk · 78f0357e
      Peter Chen 提交于
      For chipidea, its resume sequence is not-EHCI compatible, see
      below description for FPR at portsc. So in order to send SoF in
      time for remote wakeup sequence(within 3ms), the RUN/STOP bit must
      be set before the resume signal is ended, but the usb resume
      code may run after resume signal is ended, so we had to set it
      at suspend path.
      
      Force Port Resume - RW. Default = 0b.
      1= Resume detected/driven on port.
      0=No resume (K-state) detected/driven on port.
      Host mode:
      Software sets this bit to one to drive resume signaling. The Controller sets this bit to '1' if
      a J-to-K transition is detected while the port is in the Suspend state. When this bit
      transitions to a '1' because a J-to-K transition is detected, the Port Change Detect bit in
      the USBSTS register is also set to '1'. This bit will automatically change to '0' after the
      resume sequence is complete. This behavior is different from EHCI where the controller
      driver is required to set this bit to a '0' after the resume duration is timed in the driver.
      Note that when the controller owns the port, the resume sequence follows the defined
      
      sequence documented in the USB Specification Revision 2.0. The resume signaling
      (Full-speed 'K') is driven on the port as long as this bit remains a '1'. This bit will remain
      a '1' until the port has switched to idle. Writing a '0' has no affect because the port
      controller will time the resume operation, clear the bit and the port control state switches
      to HS or FS idle.
      This field is '0' if Port Power(PP) is '0' in host mode.
      
      This bit is not-EHCI compatible.
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      78f0357e
    • D
      Chipidea: Set connect-at-fullspeed bit when entering host mode if... · 905276c4
      Daniel Tang 提交于
      Chipidea: Set connect-at-fullspeed bit when entering host mode if CI_HDRC_FORCE_FULLSPEED is set in the platform data
      
      PORTSC_PFSC is not set on entering host mode which means the USB OTG
      controller will attempt to enumerate USB devices at high speed even when the
      CI_HDRC_FORCE_FULLSPEED flag is set in the platform data.
      
      This patch ensures it is set right before host mode operations begin if needed.
      Signed-off-by: NDaniel Tang <dt.tangr@gmail.com>
      Signed-off-by: NPeter Chen <peter.chen@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      905276c4
  4. 10 1月, 2015 1 次提交
  5. 27 11月, 2014 1 次提交
  6. 04 11月, 2014 3 次提交
  7. 29 9月, 2014 1 次提交
  8. 24 9月, 2014 1 次提交
  9. 25 4月, 2014 2 次提交
  10. 14 1月, 2014 1 次提交
  11. 10 12月, 2013 1 次提交
  12. 04 12月, 2013 1 次提交
  13. 30 10月, 2013 1 次提交
  14. 17 10月, 2013 1 次提交
    • R
      usb/chipidea: fix oops on memory allocation failure · 41314fea
      Russell King - ARM Linux 提交于
      When CMA fails to initialize in v3.12-rc4, the chipidea driver oopses
      the kernel while trying to remove and put the HCD which doesn't exist:
      
      WARNING: CPU: 0 PID: 6 at /home/rmk/git/linux-rmk/arch/arm/mm/dma-mapping.c:511
      __dma_alloc+0x200/0x240()
      coherent pool not initialised!
      Modules linked in:
      CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G        W    3.12.0-rc4+ #56
      Workqueue: deferwq deferred_probe_work_func
      Backtrace:
      [<c001218c>] (dump_backtrace+0x0/0x10c) from [<c0012328>] (show_stack+0x18/0x1c)
       r6:c05fd9cc r5:000001ff r4:00000000 r3:df86ad00
      [<c0012310>] (show_stack+0x0/0x1c) from [<c05f3a4c>] (dump_stack+0x70/0x8c)
      [<c05f39dc>] (dump_stack+0x0/0x8c) from [<c00230a8>] (warn_slowpath_common+0x6c/0x8c)
       r4:df883a60 r3:df86ad00
      [<c002303c>] (warn_slowpath_common+0x0/0x8c) from [<c002316c>] (warn_slowpath_fmt+0x38/0x40)
       r8:ffffffff r7:00001000 r6:c083b808 r5:00000000 r4:df2efe80
      [<c0023134>] (warn_slowpath_fmt+0x0/0x40) from [<c00196bc>] (__dma_alloc+0x200/0x240)
       r3:00000000 r2:c05fda00
      [<c00194bc>] (__dma_alloc+0x0/0x240) from [<c001982c>] (arm_dma_alloc+0x88/0xa0)
      [<c00197a4>] (arm_dma_alloc+0x0/0xa0) from [<c03e2904>] (ehci_setup+0x1f4/0x438)
      [<c03e2710>] (ehci_setup+0x0/0x438) from [<c03cbd60>] (usb_add_hcd+0x18c/0x664)
      [<c03cbbd4>] (usb_add_hcd+0x0/0x664) from [<c03e89f4>] (host_start+0xf0/0x180)
      [<c03e8904>] (host_start+0x0/0x180) from [<c03e7c34>] (ci_hdrc_probe+0x360/0x670
      )
       r6:df2ef410 r5:00000000 r4:df2c3010 r3:c03e8904
      [<c03e78d4>] (ci_hdrc_probe+0x0/0x670) from [<c0311044>] (platform_drv_probe+0x20/0x24)
      [<c0311024>] (platform_drv_probe+0x0/0x24) from [<c030fcac>] (driver_probe_device+0x9c/0x234)
      ...
      ---[ end trace c88ccaf3969e8422 ]---
      Unable to handle kernel NULL pointer dereference at virtual address 00000028
      pgd = c0004000
      [00000028] *pgd=00000000
      Internal error: Oops: 17 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G        W    3.12.0-rc4+ #56
      Workqueue: deferwq deferred_probe_work_func
      task: df86ad00 ti: df882000 task.ti: df882000
      PC is at usb_remove_hcd+0x10/0x150
      LR is at host_stop+0x1c/0x3c
      pc : [<c03cacec>]    lr : [<c03e88e4>]    psr: 60000013
      sp : df883b50  ip : df883b78  fp : df883b74
      r10: c11f4c54  r9 : c0836450  r8 : df30c400
      r7 : fffffff4  r6 : df2ef410  r5 : 00000000  r4 : df2c3010
      r3 : 00000000  r2 : 00000000  r1 : df86b0a0  r0 : 00000000
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c53c7d  Table: 2f29404a  DAC: 00000015
      Process kworker/u2:0 (pid: 6, stack limit = 0xdf882240)
      Stack: (0xdf883b50 to 0xdf884000)
      ...
      Backtrace:
      [<c03cacdc>] (usb_remove_hcd+0x0/0x150) from [<c03e88e4>] (host_stop+0x1c/0x3c)
       r6:df2ef410 r5:00000000 r4:df2c3010
      [<c03e88c8>] (host_stop+0x0/0x3c) from [<c03e8aa0>] (ci_hdrc_host_destroy+0x1c/0x20)
       r5:00000000 r4:df2c3010
      [<c03e8a84>] (ci_hdrc_host_destroy+0x0/0x20) from [<c03e7c80>] (ci_hdrc_probe+0x3ac/0x670)
      [<c03e78d4>] (ci_hdrc_probe+0x0/0x670) from [<c0311044>] (platform_drv_probe+0x20/0x24)
      [<c0311024>] (platform_drv_probe+0x0/0x24) from [<c030fcac>] (driver_probe_device+0x9c/0x234)
      [<c030fc10>] (driver_probe_device+0x0/0x234) from [<c030ff28>] (__device_attach+0x44/0x48)
      ...
      ---[ end trace c88ccaf3969e8423 ]---
      
      Fix this so at least we can continue booting and get to a shell prompt.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Tested-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      41314fea
  15. 15 8月, 2013 2 次提交
  16. 13 8月, 2013 1 次提交
  17. 25 6月, 2013 1 次提交
  18. 12 1月, 2013 1 次提交
    • F
      usb: chipidea: Allow disabling streaming not only in udc mode · 929473ea
      Fabio Estevam 提交于
      When running a scp transfer using a USB/Ethernet adapter the following crash
      happens:
      
      $ scp test.tar.gz fabio@192.168.1.100:/home/fabio
      fabio@192.168.1.100's password:
      test.tar.gz                                      0%    0     0.0KB/s   --:-- ETA
      ------------[ cut here ]------------
      WARNING: at net/sched/sch_generic.c:255 dev_watchdog+0x2cc/0x2f0()
      NETDEV WATCHDOG: eth0 (asix): transmit queue 0 timed out
      Modules linked in:
      Backtrace:
      [<80011c94>] (dump_backtrace+0x0/0x10c) from [<804d3a5c>] (dump_stack+0x18/0x1c)
       r6:000000ff r5:80412388 r4:80685dc0 r3:80696cc0
      [<804d3a44>] (dump_stack+0x0/0x1c) from [<80021868>]
      (warn_slowpath_common+0x54/0x6c)
      [<80021814>] (warn_slowpath_common+0x0/0x6c) from [<80021924>]
      (warn_slowpath_fmt+0x38/0x40)
      ...
      
      Setting SDIS (Stream Disable Mode- bit 4 of USBMODE register) fixes the problem.
      
      However, in current code CI13XXX_DISABLE_STREAMING flag is only set in udc mode,
      so allow disabling streaming also in host mode.
      
      Tested on a mx6qsabrelite board.
      Suggested-by: NPeter Chen <peter.chen@freescale.com>
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Reviewed-by: NPeter Chen <peter.chen@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      929473ea
  19. 12 11月, 2012 1 次提交
  20. 04 11月, 2012 1 次提交
  21. 03 11月, 2012 1 次提交
  22. 01 11月, 2012 1 次提交
    • A
      USB: EHCI: remove ehci_port_power() routine · c73cee71
      Alan Stern 提交于
      This patch (as1623) removes the ehci_port_power() routine and all the
      places that call it.  There's no reason for ehci-hcd to change the
      port power settings; the hub driver takes care of all that stuff.
      
      There is one exception: When the controller is resumed from
      hibernation or following a loss of power, the ports that are supposed
      to be handed over to a companion controller must be powered on first.
      Otherwise the handover won't work.  This process is not visible to the
      hub driver, so it has to be handled in ehci-hcd.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c73cee71
  23. 10 7月, 2012 1 次提交
  24. 07 7月, 2012 1 次提交
  25. 15 5月, 2012 1 次提交
  26. 12 5月, 2012 2 次提交