mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
regmap: fix deadlock on _regmap_raw_write() error path
Commit 815806e39b
("regmap: drop cache if the bus transfer error")
added a call to regcache_drop_region() to error path in
_regmap_raw_write(). However that path runs with regmap lock taken,
and regcache_drop_region() tries to re-take it, causing a deadlock.
Fix that by calling map->cache_ops->drop() directly.
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
815806e39b
commit
f0aa1ce625
1 changed files with 5 additions and 1 deletions
|
@ -1475,7 +1475,11 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
|
|||
|
||||
kfree(buf);
|
||||
} else if (ret != 0 && !map->cache_bypass && map->format.parse_val) {
|
||||
regcache_drop_region(map, reg, reg + 1);
|
||||
/* regcache_drop_region() takes lock that we already have,
|
||||
* thus call map->cache_ops->drop() directly
|
||||
*/
|
||||
if (map->cache_ops && map->cache_ops->drop)
|
||||
map->cache_ops->drop(map, reg, reg + 1);
|
||||
}
|
||||
|
||||
trace_regmap_hw_write_done(map, reg, val_len / map->format.val_bytes);
|
||||
|
|
Loading…
Reference in a new issue