Skip to content

Commit

Permalink
Merge tag 'regmap-fix-v4.8-rc7' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Sep 23, 2016
2 parents 2ddfdd4 + f0aa1ce commit 78bbf15
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/base/regmap/regmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 78bbf15

Please sign in to comment.