Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685859 > unrolled thread

[PATCHv2 0/6] Motorola Droid 4 Audio Support

Started bySebastian Reichel <sebastian.reichel@collabora.co.uk>
First post2017-07-12 17:30 +0200
Last post2017-07-17 17:30 +0200
Articles 15 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCHv2 0/6] Motorola Droid 4 Audio Support Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-12 17:30 +0200
    [PATCHv2 4/6] ARM: dts: motorola-cpcap-mapphone: add audio-codec Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-12 17:30 +0200
    Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec Takashi Iwai <tiwai@suse.de> - 2017-07-12 17:40 +0200
    Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Tony Lindgren <tony@atomide.com> - 2017-07-17 11:30 +0200
      Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-17 12:20 +0200
        Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Tony Lindgren <tony@atomide.com> - 2017-07-17 12:20 +0200
          Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-17 16:20 +0200
            Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Tony Lindgren <tony@atomide.com> - 2017-07-18 07:50 +0200
              Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-18 11:30 +0200
                Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Takashi Iwai <tiwai@suse.de> - 2017-07-18 11:40 +0200
                  Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Tony Lindgren <tony@atomide.com> - 2017-07-27 11:40 +0200
                    Re: [PATCHv2 0/6] Motorola Droid 4 Audio Support Mark Brown <broonie@kernel.org> - 2017-07-27 12:30 +0200
    Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec Tony Lindgren <tony@atomide.com> - 2017-07-17 11:30 +0200
      Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-07-17 16:20 +0200
        Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec Mark Brown <broonie@kernel.org> - 2017-07-17 17:30 +0200

#1685859 — [PATCHv2 0/6] Motorola Droid 4 Audio Support

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-07-12 17:30 +0200
Subject[PATCHv2 0/6] Motorola Droid 4 Audio Support
Message-ID<u2rAK-1ua-13@gated-at.bofh.it>
Hi,

This adds audio support to Motorola Droid 4.

Tested:
 - Playing via both DACs using Speaker, Earpiece, Headphone
 - Recording using internal Mic
 - Volume Controls

Known not to work:
 - 3.5mm detection support (requires closed source firmware,
   needs further investigation)
 - Modem / Bluetooth Audio (actually untested, but probably
   needs some quirks)

Changes since PATCHv1:
 * Add patch from Tony exporting soc_dpcm_runtime_update
 * Integrate DT patch for vaudio initial mode
 * Split dt-binding from codec patch and add Ack from Rob
 * Fix CPCAP position in Kconfig/Makefile
 * Avoid "err +=" constructs
 * Simplify reset function
 * Drop cpcap_audio_read/write helpers
 * Do not use tertiary operator for mute register value
 * Update Input Mux logic
 * Switch from simple-audio-card to audio-graph-card

-- Sebastian

Sebastian Reichel (5):
  dt-bindings: sound: add motorola,cpcap-audio-codec
  ASoC: codec: cpcap: new codec
  ARM: dts: motorola-cpcap-mapphone: add audio-codec
  ARM: dts: motorola-cpcap-mapphone: set initial mode for vaudio
  ARM: dts: omap4-droid4: add soundcard

Tony Lindgren (1):
  ALSA: pcm: Export soc_dpcm_runtime_update

 .../bindings/sound/motorola,cpcap-audio-codec.txt  |   19 +
 arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi     |    7 +
 arch/arm/boot/dts/omap4-droid4-xt894.dts           |   84 +
 sound/soc/codecs/Kconfig                           |    5 +
 sound/soc/codecs/Makefile                          |    2 +
 sound/soc/codecs/cpcap.c                           | 1607 ++++++++++++++++++++
 sound/soc/soc-pcm.c                                |    2 +
 7 files changed, 1726 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/motorola,cpcap-audio-codec.txt
 create mode 100644 sound/soc/codecs/cpcap.c

-- 
2.13.2

[toc] | [next] | [standalone]


#1685863 — [PATCHv2 4/6] ARM: dts: motorola-cpcap-mapphone: add audio-codec

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-07-12 17:30 +0200
Subject[PATCHv2 4/6] ARM: dts: motorola-cpcap-mapphone: add audio-codec
Message-ID<u2rKq-1xe-19@gated-at.bofh.it>
In reply to#1685859
Add node for audio-codec to its DT file.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
index 1eb5da1dc8f0..86033aee8a29 100644
--- a/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
+++ b/arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi
@@ -68,6 +68,12 @@
 			};
 		};
 
