13 May, 2019

1 commit

  • of_find_device_by_node takes a reference to the embedded struct device
    which needs to be dropped after use.

    Fixes: d01f449c008a ("of_net: add NVMEM support to of_get_mac_address")
    Reported-by: kbuild test robot
    Reported-by: Julia Lawall
    Signed-off-by: Petr Štetiar
    Reviewed-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Petr Štetiar
     

11 May, 2019

1 commit

  • In commit d01f449c008a ("of_net: add NVMEM support to
    of_get_mac_address") I've added `nvmem-mac-address` property which was
    wrong idea as I've allocated the property with devm_kzalloc and then
    added it to DT, so then 2 entities would be refcounting the allocation.
    So if the driver unbinds, the buffer is freed, but DT code would be
    still referencing that memory.

    I'm removing this property completely instead of fixing it, as it's not
    needed to have it.

    Fixes: d01f449c008a ("of_net: add NVMEM support to of_get_mac_address")
    Suggested-by: Rob Herring
    Signed-off-by: Petr Štetiar
    Signed-off-by: David S. Miller

    Petr Štetiar
     

08 May, 2019

2 commits

  • Pull networking updates from David Miller:
    "Highlights:

    1) Support AES128-CCM ciphers in kTLS, from Vakul Garg.

    2) Add fib_sync_mem to control the amount of dirty memory we allow to
    queue up between synchronize RCU calls, from David Ahern.

    3) Make flow classifier more lockless, from Vlad Buslov.

    4) Add PHY downshift support to aquantia driver, from Heiner
    Kallweit.

    5) Add SKB cache for TCP rx and tx, from Eric Dumazet. This reduces
    contention on SLAB spinlocks in heavy RPC workloads.

    6) Partial GSO offload support in XFRM, from Boris Pismenny.

    7) Add fast link down support to ethtool, from Heiner Kallweit.

    8) Use siphash for IP ID generator, from Eric Dumazet.

    9) Pull nexthops even further out from ipv4/ipv6 routes and FIB
    entries, from David Ahern.

    10) Move skb->xmit_more into a per-cpu variable, from Florian
    Westphal.

    11) Improve eBPF verifier speed and increase maximum program size,
    from Alexei Starovoitov.

    12) Eliminate per-bucket spinlocks in rhashtable, and instead use bit
    spinlocks. From Neil Brown.

    13) Allow tunneling with GUE encap in ipvs, from Jacky Hu.

    14) Improve link partner cap detection in generic PHY code, from
    Heiner Kallweit.

    15) Add layer 2 encap support to bpf_skb_adjust_room(), from Alan
    Maguire.

    16) Remove SKB list implementation assumptions in SCTP, your's truly.

    17) Various cleanups, optimizations, and simplifications in r8169
    driver. From Heiner Kallweit.

    18) Add memory accounting on TX and RX path of SCTP, from Xin Long.

    19) Switch PHY drivers over to use dynamic featue detection, from
    Heiner Kallweit.

    20) Support flow steering without masking in dpaa2-eth, from Ioana
    Ciocoi.

    21) Implement ndo_get_devlink_port in netdevsim driver, from Jiri
    Pirko.

    22) Increase the strict parsing of current and future netlink
    attributes, also export such policies to userspace. From Johannes
    Berg.

    23) Allow DSA tag drivers to be modular, from Andrew Lunn.

    24) Remove legacy DSA probing support, also from Andrew Lunn.

    25) Allow ll_temac driver to be used on non-x86 platforms, from Esben
    Haabendal.

    26) Add a generic tracepoint for TX queue timeouts to ease debugging,
    from Cong Wang.

    27) More indirect call optimizations, from Paolo Abeni"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1763 commits)
    cxgb4: Fix error path in cxgb4_init_module
    net: phy: improve pause mode reporting in phy_print_status
    dt-bindings: net: Fix a typo in the phy-mode list for ethernet bindings
    net: macb: Change interrupt and napi enable order in open
    net: ll_temac: Improve error message on error IRQ
    net/sched: remove block pointer from common offload structure
    net: ethernet: support of_get_mac_address new ERR_PTR error
    net: usb: smsc: fix warning reported by kbuild test robot
    staging: octeon-ethernet: Fix of_get_mac_address ERR_PTR check
    net: dsa: support of_get_mac_address new ERR_PTR error
    net: dsa: sja1105: Fix status initialization in sja1105_get_ethtool_stats
    vrf: sit mtu should not be updated when vrf netdev is the link
    net: dsa: Fix error cleanup path in dsa_init_module
    l2tp: Fix possible NULL pointer dereference
    taprio: add null check on sched_nest to avoid potential null pointer dereference
    net: mvpp2: cls: fix less than zero check on a u32 variable
    net_sched: sch_fq: handle non connected flows
    net_sched: sch_fq: do not assume EDT packets are ordered
    net: hns3: use devm_kcalloc when allocating desc_cb
    net: hns3: some cleanup for struct hns3_enet_ring
    ...

    Linus Torvalds
     
  • Pull Devicetree updates from Rob Herring:

    - Fix possible memory leak in reserved-memory failure case

    - Support for DMA parent bus which are not a parent node

    - Clang -Wunsequenced fix

    - Remove some unnecessary prints on memory alloc failures

    - Various printk msg and comment fixes

    - Update DT schema tools repository location

    - Convert simple-framebuffer binding to DT schema

    - Bindings for isl68137 and ir38064 trivial devices

    - New documentation on binding do's and don't's for binding writers to
    ignore

    * tag 'devicetree-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (22 commits)
    of: unittest: Remove error printing on OOM
    of: irq: Remove WARN_ON() for kzalloc() failure
    dt-bindings: pinctrl: fix bias-pull,up typo
    dt-bindings: Update schema project location to devicetree.org github group
    of: fix clang -Wunsequenced for be32_to_cpu()
    of/device.c: fix the wrong comments
    dt-bindings: Add isl68137 as a trivial device
    dt-bindings: Add ir38064 as a trivial device
    of: del redundant type conversion
    dt-bindings: mfd: axp20x: Add fallback for axp805
    of: Improve of_phandle_iterator_next() error message
    dt-bindings: connector: Spelling mistake
    dt-bindings: Add schemas for simple-framebuffer
    of: address: Add support for the parent DMA bus
    of: address: Retrieve a parent through a callback in __of_translate_address
    dt-bindings: bus: Add binding for the Allwinner MBUS controller
    dt-bindings: interconnect: Add a dma interconnect name
    of: use correct function prototype for of_overlay_fdt_apply()
    of: reserved_mem: fix reserve memory leak
    of: property: Document that of_graph_get_endpoint_by_regs needs of_node_put
    ...

    Linus Torvalds
     

