[alsa-devel] [PATCH 0/2] ASoC: rsnd: tidyup .remove method

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Mon Feb 2 05:52:44 CET 2015


Hi Mark

These patches call missing remove/unregister functions on rsnd driver.

Kuninori Morimoto (2):
      ASoC: rsnd: call missing snd_ctl_remove()
      ASoC: rsnd: call missing snd_soc_unregiter_component/platform()

 sound/soc/sh/rcar/core.c |   14 +++++++++++++-
 sound/soc/sh/rcar/dvc.c  |   15 +++++++++++++++
 sound/soc/sh/rcar/rsnd.h |    5 +++++
 3 files changed, 33 insertions(+), 1 deletion(-)


BTW, we found ALSA SoC bind/unbind issue on latest upstream kernel.
ALSA SoC is using like this.

	[CPU] - [CARD] - [CODEC]

If we unbind CPU here, it still has CARD infomation.
And, kernel doesn't call initialize function when re-bind,
and it will panic when playback

-------------------------

In our case,
 CPU   : rsnd
 CARD  : simple-card
 CODEC : ak4642


Current list

	/ # aplay -l
	**** List of PLAYBACK Hardware Devices ****
	card 0: rsnddai0ak4642h [rsnd-dai.0-ak4642-hifi], device 0: rsnd-dai.0-ak4642-hifi ak4642-hifi-0 []
	  Subdevices: 1/1
	  Subdevice #0: subdevice #0

Unbind CPU

	echo "ec500000.rcar_sound" > /sys/bus/platform/drivers/rcar_sound/unbind 

But, it still has unbinded card

	/ # aplay -l
	**** List of PLAYBACK Hardware Devices ****
	card 0: rsnddai0ak4642h [rsnd-dai.0-ak4642-hifi], device 0: rsnd-dai.0-ak4642-hifi ak4642-hifi-0 []
	  Subdevices: 1/1
	  Subdevice #0: subdevice #0

Re-bind. .probe function was called, but no mapping message
"asoc-simple-card sound: ak4642-hifi <-> ec500000.rcar_sound mapping ok"

	echo "ec500000.rcar_sound" > /sys/bus/platform/drivers/rcar_sound/bind 
	rcar_sound ec500000.rcar_sound: probed