+		cpcap_audio: audio-codec {
+			#sound-dai-cells = <1>;
+			compatible = "motorola,cpcap-audio-codec";
+			vdd-supply = <&vaudio>;
+		};
+
 		cpcap_rtc: rtc {
 			compatible = "motorola,cpcap-rtc";
 
-- 
2.13.2

[toc] | [prev] | [next] | [standalone]


#1685867 — Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec

FromTakashi Iwai <tiwai@suse.de>
Date2017-07-12 17:40 +0200
SubjectRe: [PATCHv2 3/6] ASoC: codec: cpcap: new codec
Message-ID<u2rU6-1Av-21@gated-at.bofh.it>
In reply to#1685859
On Wed, 12 Jul 2017 17:18:43 +0200,
Sebastian Reichel wrote:
> 
> +/* Capture Gain Control: 0dB to 31dB in 1dB steps */
> +static DECLARE_TLV_DB_SCALE(mic_gain_tlv, 0, 100, 0);
> +
> +/* Playback Gain Control: -33dB to 12dB in 3dB steps */
> +static DECLARE_TLV_DB_SCALE(vol_tlv, -3300, 300, 0);

Better to set const for TLV declarations here...

> +static const char * const cpcap_phase_invert_texts[] = {
> +	"Non Inverted", "Inverted"
> +};
> +static const SOC_ENUM_SINGLE_DECL(cpcap_hifi_l_phase_inv_enum,
> +	CPCAP_REG_RXSDOA, CPCAP_BIT_MONO_DAC0, cpcap_phase_invert_texts);
> +static const SOC_ENUM_SINGLE_DECL(cpcap_ext_l_phase_inv_enum,
> +	CPCAP_REG_RXEPOA, CPCAP_BIT_MONO_EXT0, cpcap_phase_invert_texts);

... while SOC_ENUM_*_DECL() already contain const, so you should omit
const here.


thanks,

Takashi

[toc] | [prev] | [next] | [standalone]


#1688811

FromTony Lindgren <tony@atomide.com>
Date2017-07-17 11:30 +0200
Message-ID<u4avM-3bA-3@gated-at.bofh.it>
In reply to#1685859
* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
>  * Switch from simple-audio-card to audio-graph-card

Gave this a quick try against v4.13-rc1 with SND_AUDIO_GRAPH_CARD
enabled as a loadable module. However loading it oopses for me,
see below. Maybe some dependencies are missing?

Regards,

Tony

8< --------------------
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:747
in_atomic(): 1, irqs_disabled(): 128, pid: 1590, name: modprobe
INFO: lockdep is turned off.
irq event stamp: 0
hardirqs last  enabled at (0): [<  (null)>]   (null)
hardirqs last disabled at (0): [<c0137464>] copy_process.part.5+0x2c4/0x1ac8
softirqs last  enabled at (0): [<c0137464>] copy_process.part.5+0x2c4/0x1ac8
softirqs last disabled at (0): [<  (null)>]   (null)
CPU: 0 PID: 1590 Comm: modprobe Tainted: G        W       4.13.0-rc1+ #126
Hardware name: Generic OMAP4 (Flattened Device Tree)
[<c0111524>] (unwind_backtrace) from [<c010d1fc>] (show_stack+0x10/0x14)
[<c010d1fc>] (show_stack) from [<c086375c>] (dump_stack+0xac/0xe0)
[<c086375c>] (dump_stack) from [<c0168c2c>] (___might_sleep+0x228/0x2ac)
[<c0168c2c>] (___might_sleep) from [<c087a86c>] (__mutex_lock+0x28/0x9fc)
[<c087a86c>] (__mutex_lock) from [<c087b25c>] (mutex_lock_nested+0x1c/0x24)
[<c087b25c>] (mutex_lock_nested) from [<c03532fc>] (kernfs_remove+0x18/0x30)
[<c03532fc>] (kernfs_remove) from [<c0867abc>] (kobject_del+0x14/0x44)
[<c0867abc>] (kobject_del) from [<c0867948>] (kobject_put+0x114/0x224)
[<c0867948>] (kobject_put) from [<c06c8e74>] (of_get_next_parent+0x2c/0x4c)
[<c06c8e74>] (of_get_next_parent) from [<c06ccd24>] (of_graph_get_port_parent+0x10/0x70)
[<c06ccd24>] (of_graph_get_port_parent) from [<bf4685e8>] (asoc_simple_card_parse_graph_dai+0x98/0xe0 [snd_soc_simple_card_utils])
[<bf4685e8>] (asoc_simple_card_parse_graph_dai [snd_soc_simple_card_utils]) from [<bf8e5330>] (asoc_graph_card_probe+0x200/0x444 [snd_soc_audio_graph_card])
[<bf8e5330>] (asoc_graph_card_probe [snd_soc_audio_graph_card]) from [<c05aa2b8>] (platform_drv_probe+0x50/0xb0)
[<c05aa2b8>] (platform_drv_probe) from [<c05a8088>] (driver_probe_device+0x33c/0x478)
[<c05a8088>] (driver_probe_device) from [<c05a82ac>] (__driver_attach+0xe8/0x110)
[<c05a82ac>] (__driver_attach) from [<c05a61c8>] (bus_for_each_dev+0x6c/0xa0)
[<c05a61c8>] (bus_for_each_dev) from [<c05a7354>] (bus_add_driver+0x198/0x270)
[<c05a7354>] (bus_add_driver) from [<c05a92c8>] (driver_register+0x78/0xf4)
[<c05a92c8>] (driver_register) from [<c010189c>] (do_one_initcall+0x3c/0x170)
[<c010189c>] (do_one_initcall) from [<c01edc24>] (do_init_module+0x5c/0x1e0)
[<c01edc24>] (do_init_module) from [<c01ec904>] (load_module+0x1270/0x14ec)
[<c01ec904>] (load_module) from [<c01ece08>] (SyS_finit_module+0xa8/0xec)
[<c01ece08>] (SyS_finit_module) from [<c0108440>] (ret_fast_syscall+0x0/0x1c)
OF: ERROR: Bad of_node_put() on /ocp/spi@48098000/pmic@0/audio-codec/port@0/endpoint

[toc] | [prev] | [next] | [standalone]


#1688848

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-07-17 12:20 +0200
Message-ID<u4bia-3Jo-5@gated-at.bofh.it>
In reply to#1688811

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Mon, Jul 17, 2017 at 02:29:04AM -0700, Tony Lindgren wrote:
> * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> >  * Switch from simple-audio-card to audio-graph-card
> 
> Gave this a quick try against v4.13-rc1 with SND_AUDIO_GRAPH_CARD
> enabled as a loadable module. However loading it oopses for me,
> see below. Maybe some dependencies are missing?

It works for me on top of v4.13-rc1 (my kernel is monolithic).
Looking at the stacktrace it seems to be a bug in audio graph
card and not in the codec driver.

-- Sebastian

> 8< --------------------
> BUG: sleeping function called from invalid context at kernel/locking/mutex.c:747
> in_atomic(): 1, irqs_disabled(): 128, pid: 1590, name: modprobe
> INFO: lockdep is turned off.
> irq event stamp: 0
> hardirqs last  enabled at (0): [<  (null)>]   (null)
> hardirqs last disabled at (0): [<c0137464>] copy_process.part.5+0x2c4/0x1ac8
> softirqs last  enabled at (0): [<c0137464>] copy_process.part.5+0x2c4/0x1ac8
> softirqs last disabled at (0): [<  (null)>]   (null)
> CPU: 0 PID: 1590 Comm: modprobe Tainted: G        W       4.13.0-rc1+ #126
> Hardware name: Generic OMAP4 (Flattened Device Tree)
> [<c0111524>] (unwind_backtrace) from [<c010d1fc>] (show_stack+0x10/0x14)
> [<c010d1fc>] (show_stack) from [<c086375c>] (dump_stack+0xac/0xe0)
> [<c086375c>] (dump_stack) from [<c0168c2c>] (___might_sleep+0x228/0x2ac)
> [<c0168c2c>] (___might_sleep) from [<c087a86c>] (__mutex_lock+0x28/0x9fc)
> [<c087a86c>] (__mutex_lock) from [<c087b25c>] (mutex_lock_nested+0x1c/0x24)
> [<c087b25c>] (mutex_lock_nested) from [<c03532fc>] (kernfs_remove+0x18/0x30)
> [<c03532fc>] (kernfs_remove) from [<c0867abc>] (kobject_del+0x14/0x44)
> [<c0867abc>] (kobject_del) from [<c0867948>] (kobject_put+0x114/0x224)
> [<c0867948>] (kobject_put) from [<c06c8e74>] (of_get_next_parent+0x2c/0x4c)
> [<c06c8e74>] (of_get_next_parent) from [<c06ccd24>] (of_graph_get_port_parent+0x10/0x70)
> [<c06ccd24>] (of_graph_get_port_parent) from [<bf4685e8>] (asoc_simple_card_parse_graph_dai+0x98/0xe0 [snd_soc_simple_card_utils])
> [<bf4685e8>] (asoc_simple_card_parse_graph_dai [snd_soc_simple_card_utils]) from [<bf8e5330>] (asoc_graph_card_probe+0x200/0x444 [snd_soc_audio_graph_card])
> [<bf8e5330>] (asoc_graph_card_probe [snd_soc_audio_graph_card]) from [<c05aa2b8>] (platform_drv_probe+0x50/0xb0)
> [<c05aa2b8>] (platform_drv_probe) from [<c05a8088>] (driver_probe_device+0x33c/0x478)
> [<c05a8088>] (driver_probe_device) from [<c05a82ac>] (__driver_attach+0xe8/0x110)
> [<c05a82ac>] (__driver_attach) from [<c05a61c8>] (bus_for_each_dev+0x6c/0xa0)
> [<c05a61c8>] (bus_for_each_dev) from [<c05a7354>] (bus_add_driver+0x198/0x270)
> [<c05a7354>] (bus_add_driver) from [<c05a92c8>] (driver_register+0x78/0xf4)
> [<c05a92c8>] (driver_register) from [<c010189c>] (do_one_initcall+0x3c/0x170)
> [<c010189c>] (do_one_initcall) from [<c01edc24>] (do_init_module+0x5c/0x1e0)
> [<c01edc24>] (do_init_module) from [<c01ec904>] (load_module+0x1270/0x14ec)
> [<c01ec904>] (load_module) from [<c01ece08>] (SyS_finit_module+0xa8/0xec)
> [<c01ece08>] (SyS_finit_module) from [<c0108440>] (ret_fast_syscall+0x0/0x1c)
> OF: ERROR: Bad of_node_put() on /ocp/spi@48098000/pmic@0/audio-codec/port@0/endpoint

[toc] | [prev] | [next] | [standalone]


#1688854

FromTony Lindgren <tony@atomide.com>
Date2017-07-17 12:20 +0200
Message-ID<u4bia-3Jo-17@gated-at.bofh.it>
In reply to#1688848
* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 03:13]:
> Hi,
> 
> On Mon, Jul 17, 2017 at 02:29:04AM -0700, Tony Lindgren wrote:
> > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> > >  * Switch from simple-audio-card to audio-graph-card
> > 
> > Gave this a quick try against v4.13-rc1 with SND_AUDIO_GRAPH_CARD
> > enabled as a loadable module. However loading it oopses for me,
> > see below. Maybe some dependencies are missing?
> 
> It works for me on top of v4.13-rc1 (my kernel is monolithic).
> Looking at the stacktrace it seems to be a bug in audio graph
> card and not in the codec driver.

