linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: Jiada Wang <jiada_wang@mentor.com>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, tiwai@suse.de,
	Li.Xiubo@freescale.com, timur@tabi.org, perex@perex.cz,
	nicoleotsuka@gmail.com, broonie@kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()
Date: Mon, 1 Dec 2014 07:50:46 +0100	[thread overview]
Message-ID: <20141201065046.GB27289@pengutronix.de> (raw)
In-Reply-To: <1417402251-6596-1-git-send-email-jiada_wang@mentor.com>

[-- Attachment #1: Type: text/plain, Size: 4456 bytes --]

Hi,

On Mon, Dec 01, 2014 at 11:50:51AM +0900, Jiada Wang wrote:
> irq_dispose_mapping() in turns calls unregister_irq_proc(),
> which will remove irq proc entry, if IRQ is not freed
> before calling of irq_dispose_mapping(), then it will cause
> kernel warning.
> 
> By free IRQ before irq_dispose_mapping(), this patch fix
> the following kernel warning found when remove of fsl_ssi driver:
> 
> [   31.515336] ------------[ cut here ]------------
> [   31.520091] WARNING: CPU: 2 PID: 434 at fs/proc/generic.c:521 remove_proc_entry+0x14c/0x16c()
> [   31.528708] remove_proc_entry: removing non-empty directory 'irq/79', leaking at least '202c000.ss'
> [   31.537911] Modules linked in: snd_soc_wm8962 snd_soc_imx_wm8962 snd_soc_fsl_ssi(-) evbug
> [   31.546249] CPU: 2 PID: 434 Comm: rmmod Not tainted 3.18.0-rc6-00028-g3314bf6-dirty #1
> [   31.554235] Backtrace:
> [   31.556816] [<80011ea8>] (dump_backtrace) from [<80012044>] (show_stack+0x18/0x1c)
> [   31.564416]  r6:80142c88 r5:00000000 r4:00000000 r3:00000000
> [   31.570267] [<8001202c>] (show_stack) from [<806980ec>] (dump_stack+0x88/0xa4)
> [   31.577588] [<80698064>] (dump_stack) from [<80029d78>] (warn_slowpath_common+0x70/0x94)
> [   31.585711]  r5:00000009 r4:bb61fd90
> [   31.589423] [<80029d08>] (warn_slowpath_common) from [<80029e40>] (warn_slowpath_fmt+0x38/0x40)
> [   31.598187]  r8:bb61fdfe r7:be05d76d r6:be05d9a8 r5:00000002 r4:be05d700
> [   31.605054] [<80029e0c>] (warn_slowpath_fmt) from [<80142c88>] (remove_proc_entry+0x14c/0x16c)
> [   31.613709]  r3:806a79c0 r2:808229a0
> [   31.617371] [<80142b3c>] (remove_proc_entry) from [<80070380>] (unregister_irq_proc+0x94/0xb8)
> [   31.625989]  r10:00000000 r8:8000ede4 r7:80955f2c r6:0000004f r5:8118e738 r4:be00af00
> [   31.633952] [<800702ec>] (unregister_irq_proc) from [<80069dac>] (free_desc+0x2c/0x64)
> [   31.641898]  r6:0000004f r5:80955f38 r4:be00af00
> [   31.646604] [<80069d80>] (free_desc) from [<80069e68>] (irq_free_descs+0x4c/0x8c)
> [   31.654092]  r7:00000081 r6:00000001 r5:0000004f r4:00000001
> [   31.659863] [<80069e1c>] (irq_free_descs) from [<8006fc3c>] (irq_dispose_mapping+0x40/0x5c)
> [   31.668247]  r6:be17b844 r5:be17b800 r4:0000004f r3:802c5ec0
> [   31.673998] [<8006fbfc>] (irq_dispose_mapping) from [<7f004ea4>] (fsl_ssi_remove+0x58/0x70 [snd_so)
> [   31.683948]  r4:bb5bba10 r3:00000001
> [   31.687618] [<7f004e4c>] (fsl_ssi_remove [snd_soc_fsl_ssi]) from [<803720a0>] (platform_drv_remove)
> [   31.697564]  r5:7f0064f8 r4:be17b810
> [   31.701195] [<80372080>] (platform_drv_remove) from [<80370494>] (__device_release_driver+0x78/0xc)
> [   31.710361]  r5:7f0064f8 r4:be17b810
> [   31.713987] [<8037041c>] (__device_release_driver) from [<80370d20>] (driver_detach+0xbc/0xc0)
> [   31.722631]  r5:7f0064f8 r4:be17b810
> [   31.726259] [<80370c64>] (driver_detach) from [<80370304>] (bus_remove_driver+0x54/0x98)
> [   31.734382]  r6:00000800 r5:00000000 r4:7f0064f8 r3:bb67f500
> [   31.740149] [<803702b0>] (bus_remove_driver) from [<80371398>] (driver_unregister+0x30/0x50)
> [   31.748617]  r4:7f0064f8 r3:bd9f7080
> [   31.752245] [<80371368>] (driver_unregister) from [<80371f3c>] (platform_driver_unregister+0x14/0x)
> [   31.761498]  r4:7f00655c r3:7f005a70
> [   31.765130] [<80371f28>] (platform_driver_unregister) from [<7f005a84>] (fsl_ssi_driver_exit+0x14/)
> [   31.776147] [<7f005a70>] (fsl_ssi_driver_exit [snd_soc_fsl_ssi]) from [<8008ed80>] (SyS_delete_mod)
> [   31.786553] [<8008ec64>] (SyS_delete_module) from [<8000ec20>] (ret_fast_syscall+0x0/0x48)
> [   31.794824]  r6:00c46d18 r5:00000800 r4:00c46d18
> [   31.799530] ---[ end trace 954e8a3a15379e52 ]---
> 
> Moreover replace devm_request_irq() with request_irq() since there is
> no need to use it as now driver always frees IRQ manually.

devm_request_irq() is used by other drivers too, this should not be a
problem. Looking at the code it seems that irq_dispose_mapping may not
be necessary with devm_request_irq(). So I think it would be better to
remove irq_dispose_mapping() instead.

Best Regards,

Markus Pargmann

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-12-01  7:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01  2:50 [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping() Jiada Wang
2014-12-01  6:50 ` Markus Pargmann [this message]
2014-12-01 16:49   ` [alsa-devel] " Lars-Peter Clausen
2014-12-01 16:51     ` Timur Tabi
2014-12-01 16:59       ` Lars-Peter Clausen
2014-12-01 18:48     ` Timur Tabi
2014-12-01 19:39       ` Lars-Peter Clausen
2014-12-01 19:41         ` Mark Brown
2014-12-01 19:56           ` Arnd Bergmann
2014-12-01 19:59             ` Timur Tabi
2014-12-01 20:01               ` Arnd Bergmann
2014-12-01 20:11                 ` Timur Tabi
2014-12-01 20:30                   ` Lars-Peter Clausen
2014-12-01 20:40                     ` Fabio Estevam
2014-12-01 20:42                       ` Timur Tabi
2014-12-01 21:03                         ` Fabio Estevam
2014-12-01 20:16                 ` Mark Brown
2014-12-01 19:24     ` 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=20141201065046.GB27289@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=Li.Xiubo@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jiada_wang@mentor.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nicoleotsuka@gmail.com \
    --cc=perex@perex.cz \
    --cc=timur@tabi.org \
    --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;
as well as URLs for NNTP newsgroup(s).