Kernel panic when playback after rebind

	/ # aplay /home/xxx.wav 
	ASoC: ak4642-hifi <->  No matching rates
	Unable to handle kernel paging request at virtual address ee196100
	pgd = eebbc000
	[ee196100] *pgd=6e01141e(bad)
	Internal error: Oops: 8000000d [#1] SMP ARM
	CPU: 0 PID: 936 Comm: aplay Tainted: G        W      3.19.0-rc6-02875-gf8eac9a #1541
	Hardware name: Generic R8A7790 (Flattened Device Tree)
	task: edc2adc0 ti: ee08a000 task.ti: ee08a000
	PC is at 0xee196100
	LR is at soc_pcm_open+0x6e8/0x7ac
	pc : [<ee196100>]    lr : [<c0386e18>]    psr: a00f0013
	sp : ee08bc90  ip : ee08bc90  fp : ee08bcec
	r10: eeb30800  r9 : eeae7a00  r8 : ffffffea
	r7 : eeb30800  r6 : ee947480  r5 : ee328a00  r4 : edbf5010
	r3 : ee196100  r2 : ee0dc290  r1 : ee947480  r0 : ee328a00
	Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
	Control: 10c5307d  Table: 6ebbc06a  DAC: 00000015
	Process aplay (pid: 936, stack limit = 0xee08a238)
	Stack: (0xee08bc90 to 0xee08c000)
	bc80:                                     00000001 00000002 edbf5010 00000010
	bca0: ee91d520 edbf501c 0000000c 00000000 00000000 00000001 ffffffff eeae7a00
	bcc0: ee08bcf4 00000000 ee08bd10 eea3ad00 ee328ce8 ee328d00 00000000 00000001
	bce0: ee08bd0c ee08bcf0 c0376a60 c038673c c0045098 ee328a00 00000000 ee328c00
	bd00: ee08bd54 ee08bd10 c0376b38 c0376a18 ee08bd2c 00000000 edc2adc0 c0045098
	bd20: ee328d04 ee328d04 c024dd10 ee328c00 eea3ad00 eebb3638 00000000 c0661848
	bd40: eea3ad00 eea3ad00 ee08bd6c ee08bd58 c0376d04 c0376ab4 c04f179c eea3ad00
	bd60: ee08bd8c ee08bd70 c0367f18 c0376ccc c0367e9c 00000000 eebb3638 ee13bec0
	bd80: ee08bdbc ee08bd90 c00c8b94 c0367ea8 00000000 00000010 eea3ad00 eebb3638
	bda0: ee08be88 00000000 c00c8a5c eea3ad08 ee08bde4 ee08bdc0 c00c303c c00c8a68
	bdc0: ee08bed0 eea3ad00 ee08be88 00000000 ee3f0000 ee08be84 ee08bdf4 ee08bde8
	bde0: c00c3ff8 c00c2ea0 ee08be6c ee08bdf8 c00d0c78 c00c3fb8 00000101 ee4264c8
	be00: ee03e890 ee425770 eebb26b8 00000026 00000000 ee425770 ee08bee8 00000000
	be20: 00000802 ee08bf5c 00000000 00000000 ee08a000 eebb3638 ee03e890 ee425770
	be40: c00cef24 ee08bed0 eea3ad00 ee08be90 ee08bf5c ee3f0000 ee08be88 00000000
	be60: ee08bec4 ee08be70 c00d10d4 c00d0400 ee08be84 ee9a1380 ee08bf0c ee08be88
	be80: c036cddc 00000000 ee03e890 ee4274c8 ee08bec4 ee08bea0 c01aa17c ee08bf5c
	bea0: 00000001 ee3f0000 ffffff9c c000eb24 ee08a000 00000000 ee08bf4c ee08bec8
	bec0: c00d1474 c00d0f00 00000041 ee08bed8 ee03e890 ee4274c8 474edc20 00000008
	bee0: ee3f0019 eea3a700 ee03e7d0 ee4264c8 eebb3638 00000101 00000000 00000034
	bf00: 00000000 00000000 00000000 c00de444 00080802 00080802 be8b4ea4 ee3f0000
	bf20: ffffff9c c000eb24 ee08a000 00000000 00080802 00000004 ee3f0000 ffffff9c
	bf40: ee08bf94 ee08bf50 c00c4430 c00d144c c00d38e0 c00def38 eea3a700 00000802
	bf60: be8b0000 00000026 00000100 00000001 be8b466c be8b4ea4 00000002 00000005
	bf80: c000eb24 ee08a000 ee08bfa4 ee08bf98 c00c44f8 c00c431c 00000000 ee08bfa8
	bfa0: c000e980 c00c44dc be8b466c be8b4ea4 be8b4794 00080802 be8b4628 00080802
	bfc0: be8b466c be8b4ea4 00000002 00000005 001255f8 00129264 000dd264 00124478
	bfe0: 00000000 be8b4634 00049257 00083036 600f0030 be8b4794 03433c61 0717419f
	Backtrace: 
	[<c0386730>] (soc_pcm_open) from [<c0376a60>] (snd_pcm_open_substream+0x54/0x9c)
	 r10:00000001 r9:00000000 r8:ee328d00 r7:ee328ce8 r6:eea3ad00 r5:ee08bd10
	 r4:00000000
	[<c0376a0c>] (snd_pcm_open_substream) from [<c0376b38>] (snd_pcm_open+0x90/0x1b4)
	 r5:ee328c00 r4:00000000
	[<c0376aa8>] (snd_pcm_open) from [<c0376d04>] (snd_pcm_playback_open+0x44/0x64)
	 r10:eea3ad00 r9:eea3ad00 r8:c0661848 r7:00000000 r6:eebb3638 r5:eea3ad00
	 r4:ee328c00
	[<c0376cc0>] (snd_pcm_playback_open) from [<c0367f18>] (snd_open+0x7c/0x90)
	 r5:eea3ad00 r4:c04f179c
	[<c0367e9c>] (snd_open) from [<c00c8b94>] (chrdev_open+0x138/0x164)
	 r6:ee13bec0 r5:eebb3638 r4:00000000 r3:c0367e9c
	[<c00c8a5c>] (chrdev_open) from [<c00c303c>] (do_dentry_open.isra.17+0x1a8/0x2b8)
	 r9:eea3ad08 r8:c00c8a5c r7:00000000 r6:ee08be88 r5:eebb3638 r4:eea3ad00
	[<c00c2e94>] (do_dentry_open.isra.17) from [<c00c3ff8>] (vfs_open+0x4c/0x50)
	 r9:ee08be84 r8:ee3f0000 r7:00000000 r6:ee08be88 r5:eea3ad00 r4:ee08bed0
	[<c00c3fac>] (vfs_open) from [<c00d0c78>] (do_last.isra.47+0x884/0xb00)
	[<c00d03f4>] (do_last.isra.47) from [<c00d10d4>] (path_openat+0x1e0/0x54c)
	 r10:00000000 r9:ee08be88 r8:ee3f0000 r7:ee08bf5c r6:ee08be90 r5:eea3ad00
	 r4:ee08bed0
	[<c00d0ef4>] (path_openat) from [<c00d1474>] (do_filp_open+0x34/0x80)
	 r10:00000000 r9:ee08a000 r8:c000eb24 r7:ffffff9c r6:ee3f0000 r5:00000001
	 r4:ee08bf5c
	[<c00d1440>] (do_filp_open) from [<c00c4430>] (do_sys_open+0x120/0x1c0)
	 r7:ffffff9c r6:ee3f0000 r5:00000004 r4:00080802
	[<c00c4310>] (do_sys_open) from [<c00c44f8>] (SyS_open+0x28/0x2c)
	 r9:ee08a000 r8:c000eb24 r7:00000005 r6:00000002 r5:be8b4ea4 r4:be8b466c
	[<c00c44d0>] (SyS_open) from [<c000e980>] (ret_fast_syscall+0x0/0x34)
	Code: 00000000 00000000 00000000 00000000 (0000004f) 
	---[ end trace bd44069e52a540ae ]---
	Segmentation fault


Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list