10 Jul, 2018

1 commit

  • Now that we use the driver core to stop deferred probe for missing
    drivers, IOMMU_OF_DECLARE can be removed.

    This is slightly less optimal than having a list of built-in drivers in
    that we'll now defer probe twice before giving up. This shouldn't have a
    significant impact on boot times as past discussions about deferred
    probe have given no evidence of deferred probe having a substantial
    impact.

    Cc: Robin Murphy
    Cc: Kukjin Kim
    Cc: Krzysztof Kozlowski
    Cc: Rob Clark
    Cc: Heiko Stuebner
    Cc: Frank Rowand
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: iommu@lists.linux-foundation.org
    Cc: linux-samsung-soc@vger.kernel.org
    Cc: linux-arm-msm@vger.kernel.org
    Cc: linux-rockchip@lists.infradead.org
    Cc: devicetree@vger.kernel.org
    Acked-by: Will Deacon
    Acked-by: Marek Szyprowski
    Acked-by: Joerg Roedel
    Signed-off-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Rob Herring
     

17 Jan, 2018

1 commit

  • Now that no more drivers rely on arbitrary early initialisation via an
    of_iommu_init_fn hook, let's clean up the redundant remnants. The
    IOMMU_OF_DECLARE() macro needs to remain for now, as the probe-deferral
    mechanism has no other nice way to detect built-in drivers before they
    have registered themselves, such that it can make the right decision.

    Reviewed-by: Sricharan R
    Signed-off-by: Robin Murphy
    Signed-off-by: Joerg Roedel

    Robin Murphy
     

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
     

27 Jan, 2017

1 commit

  • With the introduction of the new iommu_{register/get}_instance()
    interface in commit e4f10ffe4c9b ("iommu: Make of_iommu_set/get_ops() DT
    agnostic") (based on struct fwnode_handle as look-up token, so firmware
    agnostic) to register IOMMU instances with the core IOMMU layer there is
    no reason to keep the old OF based interface around any longer.

    Convert all the IOMMU drivers (and OF IOMMU core code) that rely on the
    of_iommu_{set/get}_ops() to the new kernel interface to register/retrieve
    IOMMU instances and remove the of_iommu_{set/get}_ops() remaining glue
    code in order to complete the interface rework.

    Cc: Matthias Brugger
    Cc: Will Deacon
    Cc: Joerg Roedel
    Cc: Marek Szyprowski
    Reviewed-by: Robin Murphy
    Tested-by: Sricharan R
    Tested-by: Yong Wu
    Signed-off-by: Lorenzo Pieralisi
    Signed-off-by: Will Deacon

    Lorenzo Pieralisi
     

29 Nov, 2016

1 commit

  • The of_iommu_{set/get}_ops() API is used to associate a device
    tree node with a specific set of IOMMU operations. The same
    kernel interface is required on systems booting with ACPI, where
    devices are not associated with a device tree node, therefore
    the interface requires generalization.

    The struct device fwnode member represents the fwnode token associated
    with the device and the struct it points at is firmware specific;
    regardless, it is initialized on both ACPI and DT systems and makes an
    ideal candidate to use it to associate a set of IOMMU operations to a
    given device, through its struct device.fwnode member pointer, paving
    the way for representing per-device iommu_ops (ie an iommu instance
    associated with a device).

    Convert the DT specific of_iommu_{set/get}_ops() interface to
    use struct device.fwnode as a look-up token, making the interface
    usable on ACPI systems and rename the data structures and the
    registration API so that they are made to represent their usage
    more clearly.

    Signed-off-by: Lorenzo Pieralisi
    Acked-by: Will Deacon
    Reviewed-by: Robin Murphy
    Reviewed-by: Tomasz Nowicki
    Tested-by: Hanjun Guo
    Tested-by: Tomasz Nowicki
    Cc: Will Deacon
    Cc: Hanjun Guo
    Cc: Robin Murphy
    Cc: Joerg Roedel
    Signed-off-by: Will Deacon

    Lorenzo Pieralisi
     

24 Jun, 2016

