Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Timur Tabi
On 12/01/2014 10:49 AM, Lars-Peter Clausen wrote: The driver creates the mapping by calling irq_of_parse_and_map(), so it also has to dispose the mapping. But the easy way out is to simply use platform_get_irq() instead of irq_of_parse_map(). In this case the mapping is not managed by the

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Lars-Peter Clausen
On 12/01/2014 05:51 PM, Timur Tabi wrote: On 12/01/2014 10:49 AM, Lars-Peter Clausen wrote: The driver creates the mapping by calling irq_of_parse_and_map(), so it also has to dispose the mapping. But the easy way out is to simply use platform_get_irq() instead of irq_of_parse_map(). In this

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Lars-Peter Clausen
On 12/01/2014 07:50 AM, Markus Pargmann wrote: [...] 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()

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Timur Tabi
On 12/01/2014 10:49 AM, Lars-Peter Clausen wrote: The driver creates the mapping by calling irq_of_parse_and_map(), so it also has to dispose the mapping. I agree with Markus, this does seem weird. It sounds like you're saying that irq_of_parse_and_map() and devm_request_irq() are

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Mark Brown
On Mon, Dec 01, 2014 at 05:49:56PM +0100, Lars-Peter Clausen wrote: On 12/01/2014 07:50 AM, Markus Pargmann wrote: 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().

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Lars-Peter Clausen
On 12/01/2014 07:48 PM, Timur Tabi wrote: On 12/01/2014 10:49 AM, Lars-Peter Clausen wrote: The driver creates the mapping by calling irq_of_parse_and_map(), so it also has to dispose the mapping. I agree with Markus, this does seem weird. It sounds like you're saying that

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Mark Brown
On Mon, Dec 01, 2014 at 08:39:51PM +0100, Lars-Peter Clausen wrote: On 12/01/2014 07:48 PM, Timur Tabi wrote: A quick grep shows the following drivers that call both functions: Most of these drivers will probably work fine without irq_of_parse_and_map(). I'd also note that quite a few of

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Arnd Bergmann
On Monday 01 December 2014 19:41:47 Mark Brown wrote: On Mon, Dec 01, 2014 at 08:39:51PM +0100, Lars-Peter Clausen wrote: On 12/01/2014 07:48 PM, Timur Tabi wrote: A quick grep shows the following drivers that call both functions: Most of these drivers will probably work fine without

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Timur Tabi
On 12/01/2014 01:56 PM, Arnd Bergmann wrote: All other drivers that call irq_of_parse_and_map and pass that into devm_request_irq just never unmap, and their interrupts are already mapped by the platform code, so I think it's not even a leak. Does this mean that fsl_ssi.c should not be calling

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Arnd Bergmann
On Monday 01 December 2014 13:59:27 Timur Tabi wrote: On 12/01/2014 01:56 PM, Arnd Bergmann wrote: All other drivers that call irq_of_parse_and_map and pass that into devm_request_irq just never unmap, and their interrupts are already mapped by the platform code, so I think it's not even a

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Timur Tabi
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

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Mark Brown
On Mon, Dec 01, 2014 at 09:01:43PM +0100, Arnd Bergmann wrote: On Monday 01 December 2014 13:59:27 Timur Tabi wrote: On 12/01/2014 01:56 PM, Arnd Bergmann wrote: All other drivers that call irq_of_parse_and_map and pass that into devm_request_irq just never unmap, and their interrupts

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Lars-Peter Clausen
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

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Fabio Estevam
On Mon, Dec 1, 2014 at 6:30 PM, Lars-Peter Clausen l...@metafoo.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()

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Timur Tabi
On 12/01/2014 02:40 PM, Fabio Estevam wrote: 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:

Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()

2014-12-01 Thread Fabio Estevam
On Mon, Dec 1, 2014 at 6:42 PM, Timur Tabi ti...@tabi.org wrote: Would the mapping continue to exist after the driver is unloaded? Can you try multiple loads/unloads and see if interrupts still work? I tried multiple loads/unloads and audio works fine with those changes. About the ssi irq we