Re: [alsa-devel] [PATCH] ASoC: fsl_ssi: free irq before irq_dispose_mapping()
From: Lars-Peter Clausen
Date: Mon Dec 01 2014 - 14:39:52 EST
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 irq_of_parse_and_map() and devm_request_irq() are incompatible.
They probably are. You have to create the mapping before you request the IRQ
and if devm_request_irq() is used the IRQ is only freed again after the
remove function of the driver been called. Yet if a driver creates a mapping
in its probe function it should also dispose it in its remove function. So
you are stuck with either freeing the mapping before freeing the IRQ or
leaking the mapping.
My opinion on this is that devices should not create mappings and should
leave that to the core. This quite easily solves the dilemma.
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().
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/