diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-23 11:50:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-09-23 11:50:49 -0700 |
commit | 78bbf153fa96e5e40234b7b05567602535645460 (patch) | |
tree | 8a5ddbd676128035182e08555d81152bf0cffb6f /drivers | |
parent | 2ddfdd428906749e45a6b765712d1c68e5daa723 (diff) | |
parent | f0aa1ce6259eb65f53f969b3250c1d0aac84f30b (diff) | |
download | lwn-78bbf153fa96e5e40234b7b05567602535645460.tar.gz lwn-78bbf153fa96e5e40234b7b05567602535645460.zip |
Merge tag 'regmap-fix-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Pull regmap fix from Mark Brown:
"A fix for an issue with double locking that was introduced earlier
this release. I'd missed in review that we were already in a locked
region when trying to drop part of the cache"
* tag 'regmap-fix-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
regmap: fix deadlock on _regmap_raw_write() error path
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/regmap/regmap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 25d26bb18970..e964d068874d 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -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); |