1 commit

  • The of_iommu_init() is called multiple times by arch code,
    make it postcore_initcall_sync, then we can drop relevant
    calls fully.

    Note, the IOMMUs should have a chance to perform some basic
    initialisation before we start adding masters to them. So
    postcore_initcall_sync is good choice, it ensures of_iommu_init()
    called before of_platform_populate.

    Acked-by: Rich Felker
    Tested-by: Marek Szyprowski
    Cc: Arnd Bergmann
    Cc: Catalin Marinas
    Cc: Marek Szyprowski
    Cc: Rich Felker
    Cc: Rob Herring
    Cc: Robin Murphy
    Cc: Will Deacon
    Signed-off-by: Kefeng Wang
    Acked-by: Joerg Roedel
    Signed-off-by: Rob Herring

    Kefeng Wang
     

09 May, 2016

1 commit


04 Mar, 2015

1 commit

  • of_iommu_configure() is called from of_dma_configure() to setup iommu ops
    using DT property. This API is currently used for platform devices for
    which DMA configuration (including IOMMU ops) may come from the device's
    parent. To extend this functionality for PCI devices, this API needs to
    take a parent node ptr as an argument instead of assuming device's parent.
    This is needed since for PCI, the DMA configuration may be defined in the
    DT node of the root bus bridge's parent device. Currently only dma-range
    is used for PCI and IOMMU is not supported. Return error if the device is
    PCI.

    Add "parent" parameter (a struct device_node *) to of_iommu_configure().

    Tested-by: Suravee Suthikulpanit (AMD Seattle)
    Signed-off-by: Murali Karicheri
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Catalin Marinas
    Acked-by: Rob Herring
    Acked-by: Will Deacon
    CC: Joerg Roedel
    CC: Grant Likely
    CC: Russell King
    CC: Arnd Bergmann

    Murali Karicheri
     

05 Dec, 2014

1 commit

  • Since the data pointer in the DT node is public and may be overwritten
    by conflicting code, move the DT-probed IOMMU ops to a private list
    where they will be safe.

    Acked-by: Grant Likely
    Signed-off-by: Robin Murphy
    [will: added missing #include and missing ')']
    Signed-off-by: Will Deacon

    Robin Murphy
     

02 Dec, 2014

2 commits

  • The generic IOMMU device-tree bindings can be used to add arbitrary OF
    masters to an IOMMU with a compliant binding.

    This patch introduces of_iommu_configure, which does exactly that.

    Acked-by: Arnd Bergmann
    Acked-by: Joerg Roedel
    Acked-by: Marek Szyprowski
    Tested-by: Robin Murphy
    Signed-off-by: Will Deacon

    Will Deacon
     
  • IOMMU drivers must be initialised before any of their upstream devices,
    otherwise the relevant iommu_ops won't be configured for the bus in
    question. To solve this, a number of IOMMU drivers use initcalls to
    initialise the driver before anything has a chance to be probed.

    Whilst this solves the immediate problem, it leaves the job of probing
    the IOMMU completely separate from the iommu_ops to configure the IOMMU,
    which are called on a per-bus basis and require the driver to figure out
    exactly which instance of the IOMMU is being requested. In particular,
    the add_device callback simply passes a struct device to the driver,
    which then has to parse firmware tables or probe buses to identify the
    relevant IOMMU instance.

    This patch takes the first step in addressing this problem by adding an
    early initialisation pass for IOMMU drivers, giving them the ability to
    store some per-instance data in their iommu_ops structure and store that
    in their of_node. This can later be used when parsing OF masters to
    identify the IOMMU instance in question.

    Acked-by: Arnd Bergmann
    Acked-by: Joerg Roedel
    Acked-by: Marek Szyprowski
    Tested-by: Robin Murphy
    Signed-off-by: Will Deacon

    Will Deacon
     

25 Jun, 2012

1 commit

  • This code was based on:
    "arch/microblaze/kernel/prom_parse.c"
    "arch/powerpc/kernel/prom_parse.c"

    Can replace "of_parse_dma_window()" in the above. This supports
    different formats flexibly. "prefix" can be configured if any. "busno"
    and "index" are optionally specified. Set NULL and 0 if not used.

    Signed-off-by: Hiroshi DOYU
    Acked-by: Stephen Warren
    Signed-off-by: Joerg Roedel

    Hiroshi Doyu