OK I do also have:

CONFIG_DEBUG_LOCKDEP=y
CONFIG_DEBUG_ATOMIC_SLEEP=y

Tony

> > 8< --------------------
> > BUG: sleeping function called from invalid context at kernel/locking/mutex.c:747
> > in_atomic(): 1, irqs_disabled(): 128, pid: 1590, name: modprobe
> > INFO: lockdep is turned off.
> > irq event stamp: 0
> > hardirqs last  enabled at (0): [<  (null)>]   (null)
> > hardirqs last disabled at (0): [<c0137464>] copy_process.part.5+0x2c4/0x1ac8
> > softirqs last  enabled at (0): [<c0137464>] copy_process.part.5+0x2c4/0x1ac8
> > softirqs last disabled at (0): [<  (null)>]   (null)
> > CPU: 0 PID: 1590 Comm: modprobe Tainted: G        W       4.13.0-rc1+ #126
> > Hardware name: Generic OMAP4 (Flattened Device Tree)
> > [<c0111524>] (unwind_backtrace) from [<c010d1fc>] (show_stack+0x10/0x14)
> > [<c010d1fc>] (show_stack) from [<c086375c>] (dump_stack+0xac/0xe0)
> > [<c086375c>] (dump_stack) from [<c0168c2c>] (___might_sleep+0x228/0x2ac)
> > [<c0168c2c>] (___might_sleep) from [<c087a86c>] (__mutex_lock+0x28/0x9fc)
> > [<c087a86c>] (__mutex_lock) from [<c087b25c>] (mutex_lock_nested+0x1c/0x24)
> > [<c087b25c>] (mutex_lock_nested) from [<c03532fc>] (kernfs_remove+0x18/0x30)
> > [<c03532fc>] (kernfs_remove) from [<c0867abc>] (kobject_del+0x14/0x44)
> > [<c0867abc>] (kobject_del) from [<c0867948>] (kobject_put+0x114/0x224)
> > [<c0867948>] (kobject_put) from [<c06c8e74>] (of_get_next_parent+0x2c/0x4c)
> > [<c06c8e74>] (of_get_next_parent) from [<c06ccd24>] (of_graph_get_port_parent+0x10/0x70)
> > [<c06ccd24>] (of_graph_get_port_parent) from [<bf4685e8>] (asoc_simple_card_parse_graph_dai+0x98/0xe0 [snd_soc_simple_card_utils])
> > [<bf4685e8>] (asoc_simple_card_parse_graph_dai [snd_soc_simple_card_utils]) from [<bf8e5330>] (asoc_graph_card_probe+0x200/0x444 [snd_soc_audio_graph_card])
> > [<bf8e5330>] (asoc_graph_card_probe [snd_soc_audio_graph_card]) from [<c05aa2b8>] (platform_drv_probe+0x50/0xb0)
> > [<c05aa2b8>] (platform_drv_probe) from [<c05a8088>] (driver_probe_device+0x33c/0x478)
> > [<c05a8088>] (driver_probe_device) from [<c05a82ac>] (__driver_attach+0xe8/0x110)
> > [<c05a82ac>] (__driver_attach) from [<c05a61c8>] (bus_for_each_dev+0x6c/0xa0)
> > [<c05a61c8>] (bus_for_each_dev) from [<c05a7354>] (bus_add_driver+0x198/0x270)
> > [<c05a7354>] (bus_add_driver) from [<c05a92c8>] (driver_register+0x78/0xf4)
> > [<c05a92c8>] (driver_register) from [<c010189c>] (do_one_initcall+0x3c/0x170)
> > [<c010189c>] (do_one_initcall) from [<c01edc24>] (do_init_module+0x5c/0x1e0)
> > [<c01edc24>] (do_init_module) from [<c01ec904>] (load_module+0x1270/0x14ec)
> > [<c01ec904>] (load_module) from [<c01ece08>] (SyS_finit_module+0xa8/0xec)
> > [<c01ece08>] (SyS_finit_module) from [<c0108440>] (ret_fast_syscall+0x0/0x1c)
> > OF: ERROR: Bad of_node_put() on /ocp/spi@48098000/pmic@0/audio-codec/port@0/endpoint

