09 Jul, 2016

1 commit

  • Linux 4.7-rc6

    * tag 'v4.7-rc6': (1245 commits)
    Linux 4.7-rc6
    ovl: warn instead of error if d_type is not supported
    MIPS: Fix possible corruption of cache mode by mprotect.
    locks: use file_inode()
    usb: dwc3: st: Use explicit reset_control_get_exclusive() API
    phy: phy-stih407-usb: Use explicit reset_control_get_exclusive() API
    phy: miphy28lp: Inform the reset framework that our reset line may be shared
    namespace: update event counter when umounting a deleted dentry
    9p: use file_dentry()
    lockd: unregister notifier blocks if the service fails to come up completely
    ACPI,PCI,IRQ: correct operator precedence
    fuse: serialize dirops by default
    drm/i915: Fix missing unlock on error in i915_ppgtt_info()
    powerpc: Initialise pci_io_base as early as possible
    mfd: da9053: Fix compiler warning message for uninitialised variable
    mfd: max77620: Fix FPS switch statements
    phy: phy-stih407-usb: Inform the reset framework that our reset line may be shared
    usb: dwc3: st: Inform the reset framework that our reset line may be shared
    usb: host: ehci-st: Inform the reset framework that our reset line may be shared
    usb: host: ohci-st: Inform the reset framework that our reset line may be shared
    ...

    Mauro Carvalho Chehab
     

09 Jun, 2016

1 commit

  • Change return value back to -ENODEV when no region is defined for given
    device. This restores old behavior of this function, as some drivers rely
    on such error code.

    Fixes: 59ce4039727ef40 ("of: reserved_mem: add support for using more than
    one region for given device")

    Reported-by: Liviu Dudau
    Signed-off-by: Marek Szyprowski
    Reviewed-by: Sylwester Nawrocki
    Reviewed-by: Liviu Dudau
    Acked-by: Rob Herring
    Reviewed-by: Sumit Semwal

    Marek Szyprowski
     

03 Jun, 2016

3 commits

  • pageblock_order can be (at least) an unsigned int or an unsigned long
    depending on the kernel config and architecture, so use max_t(unsigned
    long ...) when comparing it.

    fixes these warnings:

    In file included from include/linux/list.h:8:0,
    from include/linux/kobject.h:20,
    from include/linux/of.h:21,
    from drivers/of/of_reserved_mem.c:17:
    drivers/of/of_reserved_mem.c: In function ‘__reserved_mem_alloc_size’:
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
    (void) (&_max1 == &_max2); \
    ^
    include/linux/kernel.h:747:9: note: in definition of macro ‘max’
    typeof(y) _max2 = (y); \
    ^
    drivers/of/of_reserved_mem.c:131:48: note: in expansion of macro ‘max’
    align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_ord
    ^
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
    (void) (&_max1 == &_max2); \
    ^
    include/linux/kernel.h:747:21: note: in definition of macro ‘max’
    typeof(y) _max2 = (y); \
    ^
    drivers/of/of_reserved_mem.c:131:48: note: in expansion of macro ‘max’
    align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_ord
    ^

    Fixes: 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup")
    Signed-off-by: Stephen Rothwell
    Signed-off-by: Rob Herring

    Stephen Rothwell
     
  • There was an alignment mismatch issue for CMA and it was fixed by
    commit 1cc8e3458b51 ("drivers: of: of_reserved_mem: fixup the alignment with CMA setup").
    However the way of the commit considers not only dma-contiguous(CMA) but also
    dma-coherent which has no that requirement.

    This patch checks more to distinguish dma-contiguous(CMA) from dma-coherent.

    Signed-off-by: Jaewon Kim
    Acked-by: Jason Liu
    Acked-by: Marek Szyprowski
    [robh: remove erroneous opening bracket]
    Signed-off-by: Rob Herring

    Jaewon
     
  • This patch allows device drivers to initialize more than one reserved
    memory region assigned to given device. When driver needs to use more
    than one reserved memory region, it should allocate child devices and
    initialize regions by index for each of its child devices.

    Signed-off-by: Marek Szyprowski
    Acked-by: Rob Herring
    Signed-off-by: Sylwester Nawrocki

    Marek Szyprowski
     

04 Mar, 2016

1 commit

  • early_init_dt_alloc_reserved_memory_arch passes end as 0 to
    __memblock_alloc_base, when limits are not specified. But
    __memblock_alloc_base takes end value of 0 as MEMBLOCK_ALLOC_ACCESSIBLE
    and limits the end to memblock.current_limit. This results in regions
    never being placed in HIGHMEM area, for e.g. CMA.
    Let __memblock_alloc_base allocate from anywhere in memory if limits are
    not specified.

    Acked-by: Marek Szyprowski
    Signed-off-by: Vinayak Menon
    Cc: stable@vger.kernel.org
    Signed-off-by: Rob Herring

    Vinayak Menon
     

01 Dec, 2015

1 commit

  • In order to check for overlapping reserved memory regions, we first need
    to sort the array of memory regions. This is implemented using sort(),
    and a custom comparison function __rmem_cmp().

    Unfortunatley __rmem_cmp() doesn't work in all cases. Because the two
    base values are phys_addr_t, they may be u64 on some platforms, in which
    case subtracting one from the other and then (implicitly) casting to int
    does not give us the -ve/0/+ve value we need.

    This leads to incorrect reports about overlaps, eg:

    ibm,slw-image@1ffe600000 (0x0000001ffe600000--0x0000001ffe700000) overlaps with
    ibm,firmware-allocs-memory@1000000000 (0x0000001000000000--0x0000001000dc0200)

    Fix it by just doing the standard double if and return 0 logic.

    Fixes: ae1add247bf8 ("of: Check for overlap in reserved memory regions")
    Signed-off-by: Michael Ellerman
    Signed-off-by: Rob Herring

    Michael Ellerman
     

11 Nov, 2015

2 commits

  • There is an alignment mismatch issue between the of_reserved_mem and
    the CMA setup requirement. The of_reserved_mem will try to get the
    alignment value from the DTS and pass it to __memblock_alloc_base to
    do the memory block base allocation, but the alignment value specified
    in the DTS may not satisfy the CAM setup requirement since CMA setup
    required the alignment as the following in the code:

    align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);

    The sanity check in the function of rmem_cma_setup will fail if the
    alignment does not setup correctly and thus CMA will fail to setup.

    This patch is to fixup the alignment to meet the CMA setup required.

    Mailing-list-thread: https://lkml.org/lkml/2015/11/9/138
    Signed-off-by: Jason Liu
    Acked-by: Marek Szyprowski
    Cc: Grant Likely
    Cc: Rob Herring
    Cc: stable@vger.kernel.org
    Signed-off-by: Rob Herring

    Jason Liu
     
  • __rmem_check_for_overlap() is called very early in boot, and on some
    powerpc systems it's not safe to call WARN that early in boot.

    If the overlap check fails the system will oops instead of printing a
    warning. Furthermore because it's so early in boot the console is not up
    and the user doesn't see the oops, they just get a dead system.

    Fix it by printing an error instead of calling WARN.

    Fixes: ae1add247bf8 ("of: Check for overlap in reserved memory regions")
    Signed-off-by: Michael Ellerman
    Signed-off-by: Rob Herring

    Michael Ellerman
     

