02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

11 May, 2017

1 commit

  • A change to function pointers that was meant to address a sparse warning
    turned out to cause hundreds of new gcc-7 warnings:

    include/linux/of_irq.h:11:13: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
    drivers/of/of_reserved_mem.c: In function '__reserved_mem_init_node':
    drivers/of/of_reserved_mem.c:200:7: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
    int const (*initfn)(struct reserved_mem *rmem) = i->data;

    Turns out the sparse warnings were spurious and have been fixed in
    upstream sparse since 0.5.0 in commit "sparse: treat function pointers
    as pointers to const data".

    This partially reverts commit 17a70355ea576843a7ac851f1db26872a50b2850.

    Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code")
    Reported-by: Arnd Bergmann
    Signed-off-by: Rob Herring

    Rob Herring
     

05 May, 2017

1 commit

  • sparse generates the following warnings in drivers/of/:

    ../drivers/of/fdt.c:63:36: warning: cast to restricted __be32
    ../drivers/of/fdt.c:68:33: warning: cast to restricted __be32
    ../drivers/of/irq.c:105:88: warning: incorrect type in initializer (different base types)
    ../drivers/of/irq.c:105:88: expected restricted __be32
    ../drivers/of/irq.c:105:88: got int
    ../drivers/of/irq.c:526:35: warning: incorrect type in assignment (different modifiers)
    ../drivers/of/irq.c:526:35: expected int ( *const [usertype] irq_init_cb )( ... )
    ../drivers/of/irq.c:526:35: got void const *const data
    ../drivers/of/of_reserved_mem.c:200:50: warning: incorrect type in initializer (different modifiers)
    ../drivers/of/of_reserved_mem.c:200:50: expected int ( *[usertype] initfn )( ... )
    ../drivers/of/of_reserved_mem.c:200:50: got void const *const data
    ../drivers/of/resolver.c:95:42: warning: incorrect type in assignment (different base types)
    ../drivers/of/resolver.c:95:42: expected unsigned int [unsigned] [usertype]
    ../drivers/of/resolver.c:95:42: got restricted __be32 [usertype]

    All these are harmless type mismatches fixed by adjusting the types.

    Signed-off-by: Rob Herring

    Rob Herring
     

09 Dec, 2015

2 commits


07 Nov, 2015

1 commit

  • Pull DeviceTree updates from Rob Herring:
    "A fairly large (by DT standards) pull request this time with the
    majority being some overdue moving DT binding docs around to
    consolidate similar bindings.

    - DT binding doc consolidation moving similar bindings to common
    locations. The majority of these are display related which were
    scattered in video/, fb/, drm/, gpu/, and panel/ directories.

    - Add new config option, CONFIG_OF_ALL_DTBS, to enable building all
    dtbs in the tree for most arches with dts files (except powerpc for
    now).

    - OF_IRQ=n fixes for user enabled CONFIG_OF.

    - of_node_put ref counting fixes from Julia Lawall.

    - Common DT binding for wakeup-source and deprecation of all similar
    bindings.

    - DT binding for PXA LCD controller.

    - Allow ignoring failed PCI resource translations in order to ignore
    64-bit addresses on non-LPAE 32-bit kernels.

    - Support setting the NUMA node from DT instead of only from parent
    device.

    - Couple of earlycon DT parsing fixes for address and options"

    * tag 'devicetree-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (45 commits)
    MAINTAINERS: update DT binding doc locations
    devicetree: add Sigma Designs vendor prefix
    of: simplify arch_find_n_match_cpu_physical_id() function
    Documentation: arm: Fixed typo in socfpga fpga mgr example
    Documentation: devicetree: fix reference to legacy wakeup properties
    Documentation: devicetree: standardize/consolidate on "wakeup-source" property
    drivers: of: removing assignment of 0 to static variable
    xtensa: enable building of all dtbs
    mips: enable building of all dtbs
    metag: enable building of all dtbs
    metag: use common make variables for dtb builds
    h8300: enable building of all dtbs
    arm64: enable building of all dtbs
    arm: enable building of all dtbs
    arc: enable building of all dtbs
    arc: use common make variables for dtb builds
    of: add config option to enable building of all dtbs
    of/fdt: fix error checking for earlycon address
    of/overlay: add missing of_node_put
    of/platform: add missing of_node_put
    ...

    Linus Torvalds
     

16 Oct, 2015

3 commits

  • While msi-parent is used to point to the MSI controller that
    works for all the devices behind a root complex, it doesn't
    allow configurations where each individual device can be routed
    to a separate MSI controller.

    The msi-map property provides this flexibility (and much more),
    so let's add a utility function that parses it, and return the
    corresponding MSI domain.

    Acked-by: Rob Herring
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • Since 126b16e2ad98 ("Docs: dt: add generic MSI bindings"),
    the definition of "msi-parent" has evolved, while maintaining
    some degree of compatibility. It can now express multiple MSI
    controllers as parents, as well as some sideband data being
    communicated to the controller.

    This patch adds the parsing of the property, iterating over
    the multiple parents until a suitable irqdomain is found.
    It can also fallback to the original parsing if the old
    binding is detected.

    This support code gets used in the subsequent patches.

    Suggested-by: Robin Murphy
    Acked-by: Rob Herring
    Signed-off-by: Marc Zyngier

    Marc Zyngier
     
  • The device tree property "msi-map" specifies how to create the PCI
    requester id used in some MSI controllers. Add a new function
    of_msi_map_rid() that finds the msi-map property and applies its
    translation to a given requester id.

    Reviewed-by: Marc Zyngier
    Acked-by: Rob Herring
    Signed-off-by: David Daney
    Signed-off-by: Marc Zyngier

    David Daney
     

14 Oct, 2015

3 commits

  • Since OF is now a userselectable config symbol, having OF=y but OF_IRQ=n
    is a valid combination for non-OF platforms, and OF=y does not guarantee
    anymore that OF_IRQ is enabled (or we are building for SPARC).

    Fixes the following build error with OF=y, IRQ_DOMAIN=n and SPI=y:

    drivers/built-in.o: In function `spi_register_master':
    (.text+0xc3ae): undefined reference to `irq_of_parse_and_map'
    Makefile:935: recipe for target 'vmlinux' failed
    make: *** [vmlinux] Error 1

    Signed-off-by: Jonas Gorski
    Signed-off-by: Rob Herring

    Jonas Gorski
     
  • of_irq_find_parent has no users outside of of_irq.c, so it does not make
    sense to expose it in of_irq.h. Therefore remove the prototype and dummy
    implmeentation and make the function static instead.

    Signed-off-by: Jonas Gorski
    Signed-off-by: Rob Herring

    Jonas Gorski
     
  • of_msi_configure is part of of_irq.c, which is compiled in when OF_IRQ
    is enabled, not just OF.
    Also It is unconditionally called from of_platform_device_create_pdata,
    which does not depend on OF_IRQ, just OF_ADDRESS, so we need a dummy
    implementation in case of OF_ADDRESS=y but OF_IRQ=n.

    Fixes: c706c239 ("of/platform: Assign MSI domain to platform device")
    Signed-off-by: Jonas Gorski
    Signed-off-by: Rob Herring

    Jonas Gorski
     

30 Jul, 2015

1 commit

  • As for PCI, we're able to populate the msi_domain field at probe time,
    provided that the device tree has an "msi-parent" property.

    Signed-off-by: Marc Zyngier
    Cc:
    Cc: Yijing Wang
    Cc: Ma Jun
    Cc: Lorenzo Pieralisi
    Cc: Duc Dang
    Cc: Hanjun Guo
    Cc: Bjorn Helgaas
    Cc: Jiang Liu
    Cc: Jason Cooper
    Link: http://lkml.kernel.org/r/1438091186-10244-9-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Thomas Gleixner

    Marc Zyngier
     

15 Apr, 2015

1 commit

  • If CONFIG_IRQ_OF=n:

    drivers/built-in.o: In function `of_device_alloc':
    (.text+0x72bce): undefined reference to `of_irq_to_resource_table'
    make: *** [vmlinux] Error 1

    of_device_alloc() calls of_irq_to_resource_table() with nr_irqs = 0 due
    to of_irq_count() already being a dummy, so just add a dummy for
    of_irq_to_resource_table(), too.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Rob Herring

    Geert Uytterhoeven
     

23 May, 2014

1 commit

  • The commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef
    "of/irq: do irq resolution in platform_get_irq" from Rob Herring -
    moves resolving of the interrupt resources in platform_get_irq().
    But this solution isn't complete because platform_get_irq_byname()
    need to be modified the same way.

    Hence, fix it by adding interrupt resolution code at the
    platform_get_irq_byname() function too.

    Cc: Russell King
    Cc: Rob Herring
    Cc: Tony Lindgren
    Cc: Grant Likely
    Cc: Thierry Reding

    Signed-off-by: Grygorii Strashko
    Signed-off-by: Grant Likely

    Grygorii Strashko
     

25 Apr, 2014

1 commit

  • Currently we get the following kind of errors if we try to use interrupt
    phandles to irqchips that have not yet initialized:

    irq: no irq domain found for /ocp/pinmux@48002030 !
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184()
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012
    (show_stack+0x14/0x1c)
    (dump_stack+0x6c/0xa0)
    (warn_slowpath_common+0x64/0x84)
    (warn_slowpath_null+0x1c/0x24)
    (of_device_alloc+0x144/0x184)
    (of_platform_device_create_pdata+0x44/0x9c)
    (of_platform_bus_create+0xd0/0x170)
    (of_platform_bus_create+0x12c/0x170)
    (of_platform_populate+0x60/0x98)

    This is because we're wrongly trying to populate resources that are not
    yet available. It's perfectly valid to create irqchips dynamically, so
    let's fix up the issue by resolving the interrupt resources when
    platform_get_irq is called.

    And then we also need to accept the fact that some irqdomains do not
    exist that early on, and only get initialized later on. So we can
    make the current WARN_ON into just into a pr_debug().

    We still attempt to populate irq resources when we create the devices.
    This allows current drivers which don't use platform_get_irq to continue
    to function. Once all drivers are fixed, this code can be removed.

    Suggested-by: Russell King
    Signed-off-by: Rob Herring
    Signed-off-by: Tony Lindgren
    Tested-by: Tony Lindgren
    Cc: stable@vger.kernel.org # v3.10+
    Signed-off-by: Grant Likely

    Rob Herring
     

09 Nov, 2013

1 commit


24 Oct, 2013

4 commits

  • All the users of of_irq_parse_raw pass in a raw interrupt specifier from
    the device tree and expect it to be returned (possibly modified) in an
    of_phandle_args structure. However, the primary function of
    of_irq_parse_raw() is to check for translations due to the presence of
    one or more interrupt-map properties. The actual placing of the data
    into an of_phandle_args structure is trivial. If it is refactored to
    accept an of_phandle_args structure directly, then it becomes possible
    to consume of_phandle_args from other sources. This is important for an
    upcoming patch that allows a device to be connected to more than one
    interrupt parent. It also simplifies the code a bit.

    The biggest complication with this patch is that the old version works
    on the interrupt specifiers in __be32 form, but the of_phandle_args
    structure is intended to carry it in the cpu-native version. A bit of
    churn was required to make this work. In the end it results in tighter
    code, so the churn is worth it.

    Signed-off-by: Grant Likely
    Acked-by: Tony Lindgren
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • All the callers of irq_create_of_mapping() pass the contents of a struct
    of_phandle_args structure to the function. Since all the callers already
    have an of_phandle_args pointer, why not pass it directly to
    irq_create_of_mapping()?

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Thomas Gleixner
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • struct of_irq and struct of_phandle_args are exactly the same structure.
    This patch makes the kernel use of_phandle_args everywhere. This in
    itself isn't a big deal, but it makes some follow-on patches simpler.

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Russell King
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     
  • The OF irq handling code has been overloading the term 'map' to refer to
    both parsing the data in the device tree and mapping it to the internal
    linux irq system. This is probably because the device tree does have the
    concept of an 'interrupt-map' function for translating interrupt
    references from one node to another, but 'map' is still confusing when
    the primary purpose of some of the functions are to parse the DT data.

    This patch renames all the of_irq_map_* functions to of_irq_parse_*
    which makes it clear that there is a difference between the parsing
    phase and the mapping phase. Kernel code can make use of just the
    parsing or just the mapping support as needed by the subsystem.

    The patch was generated mechanically with a handful of sed commands.

    Signed-off-by: Grant Likely
    Acked-by: Michal Simek
    Acked-by: Tony Lindgren
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt

    Grant Likely
     