[toc] | [prev] | [next] | [standalone]


#1689090

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-07-17 16:20 +0200
Message-ID<u4f2p-69R-21@gated-at.bofh.it>
In reply to#1688854

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Mon, Jul 17, 2017 at 03:17:10AM -0700, Tony Lindgren wrote:
> * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 03:13]:
> > On Mon, Jul 17, 2017 at 02:29:04AM -0700, Tony Lindgren wrote:
> > > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> > > >  * Switch from simple-audio-card to audio-graph-card
> > > 
> > > Gave this a quick try against v4.13-rc1 with SND_AUDIO_GRAPH_CARD
> > > enabled as a loadable module. However loading it oopses for me,
> > > see below. Maybe some dependencies are missing?
> > 
> > It works for me on top of v4.13-rc1 (my kernel is monolithic).
> > Looking at the stacktrace it seems to be a bug in audio graph
> > card and not in the codec driver.
> 
> OK I do also have:
> 
> CONFIG_DEBUG_LOCKDEP=y
> CONFIG_DEBUG_ATOMIC_SLEEP=y

I added those and I do not get a stacktrace for anything sound
related and audio works. I noticed one issue in dapm routing,
that I accidently added. That will be fixed in PATCHv3, but its
in untestable path anyways (EXT capture, probably FM radio is
connected to EXT).

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1689734