18 Sep, 2015

1 commit

  • Any overlap in the reserved memory regions (those specified in the
    reserved-memory DT node) is a bug. These bugs might go undetected as
    long as the contested region isn't used simultaneously by multiple
    software agents, which makes such bugs hard to debug. Fix this by
    printing a scary warning during boot if overlap is detected.

    Signed-off-by: Mitchel Humpherys
    Signed-off-by: Rob Herring

    Mitchel Humpherys
     

14 Jan, 2015

1 commit


30 Oct, 2014

1 commit

  • Driver calling of_reserved_mem_device_init() might be interested if the
    initialization has been successful or not, so add support for returning
    error code.

    This fixes a build warining caused by commit 7bfa5ab6fa1b ("drivers:
    dma-coherent: add initialization from device tree"), which has been
    merged without this change and without fixing function return value.

    Fixes: 7bfa5ab6fa1b1 ("drivers: dma-coherent: add initialization from device tree")
    Signed-off-by: Marek Szyprowski
    Acked-by: Arnd Bergmann
    Cc: Michal Nazarewicz
    Cc: Grant Likely
    Cc: Laura Abbott
    Cc: Josh Cartwright
    Cc: Joonsoo Kim
    Cc: Kyungmin Park
    Cc: Russell King
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marek Szyprowski
     

02 Aug, 2014

1 commit


21 May, 2014

1 commit


30 Apr, 2014

1 commit

  • Make of_get_flat_dt_prop arguments compatible with libfdt fdt_getprop
    call in preparation to convert FDT code to use libfdt. Make the return
    value const and the property length ptr type an int.

    Signed-off-by: Rob Herring
    Tested-by: Michal Simek
    Tested-by: Grant Likely
    Tested-by: Stephen Chivers

    Rob Herring
     

12 Mar, 2014

2 commits


15 Oct, 2013

1 commit


10 Sep, 2013

1 commit


27 Aug, 2013

1 commit

  • This patch adds device tree support for contiguous and reserved memory
    regions defined in device tree.

    Large memory blocks can be reliably reserved only during early boot.
    This must happen before the whole memory management subsystem is
    initialized, because we need to ensure that the given contiguous blocks
    are not yet allocated by kernel. Also it must happen before kernel
    mappings for the whole low memory are created, to ensure that there will
    be no mappings (for reserved blocks) or mapping with special properties
    can be created (for CMA blocks). This all happens before device tree
    structures are unflattened, so we need to get reserved memory layout
    directly from fdt.

    Later, those reserved memory regions are assigned to devices on each
    device structure initialization.

    Signed-off-by: Marek Szyprowski
    Acked-by: Kyungmin Park
    Acked-by: Michal Nazarewicz
    Acked-by: Tomasz Figa
    Acked-by: Stephen Warren
    Reviewed-by: Rob Herring

    Marek Szyprowski