1. 02 9月, 2020 4 次提交
  2. 14 5月, 2018 2 次提交
  3. 16 2月, 2018 1 次提交
  4. 16 11月, 2017 1 次提交
  5. 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
  6. 10 8月, 2017 1 次提交
  7. 07 7月, 2017 1 次提交
    • D
      genirq: Allow to pass the IRQF_TIMER flag with percpu irq request · c80081b9
      Daniel Lezcano 提交于
      The irq timings infrastructure tracks when interrupts occur in order to
      statistically predict te next interrupt event.
      
      There is no point to track timer interrupts and try to predict them because
      the next expiration time is already known. This can be avoided via the
      IRQF_TIMER flag which is passed by timer drivers in request_irq(). It marks
      the interrupt as timer based which alloes to ignore these interrupts in the
      timings code.
      
      Per CPU interrupts which are requested via request_percpu_+irq() have no
      flag argument, so marking per cpu timer interrupts is not possible and they
      get tracked pointlessly.
      
      Add __request_percpu_irq() as a variant of request_percpu_irq() with a
      flags argument and make request_percpu_irq() an inline wrapper passing
      flags = 0.
      
      The flag parameter is restricted to IRQF_TIMER as all other IRQF_ flags
      make no sense for per cpu interrupts.
      
      The next step is to convert all existing users of request_percpu_irq() and
      then remove the wrapper and the underscores.
      
      [ tglx: Massaged changelog ]
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: peterz@infradead.org
      Cc: nicolas.pitre@linaro.org
      Cc: vincent.guittot@linaro.org
      Cc: rafael@kernel.org
      Link: http://lkml.kernel.org/r/1499344144-3964-1-git-send-email-daniel.lezcano@linaro.org
      c80081b9
  8. 24 6月, 2017 2 次提交
    • D
      genirq/timings: Add infrastructure for estimating the next interrupt arrival time · e1c92149
      Daniel Lezcano 提交于
      An interrupt behaves with a burst of activity with periodic interval of time
      followed by one or two peaks of longer interval.
      
      As the time intervals are periodic, statistically speaking they follow a normal
      distribution and each interrupts can be tracked individually.
      
      Add a mechanism to compute the statistics on all interrupts, except the
      timers which are deterministic from a prediction point of view, as their
      expiry time is known.
      
      The goal is to extract the periodicity for each interrupt, with the last
      timestamp and sum them, so the next event can be predicted to a certain
      extent.
      
      Taking the earliest prediction gives the expected wakeup on the system
      (assuming a timer won't expire before).
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Vincent Guittot <vincent.guittot@linaro.org>
      Cc: "Rafael J . Wysocki" <rafael@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Link: http://lkml.kernel.org/r/1498227072-5980-2-git-send-email-daniel.lezcano@linaro.org
      e1c92149
    • D
      genirq/timings: Add infrastructure to track the interrupt timings · b2d3d61a
      Daniel Lezcano 提交于
      The interrupt framework gives a lot of information about each interrupt. It
      does not keep track of when those interrupts occur though, which is a
      prerequisite for estimating the next interrupt arrival for power management
      purposes.
      
      Add a mechanism to record the timestamp for each interrupt occurrences in a
      per-CPU circular buffer to help with the prediction of the next occurrence
      using a statistical model.
      
      Each CPU can store up to IRQ_TIMINGS_SIZE events <irq, timestamp>, the
      current value of IRQ_TIMINGS_SIZE is 32.
      
      Each event is encoded into a single u64, where the high 48 bits are used
      for the timestamp and the low 16 bits are for the irq number.
      
      A static key is introduced so when the irq prediction is switched off at
      runtime, the overhead is near to zero.
      
      It results in most of the code in internals.h for inline reasons and a very
      few in the new file timings.c. The latter will contain more in the next patch
      which will provide the statistical model for the next event prediction.
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NNicolas Pitre <nicolas.pitre@linaro.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Hannes Reinecke <hare@suse.com>
      Cc: Vincent Guittot <vincent.guittot@linaro.org>
      Cc: "Rafael J . Wysocki" <rafael@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Link: http://lkml.kernel.org/r/1498227072-5980-1-git-send-email-daniel.lezcano@linaro.org
      b2d3d61a
  9. 23 5月, 2017 1 次提交
  10. 19 4月, 2017 1 次提交
  11. 09 11月, 2016 3 次提交
  12. 15 9月, 2016 2 次提交
  13. 04 7月, 2016 1 次提交
  14. 26 3月, 2016 1 次提交
  15. 09 3月, 2016 1 次提交
    • C
      x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected" · e237a551
      Chen Fan 提交于
      Per the x86-specific footnote to PCI spec r3.0, sec 6.2.4, the value 255 in
      the Interrupt Line register means "unknown" or "no connection."
      Previously, when we couldn't derive an IRQ from the _PRT, we fell back to
      using the value from Interrupt Line as an IRQ.  It's questionable whether
      we should do that at all, but the spec clearly suggests we shouldn't do it
      for the value 255 on x86.
      
      Calling request_irq() with IRQ 255 may succeed, but the driver won't
      receive any interrupts.  Or, if IRQ 255 is shared with another device, it
      may succeed, and the driver's ISR will be called at random times when the
      *other* device interrupts.  Or it may fail if another device is using IRQ
      255 with incompatible flags.  What we *want* is for request_irq() to fail
      predictably so the driver can fall back to polling.
      
      On x86, assume 255 in the Interrupt Line means the INTx line is not
      connected.  In that case, set dev->irq to IRQ_NOTCONNECTED so request_irq()
      will fail gracefully with -ENOTCONN.
      
      We found this problem on a system where Secure Boot firmware assigned
      Interrupt Line 255 to an i801_smbus device and another device was already
      using MSI-X IRQ 255.  This was in v3.10, where i801_probe() fails if
      request_irq() fails:
      
        i801_smbus 0000:00:1f.3: enabling device (0140 -> 0143)
        i801_smbus 0000:00:1f.3: can't derive routing for PCI INT C
        i801_smbus 0000:00:1f.3: PCI INT C: no GSI
        genirq: Flags mismatch irq 255. 00000080 (i801_smbus) vs. 00000000 (megasa)
        CPU: 0 PID: 2487 Comm: kworker/0:1 Not tainted 3.10.0-229.el7.x86_64 #1
        Hardware name: FUJITSU PRIMEQUEST 2800E2/D3736, BIOS PRIMEQUEST 2000 Serie5
        Call Trace:
          dump_stack+0x19/0x1b
          __setup_irq+0x54a/0x570
          request_threaded_irq+0xcc/0x170
          i801_probe+0x32f/0x508 [i2c_i801]
          local_pci_probe+0x45/0xa0
        i801_smbus 0000:00:1f.3: Failed to allocate irq 255: -16
        i801_smbus: probe of 0000:00:1f.3 failed with error -16
      
      After aeb8a3d1 ("i2c: i801: Check if interrupts are disabled"),
      i801_probe() will fall back to polling if request_irq() fails.  But we
      still need this patch because request_irq() may succeed or fail depending
      on other devices in the system.  If request_irq() fails, i801_smbus will
      work by falling back to polling, but if it succeeds, i801_smbus won't work
      because it expects interrupts that it may not receive.
      Signed-off-by: NChen Fan <chen.fan.fnst@cn.fujitsu.com>
      Acked-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e237a551
  16. 12 12月, 2015 1 次提交
  17. 08 12月, 2015 1 次提交
    • T
      genirq: Implement irq_percpu_is_enabled() · f0cb3220
      Thomas Petazzoni 提交于
      Certain interrupt controller drivers have a register set that does not
      make it easy to save/restore the mask of enabled/disabled interrupts
      at suspend/resume time. At resume time, such drivers rely on the core
      kernel irq subsystem to tell whether such or such interrupt is enabled
      or not, in order to restore the proper state in the interrupt
      controller register.
      
      While the irqd_irq_disabled() provides the relevant information for
      global interrupts, there is no similar function to query the
      enabled/disabled state of a per-CPU interrupt.
      
      Therefore, this commit complements the percpu_irq API with an
      irq_percpu_is_enabled() function.
      
      [ tglx: Simplified the implementation and added kerneldoc ]
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Tawfik Bayouk <tawfik@marvell.com>
      Cc: Nadav Haklai <nadavh@marvell.com>
      Cc: Lior Amsalem <alior@marvell.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Cc: Gregory Clement <gregory.clement@free-electrons.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Link: http://lkml.kernel.org/r/1445347435-2333-2-git-send-email-thomas.petazzoni@free-electrons.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      f0cb3220
  18. 22 9月, 2015 1 次提交
    • T
      genirq: Handle force threading of irqs with primary and thread handler · 2a1d3ab8
      Thomas Gleixner 提交于
      Force threading of interrupts does not really deal with interrupts
      which are requested with a primary and a threaded handler. The current
      policy is to leave them alone and let the primary handler run in
      interrupt context, but we set the ONESHOT flag for those interrupts as
      well.
      
      Kohji Okuno debugged a problem with the SDHCI driver where the
      interrupt thread waits for a hardware interrupt to trigger, which can't
      work well because the hardware interrupt is masked due to the ONESHOT
      flag being set. He proposed to set the ONESHOT flag only if the
      interrupt does not provide a thread handler.
      
      Though that does not work either because these interrupts can be
      shared. So the other interrupt would rightfully get the ONESHOT flag
      set and therefor the same situation would happen again.
      
      To deal with this proper, we need to force thread the primary handler
      of such interrupts as well. That means that the primary interrupt
      handler is treated as any other primary interrupt handler which is not
      marked IRQF_NO_THREAD. The threaded handler becomes a separate thread
      so the SDHCI flow logic can be handled gracefully.
      
      The same issue was reported against 4.1-rt.
      Reported-and-tested-by: NKohji Okuno <okuno.kohji@jp.panasonic.com>
      Reported-By: NMichal Smucr <msmucr@gmail.com>
      Reported-and-tested-by: NNathan Sullivan <nathan.sullivan@ni.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1509211058080.5606@nanosSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      2a1d3ab8
  19. 22 4月, 2015 2 次提交
  20. 09 4月, 2015 1 次提交
    • M
      genirq: Allow the irqchip state of an IRQ to be save/restored · 1b7047ed
      Marc Zyngier 提交于
      There is a number of cases where a kernel subsystem may want to
      introspect the state of an interrupt at the irqchip level:
      
      - When a peripheral is shared between virtual machines,
        its interrupt state becomes part of the guest's state,
        and must be switched accordingly. KVM on arm/arm64 requires
        this for its guest-visible timer
      - Some GPIO controllers seem to require peeking into the
        interrupt controller they are connected to to report
        their internal state
      
      This seem to be a pattern that is common enough for the core code
      to try and support this without too many horrible hacks. Introduce
      a pair of accessors (irq_get_irqchip_state/irq_set_irqchip_state)
      to retrieve the bits that can be of interest to another subsystem:
      pending, active, and masked.
      
      - irq_get_irqchip_state returns the state of the interrupt according
        to a parameter set to IRQCHIP_STATE_PENDING, IRQCHIP_STATE_ACTIVE,
        IRQCHIP_STATE_MASKED or IRQCHIP_STATE_LINE_LEVEL.
      - irq_set_irqchip_state similarly sets the state of the interrupt.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Reviewed-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
      Tested-by: NBjorn Andersson <bjorn.andersson@sonymobile.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Phong Vo <pvo@apm.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Tin Huynh <tnhuynh@apm.com>
      Cc: Y Vo <yvo@apm.com>
      Cc: Toan Le <toanle@apm.com>
      Cc: Bjorn Andersson <bjorn@kryo.se>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Link: http://lkml.kernel.org/r/1426676484-21812-2-git-send-email-marc.zyngier@arm.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      1b7047ed
  21. 06 3月, 2015 1 次提交
    • V
      genirq: Remove the deprecated 'IRQF_DISABLED' request_irq() flag entirely · d8bf368d
      Valentin Rothberg 提交于
      The IRQF_DISABLED flag is a NOOP and has been scheduled for removal
      since Linux v2.6.36 by commit 6932bf37 ("genirq: Remove
      IRQF_DISABLED from core code").
      
      According to commit e58aa3d2 ("genirq: Run irq handlers with
      interrupts disabled"), running IRQ handlers with interrupts
      enabled can cause stack overflows when the interrupt line of the
      issuing device is still active.
      
      This patch ends the grace period for IRQF_DISABLED (i.e.,
      SA_INTERRUPT in older versions of Linux) and removes the
      definition and all remaining usages of this flag.
      
      There's still a few non-functional references left in the kernel
      source:
      
        - The bigger hunk in Documentation/scsi/ncr53c8xx.txt is removed entirely
          as IRQF_DISABLED is gone now; the usage in older kernel versions
          (including the old SA_INTERRUPT flag) should be discouraged.  The
          trouble of using IRQF_SHARED is a general problem and not specific to
          any driver.
      
        - I left the reference in Documentation/PCI/MSI-HOWTO.txt untouched since
          it has already been removed in linux-next.
      
        - All remaining references are changelogs that I suggest to keep.
      Signed-off-by: NValentin Rothberg <valentinrothberg@gmail.com>
      Cc: Afzal Mohammed <afzal@ti.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Ewan Milne <emilne@redhat.com>
      Cc: Eyal Perry <eyalpe@mellanox.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Hongliang Tao <taohl@lemote.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Nishanth Menon <nm@ti.com>
      Cc: Paul Bolle <pebolle@tiscali.nl>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Lambert <lambert.quentin@gmail.com>
      Cc: Rajendra Nayak <rnayak@ti.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Sricharan R <r.sricharan@ti.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Zhou Wang <wangzhou1@hisilicon.com>
      Cc: iss_storagedev@hp.com
      Cc: linux-mips@linux-mips.org
      Cc: linux-mtd@lists.infradead.org
      Link: http://lkml.kernel.org/r/1425565425-12604-1-git-send-email-valentinrothberg@gmail.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      d8bf368d
  22. 05 3月, 2015 1 次提交
    • R
      genirq / PM: Add flag for shared NO_SUSPEND interrupt lines · 17f48034
      Rafael J. Wysocki 提交于
      It currently is required that all users of NO_SUSPEND interrupt
      lines pass the IRQF_NO_SUSPEND flag when requesting the IRQ or the
      WARN_ON_ONCE() in irq_pm_install_action() will trigger.  That is
      done to warn about situations in which unprepared interrupt handlers
      may be run unnecessarily for suspended devices and may attempt to
      access those devices by mistake.  However, it may cause drivers
      that have no technical reasons for using IRQF_NO_SUSPEND to set
      that flag just because they happen to share the interrupt line
      with something like a timer.
      
      Moreover, the generic handling of wakeup interrupts introduced by
      commit 9ce7a258 (genirq: Simplify wakeup mechanism) only works
      for IRQs without any NO_SUSPEND users, so the drivers of wakeup
      devices needing to use shared NO_SUSPEND interrupt lines for
      signaling system wakeup generally have to detect wakeup in their
      interrupt handlers.  Thus if they happen to share an interrupt line
      with a NO_SUSPEND user, they also need to request that their
      interrupt handlers be run after suspend_device_irqs().
      
      In both cases the reason for using IRQF_NO_SUSPEND is not because
      the driver in question has a genuine need to run its interrupt
      handler after suspend_device_irqs(), but because it happens to
      share the line with some other NO_SUSPEND user.  Otherwise, the
      driver would do without IRQF_NO_SUSPEND just fine.
      
      To make it possible to specify that condition explicitly, introduce
      a new IRQ action handler flag for shared IRQs, IRQF_COND_SUSPEND,
      that, when set, will indicate to the IRQ core that the interrupt
      user is generally fine with suspending the IRQ, but it also can
      tolerate handler invocations after suspend_device_irqs() and, in
      particular, it is capable of detecting system wakeup and triggering
      it as appropriate from its interrupt handler.
      
      That will allow us to work around a problem with a shared timer
      interrupt line on at91 platforms.
      
      Link: http://marc.info/?l=linux-kernel&m=142252777602084&w=2
      Link: http://marc.info/?t=142252775300011&r=1&w=2
      Link: https://lkml.org/lkml/2014/12/15/552Reported-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      17f48034
  23. 26 2月, 2015 1 次提交
    • M
      genirq / PM: better describe IRQF_NO_SUSPEND semantics · 737eb030
      Mark Rutland 提交于
      The IRQF_NO_SUSPEND flag is intended to be used for interrupts required
      to be enabled during the suspend-resume cycle. This mostly consists of
      IPIs and timer interrupts, potentially including chained irqchip
      interrupts if these are necessary to handle timers or IPIs. If an
      interrupt does not fall into one of the aforementioned categories,
      requesting it with IRQF_NO_SUSPEND is likely incorrect.
      
      Using IRQF_NO_SUSPEND does not guarantee that the interrupt can wake the
      system from a suspended state. For an interrupt to be able to trigger a
      wakeup, it may be necessary to program various components of the system.
      In these cases it is necessary to use {enable,disabled}_irq_wake.
      
      Unfortunately, several drivers assume that IRQF_NO_SUSPEND ensures that
      an IRQ can wake up the system, and the documentation can be read
      ambiguously w.r.t. this property.
      
      This patch updates the documentation regarding IRQF_NO_SUSPEND to make
      this caveat explicit, hopefully making future misuse rarer. Cleanup of
      existing misuse will occur as part of later patch series.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      737eb030
  24. 18 2月, 2015 1 次提交
    • P
      genirq: Provide disable_hardirq() · 02cea395
      Peter Zijlstra 提交于
      For things like netpoll there is a need to disable an interrupt from
      atomic context. Currently netpoll uses disable_irq() which will
      sleep-wait on threaded handlers and thus forced_irqthreads breaks
      things.
      
      Provide disable_hardirq(), which uses synchronize_hardirq() to only wait
      for active hardirq handlers; also change synchronize_hardirq() to
      return the status of threaded handlers.
      
      This will allow one to try-disable an interrupt from atomic context, or
      in case of request_threaded_irq() to only wait for the hardirq part.
      Suggested-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: David Miller <davem@davemloft.net>
      Cc: Eyal Perry <eyalpe@mellanox.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Quentin Lambert <lambert.quentin@gmail.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Link: http://lkml.kernel.org/r/20150205130623.GH5029@twins.programming.kicks-ass.net
      [ Fixed typos and such. ]
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      02cea395
  25. 13 12月, 2014 1 次提交
  26. 01 9月, 2014 1 次提交
    • T
      genirq: Simplify wakeup mechanism · 9ce7a258
      Thomas Gleixner 提交于
      Currently we suspend wakeup interrupts by lazy disabling them and
      check later whether the interrupt has fired, but that's not sufficient
      for suspend to idle as there is no way to check that once we
      transitioned into the CPU idle state.
      
      So we change the mechanism in the following way:
      
      1) Leave the wakeup interrupts enabled across suspend
      
      2) Add a check to irq_may_run() which is called at the beginning of
         each flow handler whether the interrupt is an armed wakeup source.
      
         This check is basically free as it just extends the existing check
         for IRQD_IRQ_INPROGRESS. So no new conditional in the hot path.
      
         If the IRQD_WAKEUP_ARMED flag is set, then the interrupt is
         disabled, marked as pending/suspended and the pm core is notified
         about the wakeup event.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      [ rjw: syscore.c and put irq_pm_check_wakeup() into pm.c ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9ce7a258
  27. 21 5月, 2014 1 次提交
  28. 07 5月, 2014 1 次提交
    • A
      genirq: Provide irq_force_affinity fallback for non-SMP · 4c88d7f9
      Arnd Bergmann 提交于
      Patch 01f8fa4f "genirq: Allow forcing cpu affinity of interrupts" added
      an irq_force_affinity() function, and 30ccf03b "clocksource: Exynos_mct:
      Use irq_force_affinity() in cpu bringup" subsequently uses it. However, the
      driver can be used with CONFIG_SMP disabled, but the function declaration
      is only available for CONFIG_SMP, leading to this build error:
      
      drivers/clocksource/exynos_mct.c:431:3: error: implicit declaration of function 'irq_force_affinity' [-Werror=implicit-function-declaration]
         irq_force_affinity(mct_irqs[MCT_L0_IRQ + cpu], cpumask_of(cpu));
      
      This patch introduces a dummy helper function for the non-SMP case
      that always returns success, to get rid of the build error.
      Since the patches causing the problem are marked for stable backports,
      this one should be as well.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
      Acked-by: NKukjin Kim <kgene.kim@samsung.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/5619084.0zmrrIUZLV@wuerfelSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      4c88d7f9
  29. 28 4月, 2014 1 次提交
  30. 18 4月, 2014 2 次提交