Commit cdcb5d19 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'regmap-fix-v6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fix from Mark Brown:
 "A fix for a long standing issue where when we create a new node in an
  rbtree register cache we were failing to convert the register address
  of the new register into a bitmask correctly and marking the wrong
  register as being present in the newly created node.

  This would only have affected devices with a register stride other
  than 1 but would corrupt data on those devices"

* tag 'regmap-fix-v6.6-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: rbtree: Fix wrong register marked as in-cache when creating new node
parents 5e62ed3b 7a795ac8
...@@ -453,7 +453,8 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg, ...@@ -453,7 +453,8 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,
if (!rbnode) if (!rbnode)
return -ENOMEM; return -ENOMEM;
regcache_rbtree_set_register(map, rbnode, regcache_rbtree_set_register(map, rbnode,
reg - rbnode->base_reg, value); (reg - rbnode->base_reg) / map->reg_stride,
value);
regcache_rbtree_insert(map, &rbtree_ctx->root, rbnode); regcache_rbtree_insert(map, &rbtree_ctx->root, rbnode);
rbtree_ctx->cached_rbnode = rbnode; rbtree_ctx->cached_rbnode = rbnode;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment