All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Robert Jarzmik <robert.jarzmik@free.fr>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ASoC: wm9713: fix regmap free path
Date: Sun, 21 Feb 2016 11:12:51 +0100	[thread overview]
Message-ID: <56C98DA3.4000701@metafoo.de> (raw)
In-Reply-To: <1455997470-12307-1-git-send-email-robert.jarzmik@free.fr>

On 02/20/2016 08:44 PM, Robert Jarzmik wrote:
> In the conversion to regmap, I assumed that the 2 following functions
> was working symetrically:
>  - snd_soc_codec_init_regmap()
>  - snd_soc_codec_exit_regmap(codec)
> 
> As a mater of fact with the current code the regmap is freed twice
> because of the devm_() call:
> (mutex_lock) from (debugfs_remove_recursive+0x50/0x1d0)
> (debugfs_remove_recursive) from (regmap_debugfs_exit+0x1c/0xd4)
> (regmap_debugfs_exit) from (regmap_exit+0x28/0xc8)
> (regmap_exit) from (release_nodes+0x18c/0x204)
> (release_nodes) from (device_release+0x18/0x90)
> (device_release) from (kobject_release+0x90/0x1bc)
> (kobject_release) from (wm9713_soc_remove+0x1c/0x24)
> (wm9713_soc_remove) from (soc_remove_component+0x50/0x7c)
> (soc_remove_component) from (soc_remove_dai_links+0x118/0x228)
> (soc_remove_dai_links) from (snd_soc_register_card+0x4e4/0xdd4)
> (snd_soc_register_card) from (devm_snd_soc_register_card+0x34/0x70)
> 
> Fix this by removing the doubled regmap free.

The correct fix is to use the non devm variant of regmap_init_ac97() in this
case. Device managed functions should only be used from inside a struct
device probe function.

- Lars

WARNING: multiple messages have this Message-ID (diff)
From: Lars-Peter Clausen <lars@metafoo.de>
To: Robert Jarzmik <robert.jarzmik@free.fr>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH v2] ASoC: wm9713: fix regmap free path
Date: Sun, 21 Feb 2016 11:12:51 +0100	[thread overview]
Message-ID: <56C98DA3.4000701@metafoo.de> (raw)
In-Reply-To: <1455997470-12307-1-git-send-email-robert.jarzmik@free.fr>

On 02/20/2016 08:44 PM, Robert Jarzmik wrote:
> In the conversion to regmap, I assumed that the 2 following functions
> was working symetrically:
>  - snd_soc_codec_init_regmap()
>  - snd_soc_codec_exit_regmap(codec)
> 
> As a mater of fact with the current code the regmap is freed twice
> because of the devm_() call:
> (mutex_lock) from (debugfs_remove_recursive+0x50/0x1d0)
> (debugfs_remove_recursive) from (regmap_debugfs_exit+0x1c/0xd4)
> (regmap_debugfs_exit) from (regmap_exit+0x28/0xc8)
> (regmap_exit) from (release_nodes+0x18c/0x204)
> (release_nodes) from (device_release+0x18/0x90)
> (device_release) from (kobject_release+0x90/0x1bc)
> (kobject_release) from (wm9713_soc_remove+0x1c/0x24)
> (wm9713_soc_remove) from (soc_remove_component+0x50/0x7c)
> (soc_remove_component) from (soc_remove_dai_links+0x118/0x228)
> (soc_remove_dai_links) from (snd_soc_register_card+0x4e4/0xdd4)
> (snd_soc_register_card) from (devm_snd_soc_register_card+0x34/0x70)
> 
> Fix this by removing the doubled regmap free.

The correct fix is to use the non devm variant of regmap_init_ac97() in this
case. Device managed functions should only be used from inside a struct
device probe function.

- Lars

  parent reply	other threads:[~2016-02-21 16:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20 19:44 [PATCH v2] ASoC: wm9713: fix regmap free path Robert Jarzmik
2016-02-20 19:44 ` Robert Jarzmik
2016-02-20 20:01 ` Applied "ASoC: wm9713: fix regmap free path" to the asoc tree Mark Brown
2016-02-21 10:12 ` Lars-Peter Clausen [this message]
2016-02-21 10:12   ` [alsa-devel] [PATCH v2] ASoC: wm9713: fix regmap free path Lars-Peter Clausen
2016-02-22  2:53   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2016-02-22 22:35 Robert Jarzmik
2016-02-23 14:00 ` Charles Keepax
2016-02-23 14:00   ` Charles Keepax
2016-02-23 14:04   ` Lars-Peter Clausen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C98DA3.4000701@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=perex@perex.cz \
    --cc=robert.jarzmik@free.fr \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.