From: Lee Jones <lee.jones@linaro.org>
To: Martin Kaiser <martin@kaiser.cx>
Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mfd: fsl-imx25: clean up irq settings during removal
Date: Thu, 14 Sep 2017 10:25:51 +0100 [thread overview]
Message-ID: <20170914092551.shsyujrj4obtepjh@dell> (raw)
In-Reply-To: <1505205256-6828-2-git-send-email-martin@kaiser.cx>
On Tue, 12 Sep 2017, Martin Kaiser wrote:
> When fsl-imx25-tsadc is compiled as a module, unloading and reloading
> the module will lead to a crash.
>
> Add a removal function which clears the irq handler and removes the irq
> domain. With this cleanup in place, it's possible to unload and reload
> the module.
More information please.
What is it specifically that causes the crash?
Why is this code not required? What's stopping this causing a leak?
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> drivers/mfd/fsl-imx25-tsadc.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c
> index 14189ef..a6423bd 100644
> --- a/drivers/mfd/fsl-imx25-tsadc.c
> +++ b/drivers/mfd/fsl-imx25-tsadc.c
> @@ -179,6 +179,19 @@ static int mx25_tsadc_probe(struct platform_device *pdev)
> return devm_of_platform_populate(dev);
> }
>
> +static int __exit mx25_tsadc_remove(struct platform_device *pdev)
> +{
> + struct mx25_tsadc *tsadc = platform_get_drvdata(pdev);
> + int irq = platform_get_irq(pdev, 0);
> +
> + if (irq) {
> + irq_set_chained_handler_and_data(irq, NULL, NULL);
> + irq_domain_remove(tsadc->domain);
> + }
> +
> + return 0;
> +}
> +
> static const struct of_device_id mx25_tsadc_ids[] = {
> { .compatible = "fsl,imx25-tsadc" },
> { /* Sentinel */ }
> @@ -191,6 +204,7 @@ static struct platform_driver mx25_tsadc_driver = {
> .of_match_table = of_match_ptr(mx25_tsadc_ids),
> },
> .probe = mx25_tsadc_probe,
> + .remove = __exit_p(mx25_tsadc_remove),
> };
> module_platform_driver(mx25_tsadc_driver);
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2017-09-14 9:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 8:34 [PATCH 1/2] mfd: fsl-imx25: set irq handler and data in one go Martin Kaiser
2017-09-12 8:34 ` [PATCH 2/2] mfd: fsl-imx25: clean up irq settings during removal Martin Kaiser
2017-09-14 9:25 ` Lee Jones [this message]
2017-09-14 20:59 ` Martin Kaiser
2017-09-18 8:50 ` Lee Jones
2017-09-14 9:26 ` [PATCH 1/2] mfd: fsl-imx25: set irq handler and data in one go Lee Jones
2017-09-19 6:23 ` [PATCH v2 " Martin Kaiser
2017-09-19 6:23 ` [PATCH v2 2/2] mfd: fsl-imx25: clean up irq settings during removal Martin Kaiser
2017-09-19 8:23 ` Lucas Stach
2017-09-19 8:17 ` [PATCH v2 1/2] mfd: fsl-imx25: set irq handler and data in one go Lucas Stach
2017-09-19 12:38 ` [PATCH v3 " Martin Kaiser
2017-09-19 12:38 ` [PATCH v3 2/2] mfd: fsl-imx25: clean up irq settings during removal Martin Kaiser
2017-09-19 12:41 ` Lucas Stach
2017-10-17 20:53 ` [PATCH RESEND " Martin Kaiser
2017-10-23 15:42 ` Lee Jones
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=20170914092551.shsyujrj4obtepjh@dell \
--to=lee.jones@linaro.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=martin@kaiser.cx \
/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®