06 May, 2019

1 commit

  • Many embedded devices have information such as MAC addresses stored
    inside NVMEMs like EEPROMs and so on. Currently there are only two
    drivers in the tree which benefit from NVMEM bindings.

    Adding support for NVMEM into every other driver would mean adding a lot
    of repetitive code. This patch allows us to configure MAC addresses in
    various devices like ethernet and wireless adapters directly from
    of_get_mac_address, which is already used by almost every driver in the
    tree.

    Predecessor of this patch which used directly MTD layer has originated
    in OpenWrt some time ago and supports already about 497 use cases in 357
    device tree files.

    Cc: Alban Bedel
    Signed-off-by: Felix Fietkau
    Signed-off-by: John Crispin
    Signed-off-by: Petr Štetiar
    Signed-off-by: David S. Miller

    Petr Štetiar
     

03 May, 2019

2 commits


02 May, 2019

1 commit


30 Apr, 2019

1 commit


20 Apr, 2019

1 commit

  • I've discovered following discrepancy in the bindings/net/ethernet.txt
    documentation, where it states following:

    - nvmem-cells: phandle, reference to an nvmem node for the MAC address;
    - nvmem-cell-names: string, should be "mac-address" if nvmem is to be..

    which is actually misleading and confusing. There are only two ethernet
    drivers in the tree, cadence/macb and davinci which supports this
    properties.

    This nvmem-cell* properties were introduced in commit 9217e566bdee
    ("of_net: Implement of_get_nvmem_mac_address helper"), but
    commit afa64a72b862 ("of: net: kill of_get_nvmem_mac_address()")
    forget to properly clean up this parts.

    So this patch fixes the documentation by moving the nvmem-cell*
    properties at the appropriate places. While at it, I've removed unused
    include as well.

    Cc: Bartosz Golaszewski
    Fixes: afa64a72b862 ("of: net: kill of_get_nvmem_mac_address()")
    Signed-off-by: Petr Štetiar
    Signed-off-by: David S. Miller

    Petr Štetiar
     

