13 May, 2016

1 commit


01 Apr, 2016

1 commit


30 Mar, 2016

1 commit

  • Since we changed to do formatting in the bus we now skip all the format
    parsing that the core does for its data marshalling code. This means
    that we skip the DT parsing it does which breaks some systems, we need
    to add an explict call in the MMIO code to do this.

    Reported-by: Alexander Stein
    Tested-by: Alexander Stein
    Signed-off-by: Mark Brown

    Mark Brown
     

23 Mar, 2016

1 commit


28 Jan, 2016

1 commit

  • Currently regmap-mmio uses the __raw accessors to read and write from
    memory. This is not safe as these interact poorly with spinlocks and
    are not guaranteed to generate emulated instructions on at least ARM
    where regmap is commonly used. The APIs that are provided all provide
    some byte swapping so this is difficult to do with the current
    regmap-mmio implementation which attempts to use the regmap core byte
    swapping.

    We can fix this by modernising the MMIO implementation to use
    reg_read() and reg_write() operations which were added after the API was
    implemented and pass simple unsigned integers through to the bus, making
    use of the formatting provided by the I/O accessors using a similar
    pattern to that used by the core. This will be less efficient for block
    I/O operations since we now enable and disable any required clocks per
    register but it is not clear that any users of regmap-mmio actually use
    block I/O and there is room to optimise later.

    This removes support for big endian I/O on 64 bit registers since no I/O
    accessors are provided, no current users were found and support can be
    added easily once they are available.

    In addition make the default endianness little endian. This was the
    behaviour prior to 29bb45f25ff305 (regmap-mmio: Use native endianness
    for read/write) and is the behaviour desired by most existing users, the
    users have been audited and those that need native endianness converted
    to request it explicitly. Previously native was documented as the
    default but due to the byte swapping in the accessors this was not
    correctly implemented.

    Fixes: 29bb45f25ff305 (regmap-mmio: Use native endianness for read/write)
    Reported-by: Johannes Berg
    Tested-by: Johannes Berg
    Signed-off-by: Mark Brown

    Mark Brown
     

09 Dec, 2015

2 commits


16 Nov, 2015

1 commit

  • The regmap API has an endianness setting for formatting reads and writes.
    This can be set by the usual DT "little-endian" and "big-endian" properties.
    To work properly the associated regmap_bus needs to read/write in native
    endian.

    The "syscon" DT device binding creates an mmio-based regmap_bus which
    performs all reads/writes as little-endian. These values are then converted
    again by regmap, which means that all of the MIPS BCM boards (which are
    big-endian) have been declared as "little-endian" to get regmap to convert
    them back to big-endian.

    Modify regmap-mmio to use the native-endian functions __raw_read*() and
    __raw_write*() instead of the little-endian functions read*() and
    write*().

    Modify the big-endian MIPS BCM boards to use what will now be the correct
    endianness instead of pretending that the devices are little-endian.

    Signed-off-by: Simon Arlott
    Signed-off-by: Mark Brown

    Simon Arlott
     

12 Aug, 2015

1 commit

  • Init functions defined in regmap*.c files are now prefixed with
    __, take lockdep key and class parameters, and should not be
    called directly: move the documentation to regmap.h, where the
    macros are defined.

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

    Nicolas Boichat
     

07 Aug, 2015

1 commit

  • 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
     

03 Jun, 2014

1 commit


26 May, 2014

1 commit

  • Commit 932580409a9dacbf42215fa737bf06ae2c0aa624
    "regmap: mmio: Add support for 1/2/8 bytes wide register address."
    broke regmap_mmio_write for uneven counts, for example 32-bit register
    addresses with no padding and 8-byte values (count = 5).
    Fix this by allowing all counts large enough to include some value.
    This check was BUG_ON(count < 4) before the last change.

    Signed-off-by: Philipp Zabel
    Signed-off-by: Mark Brown

    Philipp Zabel
     

14 Apr, 2014

