Skip to content
Snippets Groups Projects
  1. Jun 29, 2022
  2. Jun 28, 2022
  3. Jun 24, 2022
  4. Jun 20, 2022
  5. Jun 06, 2022
    • Dong Aisheng's avatar
      LF-4713-3 soc: imx: imx8m_pm_domains: use in core GENPD_FLAG_PM_PD_CLK feature · b9f7976c
      Dong Aisheng authored
      
      There's a potential A-B/B-A deadlock between Clock and PM domain
      framework in current kernel. Accessing PD clocks in genpd->power_on()/
      power_off() callback is unsafe as mentioned in the commit
      2b31e22d5376 ("PM: domains: add pm domain clocks support").
      
      This patch switches to use the in core GENPD_FLAG_PM_PD_CLK feature for
      imx8mp only to avoid such possible deadlock issue.
      
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      (cherry picked from commit b1f1595f)
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      b9f7976c
    • Dong Aisheng's avatar
      LF-4713-2 clk: imx: blk-ctrl: fix potential deadlock caused by reset · 40d23c9f
      Dong Aisheng authored
      
      Both blkctl clocks and resets support runtime pm.
      Async pm_runtime_put of reset devices may cause a SW lockup (waiting for
      RPM_SUSPENDING/RESUMING finish) on the same blkctl device runtime pm
      state when both reset and clk are used by different consumer devices.
      
      This patch fix below possible SW lockup:
      [   62.673341] task:kworker/0:1     state:D stack:    0 pid:   10 ppid:     2 flags:0x00000008
      [   62.681758] Workqueue: pm pm_runtime_work
      [   62.685815] Call trace:
      [   62.688300]  __switch_to+0x154/0x1b0
      [   62.691913]  __schedule+0x2f0/0x990
      [   62.695440]  schedule+0x74/0x110
      [   62.698683]  schedule_preempt_disabled+0x28/0x44
      [   62.703341]  __mutex_lock+0x2f8/0x474
      [   62.707040]  mutex_lock_nested+0x3c/0x6c
      [   62.711006]  clk_prepare_lock+0x48/0xac
      [   62.714877]  clk_unprepare+0x28/0x50
      [   62.718465]  clk_bulk_unprepare+0x3c/0x60
      [   62.722514]  pm_genpd_disable_clks+0x64/0x74
      [   62.726842]  genpd_runtime_suspend+0x1f8/0x250
      [   62.731323]  __rpm_callback+0x48/0x140
      [   62.735112]  rpm_callback+0x6c/0x80
      [   62.738613]  rpm_suspend+0x10c/0x62c
      [   62.742232]  pm_runtime_work+0xc8/0xcc
      [   62.746020]  process_one_work+0x288/0x6d4
      [   62.750066]  worker_thread+0x78/0x464
      [   62.753767]  kthread+0x158/0x164
      [   62.757033]  ret_from_fork+0x10/0x20
      
      [   62.894459] Workqueue: events_unbound deferred_probe_work_func
      [   62.900341] Call trace:
      [   62.902795]  __switch_to+0x154/0x1b0
      [   62.906412]  __schedule+0x2f0/0x990
      [   62.909944]  schedule+0x74/0x110
      [   62.913218]  rpm_resume+0x160/0x6e0
      [   62.916748]  __pm_runtime_resume+0x40/0x90
      [   62.920890]  clk_pm_runtime_get.part.0+0x20/0x90
      [   62.925553]  clk_core_prepare+0x3c/0x3b0
      [   62.929529]  clk_prepare+0x2c/0x50
      [   62.932973]  samsung_hdmi_phy_probe+0xc4/0x320
      [   62.937462]  platform_probe+0x6c/0xe0
      [   62.941168]  really_probe.part.0+0x9c/0x310
      [   62.945397]  __driver_probe_device+0x98/0x144
      [   62.949799]  driver_probe_device+0xc8/0x160
      [   62.954029]  __device_attach_driver+0xbc/0x124
      [   62.958519]  bus_for_each_drv+0x78/0xd0
      [   62.962397]  __device_attach+0xd8/0x180
      [   62.966277]  device_initial_probe+0x18/0x2c
      [   62.970505]  bus_probe_device+0xa0/0xac
      [   62.974383]  deferred_probe_work_func+0x88/0xc4
      [   62.978959]  process_one_work+0x288/0x6d4
      [   62.983009]  worker_thread+0x78/0x464
      [   62.986688]  kthread+0x158/0x164
      [   62.989958]  ret_from_fork+0x10/0x20
      
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      (cherry picked from commit 76609f10)
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      40d23c9f
    • Dong Aisheng's avatar
      LF-4713-1 PM: domains: add pm domain clocks support · e9f0cd90
      Dong Aisheng authored
      
      PM domains on some SoCs (e.g. i.MX8MP) may depend on clocks to
      work properly. For such domains, PD clocks must be enabled first
      before powering up domain and then can be gated later when
      powering off.
      
      Usually PD drivers could implement it within genpd->power_on()/power_off().
      However, there's a potential A-B/B-A deadlock between Clock and PM domain
      framework in current kernel.
      e.g.
      Possible unsafe locking scenario:
      
            CPU0                    CPU1
            ----                    ----
      genpd_power_on(genpd)
       lock(&genpd->mlock);
      			      clk_set_rate
                                    lock(prepare_lock);
      			      clk_pm_runtime_get()
      			      genpd_runtime_resume(genpd)
                                    lock(&genpd->mlock);
      clk_prepare()
       lock(prepare_lock);
      
      NOTE: assume CPU0 and CPU1 are accessing the same PD. For example in
      real life, clock controller and device using the same PD.
      
      This is a known issue in latest upstream kernel and still not get fixed.
      
      This patch abstracts this feature, implement it in PM domain core and
      moving the clock operations out of genpd_{lock|unlock} in order to address
      this potential A-B/B-A deadlock issue. A new flag GENPD_FLAG_PM_PD_CLK
      was introduced for driver to indicate the core to use it.
      
      Before fix, the locking sequence is A-B/B-A, potentially deadlock,
      after fix, the locking sequence changed to A-B/A-B.
      
      NOTE: this feature does not support clock controller using a sub-power
      domains which has a parent domains using PD clocks.
      There's lockdep warning, if enabled, about this user case.
      
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      (cherry-picked from commit c8512618)
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      e9f0cd90
  6. May 21, 2022
  7. May 18, 2022
    • Joy Zou's avatar
      LF-5479: dmaengine: imx-sdma: sdma memcpy test fail · 45de8b32
      Joy Zou authored
      
      The sdma memcpy test fail due to the channel priority not configured.
      The sdma_config_write-> sdma_config_channel-> sdma_set_channel_priority
      didn't be called in memcpy, So there are only memcpy test fail.
      
      The test fail log :
      
      root@imx8mnevk:~# echo 2000 > /sys/module/dmatest/parameters/timeout
      root@imx8mnevk:~# echo 1 > /sys/module/dmatest/parameters/iterations
      root@imx8mnevk:~# echo dma0chan1 > /sys/module/dmatest/parameters/channel                                                                                                                            	   [  248.264090] dmatest: Added 1 threads using dma0chan1
      root@imx8mnevk:~# echo 1 > /sys/module/dmatest/parameters/run
      [  253.961791] dmatest: Started 1 threads using dma0chan1
      root@imx8mnevk:~# [  255.967043] dmatest: dma0chan1-copy0: result #1: 'test timed out' with src_off=0xc4 dst_off=0x3c len=0x3ec0 (0)
      [  255.977236] dmatest: dma0chan1-copy0: summary 1 tests, 1 failures 0.49 iops 7 KB/s (0)
      
      This patch adds sdma_set_channel_priority for memcpy in transfer_init.
      
      Fixes: 11109759 ("MLK-25465-1 dmaengine: imx-sdma: move runtime behind to transfer phase")
      Signed-off-by: default avatarJoy Zou <joy.zou@nxp.com>
      Reviewed by: Dong Aisheng <aisheng.dong@nxp.com>
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      45de8b32
    • Joy Zou's avatar
      LF-5353: dmaengine: imx-sdma: optimize confused runtime related code · 58e19b36
      Joy Zou authored
      
      In order to call sdma_runtime_resume, the driver call pm_runtime_get_sync
      and pm_runtime_enable when the pm_runtime is false, it may be confused.
      The handler of true and false pm_runtime are mixed in sdma_remove function.
      
      This patch calls directly sdma_runtime_resume and remove pm_runtime_enable
      when the pm_runtime is false, and separate the handler of true and false
      pm_runtime.
      
      Signed-off-by: default avatarJoy Zou <joy.zou@nxp.com>
      Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      58e19b36
    • Joy Zou's avatar
      LF-5353: dmaengine: imx-sdma: optimize external firmware load check · b32457e4
      Joy Zou authored
      
      If external firmware has not been loaded, the sdma driver should return
      as soon as possible for client using ram script.
      
      The original firmware load check in sdma_transfer_init, if firmware
      is not ready, the sdma_config_write also will run, it is unnecessary.
      
      This patch checks firmware load status earlier and return fail immediately
      in sdma_config_write if firmware not ready and use ram script.
      
      Signed-off-by: default avatarJoy Zou <joy.zou@nxp.com>
      Reviewed-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      b32457e4
    • Joy Zou's avatar
      LF-5352: dmaengine: imx-sdma: fix the potential access registers without clock · 4dde3654
      Joy Zou authored
      
      The issue can be triggered with the sdma pm_runtime false.
      
      If the dma client try to use sdma in boot phase, it may cause
      system hang. The sdma driver really enable clk after sdma load
      firmware, the clk_disable_unused will disable the SDMA1_ROOT_CLK
      before the sdma driver enable clk. This issue will comes if access
      the sdma register when the SDMA1_ROOT_CLK is disable.
      
      This issue is very easy to reproduce with hdmi connected displayer
      on imx7d-sbd board which the i2c will use sdma early before sdma
      firmware loaded and clock enabled.
      
      The client i2c calls dmaengine_prep_slave_single->device_prep_slave_sg
      ->sdma_prep_slave_sg->sdma_config_write->sdma_config_channel to get
      descriptor in boot phase. Then, the function sdma_config_channel will
      access sdma registers. If clk is disable will cause system hang.
      
      This patch adds clk_enable and clk_disable to make sure the clk
      enable before access sdma hardware.
      
      Signed-off-by: default avatarJoy Zou <joy.zou@nxp.com>
      Reviewed-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
      Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      4dde3654
    • Joy Zou's avatar
      MMFMWK-9038: dmaengine: imx-sdma: kernel dump met in boot · 6a3be643
      Joy Zou authored
      
      The issue can be triggered with the sdma pm_runtime true.
      
      The dma clinet pcm calls snd_dmaengine_pcm_trigger->device_prep_dma_cyclic
      ->sdma_prep_dma_cyclic->pm_runtime_get_sync->sdma_transfer_init
      ->sdma_load_context to get descriptor. The sdma_buffer_descriptor
      bd0 is allocated by sdma_runtime_resume. The sdma_runtime_resume
      function will not be called because the runtime_status is
      RPM_ACTIVE. The sdma_load_context accessing bd0 will cause dump.
      
      The fail log as follow:
      
      [   13.613406] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
      [   13.622200] Mem abort info:
      [   13.625010]   ESR = 0x96000044
      [   13.628078]   EC = 0x25: DABT (current EL), IL = 32 bits
      [   13.633402]   SET = 0, FnV = 0
      [   13.636469]   EA = 0, S1PTW = 0
      [   13.639620] Data abort info:
      [   13.642515]   ISV = 0, ISS = 0x00000044
      [   13.646364]   CM = 0, WnR = 1
      [   13.649347] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000105ac5000
      [   13.655800] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
      [   13.662605] Internal error: Oops: 96000044 [#1] PREEMPT SMP
      [   13.668186] Modules linked in:
      [   13.671259] CPU: 3 PID: 695 Comm: alsa-sink-30c20 Not tainted 5.10.72-00003-g5f44cf7c854d-dirty #14
      [   13.680315] Hardware name: NXP i.MX8MPlus EVK board (DT)
      [   13.685646] pstate: 80000085 (Nzcv daIf -PAN -UAO -TCO BTYPE=--)
      [   13.691671] pc : sdma_transfer_init+0x21c/0x26c
      [   13.696223] lr : sdma_transfer_init+0x1bc/0x26c
      [   13.700767] sp : ffff800012d9bb80
      [   13.704095] x29: ffff800012d9bb80 x28: 0000000000000003
      [   13.709425] x27: ffff0000c19c46a8 x26: 0000000000000000
      [   13.714754] x25: 0000000000000080 x24: ffff0000c19c0080
      [   13.720083] x23: 00000000000003c2 x22: 0000000000000020
      [   13.725412] x21: ffff800011f4d200 x20: ffff0000d499a900
      [   13.730741] x19: ffff0000c19c0298 x18: ffffffffffffffff
      [   13.736069] x17: 0000000000000000 x16: 0000000000000000
      [   13.741398] x15: ffff800092d9b7e7 x14: 3030303165303320
      [   13.746726] x13: ffff800011b517b0 x12: 0000000000001000
      [   13.752055] x11: 000000000000037f x10: ffff800011b517b0
      [   13.757384] x9 : 0000000000000000 x8 : ffff800011f4d280
      [   13.762712] x7 : 0000000000000000 x6 : 000000000000003f
      [   13.768041] x5 : 0000000000000040 x4 : 0000000000000000
      [   13.773369] x3 : 0000000000000004 x2 : 0000000000000000
      [   13.778697] x1 : 0000000000000000 x0 : 0000000001830020
      [   13.784025] Call trace:
      [   13.786493]  sdma_transfer_init+0x21c/0x26c
      [   13.790696]  sdma_prep_dma_cyclic+0x88/0x2e4
      [   13.794984]  snd_dmaengine_pcm_trigger+0xec/0x1c0
      [   13.799706]  dmaengine_pcm_trigger+0x18/0x24
      [   13.803995]  snd_soc_pcm_component_trigger+0x48/0xf0
      [   13.808977]  soc_pcm_trigger+0xa8/0xd0
      [   13.812744]  snd_pcm_do_start+0x38/0x44
      [   13.816597]  snd_pcm_action_single+0x48/0xac
      [   13.820885]  snd_pcm_action+0x7c/0x9c
      [   13.824566]  snd_pcm_action_lock_irq+0x8c/0xbc
      [   13.829026]  snd_pcm_common_ioctl+0xfa4/0x11c0
      [   13.833487]  snd_pcm_ioctl+0x34/0x50
      [   13.837083]  __arm64_sys_ioctl+0xa8/0xf0
      [   13.841024]  el0_svc_common.constprop.0+0x78/0x1c4
      [   13.845829]  do_el0_svc+0x28/0x9c
      [   13.849163]  el0_svc+0x14/0x20
      [   13.852235]  el0_sync_handler+0xa4/0x130
      [   13.856174]  el0_sync+0x180/0x1c0
      [   13.859507] Code: b90026a0 52800400 531b6ad6 72a03060 (b9000340)
      [   13.865605] ---[ end trace 0f90c4454359a810 ]---
      [   13.870233] note: alsa-sink-30c20[695] exited with preempt_count 2
      
      This patch removes pm_runtime_set_active in sdma_probe. The clk is
      disable and the power is on when sdma probe, but the genpd_dev_pm_sync
      will sync power. So we think the runtime_status is RPM_SUSPENDED. The
      default runtime_status is RPM_SUSPENDED. This patch adds
      pm_runtime_set_suspended in order to improve code readability. The
      sdma_runtime_resume will be called.
      
      This issue is very hard to reproduce with yocto rootfs.
      If it uses auto login with ubuntu rootfs which is more easy to reproduce
      on kernel 5.10, but not easy on kernel 5.15.
      
      Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Signed-off-by: default avatarJoy Zou <joy.zou@nxp.com>
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      6a3be643
    • Joy Zou's avatar
      LF-4858: dmaengine: imx-sdma: retry load sdma firmware fail · 24776bcd
      Joy Zou authored
      
      If there is more than one sdma controller, the first controller
      load sdma firmware using fallback failed in first time, it will
      retry load sdma firmware again. But the second sdma controller
      error state clean up may be still not finished (the firmware
      request priv data has not been released). So the retry will fail
      immediately due to get the old firmware priv data.
      
      The fail log as follow:
      
      [   62.505753] imx-sdma 30e10000.dma-controller: external firmware not found, using ROM firmware
      [   62.599868] imx-sdma 30bd0000.dma-controller: firmware found.
      [   62.605808] imx-sdma 30bd0000.dma-controller: loaded firmware 4.6
      
      This patch adds a bit delay to wait for the second controller
      firmware priv data released.
      
      This issue is very hard to reproduce with yocto rootfs.
      The 20ms delay is tested value with ubuntu rootfs which is more easy
      to reproduce.
      
      Signed-off-by: default avatarJoy Zou <joy.zou@nxp.com>
      Reviewed-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      Acked-by: default avatarJason Liu <jason.hui.liu@nxp.com>
      24776bcd
  8. May 10, 2022
  9. May 09, 2022
  10. Apr 15, 2022
  11. Jan 26, 2022
  12. Jan 17, 2022
    • Laurentiu Palcu's avatar
      LF-5133: gpu/imx/dpu: fix vblank timeouts problem on DPU1 · a6b397c7
      Laurentiu Palcu authored
      
      The cause for the DPU1 missing interrupts, sometimes, during bootup is
      the CHn-MASK13 register of the IRQ STEER module being 0x0. Which means:
      all interrupts are masked. This situation happens because the sequence
      we unmask/mask the interrupts in dpu_irq_init()/dpu_irq_exit() is wrong.
      Currrently, we do it like this:
      
      dpu_irq_init():
      irq_set_chained_handler_and_data() -> unmasks irq (writel to CHn-MASK)
      irq_chip_pm_get() -> calls IRQ steer resume() synchronously
      
      dpu_irq_exit():
      irq_chip_pm_put() -> calls IRQ steer suspend() asynchronously
      irq_set_chained_handler_and_data() -> masks irq (writel to CHn-MASK)
      
      The first time dpu_irq_exit() is called is because dpu-core probe fails.
      However, since the irq_chip_pm_put() is asynchronous, it means that
      irq_set_chained_handler_and_data() will be called immediately to mask
      the interrupts. Here, it's a matter of luck if the IRQ steer suspend is
      called before or after we mask the interrupts. But, when the problem
      happens, the IRQ steer suspend is called after and the registers are
      saved in the masked state (ie. all 0x0).
      
      The second time dpu-core is probed, the dpu_irq_init() is called and the
      interrupts unmasked first, then irq_chip_pm_get() is called
      synchronously, which in turn calls IRQ steer resume and the registers
      are restored from the saved state (ie. registers in masked state: 0x0).
      Hence, we end up with the wrong value in the CHn-MASK registers.
      
      The fix for this is simple: reverse the order we call
      irq_chip_pm_get/irq_chip_pm_put and irq_set_chained_handler_and_data.
      
      Signed-off-by: default avatarLaurentiu Palcu <laurentiu.palcu@oss.nxp.com>
      Reviewed-by: default avatarLiu Ying <victor.liu@nxp.com>
      Acked-by: default avatarRobert Chiras <robert.chiras@nxp.com>
      (cherry picked from commit 90f7184f1ba1b0ab57058e962f5ea9064599a6d6)
      Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
      a6b397c7
  13. Dec 18, 2021
    • Han Xu's avatar
      LF-5091: spi: spi-nxp-fspi: fix the mtd_stress test error · 5f44cf7c
      Han Xu authored
      
      When enabling the OCTAL DTR read on DXL platform, to fix the UBIFS mount
      issue, the driver handles the OCTAL DTR read with odd address by reading
      one more byte and discard the first byte, but it involved some issues
      that can be triggered by mtd stress test, which may read from random
      start address with random length.
      
      First issue is reading data from odd address and data length is larger
      than rxfifo. nxp_fspi_adjust_op_size() sets the data size align to
      rxfifo size, but is over the rxfifo size if reads one more byte and
      causes controller timeout.
      
      Second issue happens when memcpy from src to dst in odd address cases.
      The fist byte from src discarded, the pointer to src should move N bytes
      forward and dst pointer moves N-1 bytes. Previous implementation reads
      one more byte, even there is nothing in FIFO, which triggers the
      WARN_ON() in driver.
      
      This change handles the OCTAL DTR with odd address before normal rxfifo
      read. nxp_fspi_adjust_op_size() changes the data size to an odd number
      so this special case only happens once when reading large chunk of data.
      
      Signed-off-by: default avatarHan Xu <han.xu@nxp.com>
      Reviewed-and-Tested-by: default avatarHaibo Chen <haibo.chen@nxp.com>
      5f44cf7c
  14. Dec 08, 2021
    • Ye Li's avatar
      LF-5003 watchdog: imx7ulp_wdt: Handle wdog reconfigure failure · 0705ea12
      Ye Li authored
      
      Current driver may meet reconfigure failure caused by below reasons:
      
      1. The wdog on iMX7ULP has different behavior after RCS valid. It needs
         to wait more than 2.5 wdog clock for clock sync before next
         reconfiguration, while imx8ulp wdog does not need such delay.
      
      2. After unlock, there is 128 bus clock window opened for reconfiguration,
         but on iMX8ULP, the HW can't guarantee the latency. So it is possible
         the window is closed before the writing arrives to wdog.
      
      3. If the PRES is enabled, the RCS valid time becomes x256 to the time
         of PRES disabled. It is about 1715ms on iMX8ULP. So We have to increase
         the RCS timeout and can't wait it in IRQ disabled.
      
      The patch updates the driver to handle failures
      
      1. Using different wait for unlock and RCS. Unlock valid time is very short
         and only related to bus clock. It must be in IRQ disabled to avoid
         being interrupted in 128 clock window. But for RCS time, it is longer
         and ok for IRQ enabled.
      
      2. Add retry for any reconfigure failure with default 5 times.
      
      3. Add "fsl,imx8ulp-wdt" compatile string for iMX8ULP and afterwards
         platform which don't need more 2.5 wdog clock after RCS valid.
         For imx7ulp, add post delay of 2.5 clock after RCS valid.
      
      Signed-off-by: default avatarYe Li <ye.li@nxp.com>
      Reviewed-by: default avatarJacky Bai <ping.bai@nxp.com>
      0705ea12
    • Frank Li's avatar
      usb: cdns3: gadget: fix new urb never complete if ep cancel previous requests · 314fe034
      Frank Li authored
      
      This issue was found at android12 MTP.
      1. MTP submit many out urb request.
      2. Cancel left requests (>20) when enough data get from host
      3. Send ACK by IN endpoint.
      4. MTP submit new out urb request.
      5. 4's urb never complete.
      
      TRACE LOG:
      
      MtpServer-2157    [000] d..3  1287.150391: cdns3_ep_dequeue: ep1out: req: 00000000299e6836, req buff 000000009df42287, length: 0/16384 zsi, status: -115, trb: [start:87, end:87: virt addr 0x80004000ffd50420], flags:1 SID: 0
      MtpServer-2157    [000] d..3  1287.150410: cdns3_gadget_giveback: ep1out: req: 00000000299e6836, req buff 000000009df42287, length: 0/16384 zsi, status: -104, trb: [start:87, end:87: virt addr 0x80004000ffd50420], flags:0 SID: 0
      MtpServer-2157    [000] d..3  1287.150433: cdns3_ep_dequeue: ep1out: req: 0000000080b7bde6, req buff 000000009ed5c556, length: 0/16384 zsi, status: -115, trb: [start:88, end:88: virt addr 0x80004000ffd5042c], flags:1 SID: 0
      MtpServer-2157    [000] d..3  1287.150446: cdns3_gadget_giveback: ep1out: req: 0000000080b7bde6, req buff 000000009ed5c556, length: 0/16384 zsi, status: -104, trb: [start:88, end:88: virt addr 0x80004000ffd5042c], flags:0 SID: 0
      	....
      MtpServer-2157    [000] d..1  1293.630410: cdns3_alloc_request: ep1out: req: 00000000afbccb7d, req buff 0000000000000000, length: 0/0 zsi, status: 0, trb: [start:0, end:0: virt addr (null)], flags:0 SID: 0
      MtpServer-2157    [000] d..2  1293.630421: cdns3_ep_queue: ep1out: req: 00000000afbccb7d, req buff 00000000871caf90, length: 0/512 zsi, status: -115, trb: [start:0, end:0: virt addr (null)], flags:0 SID: 0
      MtpServer-2157    [000] d..2  1293.630445: cdns3_wa1: WA1: ep1out set guard
      MtpServer-2157    [000] d..2  1293.630450: cdns3_wa1: WA1: ep1out restore cycle bit
      MtpServer-2157    [000] d..2  1293.630453: cdns3_prepare_trb: ep1out: trb 000000007317b3ee, dma buf: 0xffd5bc00, size: 512, burst: 128 ctrl: 0x00000424 (C=0, T=0, ISP, IOC, Normal) SID:0 LAST_SID:0
      MtpServer-2157    [000] d..2  1293.630460: cdns3_doorbell_epx: ep1out, ep_trbaddr ffd50414
      	....
      irq/241-5b13000-2154    [000] d..1  1293.680849: cdns3_epx_irq: IRQ for ep1out: 01000408 ISP , ep_traddr: ffd508ac ep_last_sid: 00000000 use_streams: 0
      irq/241-5b13000-2154    [000] d..1  1293.680858: cdns3_complete_trb: ep1out: trb 0000000021a11b54, dma buf: 0xffd50420, size: 16384, burst: 128 ctrl: 0x00001810 (C=0, T=0, CHAIN, LINK) SID:0 LAST_SID:0
      irq/241-5b13000-2154    [000] d..1  1293.680865: cdns3_request_handled: Req: 00000000afbccb7d not handled, DMA pos: 185, ep deq: 88, ep enq: 185, start trb: 184, end trb: 184
      
      Actually DMA pos already bigger than previous submit request afbccb7d's TRB (184-184). The reason of (not handled) is that deq position is wrong.
      
      The TRB link is below when irq happen.
      
      	DEQ LINK LINK LINK LINK LINK .... TRB(afbccb7d):START  DMA(EP_TRADDR).
      
      Original code check LINK TRB, but DEQ just move one step.
      
      	LINK DEQ LINK LINK LINK LINK .... TRB(afbccb7d):START  DMA(EP_TRADDR).
      
      This patch skip all LINK TRB and sync DEQ to trb's start.
      
      	LINK LINK LINK LINK LINK .... DEQ = TRB(afbccb7d):START  DMA(EP_TRADDR).
      
      Acked-by: default avatarPeter Chen <peter.chen@kernel.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarFrank Li <Frank.Li@nxp.com>
      Signed-off-by: default avatarJun Li <jun.li@nxp.com>
      Link: https://lore.kernel.org/r/20211130154239.8029-1-Frank.Li@nxp.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      314fe034
  15. Nov 23, 2021
  16. Nov 12, 2021
  17. Nov 08, 2021
  18. Nov 05, 2021
  19. Nov 04, 2021
  20. Nov 03, 2021
Loading