05 Nov, 2015

1 commit

  • Pull driver core updates from Greg KH:
    "Here's the "big" driver core updates for 4.4-rc1. Primarily a bunch
    of debugfs updates, with a smattering of minor driver core fixes and
    updates as well.

    All have been in linux-next for a long time"

    * tag 'driver-core-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    debugfs: Add debugfs_create_ulong()
    of: to support binding numa node to specified device in devicetree
    debugfs: Add read-only/write-only bool file ops
    debugfs: Add read-only/write-only size_t file ops
    debugfs: Add read-only/write-only x64 file ops
    debugfs: Consolidate file mode checks in debugfs_create_*()
    Revert "mm: Check if section present during memory block (un)registering"
    driver-core: platform: Provide helpers for multi-driver modules
    mm: Check if section present during memory block (un)registering
    devres: fix a for loop bounds check
    CMA: fix CONFIG_CMA_SIZE_MBYTES overflow in 64bit
    base/platform: assert that dev_pm_domain callbacks are called unconditionally
    sysfs: correctly handle short reads on PREALLOC attrs.
    base: soc: siplify ida usage
    kobject: move EXPORT_SYMBOL() macros next to corresponding definitions
    kobject: explain what kobject's sd field is
    debugfs: document that debugfs_remove*() accepts NULL and error values
    debugfs: Pass bool pointer to debugfs_create_bool()
    ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

    Linus Torvalds
     

13 Oct, 2015

3 commits

  • … 'regmap/topic/irq-hdr' into regmap-next

    Mark Brown
     
  • regmap: Allow buses to provide a custom update_bits() operation

    Some buses provide a native _update_bits() operation which for uncached
    registers is faster than doing a read/modify/write cycle as it is a
    single bus transaction. Add support for implementing this to regmap.

    # gpg: Signature made Tue 06 Oct 2015 16:21:47 BST using RSA key ID 5D5487D0
    # gpg: Oops: keyid_from_fingerprint: no pubkey
    # gpg: Oops: keyid_from_fingerprint: no pubkey
    # gpg: key 00000000 occurs more than once in the trustdb
    # gpg: key 16005C11: no public key for trusted key - skipped
    # gpg: key 16005C11 marked as ultimately trusted
    # gpg: Good signature from "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "

    Mark Brown
     
  • regmap: Support for split mask and unmask interrupt registers

    This branch adds an interface for supporting devices which have separate
    mask and unmask registers.

    # gpg: Signature made Thu 17 Sep 2015 11:52:20 BST using RSA key ID 5D5487D0
    # gpg: Oops: keyid_from_fingerprint: no pubkey
    # gpg: Oops: keyid_from_fingerprint: no pubkey
    # gpg: key 00000000 occurs more than once in the trustdb
    # gpg: key 16005C11: no public key for trusted key - skipped
    # gpg: key 16005C11 marked as ultimately trusted
    # gpg: Good signature from "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "
    # gpg: aka "Mark Brown "

    Mark Brown
     

06 Oct, 2015

1 commit

  • This commit allows installing a custom reg_update_bits function for cases where
    the hardware provides a mechanism to set or clear register bits without a
    read/modify/write cycle. Such is the case with the Microchip ENCX24J600.

    If a custom reg_update_bits function is provided, it will only be used against
    volatile registers.

    Signed-off-by: Jon Ringle
    Signed-off-by: Mark Brown

    Jon Ringle
     

04 Oct, 2015

1 commit

  • Its a bit odd that debugfs_create_bool() takes 'u32 *' as an argument,
    when all it needs is a boolean pointer.

    It would be better to update this API to make it accept 'bool *'
    instead, as that will make it more consistent and often more convenient.
    Over that bool takes just a byte.

    That required updates to all user sites as well, in the same commit
    updating the API. regmap core was also using
    debugfs_{read|write}_file_bool(), directly and variable types were
    updated for that to be bool as well.

    Signed-off-by: Viresh Kumar
    Acked-by: Mark Brown
    Acked-by: Charles Keepax
    Signed-off-by: Greg Kroah-Hartman

    Viresh Kumar
     

01 Oct, 2015

3 commits


19 Sep, 2015

3 commits


17 Sep, 2015

2 commits


15 Sep, 2015

1 commit


05 Sep, 2015

6 commits


31 Aug, 2015