FromTony Lindgren <tony@atomide.com>
Date2017-07-18 07:50 +0200
Message-ID<u4tyq-6Oe-19@gated-at.bofh.it>
In reply to#1689090
* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 07:14]:
> Hi,
> 
> On Mon, Jul 17, 2017 at 03:17:10AM -0700, Tony Lindgren wrote:
> > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 03:13]:
> > > On Mon, Jul 17, 2017 at 02:29:04AM -0700, Tony Lindgren wrote:
> > > > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> > > > >  * Switch from simple-audio-card to audio-graph-card
> > > > 
> > > > Gave this a quick try against v4.13-rc1 with SND_AUDIO_GRAPH_CARD
> > > > enabled as a loadable module. However loading it oopses for me,
> > > > see below. Maybe some dependencies are missing?
> > > 
> > > It works for me on top of v4.13-rc1 (my kernel is monolithic).
> > > Looking at the stacktrace it seems to be a bug in audio graph
> > > card and not in the codec driver.
> > 
> > OK I do also have:
> > 
> > CONFIG_DEBUG_LOCKDEP=y
> > CONFIG_DEBUG_ATOMIC_SLEEP=y
> 
> I added those and I do not get a stacktrace for anything sound
> related and audio works. I noticed one issue in dapm routing,
> that I accidently added. That will be fixed in PATCHv3, but its
> in untestable path anyways (EXT capture, probably FM radio is
> connected to EXT).

