regmap: Fixes for v4.0

A few things here:
 
  - A change from Lars to fix insertion of cache values at the start of
    rather than end of a rbtree block.  This hadn't been noticed before
    since almost everything lists registers in ascending order.
  - A fix from Takashi for spurious warnings during cache sync with read
    once registers, a problem which can be very noticeable on devices
    that it affects.
  - A fix from Valentin for a tighening of the oneshot IRQ request
    interface which would have broken affected devices.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVCAncAAoJECTWi3JdVIfQ3UwH/R94Youeta69sJvSpao38Luo
 jSj6A+zA2x2azwOTNdZ8F4vdqetoabvt8enXR0zxQnx86JP3zYFoEZcos7Bn4HRX
 E85Fn8RNLHVP0NmUdZefvSztG5A0Glf9FxEqoSfGb6r0FztYnjJ3fCEoDO8NYE8S
 xkeFvznLyPGeU39BMXuqROEUN4BNVeQ6ijIQBsP9tIpgIQA9lIzW4vSqTXvGiwLU
 UrPTYpPpVukKGwYD6UB8GQ14M3KDAmzvSTiCO7hal1NUdgtOWqObR2YALhMWBV6z
 bygbobrVGaaxmdb3maEol3h9tCxY6G+5Pcwhl0JDZdVd2McXa2oMMxQ/r1kgcxY=
 =t8iv
 -----END PGP SIGNATURE-----

Merge tag 'regmap-v4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap

Pull regmap fixes from Mark Brown:
 "A few things here:

   - a change from Lars to fix insertion of cache values at the start of
     rather than end of a rbtree block.  This hadn't been noticed before
     since almost everything lists registers in ascending order.

   - a fix from Takashi for spurious warnings during cache sync with
     read once registers, a problem which can be very noticeable on
     devices that it affects.

   - a fix from Valentin for a tighening of the oneshot IRQ request
     interface which would have broken affected devices"

* tag 'regmap-v4.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: regcache-rbtree: Fix present bitmap resize
  regmap: Skip read-only registers in regcache_sync()
  regmap-irq: set IRQF_ONESHOT flag to ensure IRQ request
This commit is contained in:
Linus Torvalds 2015-03-17 10:41:26 -07:00
commit 529d2eb679
3 changed files with 7 additions and 4 deletions

View File

@ -307,7 +307,7 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
if (pos == 0) { if (pos == 0) {
memmove(blk + offset * map->cache_word_size, memmove(blk + offset * map->cache_word_size,
blk, rbnode->blklen * map->cache_word_size); blk, rbnode->blklen * map->cache_word_size);
bitmap_shift_right(present, present, offset, blklen); bitmap_shift_left(present, present, offset, blklen);
} }
/* update the rbnode block, its size and the base register */ /* update the rbnode block, its size and the base register */

View File

@ -608,7 +608,8 @@ static int regcache_sync_block_single(struct regmap *map, void *block,
for (i = start; i < end; i++) { for (i = start; i < end; i++) {
regtmp = block_base + (i * map->reg_stride); regtmp = block_base + (i * map->reg_stride);
if (!regcache_reg_present(cache_present, i)) if (!regcache_reg_present(cache_present, i) ||
!regmap_writeable(map, regtmp))
continue; continue;
val = regcache_get_val(map, block, i); val = regcache_get_val(map, block, i);
@ -677,7 +678,8 @@ static int regcache_sync_block_raw(struct regmap *map, void *block,
for (i = start; i < end; i++) { for (i = start; i < end; i++) {
regtmp = block_base + (i * map->reg_stride); regtmp = block_base + (i * map->reg_stride);
if (!regcache_reg_present(cache_present, i)) { if (!regcache_reg_present(cache_present, i) ||
!regmap_writeable(map, regtmp)) {
ret = regcache_sync_block_raw_flush(map, &data, ret = regcache_sync_block_raw_flush(map, &data,
base, regtmp); base, regtmp);
if (ret != 0) if (ret != 0)

View File

@ -499,7 +499,8 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
goto err_alloc; goto err_alloc;
} }
ret = request_threaded_irq(irq, NULL, regmap_irq_thread, irq_flags, ret = request_threaded_irq(irq, NULL, regmap_irq_thread,
irq_flags | IRQF_ONESHOT,
chip->name, d); chip->name, d);
if (ret != 0) { if (ret != 0) {
dev_err(map->dev, "Failed to request IRQ %d for %s: %d\n", dev_err(map->dev, "Failed to request IRQ %d for %s: %d\n",