10 Apr, 2019

1 commit


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
     

06 Dec, 2018

1 commit


12 Feb, 2018

1 commit


02 Feb, 2018

1 commit

  • Pull DeviceTree updates from Rob Herring:

    - Convert to use memblock_virt_alloc in DT code which supports
    bootmem arches. With this we can remove the arch specific
    early_init_dt_alloc_memory_arch() functions.

    - Enable running the DT unittests on UML

    - Use SPDX license tags on DT files

    - Fix early FDT kconfig ifdef logic

    - Clean-up unittest Makefile

    - Fix function comment for of_irq_parse_raw

    - Add missing documentation for linux,initrd-{start,end} properties

    - Clean-up of binding examples using uppercase hex

    - Add trivial devices W83773G and Infineon TLV493D-A1B6

    - Add missing STM32 SoC bindings

    - Various small binding doc fixes

    * tag 'devicetree-for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (23 commits)
    xtensa: remove arch specific early DT functions
    x86: remove arch specific early_init_dt_alloc_memory_arch
    nios2: remove arch specific early_init_dt_alloc_memory_arch
    mips: remove arch specific early_init_dt_alloc_memory_arch
    metag: remove arch specific early DT functions
    cris: remove arch specific early DT functions
    libfdt: remove unnecessary include directive from
    of: unittest: refactor Makefile
    of/fdt: use memblock_virt_alloc for early alloc
    of: Use SPDX license tag for DT files
    of/fdt: Fix #ifdef dependency of early flattree declarations
    dt-bindings: h8300 clocksource: correct spelling of pulse
    dt-bindings: imx6q-pcie: Add required property for i.MX6SX
    mmc: Don't reference Linux-specific OF_GPIO_ACTIVE_LOW flag in DT binding
    dt-bindings: Use lower case hex in unit-addresses
    dt-bindings: display: panel: Fix compatible string for Toshiba LT089AC29000
    dt-bindings: Add Infineon TLV493D-A1B6
    dt-bindings: mailbox: ti,message-manager: Fix interrupt name error
    dt-bindings: chosen: Document linux,initrd-{start,end}
    dt-bindings: arm: document supported STM32 SoC family
    ...

    Linus Torvalds
     

08 Jan, 2018

1 commit

  • Convert remaining DT files to use SPDX-License-Identifier tags.

    Cc: Benjamin Herrenschmidt
    Cc: Guennadi Liakhovetski
    Cc: Paul Mackerras
    Cc: Pantelis Antoniou
    Reviewed-by: Frank Rowand
    Reviewed-by: Philippe Ombredanne
    Signed-off-by: Rob Herring

    Rob Herring
     

13 Dec, 2017

1 commit


09 Nov, 2017

1 commit

  • The fwnode_handle_get() function is used to obtain a reference to an
    fwnode. A common usage pattern for the OF equivalent of the function is:

    mynode = of_node_get(node);

    Similarly make fwnode_handle_get() return the fwnode to which the
    reference was obtained.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Rafael J. Wysocki

    Sakari Ailus
     

13 Oct, 2017

1 commit


08 Sep, 2017

1 commit

  • Pull DeviceTree updates from Rob Herring:
    "There's a few orphans in the conversion to %pOF printf specifiers
    included here that no one else picked up.

    Summary:

    - Convert more DT code to use of_property_read_* API.

    - Improve DT overlay support when adding multiple overlays

    - Convert printk's to %pOF format specifiers. Most went via subsystem
    trees, but picked up the remaining orphans

    - Correct unittests to use preferred "okay" for "status" property
    value

    - Add a KASLR seed property

    - Vendor prefixes for Mellanox, Theobroma System, Adaptrum, Moxa

    - Fix modalias buffer handling

    - Clean-up of include paths for building dtbs

    - Add bindings for amc6821, isl1208, tsl2x7x, srf02, and srf10
    devices

    - Add nvmem bindings for MediaTek MT7623 and MT7622 SoC

    - Add compatible string for Allwinner H5 Mali-450 GPU

    - Fix links to old OpenFirmware docs with new mirror on
    devicetree.org

    - Remove status property from binding doc examples"

    * tag 'devicetree-for-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (45 commits)
    devicetree: Adjust status "ok" -> "okay" under drivers/of/
    dt-bindings: Remove "status" from examples
    dt-bindings: pinctrl: sh-pfc: Use generic node name
    dt-bindings: Add vendor Mellanox
    dt-binding: net/phy: fix interrupts description
    virt: Convert to using %pOF instead of full_name
    macintosh: Convert to using %pOF instead of full_name
    ide: pmac: Convert to using %pOF instead of full_name
    microblaze: Convert to using %pOF instead of full_name
    dt-bindings: usb: musb: Grammar s/the/to/, s/is/are/
    of: Use PLATFORM_DEVID_NONE definition
    of/device: Fix of_device_get_modalias() buffer handling
    of/device: Prevent buffer overflow in of_device_modalias()
    dt-bindings: add amc6821, isl1208 trivial bindings
    dt-bindings: add vendor prefix for Theobroma Systems
    of: search scripts/dtc/include-prefixes path for both CPP and DTC
    of: remove arch/$(SRCARCH)/boot/dts from include search path for CPP
    of: remove drivers/of/testcase-data from include search path for CPP
    of: return of_get_cpu_node from of_cpu_device_node_get if CPUs are not registered
    iio: srf08: add device tree binding for srf02 and srf10
    ...

    Linus Torvalds
     

06 Sep, 2017

1 commit

  • Pull device properties framework updates from Rafael Wysocki:
    "These introduce fwnode operations for all of the separate types of
    'firmware nodes' that can be handled by the device properties
    framework, make the framework use const fwnode arguments all over, add
    a helper for the consolidated handling of node references and switch
    over the framework to the new UUID API.

    Specifics:

    - Introduce fwnode operations for all of the separate types of
    'firmware nodes' that can be handled by the device properties
    framework and drop the type field from struct fwnode_handle (Sakari
    Ailus, Arnd Bergmann).

    - Make the device properties framework use const fwnode arguments
    where possible (Sakari Ailus).

    - Add a helper for the consolidated handling of node references to
    the device properties framework (Sakari Ailus).

    - Switch over the ACPI part of the device properties framework to the
    new UUID API (Andy Shevchenko)"

    * tag 'devprop-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI: device property: Switch to use new generic UUID API
    device property: export irqchip_fwnode_ops
    device property: Introduce fwnode_property_get_reference_args
    device property: Constify fwnode property API
    device property: Constify argument to pset fwnode backend
    ACPI: Constify internal fwnode arguments
    ACPI: Constify acpi_bus helper functions, switch to macros
    ACPI: Prepare for constifying acpi_get_next_subnode() fwnode argument
    device property: Get rid of struct fwnode_handle type field
    ACPI: Use IS_ERR_OR_NULL() instead of non-NULL check in is_acpi_data_node()

    Linus Torvalds
     

15 Aug, 2017

1 commit


01 Aug, 2017

1 commit

  • Fix inconsistent use of of_graph_get_port_parent() where
    asoc_simple_card_parse_graph_dai() does of_node_get() before
    calling it while other callers do not. We can fix this by
    not trashing the node passed to of_graph_get_port_parent().

    Let's also make sure the callers have correct refcounts and remove
    related incorrect of_node_put() calls for of_for_each_phandle
    as that's done by of_phandle_iterator_next() except when
    we break out of the loop early.

    Let's fix both issues with a single patch to avoid kobject
    refcounts getting messed up more if two patches are merged
    separately.

    Otherwise strange issues can happen caused by memory corruption
    caused by too many kobject_del() calls such as:

    BUG: sleeping function called from invalid context at
    kernel/locking/mutex.c:747
    ...
    (___might_sleep)
    (__mutex_lock)
    (mutex_lock_nested)
    (kernfs_remove)
    (kobject_del)
    (kobject_put)
    (of_get_next_parent)
    (of_graph_get_port_parent)
    (asoc_simple_card_parse_graph_dai [snd_soc_simple_card_utils])
    (asoc_graph_card_probe [snd_soc_audio_graph_card])

    Fixes: 0ef472a973eb ("of_graph: add of_graph_get_port_parent()")
    Fixes: 2692c1c63c29 ("ASoC: add audio-graph-card support")
    Fixes: 1689333f8311 ("ASoC: simple-card-utils: add asoc_simple_card_parse_graph_dai()")
    Signed-off-by: Tony Lindgren
    Reviewed-by: Rob Herring
    Tested-by: Antonio Borneo
    Tested-by: Kuninori Morimoto
    Signed-off-by: Mark Brown

    Tony Lindgren
     

22 Jul, 2017

3 commits

  • The new fwnode_property_get_reference_args() interface amends the fwnode
    property API with the functionality of both of_parse_phandle_with_args()
    and __acpi_node_get_property_reference().

    The semantics is slightly different: the cells property is ignored on ACPI
    as the number of arguments can be explicitly obtained from the firmware
    interface.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Rafael J. Wysocki

    Sakari Ailus
     
  • Make fwnode arguments to the fwnode property API const.

    Signed-off-by: Sakari Ailus
    Reviewed-by: Rob Herring
    Signed-off-by: Rafael J. Wysocki

    Sakari Ailus
     
  • Instead of relying on the struct fwnode_handle type field, define
    fwnode_operations structs for all separate types of fwnodes. To find out
    the type, compare to the ops field to relevant ops structs.

    This change has two benefits:

    1. it avoids adding the type field to each and every instance of struct
    fwnode_handle, thus saving memory and

    2. makes the ops field the single factor that defines both the types of
    the fwnode as well as defines the implementation of its operations,
    decreasing the possibility of bugs when developing code dealing with
    fwnode internals.

    Suggested-by: Rob Herring
    Signed-off-by: Sakari Ailus
    Reviewed-by: Mika Westerberg
    Signed-off-by: Rafael J. Wysocki

    Sakari Ailus
     

19 Jul, 2017

1 commit


11 Jul, 2017

1 commit

  • Pull device properties framework updates from Rafael Wysocki:
    "These mostly rearrange the device properties core code and add a few
    helper functions to it as a foundation for future work.

    Specifics:

    - Rearrange the core device properties code by moving the code
    specific to each supported platform configuration framework (ACPI,
    DT and build-in) into a separate file (Sakari Ailus).

    - Add helper functions for accessing device properties in a
    firmware-agnostic way (Sakari Ailus, Kieran Bingham)"

    * tag 'devprop-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    device property: Add fwnode_graph_get_port_parent
    device property: Add FW type agnostic fwnode_graph_get_remote_node
    device property: Introduce fwnode_device_is_available()
    device property: Move fwnode graph ops to firmware specific locations
    device property: Move FW type specific functionality to FW specific files
    ACPI: Constify argument to acpi_device_is_present()

    Linus Torvalds
     

05 Jul, 2017

1 commit


22 Jun, 2017

3 commits


01 Jun, 2017

1 commit

  • base.c contains both core OF functions and increasingly other
    functionality such as accessing properties and graphs, including
    convenience functions. In the near future this would also include OF
    specific implementation of the fwnode property and graph APIs.

    Create driver/of/property.c to contain procedures for accessing and
    interpreting device tree properties. The procedures are moved from
    drivers/of/base.c, with no changes other than copying only the includes
    required by the moved procedures.

    Signed-off-by: Sakari Ailus
    Signed-off-by: Rob Herring

    Sakari Ailus