25 Sep, 2013

1 commit

  • Much of of_irq.h is needlessly ifdef'ed. Clean this up and minimize the
    amount ifdef'ed code. This fixes some build warnings when CONFIG_OF
    is not enabled (seen on i386 and x86_64):

    include/linux/of_irq.h:82:7: warning: 'struct device_node' declared inside parameter list [enabled by default]
    include/linux/of_irq.h:82:7: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
    include/linux/of_irq.h:87:47: warning: 'struct device_node' declared inside parameter list [enabled by default]

    Compile tested on i386, sparc and arm.

    Reported-by: Randy Dunlap
    Cc: Grant Likely
    Signed-off-by: Rob Herring

    Rob Herring
     

18 Oct, 2012

1 commit

  • drivers/of/irq.c:195:57: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:196:51: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:199:57: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:201:58: warning: restricted __be32 degrades to integer
    drivers/of/irq.c:470:37: warning: incorrect type in assignment (different modifiers)
    drivers/of/irq.c:470:37: expected int ( *[usertype] irq_init_cb )( ... )
    drivers/of/irq.c:470:37: got void const *const data
    drivers/of/irq.c:96:5: error: symbol 'of_irq_map_raw' redeclared with different type (originally declared at include/linux/of_irq.h:61) - incompatible argument 2 (different base types)

    drivers/of/of_pci_irq.c:91:40: warning: incorrect type in argument 2 (different base types)
    drivers/of/of_pci_irq.c:91:40: expected unsigned int const [usertype] *intspec
    drivers/of/of_pci_irq.c:91:40: got restricted __be32 *
    drivers/of/of_pci_irq.c:91:53: warning: incorrect type in argument 4 (different base types)
    drivers/of/of_pci_irq.c:91:53: expected unsigned int const [usertype] *addr
    drivers/of/of_pci_irq.c:91:53: got restricted __be32 *

    Signed-off-by: Kim Phillips
    Signed-off-by: Rob Herring

    Kim Phillips
     

20 Sep, 2012

1 commit

  • of_irq_find_parent is a handy function to use outside the confines of
    the Open Firmware subsystem. One such use-case is when the IRQ Domain
    wishes to find an IRQ domain for a given device node. Currently it can
    not take any notice of the 'interrupt-parent' property. Instead it
    just uses the first IRQ controller as it climbs the Device Tree. If
    we were to use this as a precursor the resultant controller is more
    likely to be correct.

    Acked-by: Rob Herring
    Acked-by: Linus Walleij
    Signed-off-by: Lee Jones

    Lee Jones
     

18 Apr, 2012

1 commit

  • Add a empty irq_of_parse_and_map() function that returns 0 for non-dt
    builds and avoid having #ifdef CONFIG_OF around all calls to
    irq_of_parse_and_map(). In addition to that, the irq_of_parse_and_map()
    function declaration is made available only if CONFIG_OF_IRQ is defined,
    which is the same config option that makes the irq_of_parse_and_map()
    function definition available. While at it, fix a typo as well.

    Changes since v1:
    - Moved irq_of_parse_and_map() function declaration under CONFIG_OF_IRQ.
    - Fix a minor typo in comments.

    Suggested-by: Grant Likely
    Signed-off-by: Thomas Abraham
    Acked-by: Rob Herring
    [grant.likely: fix bug causing SPARC to break]
    Signed-off-by: Grant Likely

    Thomas Abraham
     