11 Apr, 2019

3 commits

  • Understanding why of_phandle_iterator_next() returns an error can
    sometimes be hard to decipher based solely on the error message, a
    typical error example is that #foo-cells = and the phandle property
    used has a smaller number of cells specified, e.g.:

    #thermal-sensor-cells = ;
    phandle =

    instead of:

    phandle ;

    Instead, make it clear what the expectations are towards debugging
    incorrect Device Tree faster:

    OF: /thermal-zones/scmi-thermal: #thermal-sensor-cells = 1, found 0 instead

    Signed-off-by: Florian Fainelli
    Signed-off-by: Rob Herring

    Florian Fainelli
     
  • Some SoCs have devices that are using a separate bus from the main bus to
    perform DMA.

    These buses might have some restrictions and/or different mapping than from
    the CPU side, so we'd need to express those using the usual dma-ranges, but
    using a different DT node than the node's parent.

    Now that the generic interconnect bindings are available, we can model an
    interconnect with the reserved name "dma-mem" for those use-cases.

    Reviewed-by: Robin Murphy
    Signed-off-by: Maxime Ripard
    Signed-off-by: Rob Herring

    Maxime Ripard
     
  • The __of_translate_address function is used to translate the device tree
    addresses to physical addresses using the various ranges property to create
    the offset.

    However, it's shared between the CPU addresses (based on the ranges
    property) and the DMA addresses (based on dma-ranges). Since we're going to
    add support for a DMA parent node that is not the DT parent node, we need
    to change the logic a bit to have a callback function that will retrieve
    the parent node we should use.

    Reviewed-by: Robin Murphy
    Signed-off-by: Maxime Ripard
    Signed-off-by: Rob Herring

    Maxime Ripard
     

10 Apr, 2019

2 commits

  • The __reserved_mem_init_node will call region specific reserved memory
    init codes, but once all compatibled init codes failed, the memory region
    will left in memory.reserved and cause leakage.

    Take cma reserve memory DTS for example, if user declare 1MB size,
    which is not align to (PAGE_SIZE << max(MAX_ORDER - 1,
    pageblock_order)), rmem_cma_setup will return -EINVAL.
    Meanwhile, rmem_dma_setup will also return -EINVAL since "reusable"
    property is not set. If finally there is no reserved memory init pick up
    this memory, kernel will left the 1MB leak in memory.reserved.

    This patch will remove this kind of memory from memory.reserved, only
    when __reserved_mem_init_node return neither 0 nor -ENOENT.

    Signed-off-by: pierre Kuo
    Signed-off-by: Rob Herring

    pierre Kuo
     
  • The node returned by of_graph_get_endpoint_by_regs has a reference taken,
    and we need to put that reference back when done with the node.

    However, the documentation for that node doesn't mention it, so let's make
    sure it does.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Rob Herring

    Maxime Ripard
     

13 Mar, 2019

3 commits

  • Marc Gonzalez reported the following kmemleak crash:

    Unable to handle kernel paging request at virtual address ffffffc021e00000
    Mem abort info:
    ESR = 0x96000006
    Exception class = DABT (current EL), IL = 32 bits
    SET = 0, FnV = 0
    EA = 0, S1PTW = 0
    Data abort info:
    ISV = 0, ISS = 0x00000006
    CM = 0, WnR = 0
    swapper pgtable: 4k pages, 39-bit VAs, pgdp = (____ptrval____) [ffffffc021e00000] pgd=000000017e3ba803, pud=000000017e3ba803, pmd=0000000000000000
    Internal error: Oops: 96000006 [#1] PREEMPT SMP
    Modules linked in:
    CPU: 6 PID: 523 Comm: kmemleak Tainted: G S W 5.0.0-rc1 #13
    Hardware name: Qualcomm Technologies, Inc. MSM8998 v1 MTP (DT)
    pstate: 80000085 (Nzcv daIf -PAN -UAO)
    pc : scan_block+0x70/0x190
    lr : scan_block+0x6c/0x190
    Process kmemleak (pid: 523, stack limit = 0x(____ptrval____))
    Call trace:
    scan_block+0x70/0x190
    scan_gray_list+0x108/0x1c0
    kmemleak_scan+0x33c/0x7c0
    kmemleak_scan_thread+0x98/0xf0
    kthread+0x11c/0x120
    ret_from_fork+0x10/0x1c
    Code: f9000fb4 d503201f 97ffffd2 35000580 (f9400260)

    The crash happens when a no-map area is allocated in
    early_init_dt_alloc_reserved_memory_arch(). The allocated region is
    registered with kmemleak, but it is then removed from memblock using
    memblock_remove() that is not kmemleak-aware.

    Replacing memblock_phys_alloc_range() with memblock_find_in_range()
    makes sure that the allocated memory is not added to kmemleak and then
    memblock_remove()'ing this memory is safe.

    As a bonus, since memblock_find_in_range() ensures the allocation in the
    specified range, the bounds check can be removed.

    [rppt@linux.ibm.com: of: fix parameters order for call to memblock_find_in_range()]
    Link: http://lkml.kernel.org/r/20190221112619.GC32004@rapoport-lnx
    Link: http://lkml.kernel.org/r/20190213181921.GB15270@rapoport-lnx
    Fixes: 3f0c820664483 ("drivers: of: add initialization code for dynamic reserved memory")
    Signed-off-by: Mike Rapoport
    Acked-by: Marek Szyprowski
    Acked-by: Prateek Patel
    Tested-by: Marc Gonzalez
    Cc: Rob Herring
    Cc: Frank Rowand
    Cc: Catalin Marinas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • Add check for the return value of memblock_alloc*() functions and call
    panic() in case of error. The panic message repeats the one used by
    panicing memblock allocators with adjustment of parameters to include
    only relevant ones.

    The replacement was mostly automated with semantic patches like the one
    below with manual massaging of format strings.

    @@
    expression ptr, size, align;
    @@
    ptr = memblock_alloc(size, align);
    + if (!ptr)
    + panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align);

    [anders.roxell@linaro.org: use '%pa' with 'phys_addr_t' type]
    Link: http://lkml.kernel.org/r/20190131161046.21886-1-anders.roxell@linaro.org
    [rppt@linux.ibm.com: fix format strings for panics after memblock_alloc]
    Link: http://lkml.kernel.org/r/1548950940-15145-1-git-send-email-rppt@linux.ibm.com
    [rppt@linux.ibm.com: don't panic if the allocation in sparse_buffer_init fails]
    Link: http://lkml.kernel.org/r/20190131074018.GD28876@rapoport-lnx
    [akpm@linux-foundation.org: fix xtensa printk warning]
    Link: http://lkml.kernel.org/r/1548057848-15136-20-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Anders Roxell
    Reviewed-by: Guo Ren [c-sky]
    Acked-by: Paul Burton [MIPS]
    Acked-by: Heiko Carstens [s390]
    Reviewed-by: Juergen Gross [Xen]
    Reviewed-by: Geert Uytterhoeven [m68k]
    Acked-by: Max Filippov [xtensa]
    Cc: Catalin Marinas
    Cc: Christophe Leroy
    Cc: Christoph Hellwig
    Cc: "David S. Miller"
    Cc: Dennis Zhou
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Mark Salter
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Petr Mladek
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Rob Herring
    Cc: Rob Herring
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     
  • The __memblock_alloc_base() function tries to allocate a memory up to
    the limit specified by its max_addr parameter. Depending on the value
    of this parameter, the __memblock_alloc_base() can is replaced with the
    appropriate memblock_phys_alloc*() variant.

    Link: http://lkml.kernel.org/r/1548057848-15136-9-git-send-email-rppt@linux.ibm.com
    Signed-off-by: Mike Rapoport
    Acked-by: Rob Herring
    Cc: Catalin Marinas
    Cc: Christophe Leroy
    Cc: Christoph Hellwig
    Cc: "David S. Miller"
    Cc: Dennis Zhou
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Guo Ren [c-sky]
    Cc: Heiko Carstens
    Cc: Juergen Gross [Xen]
    Cc: Mark Salter
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Paul Burton
    Cc: Petr Mladek
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Rob Herring
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

11 Mar, 2019

2 commits

  • Pull DMA mapping updates from Christoph Hellwig:

    - add debugfs support for dumping dma-debug information (Corentin
    Labbe)

    - Kconfig cleanups (Andy Shevchenko and me)

    - debugfs cleanups (Greg Kroah-Hartman)

    - improve dma_map_resource and use it in the media code

    - arch_setup_dma_ops / arch_teardown_dma_ops cleanups

    - various small cleanups and improvements for the per-device coherent
    allocator

    - make the DMA mask an upper bound and don't fail "too large" dma mask
    in the remaning two architectures - this will allow big driver
    cleanups in the following merge windows

    * tag 'dma-mapping-5.1' of git://git.infradead.org/users/hch/dma-mapping: (21 commits)
    Documentation/DMA-API-HOWTO: update dma_mask sections
    sparc64/pci_sun4v: allow large DMA masks
    sparc64/iommu: allow large DMA masks
    sparc64: refactor the ali DMA quirk
    ccio: allow large DMA masks
    dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag
    dma-mapping: remove dma_mark_declared_memory_occupied
    dma-mapping: move CONFIG_DMA_CMA to kernel/dma/Kconfig
    dma-mapping: improve selection of dma_declare_coherent availability
    dma-mapping: remove an incorrect __iommem annotation
    of: select OF_RESERVED_MEM automatically
    device.h: dma_mem is only needed for HAVE_GENERIC_DMA_COHERENT
    mfd/sm501: depend on HAS_DMA
    dma-mapping: add a kconfig symbol for arch_teardown_dma_ops availability
    dma-mapping: add a kconfig symbol for arch_setup_dma_ops availability
    dma-mapping: move debug configuration options to kernel/dma
    dma-debug: add dumping facility via debugfs
    dma: debug: no need to check return value of debugfs_create functions
    videobuf2: replace a layering violation with dma_map_resource
    dma-mapping: don't BUG when calling dma_map_resource on RAM
    ...

    Linus Torvalds
     
  • Pull Devicetree updates from Rob Herring:

    - Fix a unittest failure on UML. Preparation for converting to kunit
    test framework.

    - Add annotations to dtx_diff output

    - Fix unittest reporting of expected error

    - Move DMA configuration for virtual devices into the driver that needs
    it (s5p-mfc)

    - Vendor prefixes for feiyang and techstar

    - Convert ARM GIC, GICv3, and L2x0 to DT schema

    - Add r8a7778/9 HSCIF serial bindings

    * tag 'devicetree-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
    of: unittest: unflatten device tree on UML when testing
    dt-bindings: Add vendor prefix for feiyang
    dt-bindings: Add vendor prefix for techstar
    dt-bindings: display: add missing semicolon in example
    of: mark early_init_dt_alloc_reserved_memory_arch static
    of: add dtc annotations functionality to dtx_diff
    of: unittest: add caution to function header comment
    of: unittest: remove report of expected error
    dt-bindings: interrupt-controller: Convert ARM GICv3 to json-schema
    dt-bindings: interrupt-controller: Convert ARM GIC to json-schema
    dt-bindings: arm: l2x0: Convert L2 cache to json-schema
    media: s5p-mfc: Fix memdev DMA configuration
    dt-bindings: serial: sh-sci: Document r8a7778/9 HSCIF bindings

    Linus Torvalds
     

01 Mar, 2019

2 commits


20 Feb, 2019

1 commit

  • This API is primarily used through DT entries, but two architectures
    and two drivers call it directly. So instead of selecting the config
    symbol for random architectures pull it in implicitly for the actual
    users. Also rename the Kconfig option to describe the feature better.

    Signed-off-by: Christoph Hellwig
    Acked-by: Paul Burton # MIPS
    Acked-by: Lee Jones
    Reviewed-by: Greg Kroah-Hartman

    Christoph Hellwig
     

14 Feb, 2019

3 commits

  • The OF_RESERVED_MEM can be used if we have either CMA or the generic
    declare coherent code built and we support the early flattened DT.

    So don't bother making it a user visible options that is selected
    by most configs that fit the above category, but just select it when
    the requirements are met.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Rob Herring

    Christoph Hellwig
     
  • Name of function attach_node_and_children() is misleading because
    if the node already exists in the livetree then only the node's
    properties are attached. This works for the existing test data,
    but add comment warning of this misleading name.

    Signed-off-by: Frank Rowand
    Signed-off-by: Rob Herring

    Frank Rowand
     
  • update_node_properties() reports an error when the test data contains
    a node (such as "/aliases") that already exists in the base devicetree.
    The error is caused by of_fdt_unflatten_tree() autogenerating the
    "name" property, thus both the existing node and the new node will
    have a property with the same name. Suppress reporting the known
    error.

    Signed-off-by: Frank Rowand
    Signed-off-by: Rob Herring

    Frank Rowand
     

05 Feb, 2019

1 commit

  • All users of the fixed_phy_add() pass -1 as GPIO number
    to the fixed phy driver, and all users of fixed_phy_register()
    pass -1 as GPIO number as well, except for the device
    tree MDIO bus.

    Any new users should create a proper device and pass the
    GPIO as a descriptor associated with the device so delete
    the GPIO argument from the calls and drop the code looking
    requesting a GPIO in fixed_phy_add().

    In fixed phy_register(), investigate the "fixed-link"
    node and pick the GPIO descriptor from "link-gpios" if
    this property exists. Move the corresponding code out
    of of_mdio.c as the fixed phy code anyways requires
    OF to be in use.

    Tested-by: Andrew Lunn
    Signed-off-by: Linus Walleij
    Signed-off-by: David S. Miller

    Linus Walleij
     

22 Jan, 2019

1 commit

  • Having of_reserved_mem_device_init() forcibly reconfigure DMA for all
    callers, potentially overriding the work done by a bus-specific
    .dma_configure method earlier, is at best a bad idea and at worst
    actively harmful. If drivers really need virtual devices to own
    dma-coherent memory, they should explicitly configure those devices
    based on the appropriate firmware node as they create them.

    It looks like the only driver not passing in a proper OF platform device
    is s5p-mfc, so move the rogue of_dma_configure() call into that driver
    where it logically belongs.

    Reviewed-by: Marek Szyprowski
    Acked-by: Mauro Carvalho Chehab
    Signed-off-by: Robin Murphy
    Signed-off-by: Rob Herring

    Robin Murphy
     

17 Jan, 2019

1 commit

  • Add an of_node_put when the result of of_graph_get_remote_port_parent is
    not available.

    The semantic match that finds this problem is as follows
    (http://coccinelle.lip6.fr):

    //
    @r exists@
    local idexpression e;
    expression x;
    @@
    e = of_graph_get_remote_port_parent(...);
    ... when != x = e
    when != true e == NULL
    when != of_node_put(e)
    when != of_fwnode_handle(e)
    (
    return e;
    |
    *return ...;
    )
    //

    Signed-off-by: Julia Lawall
    Cc: stable@vger.kernel.org
    Signed-off-by: Rob Herring

    Julia Lawall
     

11 Jan, 2019

1 commit


29 Dec, 2018

1 commit

  • Pull Devicetree updates from Rob Herring:
    "The biggest highlight here is the start of using json-schema for DT
    bindings. Being able to validate bindings has been discussed for years
    with little progress.

    - Initial support for DT bindings using json-schema language. This is
    the start of converting DT bindings from free-form text to a
    structured format.

    - Reworking of initrd address initialization. This moves to using the
    phys address instead of virt addr in the DT parsing code. This
    rework was motivated by CONFIG_DEV_BLK_INITRD causing unnecessary
    rebuilding of lots of files.

    - Fix stale phandle entries in phandle cache

    - DT overlay validation improvements. This exposed several memory
    leak bugs which have been fixed.

    - Use node name and device_type helper functions in DT code

    - Last remaining conversions to using %pOFn printk specifier instead
    of device_node.name directly

    - Create new common RTC binding doc and move all trivial RTC devices
    out of trivial-devices.txt.

    - New bindings for Freescale MAG3110 magnetometer, Cadence Sierra
    PHY, and Xen shared memory

    - Update dtc to upstream version v1.4.7-57-gf267e674d145"

    * tag 'devicetree-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (68 commits)
    of: __of_detach_node() - remove node from phandle cache
    of: of_node_get()/of_node_put() nodes held in phandle cache
    gpio-omap.txt: add reg and interrupts properties
    dt-bindings: mrvl,intc: fix a trivial typo
    dt-bindings: iio: magnetometer: add dt-bindings for freescale mag3110
    dt-bindings: Convert trivial-devices.txt to json-schema
    dt-bindings: arm: mrvl: amend Browstone compatible string
    dt-bindings: arm: Convert Tegra board/soc bindings to json-schema
    dt-bindings: arm: Convert ZTE board/soc bindings to json-schema
    dt-bindings: arm: Add missing Xilinx boards
    dt-bindings: arm: Convert Xilinx board/soc bindings to json-schema
    dt-bindings: arm: Convert VIA board/soc bindings to json-schema
    dt-bindings: arm: Convert ST STi board/soc bindings to json-schema
    dt-bindings: arm: Convert SPEAr board/soc bindings to json-schema
    dt-bindings: arm: Convert CSR SiRF board/soc bindings to json-schema
    dt-bindings: arm: Convert QCom board/soc bindings to json-schema
    dt-bindings: arm: Convert TI nspire board/soc bindings to json-schema
    dt-bindings: arm: Convert TI davinci board/soc bindings to json-schema
    dt-bindings: arm: Convert Calxeda board/soc bindings to json-schema
    dt-bindings: arm: Convert Altera board/soc bindings to json-schema
    ...

    Linus Torvalds
     

28 Dec, 2018

1 commit

  • Pull networking updates from David Miller:

    1) New ipset extensions for matching on destination MAC addresses, from
    Stefano Brivio.

    2) Add ipv4 ttl and tos, plus ipv6 flow label and hop limit offloads to
    nfp driver. From Stefano Brivio.

    3) Implement GRO for plain UDP sockets, from Paolo Abeni.

    4) Lots of work from Michał Mirosław to eliminate the VLAN_TAG_PRESENT
    bit so that we could support the entire vlan_tci value.

    5) Rework the IPSEC policy lookups to better optimize more usecases,
    from Florian Westphal.

    6) Infrastructure changes eliminating direct manipulation of SKB lists
    wherever possible, and to always use the appropriate SKB list
    helpers. This work is still ongoing...

    7) Lots of PHY driver and state machine improvements and
    simplifications, from Heiner Kallweit.

    8) Various TSO deferral refinements, from Eric Dumazet.

    9) Add ntuple filter support to aquantia driver, from Dmitry Bogdanov.

    10) Batch dropping of XDP packets in tuntap, from Jason Wang.

    11) Lots of cleanups and improvements to the r8169 driver from Heiner
    Kallweit, including support for ->xmit_more. This driver has been
    getting some much needed love since he started working on it.

    12) Lots of new forwarding selftests from Petr Machata.

    13) Enable VXLAN learning in mlxsw driver, from Ido Schimmel.

    14) Packed ring support for virtio, from Tiwei Bie.

    15) Add new Aquantia AQtion USB driver, from Dmitry Bezrukov.

    16) Add XDP support to dpaa2-eth driver, from Ioana Ciocoi Radulescu.

    17) Implement coalescing on TCP backlog queue, from Eric Dumazet.

    18) Implement carrier change in tun driver, from Nicolas Dichtel.

    19) Support msg_zerocopy in UDP, from Willem de Bruijn.

    20) Significantly improve garbage collection of neighbor objects when
    the table has many PERMANENT entries, from David Ahern.

    21) Remove egdev usage from nfp and mlx5, and remove the facility
    completely from the tree as it no longer has any users. From Oz
    Shlomo and others.

    22) Add a NETDEV_PRE_CHANGEADDR so that drivers can veto the change and
    therefore abort the operation before the commit phase (which is the
    NETDEV_CHANGEADDR event). From Petr Machata.

    23) Add indirect call wrappers to avoid retpoline overhead, and use them
    in the GRO code paths. From Paolo Abeni.

    24) Add support for netlink FDB get operations, from Roopa Prabhu.

    25) Support bloom filter in mlxsw driver, from Nir Dotan.

    26) Add SKB extension infrastructure. This consolidates the handling of
    the auxiliary SKB data used by IPSEC and bridge netfilter, and is
    designed to support the needs to MPTCP which could be integrated in
    the future.

    27) Lots of XDP TX optimizations in mlx5 from Tariq Toukan.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1845 commits)
    net: dccp: fix kernel crash on module load
    drivers/net: appletalk/cops: remove redundant if statement and mask
    bnx2x: Fix NULL pointer dereference in bnx2x_del_all_vlans() on some hw
    net/net_namespace: Check the return value of register_pernet_subsys()
    net/netlink_compat: Fix a missing check of nla_parse_nested
    ieee802154: lowpan_header_create check must check daddr
    net/mlx4_core: drop useless LIST_HEAD
    mlxsw: spectrum: drop useless LIST_HEAD
    net/mlx5e: drop useless LIST_HEAD
    iptunnel: Set tun_flags in the iptunnel_metadata_reply from src
    net/mlx5e: fix semicolon.cocci warnings
    staging: octeon: fix build failure with XFRM enabled
    net: Revert recent Spectre-v1 patches.
    can: af_can: Fix Spectre v1 vulnerability
    packet: validate address length if non-zero
    nfc: af_nfc: Fix Spectre v1 vulnerability
    phonet: af_phonet: Fix Spectre v1 vulnerability
    net: core: Fix Spectre v1 vulnerability
    net: minor cleanup in skb_ext_add()
    net: drop the unused helper skb_ext_get()
    ...

    Linus Torvalds
     

