1. 13 5月, 2018 1 次提交
    • M
      genirq/msi: Allow level-triggered MSIs to be exposed by MSI providers · 0be8153c
      Marc Zyngier 提交于
      So far, MSIs have been used to signal edge-triggered interrupts, as
      a write is a good model for an edge (you can't "unwrite" something).
      On the other hand, routing zillions of wires in an SoC because you
      need level interrupts is a bit extreme.
      
      People have come up with a variety of schemes to support this, which
      involves sending two messages: one to signal the interrupt, and one
      to clear it. Since the kernel cannot represent this, we've ended up
      with side-band mechanisms that are pretty awful.
      
      Instead, let's acknoledge the requirement, and ensure that, under the
      right circumstances, the irq_compose_msg and irq_write_msg can take
      as a parameter an array of two messages instead of a pointer to a
      single one. We also add some checking that the compose method only
      clobbers the second message if the MSI domain has been created with
      the MSI_FLAG_LEVEL_CAPABLE flags.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Link: https://lkml.kernel.org/r/20180508121438.11301-2-marc.zyngier@arm.com
      0be8153c
  2. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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 <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  3. 26 9月, 2017 1 次提交
  4. 30 7月, 2017 1 次提交
  5. 16 2月, 2017 1 次提交
    • A
      genirq/msi: Add stubs for get_cached_msi_msg/pci_write_msi_msg · 2f44e29c
      Arnd Bergmann 提交于
      A bug fix to the MSIx handling in vfio added references to functions
      that may not be defined if MSI is disabled in the kernel, resulting in
      this link error:
      
      drivers/built-in.o: In function `vfio_msi_set_vector_signal':
      :(.text+0x450808): undefined reference to `get_cached_msi_msg'
      :(.text+0x45080c): undefined reference to `write_msi_msg'
      
      As suggested by Alex Williamson, add stub implementations for
      get_cached_msi_msg() and pci_write_msi_msg().
      
      In case this bugfix gets backported, please note that the #ifdef
      has changed over time, originally both functions were implemented
      in drivers/pci/msi.c and controlled by CONFIG_PCI_MSI, while nowadays
      get_cached_msi_msg() is part of the generic MSI support and can be
      used without PCI.
      
      Fixes: b8f02af0 ("vfio/pci: Restore MSIx message prior to enabling")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Link: http://lkml.kernel.org/r/1413190208.4202.34.camel@ul30vt.home
      Link: http://lkml.kernel.org/r/20170214215343.3307861-1-arnd@arndb.deSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      2f44e29c
  6. 11 2月, 2017 2 次提交
  7. 15 9月, 2016 1 次提交
  8. 09 8月, 2016 1 次提交
  9. 04 7月, 2016 2 次提交
  10. 08 2月, 2016 1 次提交
  11. 08 1月, 2016 1 次提交
  12. 16 12月, 2015 3 次提交
    • M
      platform-msi: Allow creation of a MSI-based stacked irq domain · 552c494a
      Marc Zyngier 提交于
      We almost have all the needed bits requiredable to create a irq domain
      on top of a MSI domain.
      
      For this, we enable a few things:
      - the virq is stored in the msi_desc
      - device, msi_alloc_info and domain-specific data
        are stored in the platform_priv_data structure
      - we introduce a new API for platform-msi:
      
        /* Create a MSI-based domain */
        struct irq_domain *
        platform_msi_create_device_domain(struct device *dev,
                                          unsigned int nvec,
                                          irq_write_msi_msg_t write_msi_msg,
                                          const struct irq_domain_ops *ops,
                                          void *host_data);
      
        /* Allocate MSIs in an MSI domain */
        int platform_msi_domain_alloc(struct irq_domain *domain,
      				unsigned int virq,
      				unsigned int nr_irqs);
      
        /* Free MSIs from an MSI domain */
        void platform_msi_domain_free(struct irq_domain *domain,
      				unsigned int virq,
      				unsigned int nvec);
      
        /* Obtain the host data passed to platform_msi_create_device_domain */
        void *platform_msi_get_host_data(struct irq_domain *domain);
      
      platform_msi_create_device_domain() is a hybrid of irqdomain creation
      and interrupt allocation, creating a domain backed by the MSIs associated
      to a device. IRQs can then be allocated in that domain using
      platform_msi_domain_alloc().
      
      This now allows a wired irq to MSI bridge to be created.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      552c494a
    • M
      genirq/msi: Add msi_domain_populate_irqs · 2145ac93
      Marc Zyngier 提交于
      To be able to allocate interrupts from the MSI layer down,
      add a new msi_domain_populate_irqs entry point.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      2145ac93
    • M
      genirq/msi: Make the .prepare callback reusable · b2eba39b
      Marc Zyngier 提交于
      The .prepare callbacks are so far only called from msi_domain_alloc_irqs.
      In order to reuse that code, split that code and create a
      msi_domain_prepare_irqs function that the existing code can call into.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      b2eba39b
  13. 16 10月, 2015 2 次提交
  14. 14 10月, 2015 1 次提交
  15. 19 9月, 2015 1 次提交
  16. 30 7月, 2015 2 次提交
    • M
      PCI/MSI: Drop domain field from msi_controller · f075915a
      Marc Zyngier 提交于
      The only three users of that field are not using the msi_controller
      structure anymore, so drop it altogether.
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: <linux-arm-kernel@lists.infradead.org>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Ma Jun <majun258@huawei.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Duc Dang <dhdang@apm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/1438091186-10244-20-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f075915a
    • M
      drivers/base: Add MSI domain support for non-PCI devices · c09fcc4b
      Marc Zyngier 提交于
      With the msi_list and the msi_domain properties now being at the
      generic device level, it is starting to be relatively easy to offer
      a generic way of providing non-PCI MSIs.
      
      The two major hurdles with this idea are:
      
      - Lack of global ID that identifies a device: this is worked around by
        having a global ID allocator for each device that gets enrolled in
        the platform MSI subsystem
      
      - Lack of standard way to write the message in the generating device.
        This is solved by mandating driver code to provide a write_msg
        callback, so that everyone can have their own square wheel
      
      Apart from that, the API is fairly straightforward:
      
      - platform_msi_create_irq_domain creates an MSI domain that gets
        tagged with DOMAIN_BUS_PLATFORM_MSI
      
      - platform_msi_domain_alloc_irqs allocate MSIs for a given device,
        populating the msi_list
      
      - platform_msi_domain_free_irqs does what is written on the tin
      
      [ tglx: Created a seperate struct platform_msi_desc and added
        	kerneldoc entries ]
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Cc: <linux-arm-kernel@lists.infradead.org>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Ma Jun <majun258@huawei.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Duc Dang <dhdang@apm.com>
      Cc: Hanjun Guo <hanjun.guo@linaro.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Link: http://lkml.kernel.org/r/1438091186-10244-10-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      c09fcc4b
  17. 23 7月, 2015 5 次提交
  18. 24 11月, 2014 1 次提交
  19. 23 11月, 2014 9 次提交
  20. 12 11月, 2014 3 次提交