AnsweredAssumed Answered

Backporting ADAU1761 to 3.14, kernel oops when adding dapm dsp routes?

Question asked by peeter123 on Oct 29, 2014
Latest reply on Oct 29, 2014 by peeter123

I'm trying to backport the ADAU1761 drivers from analogdevicesinc/linux@asoc-adau1761-alc to the Freescale imx6 3.14.14 kernel and I'm hitting some road bumps. I've successfully merged all drivers and can build my kernel, I've also made a platform driver with device tree support. This is all working and the codec is being probed when the module is loaded, the firmware is loaded but after that the kernel is oopsing with a NULL pointer deference error.


I have traced back the conflicting function to adau17x1_add_routes in adau17x1.c:797. It breaks when the kernel is trying to add the adau17x1_dsp_dapm_routes in adau17x1.c:807. More specifically if the route has a control instead of NULL in its routing array.


if (adau17x1_has_dsp(adau)) {
     ret = snd_soc_dapm_add_routes(&codec->dapm,



I'm hoping someone can give me some insight in how to fix this, I'm probably missing some function which signature has changed between kernel versions.


The kernel oops:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = 8d820000
[00000000] *pgd=00000000
Internal error: Oops: 80000005 [#1] SMP ARM
Modules linked in: snd_soc_imx_eval_adau1761(+) snd_soc_adau1761_i2c snd_soc_adau1761 snd_soc_adau17x1 snd_soc_sigmadsp_regmap snd_soc_sigmadsp spidev snd_soc_fsl_ssi snd_soc_imx_audmux mxc_vpu galcore
CPU: 0 PID: 2583 Comm: modprobe Not tainted 3.14.14-cubox #16
task: 8c196200 ti: 8d8e8000 task.ti: 8d8e8000
PC is at 0x0
LR is at snd_soc_read+0x18/0x5c
pc : [<00000000>]    lr : [<8041b770>]    psr: a0000013
sp : 8d8e9b08  ip : 8c763dd4  fp : 00000002
r10: 00000000  r9 : 8c763ddc  r8 : 00000000
r7 : 7f05b978  r6 : 0000ffff  r5 : 8c4b4200  r4 : 00000000
r3 : 7f05b948  r2 : 00000000  r1 : 0000ffff  r0 : 8c4b4200
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c53c7d  Table: 1d820059  DAC: 00000015
Process modprobe (pid: 2583, stack limit = 0x8d8e8240)
Stack: (0x8d8e9b08 to 0x8d8ea000)
9b00:                   807c00c0 8d8e9b24 00000000 8d8e9b34 8c3c5480 804236c4
9b20: 7f05b948 8c763dc0 7f05b978 80423a08 8c3c53c0 800cff90 8c763dc0 8c3c5b40
9b40: 8c3c5480 7f05b978 00000000 80423f74 807fc1e8 8c763dd4 8c763ddc 8c4b42b8
9b60: 7f05b978 8c3c5b40 8c3c56c0 8c4ae938 8c4b42b8 7f05ae64 8c3c5b40 7f05baac
9b80: 8c4ae94c 8c3c5480 8c3c5b40 80424170 00000000 8c169838 7f05bac0 8c3c5480
9ba0: 00000001 807c00c0 8d8e9bfc 00000001 ffff9a47 8c9c0503 00000001 803792dc
9bc0: 00000013 00000003 00000001 8c169810 8d8e9bfc 00000001 8c9c0502 8037ae64
9be0: 00000000 00000003 00000000 8c9c0502 00000001 8037af00 00000001 00000038
9c00: 00000003 8c9c0500 00000003 802f2090 8c4b4600 802eea70 00000000 8d8e9c58
9c20: 00000001 7f0520e4 8c9c0500 00000002 00000000 7f05ade4 0000000a 8c4b42b8
9c40: 0000000a 7f05ae74 00000001 8c4b42b8 0000000f 00000000 806b1138 00000000
9c60: 805be5b4 804242c0 8c9c0810 7f064088 8c9c0810 8c4b4200 00000000 7f064088
9c80: 8c9c0810 8c4b42b8 8c9c0810 7f061310 7f0610a4 8c4b4200 807ed08c 807ed140
9ca0: 8c4ae864 7f0621bc 8c4b42b8 8041f68c 805bdcfc 00000006 8c4ae96c 8c49c700
9cc0: 8c4ae864 8c88400c 00000000 807ed138 00000000 804208e4 8c4ae874 8c134c00
9ce0: 00000001 00000000 000005bc 8c49c700 8c4ae96c 00000001 8c4b4230 8c4b4200
9d00: 8c4ae864 807ed138 807ed178 807ff8d8 8c4ae884 8c4ae95c 806fd3e4 8c4ae944
9d20: 8c4ae934 8c4ae93c 8c4ae864 8c4ae864 8c379410 8c4ae810 8c134c10 8fb74cec
9d40: 8c4ae864 7f02a000 7f028b74 8042d9c4 8c127900 00000000 8c134c10 8c4ae810
9d60: 00000000 7f0282d8 00000000 00000004 7f028b74 8c134c10 7f028ae8 807f9d28
9d80: 00000000 7f028ae8 00000009 802df4e8 802df4d0 8c134c10 8085ad5c 802ddb60
9da0: 802df644 8c134c10 7f028ae8 8c134c10 7f028ae8 8c134c44 00000000 8d8e8020
9dc0: 00000000 802dde94 00000000 7f028ae8 802dde08 802dbe9c 8c07a65c 8c127934
9de0: 7f028ae8 8cabfc80 807e17c0 802dd180 7f028a2c 00000000 7f028ae8 7f028ae8
9e00: 00000001 7f028b38 8c3795c0 802de4bc 00000000 8d8e9f58 00000001 80008818
9e20: 807d9a7c 7f028b74 8fd29520 00000001 00000000 806a2b90 806a2b7c 8009f15c
9e40: 8c379880 8fd29500 00000000 00000000 00000001 00000001 8fd29500 00000000
9e60: 00000000 800a090c 00000003 00000003 8c3791c0 8d8e9f58 00000001 7f028b38
9e80: 8c3795c0 00000001 8c3795e4 7f028b2c 7f028b74 80083934 7f028b38 00007fff
9ea0: 800808f8 a0804000 a0800000 00000000 a0a91000 00000000 8d8e8018 8c3795c8
9ec0: 7f028b74 807f7028 a0a91d7c 00000064 8d8e9f60 8d8e9f8c 000000b2 800129d8
9ee0: a0a93000 76de8000 0000074b 00000000 00000000 00000000 00000000 00000000
9f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
9f20: 00000000 00000000 76de6000 000027cb 76de6000 76f05d50 00000080 8000ed64
9f40: 8d8e8000 00000000 00000000 80083f00 8d8e9f5c 00000000 a0a91000 000027cb
9f60: a0a9251c a0a923cb a0a93394 00000c84 00000d04 00000000 00000000 00000000
9f80: 0000001f 00000020 00000014 00000018 0000000f 00000000 00000000 777a02a0
9fa0: 777a0360 8000ebe0 00000000 777a02a0 76de6000 000027cb 76f05d50 00000002
9fc0: 00000000 777a02a0 777a0360 00000080 00000000 76f05d50 000027cb 00000000
9fe0: 00040000 7ec3f304 76effb07 76e8afd4 80000010 76de6000 00000000 00000000
[<8041b770>] (snd_soc_read) from [<804236c4>] (soc_widget_read+0x20/0x68)
[<804236c4>] (soc_widget_read) from [<80423a08>] (dapm_set_path_status+0x124/0x248)
[<80423a08>] (dapm_set_path_status) from [<80423f74>] (snd_soc_dapm_add_path+0x3b4/0x4c0)
[<80423f74>] (snd_soc_dapm_add_path) from [<80424170>] (snd_soc_dapm_add_route+0xf0/0x1e0)
[<80424170>] (snd_soc_dapm_add_route) from [<804242c0>] (snd_soc_dapm_add_routes+0x60/0xc0)
[<804242c0>] (snd_soc_dapm_add_routes) from [<7f061310>] (adau1761_codec_probe+0x26c/0x350 [snd_soc_adau1761])
[<7f061310>] (adau1761_codec_probe [snd_soc_adau1761]) from [<8041f68c>] (soc_probe_codec+0x178/0x2f4)
[<8041f68c>] (soc_probe_codec) from [<804208e4>] (snd_soc_register_card+0xa98/0x1560)
[<804208e4>] (snd_soc_register_card) from [<8042d9c4>] (devm_snd_soc_register_card+0x30/0x68)
[<8042d9c4>] (devm_snd_soc_register_card) from [<7f0282d8>] (imx_eval_adau1761_probe+0x2bc/0x2f4 [snd_soc_imx_eval_adau1761])
[<7f0282d8>] (imx_eval_adau1761_probe [snd_soc_imx_eval_adau1761]) from [<802df4e8>] (platform_drv_probe+0x18/0x48)
[<802df4e8>] (platform_drv_probe) from [<802ddb60>] (driver_probe_device+0x154/0x3b8)
[<802ddb60>] (driver_probe_device) from [<802dde94>] (__driver_attach+0x8c/0x90)
[<802dde94>] (__driver_attach) from [<802dbe9c>] (bus_for_each_dev+0x60/0x94)
[<802dbe9c>] (bus_for_each_dev) from [<802dd180>] (bus_add_driver+0x15c/0x218)
[<802dd180>] (bus_add_driver) from [<802de4bc>] (driver_register+0x78/0xf8)
[<802de4bc>] (driver_register) from [<80008818>] (do_one_initcall+0xd4/0x17c)
[<80008818>] (do_one_initcall) from [<80083934>] (load_module+0x1c90/0x21b4)
[<80083934>] (load_module) from [<80083f00>] (SyS_init_module+0xa8/0x110)
[<80083f00>] (SyS_init_module) from [<8000ebe0>] (ret_fast_syscall+0x0/0x30)
Code: bad PC value
---[ end trace e4bb6fffbf191a9d ]---

Thanks in advance!