Files
i2som-imx-linux/kernel
Simon Guinot 5215afa128 kernel/resource.c: fix muxed resource handling in __request_region()
commit 59ceeaaf35 upstream.

In __request_region, if a conflict with a BUSY and MUXED resource is
detected, then the caller goes to sleep and waits for the resource to be
released.  A pointer on the conflicting resource is kept.  At wake-up
this pointer is used as a parent to retry to request the region.

A first problem is that this pointer might well be invalid (if for
example the conflicting resource have already been freed).  Another
problem is that the next call to __request_region() fails to detect a
remaining conflict.  The previously conflicting resource is passed as a
parameter and __request_region() will look for a conflict among the
children of this resource and not at the resource itself.  It is likely
to succeed anyway, even if there is still a conflict.

Instead, the parent of the conflicting resource should be passed to
__request_region().

As a fix, this patch doesn't update the parent resource pointer in the
case we have to wait for a muxed region right after.

Reported-and-tested-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Tested-by: Vincent Donnefort <vdonnefort@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2016-04-01 01:54:34 +01:00
..
2016-01-22 21:40:09 +00:00
2014-12-14 16:23:56 +00:00
2014-11-05 20:27:46 +00:00
2013-01-03 03:33:08 +00:00
2012-07-12 04:31:59 +01:00
2014-07-11 13:33:51 +01:00
2014-06-09 13:29:04 +01:00