Hmm maybe that was not with DEBUG_ATOMIC_SLEEP then? I also
verified it does not happen unless your dts patch
"ARM: dts: omap4-droid4: add soundcard" is applied.

I doubt that having it as loadable module makes any difference
here as it's the might_sleep() in __mutex_lock_common() producing
the BUG.

Regards,

Tony

[toc] | [prev] | [next] | [standalone]


#1689917

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-07-18 11:30 +0200
Message-ID<u4wZk-zm-15@gated-at.bofh.it>
In reply to#1689734

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Mon, Jul 17, 2017 at 10:48:33PM -0700, Tony Lindgren wrote:
> * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 07:14]:
> > Hi,
> > 
> > On Mon, Jul 17, 2017 at 03:17:10AM -0700, Tony Lindgren wrote:
> > > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 03:13]:
> > > > On Mon, Jul 17, 2017 at 02:29:04AM -0700, Tony Lindgren wrote:
> > > > > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> > > > > >  * Switch from simple-audio-card to audio-graph-card
> > > > > 
> > > > > Gave this a quick try against v4.13-rc1 with SND_AUDIO_GRAPH_CARD
> > > > > enabled as a loadable module. However loading it oopses for me,
> > > > > see below. Maybe some dependencies are missing?
> > > > 
> > > > It works for me on top of v4.13-rc1 (my kernel is monolithic).
> > > > Looking at the stacktrace it seems to be a bug in audio graph
> > > > card and not in the codec driver.
> > > 
> > > OK I do also have:
> > > 
> > > CONFIG_DEBUG_LOCKDEP=y
> > > CONFIG_DEBUG_ATOMIC_SLEEP=y
> > 
> > I added those and I do not get a stacktrace for anything sound
> > related and audio works. I noticed one issue in dapm routing,
> > that I accidently added. That will be fixed in PATCHv3, but its
> > in untestable path anyways (EXT capture, probably FM radio is
> > connected to EXT).
> 
> Hmm maybe that was not with DEBUG_ATOMIC_SLEEP then?

$ grep DEBUG_ATOMIC_SLEEP .config
CONFIG_DEBUG_ATOMIC_SLEEP=y