27 Feb, 2012

1 commit

  • Several architectures define their own empty irq_dispose_mapping(). Since
    the irq_domain code is centralized now, there is little need to do so. This
    patch removes them and creates a new empty copy when !CONFIG_IRQ_DOMAIN is
    selected.

    The patch also means that IRQ_DOMAIN becomes selectable on all architectures.

    Signed-off-by: Grant Likely
    Cc: Rob Herring
    Cc: "David S. Miller"
    Cc: Jonas Bonn
    Cc: sparclinux@vger.kernel.org
    Cc: linux@lists.openrisc.net

    Grant Likely
     

31 Oct, 2011

1 commit

  • of_irq_init will scan the devicetree for matching interrupt controller
    nodes. Then it calls an initialization function for each found controller
    in the proper order with parent nodes initialized before child nodes.

    Based on initial pseudo code from Grant Likely.

    Changes in v4:
    - Drop unnecessary empty list check
    - Be more verbose on errors
    - Simplify "if (!desc) WARN_ON(1)" to "if (WARN_ON(!desc))"

    Changes in v3:
    - add missing kfree's found by Jamie
    - Implement Grant's comments to simplify the init loop
    - fix function comments

    Changes in v2:
    - Complete re-write of list searching code from Grant Likely

    Signed-off-by: Rob Herring
    Reviewed-by: Jamie Iles
    Tested-by: Thomas Abraham
    Acked-by: Grant Likely

    Rob Herring
     

28 Jul, 2011

1 commit

  • This patch adds irq_domain infrastructure for translating from
    hardware irq numbers to linux irqs. This is particularly important
    for architectures adding device tree support because the current
    implementation (excluding PowerPC and SPARC) cannot handle
    translation for more than a single interrupt controller. irq_domain
    supports device tree translation for any number of interrupt
    controllers.

    This patch converts x86, Microblaze, ARM and MIPS to use irq_domain
    for device tree irq translation. x86 is untested beyond compiling it,
    irq_domain is enabled for MIPS and Microblaze, but the old behaviour is
    preserved until the core code is modified to actually register an
    irq_domain yet. On ARM it works and is required for much of the new
    ARM device tree board support.

    PowerPC has /not/ been converted to use this new infrastructure. It
    is still missing some features before it can replace the virq
    infrastructure already in powerpc (see documentation on
    irq_domain_map/unmap for details). Followup patches will add the
    missing pieces and migrate PowerPC to use irq_domain.

    SPARC has its own method of managing interrupts from the device tree
    and is unaffected by this change.

    Acked-by: Ralf Baechle
    Signed-off-by: Grant Likely

    Grant Likely
     

20 Apr, 2011

1 commit


22 Oct, 2010

1 commit


13 Oct, 2010

1 commit


06 Jul, 2010

1 commit

  • Merge common irq mapping code between PowerPC and Microblaze.

    This patch merges of_irq_find_parent(), of_irq_map_raw() and
    of_irq_map_one(). The functions are dependent on one another, so all
    three are merged in a single patch. Other than cosmetic difference
    (ie. DBG() vs. pr_debug()), the implementations are identical.

    of_irq_to_resource() is also merged, but in this case the
    implementations are different. This patch drops the microblaze version
    and uses the powerpc implementation unchanged. The microblaze version
    essentially open-coded irq_of_parse_and_map() which it does not need
    to do. Therefore the powerpc version is safe to adopt.

    Signed-off-by: Grant Likely
    CC: Michal Simek
    CC: Benjamin Herrenschmidt
    CC: Stephen Rothwell

    Grant Likely
     

29 Jun, 2010

1 commit

  • Merge common code between PowerPC and Microblaze. SPARC implements
    irq_of_parse_and_map(), but the implementation is different, so it
    does not use this code.

    Signed-off-by: Grant Likely
    Acked-by: Benjamin Herrenschmidt
    Cc: Michal Simek
    Cc: "David S. Miller"
    Cc: Stephen Rothwell
    Cc: Jeremy Kerr

    Grant Likely