27 May, 2020

6 commits


26 May, 2020

2 commits

  • There are two more DONE0_CONFIG/DONE1_CONFIG registers on i.mx8m family.
    Add them to save/restore register list during systerm level suspend/
    resume to restore them after resume back, otherwise, PDM case maybe failed
    in suspend/resume case.

    Signed-off-by: Robin Gong
    Reviewed-by: Shengjiu Wang
    (cherry picked from commit 2c213d8ac495065f5ec4182335c151d32d0eb482)

    Robin Gong
     
  • Enable wdog for rpmsg dts to make wdog function could work properly.

    Reviewed-by: Robin Gong
    Signed-off-by: Peng Fan
    (cherry picked from commit 0268df6bb34b066e2b31f340c8922cb68ade72e7)

    Peng Fan
     

25 May, 2020

1 commit

  • The original patch updates REG_MICFIL_STAT in fsl_micfil_reset
    method, but not in configure_hwvad_interrupts, fix this.

    Fixes: e12b0060cdac ("MLK-22598: ASoC: fsl_micfil: Reset channel output
    data Flag")
    Signed-off-by: Viorel Suman
    (cherry picked from commit eb01ee51095e0b11b3f58b52549eec09a14ebca1)

    Viorel Suman
     

22 May, 2020

5 commits

  • During probe SOF driver loads the topology, which will send messages
    to DSP to create the Audio components.

    SOF DAI component at creation time calls probe() and touches DAI
    registers thus we need to make sure DAI clocks are turned on during
    probe.

    Using pm_runtime_get_sync() we force resume to be called which will
    enable all necessary clocks.

    Later we call the pm_runtime_put_sync() and mark the device as
    autosuspend. This will cause suspend to be called which will disable
    all clocks to save power.

    Later, when userspace uses the sound card (via aplay/arecord) or any
    alsa-lib calls the normal runtime resume/suspend flow will happen.

    Signed-off-by: Daniel Baluta
    Reviewed-by: Shengjiu Wang

    Daniel Baluta
     
  • When M4 boots from flexspi, linux should not use that, otherwise
    M4 will hang.

    Reviewed-by: Richard Zhu
    Signed-off-by: Peng Fan
    (cherry picked from commit 1f49d90ebaf77492bcb2e9f8a8e5a8d4d7aee58a)

    Peng Fan
     
  • Apparently, in order to enable the MIPI block, the reset signals must
    be in asserted mode, in order to proper de-assert and initialize the
    MIPI block. So, before the enable process, assert all the MIPI resets.

    Signed-off-by: Robert Chiras

    Robert Chiras
     
  • The reason is that we access the register when power is disabled

    reproduce command:
    echo 8 > /sys/devices/platform/soc@0/30c00000.bus/30c00000.spba-bus/30ca0000.micfil/hwvad/enable

    [ 332.838518] SError Interrupt on CPU2, code 0xbf000002 -- SError
    [ 332.838521] CPU: 2 PID: 1383 Comm: sh Tainted: G O 5.4.24-2.1.0+g2ad925d15481 #1
    [ 332.838523] Hardware name: NXP i.MX8MPlus EVK board (DT)
    [ 332.838525] pstate: 20000085 (nzCv daIf -PAN -UAO)
    [ 332.838526] pc : regcache_sync_block+0x7c/0x258
    [ 332.838528] lr : regcache_sync_block+0xf0/0x258
    [ 332.838531] sp : ffff800012bf3be0
    [ 332.838532] x29: ffff800012bf3be0 x28: 0000000000000000
    [ 332.838535] x27: 0000000000000000 x26: 0000000000000001
    [ 332.838541] x25: ffff00017753ed00 x24: 0000000000000000
    [ 332.838546] x23: ffff00017706d400 x22: 000000000000002b
    [ 332.838550] x21: ffff00017753f100 x20: ffff000177538c00
    [ 332.838554] x19: 0000000000000001 x18: 0000000000000000
    [ 332.838559] x17: 0000000000000000 x16: 0000000000000000
    [ 332.838564] x15: 0000000000000000 x14: 0000000000000000
    [ 332.838567] x13: 0000000000000000 x12: 0000000000000000
    [ 332.838572] x11: ffff800012bf3d50 x10: ffff000173c0e900
    [ 332.838577] x9 : ffff00017706d870 x8 : 0000000000000000
    [ 332.838582] x7 : 00000000000000a8 x6 : 0000000000000000
    [ 332.838587] x5 : 0000000000000000 x4 : ffff800010769d88
    [ 332.838592] x3 : ffff80001076d278 x2 : 0000000008000000
    [ 332.838597] x1 : ffff800023c10000 x0 : 0000000000000000
    [ 332.838603] Kernel panic - not syncing: Asynchronous SError Interrupt
    [ 332.838605] CPU: 2 PID: 1383 Comm: sh Tainted: G O 5.4.24-2.1.0+g2ad925d15481 #1
    [ 332.838606] Hardware name: NXP i.MX8MPlus EVK board (DT)
    [ 332.838608] Call trace:
    [ 332.838609] dump_backtrace+0x0/0x140
    [ 332.838612] show_stack+0x14/0x20
    [ 332.838613] dump_stack+0xb4/0xf8
    [ 332.838617] panic+0x158/0x324
    [ 332.838618] nmi_panic+0x84/0x88
    [ 332.838621] arm64_serror_panic+0x74/0x80
    [ 332.838622] do_serror+0x80/0x138
    [ 332.838623] el1_error+0x84/0xf8
    [ 332.838627] regcache_sync_block+0x7c/0x258
    [ 332.838628] regcache_rbtree_sync+0x60/0xb0
    [ 332.838629] regcache_sync+0xac/0x140
    [ 332.838633] disable_hwvad+0x3c/0x1f0
    [ 332.838634] micfil_hwvad_handler+0x78/0x170
    [ 332.838635] kobj_attr_store+0x14/0x28
    [ 332.838637] sysfs_kf_write+0x40/0x50
    [ 332.838640] kernfs_fop_write+0xf8/0x210
    [ 332.838641] __vfs_write+0x18/0x40
    [ 332.838642] vfs_write+0xdc/0x1c8
    [ 332.838646] ksys_write+0x68/0xf0
    [ 332.838647] __arm64_sys_write+0x18/0x20
    [ 332.838648] el0_svc_common.constprop.0+0x68/0x160
    [ 332.838651] el0_svc_handler+0x20/0x80
    [ 332.838653] el0_svc+0x8/0xc
    [ 332.838972] SMP: stopping secondary CPUs
    [ 332.838974] Kernel Offset: disabled
    [ 332.838975] CPU features: 0x0002,2000200c
    [ 332.838976] Memory Limit: none

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Viorel Suman

    Shengjiu Wang
     
  • In VDOA_MODE, _get_vdoa_ipu_res() would lock ipu_ch_tbl.lock mutex first,
    then lock vdoa_lock mutex and finally unlock ipu_ch_tbl.lock mutex.
    The vdoa_lock mutex is unlocked until put_vdoa_ipu_res(). Since the two
    mutexes are not unlocked in a reversed order as they are locked, AB-BA
    deadlock issue may happen as the below warning shows, which can be detected
    with the debug option CONFIG_PROVE_LOCKING enabled.

    [ 52.398770] ======================================================
    [ 52.404957] WARNING: possible circular locking dependency detected
    [ 52.411145] 5.4.24 #1477 Not tainted
    [ 52.414728] ------------------------------------------------------
    [ 52.420915] ipu1_task/92 is trying to acquire lock:
    [ 52.425800] 81f02274 (&ipu_ch_tbl.lock){+.+.}, at: get_res_do_task+0x144/0x77c
    [ 52.433050]
    [ 52.433050] but task is already holding lock:
    [ 52.438888] 8183189c (vdoa_lock){+.+.}, at: vdoa_get_handle+0x64/0x158
    [ 52.445434]
    [ 52.445434] which lock already depends on the new lock.
    [ 52.445434]
    [ 52.453615]
    [ 52.453615] the existing dependency chain (in reverse order) is:
    [ 52.461101]
    [ 52.461101] -> #1 (vdoa_lock){+.+.}:
    [ 52.466175] __mutex_lock+0xb8/0xaa8
    [ 52.470283] mutex_lock_nested+0x2c/0x34
    [ 52.474735] vdoa_get_handle+0x64/0x158
    [ 52.479100] _get_vdoa_ipu_res+0x2b4/0x338
    [ 52.483726] get_res_do_task+0x34/0x77c
    [ 52.488092] ipu_task_thread+0x148/0xeb0
    [ 52.492551] kthread+0x168/0x170
    [ 52.496310] ret_from_fork+0x14/0x20
    [ 52.500414] 0x0
    [ 52.502779]
    [ 52.502779] -> #0 (&ipu_ch_tbl.lock){+.+.}:
    [ 52.508457] __lock_acquire+0x15d0/0x2588
    [ 52.512995] lock_acquire+0xdc/0x280
    [ 52.517103] __mutex_lock+0xb8/0xaa8
    [ 52.521210] mutex_lock_nested+0x2c/0x34
    [ 52.525662] get_res_do_task+0x144/0x77c
    [ 52.530113] ipu_task_thread+0x148/0xeb0
    [ 52.534566] kthread+0x168/0x170
    [ 52.538322] ret_from_fork+0x14/0x20
    [ 52.542425] 0x0
    [ 52.544790]
    [ 52.544790] other info that might help us debug this:
    [ 52.544790]
    [ 52.552797] Possible unsafe locking scenario:
    [ 52.552797]
    [ 52.558721] CPU0 CPU1
    [ 52.563256] ---- ----
    [ 52.567790] lock(vdoa_lock);
    [ 52.570853] lock(&ipu_ch_tbl.lock);
    [ 52.577040] lock(vdoa_lock);
    [ 52.582619] lock(&ipu_ch_tbl.lock);
    [ 52.586289]
    [ 52.586289] *** DEADLOCK ***
    [ 52.586289]
    [ 52.592215] 1 lock held by ipu1_task/92:
    [ 52.596142] #0: 8183189c (vdoa_lock){+.+.}, at: vdoa_get_handle+0x64/0x158
    [ 52.603123]
    [ 52.603123] stack backtrace:
    [ 52.607493] CPU: 0 PID: 92 Comm: ipu1_task Not tainted 5.4.24 #1477
    [ 52.613765] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
    [ 52.620298] Backtrace:
    [ 52.622764] [] (dump_backtrace) from [] (show_stack+0x20/0x24)
    [ 52.630345] r7:818641a8 r6:00000000 r5:600f0193 r4:818641a8
    [ 52.636026] [] (show_stack) from [] (dump_stack+0xbc/0xe8)
    [ 52.643261] [] (dump_stack) from [] (print_circular_bug+0x1c4/0x214)
    [ 52.651361] r10:a8330000 r9:ffffffff r8:a8330000 r7:a8330550 r6:81d13b1c r5:81d13ac0
    [ 52.659197] r4:81d13ac0 r3:46e9f8d1
    [ 52.662783] [] (print_circular_bug) from [] (check_noncircular+0x204/0x21c)
    [ 52.671492] r9:00000001 r8:81708f50 r7:00000000 r6:a8423a98 r5:a8330530 r4:a8330550
    [ 52.679245] [] (check_noncircular) from [] (__lock_acquire+0x15d0/0x2588)
    [ 52.687778] r8:81708f50 r7:81d13ac0 r6:00000001 r5:81e93d7c r4:a8330530
    [ 52.694491] [] (__lock_acquire) from [] (lock_acquire+0xdc/0x280)
    [ 52.702334] r10:00000000 r9:00000000 r8:00000000 r7:81f02274 r6:600f0113 r5:81708724
    [ 52.710169] r4:00000000
    [ 52.712717] [] (lock_acquire) from [] (__mutex_lock+0xb8/0xaa8)
    [ 52.720384] r10:81e93d7c r9:0000f6d0 r8:81f022e8 r7:00008f50 r6:00000000 r5:ffffe000
    [ 52.728219] r4:81f02240
    [ 52.730765] [] (__mutex_lock) from [] (mutex_lock_nested+0x2c/0x34)
    [ 52.738778] r10:00000000 r9:a8423ccc r8:81f022e8 r7:000002d0 r6:8188b6f8 r5:81f02234
    [ 52.746613] r4:a4540400
    [ 52.749162] [] (mutex_lock_nested) from [] (get_res_do_task+0x144/0x77c)
    [ 52.757612] [] (get_res_do_task) from [] (ipu_task_thread+0x148/0xeb0)
    [ 52.765886] r10:a8139bd0 r9:a8423ccc r8:81f022e8 r7:a4540400 r6:81831604 r5:a454053c
    [ 52.773721] r4:600f0013
    [ 52.776269] [] (ipu_task_thread) from [] (kthread+0x168/0x170)
    [ 52.783849] r10:a8139bd0 r9:80b8d558 r8:81f022e8 r7:a8422000 r6:00000000 r5:a840cd00
    [ 52.791684] r4:a83cc080
    [ 52.794231] [] (kthread) from [] (ret_from_fork+0x14/0x20)
    [ 52.801460] Exception stack(0xa8423fb0 to 0xa8423ff8)
    [ 52.806521] 3fa0: 00000000 00000000 00000000 00000000
    [ 52.814711] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [ 52.822898] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
    [ 52.829521] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:80168360
    [ 52.837356] r4:a840cd00

    This patch corrects the locking/unlocking sequence for the two mutexes
    to fix the deadlock issue.

    Reviewed-by: Sandor Yu
    Signed-off-by: Liu Ying
    (cherry picked from commit c18ff376db6529818037a66b2cafaa3f512577d8)

    Liu Ying
     

21 May, 2020

5 commits

  • in_filled_len need to be reset on suspend, for suspend, every state
    will go back to initilization state.

    Fixes: 3e87108614d1 ("MLK-24044: ASoC: fsl_easrc_m2m: Fix output length not accurate")
    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta

    Shengjiu Wang
     
  • initilize the m2m->complete in open() to avoid the NULL pointer in suspend
    because the suspend can be called before initilizing m2m->complete in convert

    [ 591.006691] Filesystems sync: 0.084 seconds
    [ 591.012292] Freezing user space processes ... (elapsed 0.001 seconds) done.
    [ 591.020768] OOM killer disabled.
    [ 591.024016] Freezing remaining freezable tasks ... (elapsed 0.105 seconds) done.
    [ 591.809374] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
    [ 591.818160] Mem abort info:
    [ 591.820949] ESR = 0x96000004
    [ 591.824000] EC = 0x25: DABT (current EL), IL = 32 bits
    [ 591.829307] SET = 0, FnV = 0
    [ 591.832356] EA = 0, S1PTW = 0
    [ 591.835493] Data abort info:
    [ 591.838369] ISV = 0, ISS = 0x00000004
    [ 591.842200] CM = 0, WnR = 0
    [ 591.845165] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001b033e000
    [ 591.851600] [0000000000000000] pgd=0000000000000000
    [ 591.856476] Internal error: Oops: 96000004 [#1] PREEMPT SMP
    [ 591.862043] Modules linked in:
    [ 591.865097] CPU: 2 PID: 867 Comm: rtcwakeup.out Not tainted 5.4.24-04892-g8b7eb66 #911
    [ 591.873009] Hardware name: NXP i.MX8MPlus EVK board (DT)
    [ 591.878317] pstate: a0000085 (NzCv daIf -PAN -UAO)
    [ 591.883110] pc : __wake_up_common+0x58/0x170
    [ 591.887377] lr : __wake_up_locked+0x18/0x20
    [ 591.891555] sp : ffff8000120b3a00
    [ 591.894866] x29: ffff8000120b3a00 x28: ffff800011b84000
    [ 591.900174] x27: 0000000000000000 x26: 0000000000000000
    [ 591.905482] x25: 0000000000000003 x24: 0000000000000000
    [ 591.910791] x23: 0000000000000001 x22: 0000000000000000
    [ 591.916099] x21: ffff000171369420 x20: ffff000171369418
    [ 591.921407] x19: ffff000171369410 x18: 0000000000000000
    [ 591.926715] x17: 0000000000000000 x16: 0000000000000000
    [ 591.932023] x15: 0000000000000000 x14: ffff0001760daa00
    [ 591.937331] x13: ffff80016dbdc000 x12: 0000000034d4d91d
    [ 591.942639] x11: 0000000000000000 x10: 00000000000009c0
    [ 591.947948] x9 : ffff000171a30470 x8 : 00000000ffffffff
    [ 591.953256] x7 : ffff8000120b3a38 x6 : ffffffffffffffe8
    [ 591.958564] x5 : 0000000000000000 x4 : 0000000000000000
    [ 591.963871] x3 : 0000000000000000 x2 : 0000000000000001
    [ 591.969179] x1 : 0000000000000003 x0 : 0000000000000000
    [ 591.974487] Call trace:
    [ 591.976931] __wake_up_common+0x58/0x170
    [ 591.980851] __wake_up_locked+0x18/0x20
    [ 591.984683] complete+0x48/0x68
    [ 591.987823] fsl_easrc_suspend+0x84/0x100
    [ 591.991831] dpm_run_callback.isra.0+0x38/0xd8
    [ 591.996271] __device_suspend+0xfc/0x3c8
    [ 592.000191] dpm_suspend+0xf0/0x1e8
    [ 592.003676] dpm_suspend_start+0x98/0xa0
    [ 592.007596] suspend_devices_and_enter+0xec/0x5b8
    [ 592.012297] pm_suspend+0x2f8/0x340
    [ 592.015781] state_store+0x88/0x108
    [ 592.019267] kobj_attr_store+0x14/0x28
    [ 592.023015] sysfs_kf_write+0x40/0x50
    [ 592.026674] kernfs_fop_write+0xf8/0x210
    [ 592.030594] __vfs_write+0x18/0x40
    [ 592.033992] vfs_write+0xdc/0x1c8
    [ 592.037303] ksys_write+0x68/0xf0
    [ 592.040615] __arm64_sys_write+0x18/0x20
    [ 592.044536] el0_svc_common.constprop.0+0x68/0x160
    [ 592.049324] el0_svc_handler+0x20/0x80
    [ 592.053070] el0_svc+0x8/0xc
    [ 592.055950] Code: 54000700 a90153f3 2a0203f7 52800018 (f9400cd3)
    [ 592.062040] ---[ end trace a36c1a42637c268e ]---

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta

    Shengjiu Wang
     
  • initilize the m2m->complete in open() to avoid the NULL pointer in suspend
    because the suspend can be called before initilizing m2m->complete in convert

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta

    Shengjiu Wang
     
  • Add copyright

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta

    Shengjiu Wang
     
  • Add copyright

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta

    Shengjiu Wang
     

20 May, 2020

6 commits


19 May, 2020

3 commits

  • The spdif capture need the power supply be enabled on audio board,
    otherwise the input signal can't be transferred to chip.

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta
    (cherry picked from commit c012f4ddbcc825e5f4195a832aaa56abcbb4b126)

    Shengjiu Wang
     
  • The LCDIF3 is included in the HDMIMIX block, so it is
    necessary to enable hdmimix power domain for LCDIF3 to
    avoid any potential hang issue.

    Signed-off-by: Fancy Fang
    Reviewed-by: Sandor Yu
    (cherry picked from commit 04ff1b1c585a29a08fae5dd2c0a28c1e669fce0b)

    Fancy Fang
     
  • During the unbind() procedure, drm_encoder_cleanup() will
    detach the downstream DSI bridge if exists. And the DSI
    bridge's detach() will detach itself from the DSI host.
    So DSI host should be unregistered later than DSI device
    detach. Otherwise, below kernel panic happens:

    [ 2.437740] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000007
    [ 2.446534] Mem abort info:
    [ 2.449327] ESR = 0x96000004
    [ 2.452401] EC = 0x25: DABT (current EL), IL = 32 bits
    [ 2.457717] SET = 0, FnV = 0
    [ 2.460777] EA = 0, S1PTW = 0
    [ 2.463921] Data abort info:
    [ 2.466808] ISV = 0, ISS = 0x00000004
    [ 2.470649] CM = 0, WnR = 0
    [ 2.473617] [0000000000000007] user address but active_mm is swapper
    [ 2.479978] Internal error: Oops: 96000004 [#1] PREEMPT SMP
    [ 2.485550] Modules linked in:
    [ 2.488609] CPU: 0 PID: 188 Comm: kworker/0:2 Not tainted 5.4.24-04902-g14319eb2bae3 #1683
    [ 2.496871] Hardware name: NXP i.MX8MPlus EVK board (DT)
    [ 2.502188] Workqueue: events deferred_probe_work_func
    [ 2.507328] pstate: 80000005 (Nzcv daif -PAN -UAO)
    [ 2.512121] pc : mipi_dsi_detach+0x10/0x38
    [ 2.516219] lr : adv7533_detach_dsi+0x18/0x30
    [ 2.520574] sp : ffff80001242b6e0
    [ 2.523885] x29: ffff80001242b6e0 x28: ffff8000119d6000
    [ 2.529196] x27: 0000000000000000 x26: 00000000fffffdfb
    [ 2.534507] x25: 0000000000000001 x24: ffff8000115159f0
    [ 2.539819] x23: ffff000176652120 x22: ffff800011b94000
    [ 2.545132] x21: ffff000177882000 x20: ffff0001778766e8
    [ 2.550444] x19: ffff000177876880 x18: 0000000000000000
    [ 2.555756] x17: ffff800011e0d000 x16: 0000000000000000
    [ 2.561068] x15: 0000000000000004 x14: ffffffffffffffff
    [ 2.566381] x13: 0000000000000000 x12: ffff0001745765c8
    [ 2.571694] x11: ffff000174576480 x10: 0000000000000040
    [ 2.577006] x9 : ffff000176020e98 x8 : ffff000176020e90
    [ 2.582318] x7 : 0000000000000001 x6 : 0000000000000001
    [ 2.587630] x5 : 0000000000000000 x4 : 0000000000000000
    [ 2.592943] x3 : ffff800011a398b0 x2 : ffffffffffffffff
    [ 2.598255] x1 : ffff0001778d5c00 x0 : ffff0001778d6400
    [ 2.603569] Call trace:
    [ 2.606018] mipi_dsi_detach+0x10/0x38
    [ 2.609769] adv7511_bridge_detach+0x6c/0x80
    [ 2.614041] drm_bridge_detach+0x2c/0x50
    [ 2.617964] drm_encoder_cleanup+0x2c/0xa0
    [ 2.622063] imx_sec_dsim_unbind+0x50/0x68
    [ 2.626159] component_unbind.isra.0+0x2c/0x50
    [ 2.630601] component_bind_all+0x1e0/0x228
    [ 2.634784] imx_drm_bind+0xb8/0x150
    [ 2.638357] try_to_bring_up_master+0x164/0x1c0
    [ 2.642887] __component_add+0xa0/0x168
    [ 2.646721] component_add+0x10/0x18
    [ 2.650297] lcdifv3_crtc_probe+0x4c/0x78
    [ 2.654309] platform_drv_probe+0x50/0xa0
    [ 2.658317] really_probe+0xd4/0x318
    [ 2.661891] driver_probe_device+0x54/0xe8
    [ 2.665991] __device_attach_driver+0x80/0xb8
    [ 2.670348] bus_for_each_drv+0x74/0xc0
    [ 2.674183] __device_attach+0xdc/0x138
    [ 2.678020] device_initial_probe+0x10/0x18
    [ 2.682204] bus_probe_device+0x90/0x98
    [ 2.686042] device_add+0x378/0x648
    [ 2.689531] platform_device_add+0xfc/0x228
    [ 2.693718] imx_lcdifv3_probe+0x2b0/0x388
    [ 2.697814] platform_drv_probe+0x50/0xa0
    [ 2.701825] really_probe+0xd4/0x318
    [ 2.705403] driver_probe_device+0x54/0xe8
    [ 2.709502] __device_attach_driver+0x80/0xb8
    [ 2.713859] bus_for_each_drv+0x74/0xc0
    [ 2.717696] __device_attach+0xdc/0x138
    [ 2.721535] device_initial_probe+0x10/0x18
    [ 2.725721] bus_probe_device+0x90/0x98
    [ 2.729555] deferred_probe_work_func+0x64/0x98
    [ 2.734089] process_one_work+0x198/0x320
    [ 2.738100] worker_thread+0x1f0/0x420
    [ 2.741850] kthread+0xf0/0x120
    [ 2.744993] ret_from_fork+0x10/0x18
    [ 2.748573] Code: aa0003e1 f9400000 f9400402 b4000102 (f9400442)
    [ 2.754667] ---[ end trace 756e3cdcc6c5557e ]---

    Signed-off-by: Fancy Fang
    (cherry picked from commit ac040846d4c80c03e7ccb96a3b8553f84b743d39)

    Fancy Fang
     

18 May, 2020

8 commits

  • Add ddr bandwidth usage metric support for i.MX8DXL.

    Metric:
    imx8dxl_lpddr4.bandwidth_usage
    imx8dxl_ddr3l.bandwidth_usage

    Example:
    root@imx8dxlevk:~# ./perf stat -a -I 1000 -M imx8dxl_lpddr4.bandwidth_usage dd if=/dev/zero of=/dev/null bs=100M count=1000000
    1.000242625 1444320 imx8_ddr0/axid-read,axi_mask=0xffff,axi_id=0x0000,axi_channel=0x0/ # 15.1 % imx8dxl_lpddr4.bandwidth_usage
    1.000242625 88964544 imx8_ddr0/axid-write,axi_mask=0xffff,axi_id=0x0000,axi_channel=0x0/
    1.000242625 1000242625 ns duration_time
    2.001170500 297392 imx8_ddr0/axid-read,axi_mask=0xffff,axi_id=0x0000,axi_channel=0x0/ # 16.0 % imx8dxl_lpddr4.bandwidth_usage
    2.001170500 95684315 imx8_ddr0/axid-write,axi_mask=0xffff,axi_id=0x0000,axi_channel=0x0/
    2.001170500 1000927875 ns duration_time
    3.001840125 320798 imx8_ddr0/axid-read,axi_mask=0xffff,axi_id=0x0000,axi_channel=0x0/ # 16.0 % imx8dxl_lpddr4.bandwidth_usage
    3.001840125 95655155 imx8_ddr0/axid-write,axi_mask=0xffff,axi_id=0x0000,axi_channel=0x0/
    3.001840125 1000669625 ns duration_time

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • Add ddr bandwidth usage metric support for i.MX8MP.

    Metric:
    imx8mp-lpddr4-bandwidth-usage

    Example:
    root@imx8mpevk:~# ./perf stat -a -I 1000 -M imx8mp-lpddr4-bandwidth-usage dd if=/dev/zero of=/dev/null bs=100M count=1000000
    1.000770875 18081664 imx8_ddr0/axid-read,axi_mask=0xffff,axi_id=0x0000/ # 37.0 % imx8mp-lpddr4-bandwidth-usage
    1.000770875 5895351484 imx8_ddr0/axid-write,axi_mask=0xffff,axi_id=0x0000/
    1.000770875 1000770875 ns duration_time
    2.001780250 11137456 imx8_ddr0/axid-read,axi_mask=0xffff,axi_id=0x0000/ # 39.0 % imx8mp-lpddr4-bandwidth-usage
    2.001780250 6232776052 imx8_ddr0/axid-write,axi_mask=0xffff,axi_id=0x0000/
    2.001780250 1001009375 ns duration_time
    3.002748125 10643520 imx8_ddr0/axid-read,axi_mask=0xffff,axi_id=0x0000/ # 39.0 % imx8mp-lpddr4-bandwidth-usage
    3.002748125 6229700768 imx8_ddr0/axid-write,axi_mask=0xffff,axi_id=0x0000/
    3.002748125 1000967875 ns duration_time

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • In interval mode, if metric expression contains duration_time event,
    command with -I 5000 config can trigger this cast issue.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • For interval mode, the metric is printed after the '#' character if it
    exists. But it's not calculated by the counts generated in this
    interval.

    See the following examples:

    root@kbl-ppc:~# perf stat -M CPI -I1000 --interval-count 2
    # time counts unit events
    1.000422803 764,809 inst_retired.any # 2.9 CPI
    1.000422803 2,234,932 cycles
    2.001464585 1,960,061 inst_retired.any # 1.6 CPI
    2.001464585 4,022,591 cycles

    The second CPI should not be 1.6 (4,022,591/1,960,061 is 2.1)

    root@kbl-ppc:~# perf stat -e cycles,instructions -I1000 --interval-count 2
    # time counts unit events
    1.000429493 2,869,311 cycles
    1.000429493 816,875 instructions # 0.28 insn per cycle
    2.001516426 9,260,973 cycles
    2.001516426 5,250,634 instructions # 0.87 insn per cycle

    The second 'insn per cycle' should not be 0.87 (5,250,634/9,260,973 is
    0.57).

    The current code uses a global variable 'rt_stat' for tracking and
    updating the std dev of runtime stat. Unlike the counts, 'rt_stat' is not
    reset for interval. While the counts are reset for interval.

    perf_stat_process_counter()
    {
    if (config->interval)
    init_stats(ps->res_stats);
    }

    So for interval mode, the 'rt_stat' variable should be reset too.

    This patch resets 'rt_stat' before read_counters(), so the runtime stat
    is only calculated by the counts generated in this interval.

    With this patch:

    root@kbl-ppc:~# perf stat -M CPI -I1000 --interval-count 2
    # time counts unit events
    1.000420924 2,408,818 inst_retired.any # 2.1 CPI
    1.000420924 5,010,111 cycles
    2.001448579 2,798,407 inst_retired.any # 1.6 CPI
    2.001448579 4,599,861 cycles

    root@kbl-ppc:~# perf stat -e cycles,instructions -I1000 --interval-count 2
    # time counts unit events
    1.000428555 2,769,714 cycles
    1.000428555 774,462 instructions # 0.28 insn per cycle
    2.001471562 3,595,904 cycles
    2.001471562 1,243,703 instructions # 0.35 insn per cycle

    Now the second 'insn per cycle' and CPI are calculated by the counts
    generated in this interval.

    Signed-off-by: Jin Yao
    Acked-by: Jiri Olsa
    Tested-By: Kajol Jain
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Jin Yao
    Cc: Kan Liang
    Cc: Peter Zijlstra
    Link: http://lore.kernel.org/lkml/20200420145417.6864-1-yao.jin@linux.intel.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Joakim cherry pick from perf/core commit: 197ba86fdc888dc0d3d6b89b402c9c6851d4c6fb
    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Jin Yao
     
  • Coverity report: CID = 4327643

    incompatible_cast: Pointer &irqchip_data->irqstat points to an object whose
    effective type is unsigned int (32 bits, unsigned) but is dereferenced as a
    wider unsigned long (64 bits, unsigned). This may lead to memory corruption.

    Reviewed-by: Fugang Duan
    Signed-off-by: Joakim Zhang

    Joakim Zhang
     
  • Correct the resource id for edma0.

    Signed-off-by: Shengjiu Wang
    Reviewed-by: Daniel Baluta

    Shengjiu Wang
     
  • GENMASK(h, l) is creating a contiguous bitmask starting at bit
    position @l and ending at position @h.

    Reviewed-by: Peter Chen
    Reviewed-by: Peng Fan
    Signed-off-by: Li Jun

    Li Jun
     
  • By default, usdhc2 is for SD boot.

    The patch is to enable usdhc2 on M.2 interface for SDIO wlan,
    then it requires users use eMMC boot instead of SD boot.

    The HW rework:
    - install R1429 - R1436
    - remove R1617 - R1621, R1603

    Reviewed-by: Richard Zhu
    Signed-off-by: Fugang Duan

    Fugang Duan
     

16 May, 2020

3 commits


15 May, 2020

1 commit

  • The YUV formats were removed from graphics plane and RGB ones were removed from
    video planes. That's because, in general, one will use a window manager and the
    UI will always reside on the graphics plane, while video playback will go to
    the overlay planes.

    However, this move affects users using custom applications that would like to
    use 2 graphics planes and one video plane. Or 3 graphics planes.

    DCSS is perfectly capable of scanning out RGB/YUV linear formats on all 3
    pipes. Only tiled and tiled-compressed formats need special treatment:
    tiled-compressed graphics has to always go to pipe 1 (since DEC400D is needed
    for uncompressing the graphics format) whilst tiled-uncompressed and
    tiled-compressed VPU formats need to always go to pipes 2 and 3 (DTRC will
    handle de-tiling and decompression).

    Signed-off-by: Laurentiu Palcu
    Reviewed-by: Robert Chiras

    Laurentiu Palcu