mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Koro Chen <koro.chen@mediatek.com>
To: Mark Brown <broonie@kernel.org>
Cc: <perex@perex.cz>, <tiwai@suse.de>, <lgirdwood@gmail.com>,
	<srv_heupstream@mediatek.com>, <linux-kernel@vger.kernel.org>,
	<alsa-devel@alsa-project.org>, <bardliao@realtek.com>,
	<oder_chiou@realtek.com>
Subject: Re: [PATCH 1/2] ASoC: rt5645: Fix missing free_irq
Date: Thu, 9 Jul 2015 09:48:13 +0800	[thread overview]
Message-ID: <1436406493.15417.4.camel@mtksdaap41> (raw)
In-Reply-To: <20150708111437.GQ11162@sirena.org.uk>

On Wed, 2015-07-08 at 12:14 +0100, Mark Brown wrote:
> On Wed, Jul 08, 2015 at 04:25:50PM +0800, Koro Chen wrote:
> 
> > The driver does not free irq if snd_soc_register_codec fails.
> > It does not return error when request irq failed, either.
> > Fix this by using devm_request_threaded_irq(), and returns when error.
> 
> Unfortunately this isn't safe...
> 
> > -	if (i2c->irq)
> > -		free_irq(i2c->irq, rt5645);
> > -
> >  	cancel_delayed_work_sync(&rt5645->jack_detect_work);
> 
> This work item is queued up by the interrupt handler so we need to
> unregister the interrupt before we cancel any pending work otherwise
> it's possible that the interrupt may fire after we cancelled the work.
Thank you for seeing this, I didn't notice the delayed work.
Do you think I should use devm_request_threaded_irq(), and change
free_irq to devm_free_irq in remove? Or I should keep the original
request_thread_irq(), and just add a free_irq() during probe failed?
 



  reply	other threads:[~2015-07-09  1:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08  8:25 Koro Chen
2015-07-08  8:25 ` [PATCH 2/2] ASoC: rt5645: Add regulator support Koro Chen
2015-07-08 11:14 ` [PATCH 1/2] ASoC: rt5645: Fix missing free_irq Mark Brown
2015-07-09  1:48   ` Koro Chen [this message]
2015-07-09 11:10     ` Mark Brown
2015-07-10 14:43       ` Koro Chen
2015-07-13 15:00         ` Mark Brown

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=1436406493.15417.4.camel@mtksdaap41 \
    --to=koro.chen@mediatek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=srv_heupstream@mediatek.com \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®