lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5B7MxLSaETUW0QyajdHMMX2nLg=t=5dVCNRePb6UzizRQ@mail.gmail.com>
Date:	Mon, 1 Dec 2014 18:40:51 -0200
From:	Fabio Estevam <festevam@...il.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	Timur Tabi <timur@...i.org>, Arnd Bergmann <arnd@...db.de>,
	"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
	Jiada Wang <jiada_wang@...tor.com>,
	Xiubo Li <Li.Xiubo@...escale.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Nicolin Chen <nicoleotsuka@...il.com>,
	Takashi Iwai <tiwai@...e.de>, Mark Brown <broonie@...nel.org>,
	Markus Pargmann <mpa@...gutronix.de>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

On Mon, Dec 1, 2014 at 6:30 PM, Lars-Peter Clausen <lars@...afoo.de> wrote:
> On 12/01/2014 09:11 PM, Timur Tabi wrote:
>>
>> On 12/01/2014 02:01 PM, Arnd Bergmann wrote:
>>>>
>>>> >Does this mean that fsl_ssi.c should not be calling
>>>> >irq_of_parse_and_map?  How else should it get the IRQ?
>>>
>>> platform_get_irq()
>>
>>
>> Ok, but that function also calls irq_create_of_mapping().  So it still
>> appears that the only way to get the IRQ is to map it, but then we can't
>> use
>> devm_request_irq().
>>
>
> Hm... that's new. But it's not really a driver issue anymore if it is done
> in the core. So I guess for now just use platform_get_irq() and ignore the
> other issue.

With the suggested changes below, the removal of the driver works fine on a mx6:

root@...escale /$ modprobe   snd-soc-fsl-ssi
root@...escale /$ modprobe snd-soc-imx-wm8962
[  319.517679] input: WM8962 Beep Generator as
/devices/soc0/soc/2100000.aips-bus/21a0000.i2c/i2c-0/0-001a/input/input7
[  319.543225] imx-wm8962 sound: wm8962 <-> 202c000.ssi mapping ok
root@...escale /$ rmmod  snd-soc-imx-wm8962
root@...escale /$ rmmod   snd-soc-fsl-ssi

 sound/soc/fsl/fsl_ssi.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 32a31d9..c528f16 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1361,7 +1361,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
         return PTR_ERR(ssi_private->regs);
     }

-    ssi_private->irq = irq_of_parse_and_map(np, 0);
+    ssi_private->irq = platform_get_irq(pdev, 0);
     if (!ssi_private->irq) {
         dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
         return -ENXIO;
@@ -1387,7 +1387,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
     if (ssi_private->soc->imx) {
         ret = fsl_ssi_imx_probe(pdev, ssi_private, iomem);
         if (ret)
-            goto error_irqmap;
+            return ret;
     }

     ret = snd_soc_register_component(&pdev->dev, &fsl_ssi_component,
@@ -1458,10 +1458,6 @@ error_asoc_register:
     if (ssi_private->soc->imx)
         fsl_ssi_imx_clean(pdev, ssi_private);

-error_irqmap:
-    if (ssi_private->use_dma)
-        irq_dispose_mapping(ssi_private->irq);
-
     return ret;
 }

@@ -1478,9 +1474,6 @@ static int fsl_ssi_remove(struct platform_device *pdev)
     if (ssi_private->soc->imx)
         fsl_ssi_imx_clean(pdev, ssi_private);

-    if (ssi_private->use_dma)
-        irq_dispose_mapping(ssi_private->irq);
-
     return 0;
 }

-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