> I also verified it does not happen unless your dts patch "ARM:
> dts: omap4-droid4: add soundcard" is applied.

That's what I expected, since the stacktrace started in the
soundcard driver.

> I doubt that having it as loadable module makes any difference
> here as it's the might_sleep() in __mutex_lock_common() producing
> the BUG.

It might make a difference, since it changes the probe order. The
mutex may not even be called on my system.

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1689942

FromTakashi Iwai <tiwai@suse.de>
Date2017-07-18 11:40 +0200
Message-ID<u4x90-CI-35@gated-at.bofh.it>
In reply to#1689917
On Tue, 18 Jul 2017 11:29:31 +0200,
Sebastian Reichel wrote:
> 
> Hi,
> 
> On Mon, Jul 17, 2017 at 10:48:33PM -0700, Tony Lindgren wrote:
> > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 07:14]:
> > > Hi,
> > > 
> > > On Mon, Jul 17, 2017 at 03:17:10AM -0700, Tony Lindgren wrote:
> > > > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170717 03:13]:
> > > > > On Mon, Jul 17, 2017 at 02:29:04AM -0700, Tony Lindgren wrote:
> > > > > > * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> > > > > > >  * Switch from simple-audio-card to audio-graph-card
> > > > > > 
> > > > > > Gave this a quick try against v4.13-rc1 with SND_AUDIO_GRAPH_CARD
> > > > > > enabled as a loadable module. However loading it oopses for me,
> > > > > > see below. Maybe some dependencies are missing?
> > > > > 
> > > > > It works for me on top of v4.13-rc1 (my kernel is monolithic).
> > > > > Looking at the stacktrace it seems to be a bug in audio graph
> > > > > card and not in the codec driver.
> > > > 
> > > > OK I do also have:
> > > > 
> > > > CONFIG_DEBUG_LOCKDEP=y
> > > > CONFIG_DEBUG_ATOMIC_SLEEP=y
> > > 
> > > I added those and I do not get a stacktrace for anything sound
> > > related and audio works. I noticed one issue in dapm routing,
> > > that I accidently added. That will be fixed in PATCHv3, but its
> > > in untestable path anyways (EXT capture, probably FM radio is
> > > connected to EXT).
> > 
> > Hmm maybe that was not with DEBUG_ATOMIC_SLEEP then?
> 
> $ grep DEBUG_ATOMIC_SLEEP .config
> CONFIG_DEBUG_ATOMIC_SLEEP=y
> 
> > I also verified it does not happen unless your dts patch "ARM:
> > dts: omap4-droid4: add soundcard" is applied.
> 
> That's what I expected, since the stacktrace started in the
> soundcard driver.
> 
> > I doubt that having it as loadable module makes any difference
> > here as it's the might_sleep() in __mutex_lock_common() producing
> > the BUG.
> 
> It might make a difference, since it changes the probe order. The
> mutex may not even be called on my system.

The problem manifests itself as an unblanaced of node reference.
The node is released mistakenly at of_node_put() and this is caught as
sleep-in-atomic, fortunately.

So likely either something forgot to take the node ref or it hits the
unreference due to the missing object by the implicit probe disorder,
etc, I suppose.


Takashi

[toc] | [prev] | [next] | [standalone]


#1697848

FromTony Lindgren <tony@atomide.com>
Date2017-07-27 11:40 +0200
Message-ID<u7NqW-4mb-23@gated-at.bofh.it>
In reply to#1689942
* Takashi Iwai <tiwai@suse.de> [170718 02:38]:
> 
> The problem manifests itself as an unblanaced of node reference.
> The node is released mistakenly at of_node_put() and this is caught as
> sleep-in-atomic, fortunately.
> 
> So likely either something forgot to take the node ref or it hits the
> unreference due to the missing object by the implicit probe disorder,
> etc, I suppose.

Yup you're right. This is what happens, will send a fix for it shortly.

Regards,

Tony

[toc] | [prev] | [next] | [standalone]


#1697876

FromMark Brown <broonie@kernel.org>
Date2017-07-27 12:30 +0200
Message-ID<u7Odj-4Tl-9@gated-at.bofh.it>
In reply to#1697848

