1. 02 10月, 2020 11 次提交
  2. 24 9月, 2020 1 次提交
    • P
      usb: cdns3: gadget: free interrupt after gadget has deleted · 98df91f8
      Peter Chen 提交于
      The interrupt may occur during the gadget deletion, it fixes the
      below oops.
      
      [ 2394.974604] configfs-gadget gadget: suspend
      [ 2395.042578] configfs-gadget 5b130000.usb: unregistering UDC driver [g1]
      [ 2395.382562] irq 229: nobody cared (try booting with the "irqpoll" option)
      [ 2395.389362] CPU: 0 PID: 301 Comm: kworker/u12:6 Not tainted 5.8.0-rc3-next-20200703-00060-g2f13b83cbf30-dirty #456
      [ 2395.399712] Hardware name: Freescale i.MX8QM MEK (DT)
      [ 2395.404782] Workqueue: 2-0051 tcpm_state_machine_work
      [ 2395.409832] Call trace:
      [ 2395.412289]  dump_backtrace+0x0/0x1d0
      [ 2395.415950]  show_stack+0x1c/0x28
      [ 2395.419271]  dump_stack+0xbc/0x118
      [ 2395.422678]  __report_bad_irq+0x50/0xe0
      [ 2395.426513]  note_interrupt+0x2cc/0x38c
      [ 2395.430355]  handle_irq_event_percpu+0x88/0x90
      [ 2395.434800]  handle_irq_event+0x4c/0xe8
      [ 2395.438640]  handle_fasteoi_irq+0xbc/0x168
      [ 2395.442740]  generic_handle_irq+0x34/0x48
      [ 2395.446752]  __handle_domain_irq+0x68/0xc0
      [ 2395.450846]  gic_handle_irq+0x64/0x150
      [ 2395.454596]  el1_irq+0xb8/0x180
      [ 2395.457733]  __do_softirq+0xac/0x3b8
      [ 2395.461310]  irq_exit+0xc0/0xe0
      [ 2395.464448]  __handle_domain_irq+0x6c/0xc0
      [ 2395.468540]  gic_handle_irq+0x64/0x150
      [ 2395.472295]  el1_irq+0xb8/0x180
      [ 2395.475436]  _raw_spin_unlock_irqrestore+0x14/0x48
      [ 2395.480232]  usb_gadget_disconnect+0x120/0x140
      [ 2395.484678]  usb_gadget_remove_driver+0xb4/0xd0
      [ 2395.489208]  usb_del_gadget+0x6c/0xc8
      [ 2395.492872]  cdns3_gadget_exit+0x5c/0x120
      [ 2395.496882]  cdns3_role_stop+0x60/0x90
      [ 2395.500634]  cdns3_role_set+0x64/0xd8
      [ 2395.504301]  usb_role_switch_set_role.part.0+0x3c/0x90
      [ 2395.509444]  usb_role_switch_set_role+0x20/0x30
      [ 2395.513978]  tcpm_mux_set+0x60/0xf8
      [ 2395.517470]  tcpm_reset_port+0xa4/0xf0
      [ 2395.521222]  tcpm_detach.part.0+0x44/0x50
      [ 2395.525227]  tcpm_state_machine_work+0x8b0/0x2360
      [ 2395.529932]  process_one_work+0x1c8/0x470
      [ 2395.533939]  worker_thread+0x50/0x420
      [ 2395.537603]  kthread+0x148/0x168
      [ 2395.540830]  ret_from_fork+0x10/0x18
      [ 2395.544399] handlers:
      [ 2395.546671] [<000000008dea28da>] cdns3_wakeup_irq
      [ 2395.551375] [<000000009fee5c61>] cdns3_drd_irq threaded [<000000005148eaec>] cdns3_drd_thread_irq
      [ 2395.560255] Disabling IRQ #229
      [ 2395.563454] configfs-gadget gadget: unbind function 'Mass Storage Function'/000000000132f835
      [ 2395.563657] configfs-gadget gadget: unbind
      [ 2395.563917] udc 5b130000.usb: releasing '5b130000.usb'
      
      Fixes: 7733f6c3 ("usb: cdns3: Add Cadence USB3 DRD Driver")
      Cc: <stable@vger.kernel.org>
      Acked-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      98df91f8
  3. 24 7月, 2020 3 次提交
    • P
      usb: cdns3: drd: simplify *switch_gadet and *switch_host · b2aeb6da
      Pawel Laszczak 提交于
      Patch split function cdns3_drd_switch_gadget and
      cdns3_drd_switch_host into:
      - cdns3_drd_host_on
      - cdns3_drd_host_off
      - cdns3_drd_gadget_on
      - cdns3_drd_gadgett_off
      
      These functions don't have any shared code so it's better to
      have smaller, faster and easier functions.
      Signed-off-by: NPawel Laszczak <pawell@cadence.com>
      Reviewed-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      b2aeb6da
    • P
      usb: cdns3: gadget: always zeroed TRB buffer when enable endpoint · 95f5acfc
      Peter Chen 提交于
      During the endpoint dequeue operation, it changes dequeued TRB as link
      TRB, when the endpoint is disabled and re-enabled, the DMA fetches the
      TRB before the link TRB, after it handles current TRB, the DMA pointer
      will advance to the TRB after link TRB, but enqueue and dequene
      variables don't know it due to no hardware interrupt at the time, when
      the next TRB is added to link TRB position, the DMA will not handle
      this TRB due to its pointer is already at the next TRB. See the trace
      log like below:
      
      file-storage-675   [001] d..1    86.585657: usb_ep_queue: ep0: req 00000000df9b3a4f length 0/0 sgs 0/0 stream 0 zsI status 0 --> 0
      file-storage-675   [001] d..1    86.585663: cdns3_ep_queue: ep1out: req: 000000002ebce364, req buff 00000000f5bc96b4, length: 0/1024 zsi, status: -115, trb: [start:0, end:0: virt addr (null)], flags:0 SID: 0
      file-storage-675   [001] d..1    86.585671: cdns3_prepare_trb: ep1out: trb 000000007f770303, dma buf: 0xbd195800, size: 1024, burst: 128 ctrl: 0x00000425 (C=1, T=0, ISP, IOC, Normal) SID:0 LAST_SID:0
      file-storage-675   [001] d..1    86.585676: cdns3_ring:
                  Ring contents for ep1out:
                  Ring deq index: 0, trb: 000000007f770303 (virt), 0xc4003000 (dma)
                  Ring enq index: 1, trb: 0000000049c1ba21 (virt), 0xc400300c (dma)
                  free trbs: 38, CCS=1, PCS=1
                  @0x00000000c4003000 bd195800 80020400 00000425
                  @0x00000000c400300c c4003018 80020400 00001811
                  @0x00000000c4003018 bcfcc000 0000001f 00000426
                  @0x00000000c4003024 bcfce800 0000001f 00000426
      
      	    ...
      
       irq/144-5b13000-698   [000] d...    87.619286: usb_gadget_giveback_request: ep1in: req 0000000031b832eb length 13/13 sgs 0/0 stream 0 zsI status 0 --> 0
          file-storage-675   [001] d..1    87.619287: cdns3_ep_queue: ep1out: req: 000000002ebce364, req buff 00000000f5bc96b4, length: 0/1024 zsi, status: -115, trb: [start:0, end:0: virt addr 0x80020400c400300c], flags:0 SID: 0
          file-storage-675   [001] d..1    87.619294: cdns3_prepare_trb: ep1out: trb 0000000049c1ba21, dma buf: 0xbd198000, size: 1024, burst: 128 ctrl: 0x00000425 (C=1, T=0, ISP, IOC, Normal) SID:0 LAST_SID:0
          file-storage-675   [001] d..1    87.619297: cdns3_ring:
                      Ring contents for ep1out:
                      Ring deq index: 1, trb: 0000000049c1ba21 (virt), 0xc400300c (dma)
                      Ring enq index: 2, trb: 0000000059b34b67 (virt), 0xc4003018 (dma)
                      free trbs: 38, CCS=1, PCS=1
                      @0x00000000c4003000 bd195800 0000001f 00000427
                      @0x00000000c400300c bd198000 80020400 00000425
                      @0x00000000c4003018 bcfcc000 0000001f 00000426
                      @0x00000000c4003024 bcfce800 0000001f 00000426
      		...
      
          file-storage-675   [001] d..1    87.619305: cdns3_doorbell_epx: ep1out, ep_trbaddr c4003018
          file-storage-675   [001] ....    87.619308: usb_ep_queue: ep1out: req 000000002ebce364 length 0/1024 sgs 0/0 stream 0 zsI status -115 --> 0
       irq/144-5b13000-698   [000] d..1    87.619315: cdns3_epx_irq: IRQ for ep1out: 01000c80 TRBERR , ep_traddr: c4003018 ep_last_sid: 00000000 use_streams: 0
       irq/144-5b13000-698   [000] d..1    87.619395: cdns3_usb_irq: IRQ 00000008 = Hot Reset
      
      Fixes: f616c3bd ("usb: cdns3: Fix dequeue implementation")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      95f5acfc
    • P
      usb: cdns3: gadget: improve the set_configuration handling · f4cfe5ce
      Peter Chen 提交于
      - Delete the duplicated EP_CMD_ERDY and EP_CMD_REQ_CMPL setting
      - Prepare the next setup before setting EP_CMD_ERDY and EP_CMD_REQ_CMPL,
      it could avoid a bug that DMA hang at EP0 OUT for DEV_VER_NXP_V1
      - Delete the duplicated cdns3_set_hw_configuration calling at
      cdns3_req_ep0_set_configuration, the composite.c will handle
      this request, and call .ep0_queue back, and at .ep_queue it will
      call cdns3_set_hw_configuration.
      - Move cdns3_allow_enable_l1 into cdns3_set_hw_configuration since
      it is part of this function.
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      f4cfe5ce
  4. 10 7月, 2020 1 次提交
  5. 03 7月, 2020 1 次提交
    • L
      usb: cdns3: gadget: Fix a bunch of kernel doc issues · 4a35aa6d
      Lee Jones 提交于
      Mainline misspelled function argument descriptions.  Also one
      formatting issue with a missing '@' identifier.
      
      Fixes the following W=1 build warnings:
      
       drivers/usb/cdns3/gadget.c:653: warning: Function parameter or member 'priv_ep' not described in 'cdns3_wa2_descmissing_packet'
       drivers/usb/cdns3/gadget.c:653: warning: Excess function parameter 'priv_dev' description in 'cdns3_wa2_descmissing_packet'
       drivers/usb/cdns3/gadget.c:1088: warning: Function parameter or member 'request' not described in 'cdns3_ep_run_transfer'
       drivers/usb/cdns3/gadget.c:2574: warning: Function parameter or member 'priv_ep' not described in '__cdns3_gadget_ep_set_halt'
       drivers/usb/cdns3/gadget.c:2574: warning: Excess function parameter 'ep' description in '__cdns3_gadget_ep_set_halt'
       drivers/usb/cdns3/gadget.c:2595: warning: Function parameter or member 'priv_ep' not described in '__cdns3_gadget_ep_clear_halt'
       drivers/usb/cdns3/gadget.c:2595: warning: Excess function parameter 'ep' description in '__cdns3_gadget_ep_clear_halt'
       drivers/usb/cdns3/gadget.c:2898: warning: Function parameter or member 'priv_dev' not described in 'cdns3_init_eps'
       drivers/usb/cdns3/gadget.c:2898: warning: Excess function parameter 'cdns3' description in 'cdns3_init_eps'
       drivers/usb/cdns3/gadget.c:3210: warning: Function parameter or member 'cdns' not described in 'cdns3_gadget_init'
      
      Cc: Pawel Laszczak <pawell@cadence.com>
      Cc: Pawel Jez <pjez@cadence.com>
      Cc: Peter Chen <peter.chen@nxp.com>
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20200702144625.2533530-18-lee.jones@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a35aa6d
  6. 01 7月, 2020 2 次提交
  7. 27 6月, 2020 1 次提交
  8. 25 5月, 2020 2 次提交
    • P
      usb: cdns3: gadget: assign interrupt number to USB gadget structure · 77f30ff4
      Peter Chen 提交于
      Assign interrupt number to USB gadget structure.
      Reviewed-by: NJun Li <jun.li@nxp.com>
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      77f30ff4
    • P
      usb: cdns3: change dev_info to dev_dbg for debug message · a55b8dce
      Peter Chen 提交于
      During device mode initialization, lots of device information
      are printed to console, see below. Change them as debug message.
      
      cdns-usb3 5b130000.cdns3: Initialized  ep0 support:
      cdns-usb3 5b130000.cdns3: Initialized  ep1out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep2out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep3out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep4out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep5out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep6out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep7out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep1in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep2in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep3in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep4in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep5in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep6in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep7in support: BULK, INT ISO
      Reviewed-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      a55b8dce
  9. 14 5月, 2020 1 次提交
    • J
      usb: cdns3: gadget: make a bunch of functions static · 172b14b4
      Jason Yan 提交于
      Fix the following sparse warning:
      
      drivers/usb/cdns3/gadget.c:85:6: warning: symbol
      'cdns3_clear_register_bit' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:140:26: warning: symbol
      'cdns3_next_align_buf' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:151:22: warning: symbol
      'cdns3_next_priv_request' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:193:5: warning: symbol 'cdns3_ring_size' was
      not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:348:6: warning: symbol
      'cdns3_move_deq_to_next_trb' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:514:20: warning: symbol
      'cdns3_wa2_gadget_giveback' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:554:5: warning: symbol
      'cdns3_wa2_gadget_ep_queue' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:839:6: warning: symbol
      'cdns3_wa1_restore_cycle_bit' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:1907:6: warning: symbol
      'cdns3_stream_ep_reconfig' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:1928:6: warning: symbol
      'cdns3_configure_dmult' was not declared. Should it be static?
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Reviewed-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      172b14b4
  10. 09 5月, 2020 1 次提交
    • P
      usb: cdns3: gadget: prev_req->trb is NULL for ep0 · 95cd7dc4
      Peter Chen 提交于
      And there are no multiple TRBs on EP0 and WA1 workaround,
      so it doesn't need to change TRB for EP0. It fixes below oops.
      
      configfs-gadget gadget: high-speed config #1: b
      android_work: sent uevent USB_STATE=CONFIGURED
      Unable to handle kernel read from unreadable memory at virtual address 0000000000000008
      Mem abort info:
      android_work: sent uevent USB_STATE=DISCONNECTED
        ESR = 0x96000004
        EC = 0x25: DABT (current EL), IL = 32 bits
      
        SET = 0, FnV = 0
        EA = 0, S1PTW = 0
      Data abort info:
        ISV = 0, ISS = 0x00000004
        CM = 0, WnR = 0
      user pgtable: 4k pages, 48-bit VAs, pgdp=00000008b5bb7000
      [0000000000000008] pgd=0000000000000000
      Internal error: Oops: 96000004 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 2 PID: 430 Comm: HwBinder:401_1 Not tainted 5.4.24-06071-g6fa8921409c1-dirty #77
      Hardware name: Freescale i.MX8QXP MEK (DT)
      pstate: 60400085 (nZCv daIf +PAN -UAO)
      pc : cdns3_gadget_ep_dequeue+0x1d4/0x270
      lr : cdns3_gadget_ep_dequeue+0x48/0x270
      sp : ffff800012763ba0
      x29: ffff800012763ba0 x28: ffff00082c653c00
      x27: 0000000000000000 x26: ffff000068fa7b00
      x25: ffff0000699b2000 x24: ffff00082c6ac000
      x23: ffff000834f0a480 x22: ffff000834e87b9c
      x21: 0000000000000000 x20: ffff000834e87800
      x19: ffff000069eddc00 x18: 0000000000000000
      x17: 0000000000000000 x16: 0000000000000000
      x15: 0000000000000000 x14: 0000000000000000
      x13: 0000000000000000 x12: 0000000000000001
      x11: ffff80001180fbe8 x10: 0000000000000001
      x9 : ffff800012101558 x8 : 0000000000000001
      x7 : 0000000000000006 x6 : ffff000835d9c668
      x5 : ffff000834f0a4c8 x4 : 0000000096000000
      x3 : 0000000000001810 x2 : 0000000000000000
      x1 : ffff800024bd001c x0 : 0000000000000001
      Call trace:
       cdns3_gadget_ep_dequeue+0x1d4/0x270
       usb_ep_dequeue+0x34/0xf8
       composite_dev_cleanup+0x154/0x170
       configfs_composite_unbind+0x6c/0xa8
       usb_gadget_remove_driver+0x44/0x70
       usb_gadget_unregister_driver+0x74/0xe0
       unregister_gadget+0x28/0x58
       gadget_dev_desc_UDC_store+0x80/0x110
       configfs_write_file+0x1e0/0x2a0
       __vfs_write+0x48/0x90
       vfs_write+0xe4/0x1c8
       ksys_write+0x78/0x100
       __arm64_sys_write+0x24/0x30
       el0_svc_common.constprop.0+0x74/0x168
       el0_svc_handler+0x34/0xa0
       el0_svc+0x8/0xc
      Code: 52830203 b9407660 f94042e4 11000400 (b9400841)
      ---[ end trace 1574516e4c1772ca ]---
      Kernel panic - not syncing: Fatal exception
      SMP: stopping secondary CPUs
      Kernel Offset: disabled
      CPU features: 0x0002,20002008
      Memory Limit: none
      Rebooting in 5 seconds..
      
      Fixes: f616c3bd ("usb: cdns3: Fix dequeue implementation")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      95cd7dc4
  11. 05 5月, 2020 1 次提交
  12. 16 4月, 2020 2 次提交
    • J
      usb: cdns3: gadget: make a bunch of functions static · e9010320
      Jason Yan 提交于
      Fix the following sparse warning:
      
      drivers/usb/cdns3/gadget.c:85:6: warning: symbol
      'cdns3_clear_register_bit' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:140:26: warning: symbol
      'cdns3_next_align_buf' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:151:22: warning: symbol
      'cdns3_next_priv_request' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:193:5: warning: symbol 'cdns3_ring_size' was
      not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:348:6: warning: symbol
      'cdns3_move_deq_to_next_trb' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:514:20: warning: symbol
      'cdns3_wa2_gadget_giveback' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:554:5: warning: symbol
      'cdns3_wa2_gadget_ep_queue' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:839:6: warning: symbol
      'cdns3_wa1_restore_cycle_bit' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:1907:6: warning: symbol
      'cdns3_stream_ep_reconfig' was not declared. Should it be static?
      drivers/usb/cdns3/gadget.c:1928:6: warning: symbol
      'cdns3_configure_dmult' was not declared. Should it be static?
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NJason Yan <yanaijie@huawei.com>
      Reviewed-by: NPeter Chen <peter.chen@nxp.com>
      Link: https://lore.kernel.org/r/20200402123837.5850-1-yanaijie@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e9010320
    • P
      usb: cdns3: change dev_info to dev_dbg for debug message · eed6ed6e
      Peter Chen 提交于
      During device mode initialization, lots of device information
      are printed to console, see below. Change them as debug message.
      
      cdns-usb3 5b130000.cdns3: Initialized  ep0 support:
      cdns-usb3 5b130000.cdns3: Initialized  ep1out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep2out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep3out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep4out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep5out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep6out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep7out support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep1in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep2in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep3in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep4in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep5in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep6in support: BULK, INT ISO
      cdns-usb3 5b130000.cdns3: Initialized  ep7in support: BULK, INT ISO
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Reviewed-by: NRoger Quadros <rogerq@ti.com>
      Link: https://lore.kernel.org/r/20200331081005.32752-4-peter.chen@nxp.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eed6ed6e
  13. 15 3月, 2020 1 次提交
  14. 04 3月, 2020 2 次提交
  15. 11 2月, 2020 1 次提交
  16. 15 1月, 2020 1 次提交
    • J
      usb: cdns3: Add streams support to cadence USB3 DRD driver · 54c4c69f
      Jayshri Pawar 提交于
      This patch includes streams implementation changes.
      The current changes has been validated on FPGA platform.
      
      Enabled streams related interrupts only for streams capable endpoints.
      Processed  PRIME and IOT interrupts related to streams capable endpoints.
      Based on PRIME interrupt prime_flag is set and transfer is armed
      otherwise just adding request to the deferred request queue.
      For streams capable endpoints preparing TD with correct stream ID.
      
      TDL calculation:
      Updated tdl calculation based on controller versions.
      1. For controller version DEV_VER_V2 :We have enabled USB_CONF2_EN_TDL_TRB
         bit in usb_conf2 register in DMULT configuration.
         This enables TDL calculation based on TRB, hence setting TDL in TRB.
      2. For controller Version < DEV_VER_V2 : Writing TDL and STDL in ep_cmd
         register
      3. For controller version > DEV_VER_V2 : Writing TDL in ep_tdl register.
      
      Writing ERDY with correct Stream ID to ep_cmd register.
      Added stream id related information to trace logs.
      Signed-off-by: NRahul Kumar <kurahul@cadence.com>
      Signed-off-by: NPawel Laszczak <pawell@cadence.com>
      Signed-off-by: NJayshri Pawar <jpawar@cadence.com>
      Signed-off-by: NFelipe Balbi <balbi@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      54c4c69f
  17. 31 12月, 2019 2 次提交
    • X
      usb: cdns3: gadget: Remove unneeded variable ret · 8e1a2009
      Xu Wang 提交于
      Remove unneeded variable ret used to store return value,just return 0.
      Signed-off-by: NXu Wang <vulab@iscas.ac.cn>
      Acked-by: NRoger Quadros <rogerq@ti.com>
      Link: https://lore.kernel.org/r/1576826378-4387-1-git-send-email-vulab@iscas.ac.cnSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e1a2009
    • P
      usb: cdns3: should not use the same dev_id for shared interrupt handler · af58e1fc
      Peter Chen 提交于
      Both drd and gadget interrupt handler use the struct cdns3 pointer as
      dev_id, it causes devm_free_irq at cdns3_gadget_exit doesn't free
      gadget's interrupt handler, it freed drd's handler. So, when the
      host interrupt occurs, the gadget's interrupt hanlder is still
      called, and causes below oops. To fix it, we use gadget's private
      data priv_dev as interrupt dev_id for gadget.
      
      Unable to handle kernel NULL pointer dereference at virtual address 0000000000000380
      Mem abort info:
        ESR = 0x96000006
        EC = 0x25: DABT (current EL), IL = 32 bits
        SET = 0, FnV = 0
        EA = 0, S1PTW = 0
      Data abort info:
        ISV = 0, ISS = 0x00000006
        CM = 0, WnR = 0
      user pgtable: 4k pages, 48-bit VAs, pgdp=0000000971d79000
      [0000000000000380] pgd=0000000971d6f003, pud=0000000971d6e003, pmd=0000000000000000
      Internal error: Oops: 96000006 [#1] PREEMPT SMP
      Modules linked in: mxc_jpeg_encdec crct10dif_ce fsl_imx8_ddr_perf
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.0-03486-g69f4e7d9c54a-dirty #254
      Hardware name: Freescale i.MX8QM MEK (DT)
      pstate: 00000085 (nzcv daIf -PAN -UAO)
      pc : cdns3_device_irq_handler+0x1c/0xb8
      lr : __handle_irq_event_percpu+0x78/0x2c0
      sp : ffff800010003e30
      x29: ffff800010003e30 x28: ffff8000129bb000
      x27: ffff8000126e9000 x26: ffff0008f61b5600
      x25: ffff800011fe1018 x24: ffff8000126ea120
      x23: ffff800010003f04 x22: 0000000000000000
      x21: 0000000000000093 x20: ffff0008f61b5600
      x19: ffff0008f5061a80 x18: 0000000000000000
      x17: 0000000000000000 x16: 0000000000000000
      x15: 0000000000000000 x14: 003d090000000000
      x13: 00003d0900000000 x12: 0000000000000000
      x11: 00003d0900000000 x10: 0000000000000040
      x9 : ffff800012708cb8 x8 : ffff800012708cb0
      x7 : ffff0008f7c7a9d0 x6 : 0000000000000000
      x5 : ffff0008f7c7a910 x4 : ffff8008ed359000
      x3 : ffff800010003f40 x2 : 0000000000000000
      x1 : ffff0008f5061a80 x0 : ffff800010161a60
      Call trace:
       cdns3_device_irq_handler+0x1c/0xb8
       __handle_irq_event_percpu+0x78/0x2c0
       handle_irq_event_percpu+0x40/0x98
       handle_irq_event+0x4c/0xd0
       handle_fasteoi_irq+0xbc/0x168
       generic_handle_irq+0x34/0x50
       __handle_domain_irq+0x6c/0xc0
       gic_handle_irq+0xd4/0x174
       el1_irq+0xb8/0x180
       arch_cpu_idle+0x3c/0x230
       default_idle_call+0x38/0x40
       do_idle+0x20c/0x298
       cpu_startup_entry+0x28/0x48
       rest_init+0xdc/0xe8
       arch_call_rest_init+0x14/0x1c
       start_kernel+0x48c/0x4b8
      Code: aa0103f3 aa1e03e0 d503201f f9409662 (f941c040)
      ---[ end trace 091dcf4dee011b0e ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      SMP: stopping secondary CPUs
      Kernel Offset: disabled
      CPU features: 0x0002,2100600c
      Memory Limit: none
      ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
      
      Fixes: 7733f6c3 ("usb: cdns3: Add Cadence USB3 DRD Driver")
      Cc: <stable@vger.kernel.org> #v5.4
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Link: https://lore.kernel.org/r/1577437804-18146-1-git-send-email-peter.chen@nxp.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      af58e1fc
  18. 30 10月, 2019 2 次提交
  19. 27 10月, 2019 1 次提交
  20. 16 10月, 2019 1 次提交
  21. 10 10月, 2019 2 次提交