22 Dec, 2018

2 commits

  • Non-overlay dynamic devicetree node removal may leave the node in
    the phandle cache. Subsequent calls to of_find_node_by_phandle()
    will incorrectly find the stale entry. Remove the node from the
    cache.

    Add paranoia checks in of_find_node_by_phandle() as a second level
    of defense (do not return cached node if detached, do not add node
    to cache if detached).

    Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()")
    Reported-by: Michael Bringmann
    Cc: stable@vger.kernel.org # v4.17+
    Signed-off-by: Frank Rowand
    Signed-off-by: Rob Herring

    Frank Rowand
     
  • The phandle cache contains struct device_node pointers. The refcount
    of the pointers was not incremented while in the cache, allowing use
    after free error after kfree() of the node. Add the proper increment
    and decrement of the use count.

    Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()")
    Cc: stable@vger.kernel.org # v4.17+
    Signed-off-by: Frank Rowand
    Signed-off-by: Rob Herring

    Frank Rowand
     

14 Dec, 2018

1 commit


06 Dec, 2018

1 commit


04 Dec, 2018

2 commits


28 Nov, 2018

1 commit


27 Nov, 2018

1 commit

  • Now that ARM64 uses phys_initrd_start/phys_initrd_size, we can get rid
    of its custom __early_init_dt_declare_initrd() which causes a fair
    amount of objects rebuild when changing CONFIG_BLK_DEV_INITRD. In order
    to make sure ARM64 does not produce a BUG() when VM debugging is turned
    on though, we must avoid early calls to __va() which is what
    __early_init_dt_declare_initrd() does and wrap this around to avoid
    running that code on ARM64.

    Signed-off-by: Florian Fainelli
    Reviewed-by: Mike Rapoport
    Signed-off-by: Rob Herring

    Florian Fainelli