1 commit

  • 'offset = *(u32 *)reg;'
    This will be okey for 32/64-bits register device, but for 8/16-bits
    register ones, the 'offset' value will overflow, for example:

    The IMX2 Watchdog, whose registers and values are all 16-bits:

    If the IO base virtual address is ctx->regs = 0x888c0000, and the now
    doing the 0x00 register accessing:
    Using 'offset = *(u32 *)reg' the offset value will possiblly be 0x77310000,
    Using 'offset = *(u16 *)reg' the offset value will be 0x0000.

    In the regmap_mmio_gather_write(), ctx->regs + 0x7731000 will be 0xffbd0000,
    but actually it should be ctx->regs + 0x0000 = 0x888c0000.

    Signed-off-by: Xiubo Li
    Signed-off-by: Mark Brown

    Xiubo Li
     

02 Apr, 2014

1 commit

  • Pull driver core and sysfs updates from Greg KH:
    "Here's the big driver core / sysfs update for 3.15-rc1.

    Lots of kernfs updates to make it useful for other subsystems, and a
    few other tiny driver core patches.

    All have been in linux-next for a while"

    * tag 'driver-core-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (42 commits)
    Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()"
    kernfs: cache atomic_write_len in kernfs_open_file
    numa: fix NULL pointer access and memory leak in unregister_one_node()
    Revert "driver core: synchronize device shutdown"
    kernfs: fix off by one error.
    kernfs: remove duplicate dir.c at the top dir
    x86: align x86 arch with generic CPU modalias handling
    cpu: add generic support for CPU feature based module autoloading
    sysfs: create bin_attributes under the requested group
    driver core: unexport static function create_syslog_header
    firmware: use power efficient workqueue for unloading and aborting fw load
    firmware: give a protection when map page failed
    firmware: google memconsole driver fixes
    firmware: fix google/gsmi duplicate efivars_sysfs_init()
    drivers/base: delete non-required instances of include
    kernfs: fix kernfs_node_from_dentry()
    ACPI / platform: drop redundant ACPI_HANDLE check
    kernfs: fix hash calculation in kernfs_rename_ns()
    kernfs: add CONFIG_KERNFS
    sysfs, kobject: add sysfs wrapper for kernfs_enable_ns()
    ...

    Linus Torvalds
     

28 Mar, 2014

1 commit


27 Mar, 2014

2 commits


15 Feb, 2014

1 commit

  • None of these files are actually using any __init type directives
    and hence don't need to include . Most are just a
    left over from __devinit and __cpuinit removal, or simply due to
    code getting copied from one driver to the next.

    Cc: Len Brown
    Signed-off-by: Paul Gortmaker
    Acked-by: Pavel Machek
    Acked-by: Rafael J. Wysocki
    Acked-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Paul Gortmaker
     

26 Nov, 2013

1 commit


15 Feb, 2013

1 commit

  • Some mmio devices have a dedicated interface clock that needs
    to be enabled to access their registers. This patch optionally
    enables a clock before accessing registers in the regmap_bus
    callbacks.

    I added (devm_)regmap_init_mmio_clk variants of the init
    functions that have an added clk_id string parameter. This
    is passed to clk_get to request the clock from the clk
    framework.

    Signed-off-by: Philipp Zabel
    Signed-off-by: Mark Brown

    Philipp Zabel
     

19 Jul, 2012

1 commit


14 Jun, 2012

1 commit


03 Jun, 2012

1 commit


10 Apr, 2012

1 commit

  • regmap_config.reg_stride is introduced. All extant register addresses
    are a multiple of this value. Users of serial-oriented regmap busses will
    typically set this to 1. Users of the MMIO regmap bus will typically set
    this based on the value size of their registers, in bytes, so 4 for a
    32-bit register.

    Throughout the regmap code, actual register addresses are used. Wherever
    the register address is used to index some array of values, the address
    is divided by the stride to determine the index, or vice-versa. Error-
    checking is added to all entry-points for register address data to ensure
    that register addresses actually satisfy the specified stride. The MMIO
    bus ensures that the specified stride is large enough for the register
    size.

    Signed-off-by: Stephen Warren
    Signed-off-by: Mark Brown

    Stephen Warren
     

07 Apr, 2012

2 commits


06 Apr, 2012

1 commit

  • This is a basic memory-mapped-IO bus for regmap. It has the following
    features and limitations:

    * Registers themselves may be 8, 16, 32, or 64-bit. 64-bit is only
    supported on 64-bit platforms.
    * Register offsets are limited to precisely 32-bit.
    * IO is performed using readl/writel, with no provision for using the
    __raw_readl or readl_relaxed variants.

    Signed-off-by: Stephen Warren
    Signed-off-by: Mark Brown

    Stephen Warren