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

2 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
     
  • 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
     

21 May, 2020

3 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
     

20 May, 2020

1 commit


15 May, 2020

4 commits


13 May, 2020

1 commit

  • Update drivers constrains, limit sample rates to
    [8Khz - 64Khz] and up to 8 channels.
    Use SND_SOC_DAIFMT_PDM format type and remove
    tdm slot settings to allow capture from multiple
    SAI_RxD pins.

    Reviewed-by: Shengjiu Wang
    Signed-off-by: Adrian Alonso
    (cherry picked from commit c9f12b9c9e60d93ce011a6d37ebceb78ac910300)

    Adrian Alonso
     

12 May, 2020

1 commit


11 May, 2020

4 commits


09 May, 2020

1 commit


08 May, 2020

1 commit


07 May, 2020

4 commits

  • The call flow:
    devm_regmap_init_mmio_clk
    - clk_prepare()
    - clk_pm_runtime_get()

    Cause the power domain of ipg clock always be enabled.
    which impact the power consumption.

    so we can't bind clock with regmap, but explicitly enable
    clock when using.

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

    Shengjiu Wang
     
  • The call flow:
    devm_regmap_init_mmio_clk
    - clk_prepare()
    - clk_pm_runtime_get()

    Cause the power domain of mem clock always be enabled.
    which impact the power consumption.

    so we can't bind clock with regmap, but explicitly enable
    clock when using.

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

    Shengjiu Wang
     
  • With imx-pcm-dma, the dma channel is created in probe, when
    there is power domain attached with dma device, the power
    domain will be enabled when channel is created, then the
    power of the domain will be always enabled from beginning.

    So switch to imx-pcm-dma-v2, then the dma channel will be
    created when playback or capture really started.

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

    Shengjiu Wang
     
  • The call flow:
    devm_regmap_init_mmio_clk
    - clk_prepare()
    - clk_pm_runtime_get()

    Cause the power domain of bus clock always be enabled.
    which impact the power consumption.

    So we can't bind clock with regmap, then explicitly enable
    clock when using.

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

    Shengjiu Wang
     

01 May, 2020

2 commits

  • A power domain associated with a device may be disabled in
    a separate thread by "genpd_power_off_work_fn" function in
    case the device has no PM runtime enabled at that moment.
    This will stop the parent clock of "bus" clk and hang
    the probe in regmap read/write operation. In order to avoid
    this PM runtime must be enabled before any regmap read/write
    ops. Aside of this replace clk bus clocks with
    pm_runtime_get/put_sync calls.

    Signed-off-by: Viorel Suman
    Fixes: c2641e1974f7 ("MLK-23618-9: ASoC: fsl_sai: Don't bind clock with regmap")
    Reviewed-by: Shengjiu Wang

    Viorel Suman
     
  • Set regmap to use regcache only in probe in order to avoid
    issue on cat /sys/kernel/debug/regmap/30cc0000.xcvr/registers

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

    Viorel Suman
     

29 Apr, 2020

3 commits

  • The issue is GPU will crash when do dsp suspend test, and only
    meet this issue when load GPU as module.
    The reason is that dsp framework's global data set size little
    than actul size. So dsp will touch the memory that not owned
    dsp, then caused GPU crash.

    Signed-off-by: Zhang Peng

    Zhang Peng
     
  • Add support 6 channels

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

    Shengjiu Wang
     
  • Add iec958 controls, then user can set the AES from user space.
    The command is "iecset", which is in alsa-utils.

    For HBR test, we need do below steps
    1. Generate iec61937 mat stream by ffmpeg.
    ffmpeg -i input.mlp -acodec copy -f spdif output.spd

    2. Add iec60958 header by iec958 plugin in alsa-lib

    IMX-CDNHDMI.pcm.iec958.0 {
    @args [ CARD AES0 AES1 AES2 AES3 ]
    @args.CARD {
    type string
    }
    @args.AES0 {
    type integer
    }
    @args.AES1 {
    type integer
    }
    @args.AES2 {
    type integer
    }
    @args.AES3 {
    type integer
    }
    type iec958
    slave {
    format IEC958_SUBFRAME_LE
    pcm {
    type file
    slave.pcm null
    file "output.spd.iec958"
    format "raw"
    }
    }
    status [ $AES0 $AES1 $AES2 $AES3 ]
    preamble.z 0x1
    preamble.x 0x0
    preamble.y 0x0
    }
    aplay -Diec958:3,AES0=0x06,AES1=0x80,AES2=0x02,AES3=0x09 -r 192000 -c 2 -f S16_LE output.spd

    3. Enable non-linear pcm.
    iecset -c 3 audio off

    4. aplay -Dcdnhdmi8ch -r 192000 -c 8 -f S32_LE output.spd.iec958
    pcm.cdnhdmi8ch {
    type dshare
    slave {
    pcm "hw:3,0"
    channels 8
    rate 192000
    format S32_LE
    }
    ipc_key 5144458
    bindings.0 0
    bindings.1 4
    bindings.2 1
    bindings.3 5
    bindings.4 2
    bindings.5 6
    bindings.6 3
    bindings.7 7
    }

    5. Test is finished, disable non-linear pcm
    iecset -c 3 audio on

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

    Shengjiu Wang
     

27 Apr, 2020

8 commits


24 Apr, 2020

1 commit


17 Apr, 2020

3 commits