2 commits

  • __regmap_init() may receive a NULL `struct regmap_bus *bus' pointer,
    for example, from snd_hdac_regmap_init(), and it make sure that it
    does not NULL deference `bus`, except around ->max_raw_read and
    ->max_raw_write initialisation. Add missing check.

    Signed-off-by: Sergey Senozhatsky
    Signed-off-by: Mark Brown

    Sergey SENOZHATSKY
     
  • When doing a bulk read from a device which lacks raw I/O support we fall
    back to doing register at a time reads but we still use the raw
    formatters in order to render the data into the word size used by the
    device (since bulk reads still operate on the device word size rather
    than unsigned ints). This means that devices without raw formatting
    such as those that provide reg_read() are not supported. Provide
    handling for them by copying the values read into native endian values
    of the appropriate size.

    Signed-off-by: Mark Brown

    Mark Brown
     

30 Aug, 2015

5 commits


22 Aug, 2015

3 commits

  • There is no multi_write support available if we cannot use raw_write.
    This is the case if bus->write is not implemented.

    This patch adds a condition that we need bus and bus->write so that
    can_multi_write is true.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Mark Brown

    Markus Pargmann
     
  • use_single_rw currently reflects the capabilities of the connected
    device. The capabilities of the bus are currently missing for this
    variable.

    As there are read only and write only buses we need seperate values for
    use_single_rw to also reflect tha capabilities of the bus.

    This patch splits use_single_rw into use_single_read and
    use_single_write. The initialization is changed to check the
    configuration for use_single_rw and to check the capabilities of the
    used bus.

    Signed-off-by: Markus Pargmann
    Signed-off-by: Mark Brown

    Markus Pargmann
     
  • The regmap config does not prohibit val_bytes that are not powers of
    two. But the current code of regmap_bulk_write for use_single_rw does
    limit the possible val_bytes to 1, 2 and 4.

    This patch fixes the behaviour to allow bus writes with non-standard
    val_bytes sizes.

    Cc: Stephen Boyd
    Signed-off-by: Markus Pargmann
    Signed-off-by: Mark Brown

    Markus Pargmann
     

21 Aug, 2015

1 commit


15 Aug, 2015

1 commit


12 Aug, 2015

3 commits


07 Aug, 2015

2 commits

  • Lockdep validator complains about recursive locking and deadlock
    when two different regmap instances are called in a nested order.
    That happens anytime a regmap read/write call needs to access
    another regmap.

    This is because, for performance reason, lockdep groups all locks
    initialized by the same mutex_init() in the same lock class.
    Therefore all regmap mutexes are in the same lock class, leading
    to lockdep "nested locking" warnings if a regmap accesses another
    regmap.

    In general, it is impossible to establish in advance the hierarchy
    of regmaps, so we make sure that each regmap init call initializes
    its own static lock_class_key. This is done by wrapping all
    regmap_init calls into macros.

    This also allows us to give meaningful names to the lock_class_key.
    For example, in rt5677 case, we have in /proc/lockdep_chains:
    irq_context: 0
    [ffffffc0018d2198] &dev->mutex
    [ffffffc0018d2198] &dev->mutex
    [ffffffc001bd7f60] rt5677:5104:(&rt5677_regmap)->_lock
    [ffffffc001bd7f58] rt5677:5096:(&rt5677_regmap_physical)->_lock
    [ffffffc001b95448] &(&base->lock)->rlock

    The above would have resulted in a lockdep recursive warning
    previously. This is not the case anymore as the lockdep validator
    now clearly identifies the 2 regmaps as separate.

    Signed-off-by: Nicolas Boichat
    Signed-off-by: Mark Brown

    Nicolas Boichat
     
  • IS_ENABLED should only be used for CONFIG_* symbols.

    I have done a small test:
    #define REGMAP_ALLOW_WRITE_DEBUGFS
    IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.

    #define REGMAP_ALLOW_WRITE_DEBUGFS 0
    IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.

    #define REGMAP_ALLOW_WRITE_DEBUGFS 1
    IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 1.

    #define REGMAP_ALLOW_WRITE_DEBUGFS 2
    IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.

    So fix the misuse of IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) and switch to
    use #if defined(REGMAP_ALLOW_WRITE_DEBUGFS) instead.

    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown

    Axel Lin
     

29 Jul, 2015

1 commit

  • When inserting a new register into a block, the present bit map size is
    increased using krealloc. krealloc does not clear the additionally
    allocated memory, leaving it filled with random values. Result is that
    some registers are considered cached even though this is not the case.

    Fix the problem by clearing the additionally allocated memory. Also, if
    the bitmap size does not increase, do not reallocate the bitmap at all
    to reduce overhead.

    Fixes: 3f4ff561bc88 ("regmap: rbtree: Make cache_present bitmap per node")
    Signed-off-by: Guenter Roeck
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Guenter Roeck
     

21 Jul, 2015

1 commit

  • Allow the user to write the cache_only and cache_bypass settings.
    This can be useful for debugging.

    Since this can lead to the hardware getting out-of-sync with the
    cache, at least for the period that the cache state is forced, the
    kernel is tainted and the action is recorded in the kernel log.

    When disabling cache_only through debugfs a cache sync will be performed.

    Signed-off-by: Richard Fitzgerald
    Signed-off-by: Mark Brown

    Richard Fitzgerald