[Multipart message — attachments visible in raw view] — view raw

On Thu, Jul 27, 2017 at 02:39:43AM -0700, Tony Lindgren wrote:
> * Takashi Iwai <tiwai@suse.de> [170718 02:38]:

> > The problem manifests itself as an unblanaced of node reference.
> > The node is released mistakenly at of_node_put() and this is caught as
> > sleep-in-atomic, fortunately.

> > So likely either something forgot to take the node ref or it hits the
> > unreference due to the missing object by the implicit probe disorder,
> > etc, I suppose.

> Yup you're right. This is what happens, will send a fix for it shortly.

There was also a separate thread where people were trying to fix this
having run into it elsewhere.  The of_graph APIs look pretty confusing
from a user point of view sadly :(

[toc] | [prev] | [next] | [standalone]


#1688816 — Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec

FromTony Lindgren <tony@atomide.com>
Date2017-07-17 11:30 +0200
SubjectRe: [PATCHv2 3/6] ASoC: codec: cpcap: new codec
Message-ID<u4avM-3bA-13@gated-at.bofh.it>
In reply to#1685859
* Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
> index 6c78b0b49b81..1615e5acc8fd 100644
> --- a/sound/soc/codecs/Kconfig
> +++ b/sound/soc/codecs/Kconfig
> @@ -401,6 +401,11 @@ config SND_SOC_ALC5632
>  config SND_SOC_BT_SCO
>  	tristate "Dummy BT SCO codec driver"
>  
> +config SND_SOC_CPCAP
> +	tristate "Motorola CPCAP codec"
> +	depends on MFD_CPCAP
> +	default MFD_CPCAP
> +

Should it also have depends on SND_AUDIO_GRAPH_CARD?

Tony

[toc] | [prev] | [next] | [standalone]


#1689085 — Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec

FromSebastian Reichel <sebastian.reichel@collabora.co.uk>
Date2017-07-17 16:20 +0200
SubjectRe: [PATCHv2 3/6] ASoC: codec: cpcap: new codec
Message-ID<u4f2p-69R-1@gated-at.bofh.it>
In reply to#1688816

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Mon, Jul 17, 2017 at 02:29:29AM -0700, Tony Lindgren wrote:
> * Sebastian Reichel <sebastian.reichel@collabora.co.uk> [170712 08:19]:
> > diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
> > index 6c78b0b49b81..1615e5acc8fd 100644
> > --- a/sound/soc/codecs/Kconfig
> > +++ b/sound/soc/codecs/Kconfig
> > @@ -401,6 +401,11 @@ config SND_SOC_ALC5632
> >  config SND_SOC_BT_SCO
> >  	tristate "Dummy BT SCO codec driver"
> >  
> > +config SND_SOC_CPCAP
> > +	tristate "Motorola CPCAP codec"
> > +	depends on MFD_CPCAP
> > +	default MFD_CPCAP
> > +
> 
> Should it also have depends on SND_AUDIO_GRAPH_CARD?

The codec does not depend on audio graph card. You can
also use it with (deprecated) simple card or a custom
written one. In case of a custom written one it would
make sense to add a dependency from the custom written
one to SND_SOC_CPCAP. So I think we should not add such
a dependency.

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1689172 — Re: [PATCHv2 3/6] ASoC: codec: cpcap: new codec

FromMark Brown <broonie@kernel.org>
Date2017-07-17 17:30 +0200
SubjectRe: [PATCHv2 3/6] ASoC: codec: cpcap: new codec
Message-ID<u4g89-6OB-3@gated-at.bofh.it>
In reply to#1689085

[Multipart message — attachments visible in raw view] — view raw

On Mon, Jul 17, 2017 at 04:18:08PM +0200, Sebastian Reichel wrote:
> On Mon, Jul 17, 2017 at 02:29:29AM -0700, Tony Lindgren wrote:

> > Should it also have depends on SND_AUDIO_GRAPH_CARD?

> The codec does not depend on audio graph card. You can
> also use it with (deprecated) simple card or a custom
> written one. In case of a custom written one it would
> make sense to add a dependency from the custom written
> one to SND_SOC_CPCAP. So I think we should not add such
> a dependency.

Right, the dependencies should go in the opposite direction.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web