1. 14 5月, 2018 3 次提交
  2. 13 5月, 2018 5 次提交
    • M
      irqchip/gic-v3: Add support for Message Based Interrupts as an MSI controller · 50528752
      Marc Zyngier 提交于
      GICv3 offers the possibility to signal SPIs using a pair of doorbells
      (SETPI, CLRSPI) under the name of Message Based Interrupts (MBI).
      They can be used as either traditional (edge) MSIs, or the more exotic
      level-triggered flavour.
      
      Let's implement support for platform MSI, which is the original intent
      for this feature.
      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-8-marc.zyngier@arm.com
      50528752
    • M
      irqdomain: Let irq_find_host default to DOMAIN_BUS_WIRED · 64619343
      Marc Zyngier 提交于
      At the beginning of times, irq_find_host() was simple. Each device node
      implemented at most one irq domain, and we were happy. Over time, things
      have become more complex, and we now have nodes implementing a plurality
      of domains, tagged by "bus_token".
      
      Crutially, users of irq_find_host() all expect the most basic domain
      to be returned, and not any other domain such as a bus-specific MSI
      domain.
      
      So let's change irq_find_host() to first look for a DOMAIN_BUS_WIRED
      domain, and only if this fails fallback to DOMAIN_BUS_ANY. Note that
      this is consistent with what irq_create_fwspec_mapping is already
      doing, see 530cbe10 ("irqdomain: Allow domain lookup with
      DOMAIN_BUS_WIRED token").
      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-6-marc.zyngier@arm.com
      64619343
    • M
      dma-iommu: Fix compilation when !CONFIG_IOMMU_DMA · 8a22a3e1
      Marc Zyngier 提交于
      Inclusion of include/dma-iommu.h when CONFIG_IOMMU_DMA is not selected
      results in the following splat:
      
      In file included from drivers/irqchip/irq-gic-v3-mbi.c:20:0:
      ./include/linux/dma-iommu.h:95:69: error: unknown type name ‘dma_addr_t’
       static inline int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base)
                                                                           ^~~~~~~~~~
      ./include/linux/dma-iommu.h:108:74: warning: ‘struct list_head’ declared inside parameter list will not be visible outside of this definition or declaration
       static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list)
                                                                                ^~~~~~~~~
      scripts/Makefile.build:312: recipe for target 'drivers/irqchip/irq-gic-v3-mbi.o' failed
      
      Fix it by including linux/types.h.
      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-5-marc.zyngier@arm.com
      8a22a3e1
    • M
      genirq/msi: Limit level-triggered MSI to platform devices · 6988e0e0
      Marc Zyngier 提交于
      Nobody would be insane enough to try and use level triggered
      MSIs on PCI, but let's make sure it doesn't happen. Also,
      let's mandate that the irqchip backing the platform MSI domain
      is providing the IRQCHIP_SUPPORTS_LEVEL_MSI flag.
      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-3-marc.zyngier@arm.com
      6988e0e0
    • 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
  3. 12 5月, 2018 2 次提交
  4. 11 5月, 2018 3 次提交
  5. 10 5月, 2018 1 次提交
  6. 08 5月, 2018 1 次提交
  7. 07 5月, 2018 1 次提交
  8. 05 5月, 2018 1 次提交
  9. 04 5月, 2018 2 次提交
    • M
      MAINTAINERS & files: Canonize the e-mails I use at files · 32590819
      Mauro Carvalho Chehab 提交于
      From now on, I'll start using my @kernel.org as my development e-mail.
      
      As such, let's remove the entries that point to the old
      mchehab@s-opensource.com at MAINTAINERS file.
      
      For the files written with a copyright with mchehab@s-opensource,
      let's keep Samsung on their names, using mchehab+samsung@kernel.org,
      in order to keep pointing to my employer, with sponsors the work.
      
      For the files written before I join Samsung (on July, 4 2013),
      let's just use mchehab@kernel.org.
      
      For bug reports, we can simply point to just kernel.org, as
      this will reach my mchehab+samsung inbox anyway.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NBrian Warner <brian.warner@samsung.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      32590819
    • P
      sched/core: Introduce set_special_state() · b5bf9a90
      Peter Zijlstra 提交于
      Gaurav reported a perceived problem with TASK_PARKED, which turned out
      to be a broken wait-loop pattern in __kthread_parkme(), but the
      reported issue can (and does) in fact happen for states that do not do
      condition based sleeps.
      
      When the 'current->state = TASK_RUNNING' store of a previous
      (concurrent) try_to_wake_up() collides with the setting of a 'special'
      sleep state, we can loose the sleep state.
      
      Normal condition based wait-loops are immune to this problem, but for
      sleep states that are not condition based are subject to this problem.
      
      There already is a fix for TASK_DEAD. Abstract that and also apply it
      to TASK_STOPPED and TASK_TRACED, both of which are also without
      condition based wait-loop.
      Reported-by: NGaurav Kohli <gkohli@codeaurora.org>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: NOleg Nesterov <oleg@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      b5bf9a90
  10. 03 5月, 2018 3 次提交
  11. 02 5月, 2018 5 次提交
  12. 29 4月, 2018 1 次提交
    • A
      <linux/stringhash.h>: fix end_name_hash() for 64bit long · 19b9ad67
      Amir Goldstein 提交于
      The comment claims that this helper will try not to loose bits, but for
      64bit long it looses the high bits before hashing 64bit long into 32bit
      int.  Use the helper hash_long() to do the right thing for 64bit long.
      For 32bit long, there is no change.
      
      All the callers of end_name_hash() either assign the result to
      qstr->hash, which is u32 or return the result as an int value (e.g.
      full_name_hash()).  Change the helper return type to int to conform to
      its users.
      
      [ It took me a while to apply this, because my initial reaction to it
        was - incorrectly - that it could make for slower code.
      
        After having looked more at it, I take back all my complaints about
        the patch, Amir was right and I was mis-reading things or just being
        stupid.
      
        I also don't worry too much about the possible performance impact of
        this on 64-bit, since most architectures that actually care about
        performance end up not using this very much (the dcache code is the
        most performance-critical, but the word-at-a-time case uses its own
        hashing anyway).
      
        So this ends up being mostly used for filesystems that do their own
        degraded hashing (usually because they want a case-insensitive
        comparison function).
      
        A _tiny_ worry remains, in that not everybody uses DCACHE_WORD_ACCESS,
        and then this potentially makes things more expensive on 64-bit
        architectures with slow or lacking multipliers even for the normal
        case.
      
        That said, realistically the only such architecture I can think of is
        PA-RISC. Nobody really cares about performance on that, it's more of a
        "look ma, I've got warts^W an odd machine" platform.
      
        So the patch is fine, and all my initial worries were just misplaced
        from not looking at this properly.   - Linus ]
      Signed-off-by: NAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      19b9ad67
  13. 28 4月, 2018 1 次提交
  14. 27 4月, 2018 5 次提交
  15. 26 4月, 2018 4 次提交
    • O
      blk-mq: fix sysfs inflight counter · bf0ddaba
      Omar Sandoval 提交于
      When the blk-mq inflight implementation was added, /proc/diskstats was
      converted to use it, but /sys/block/$dev/inflight was not. Fix it by
      adding another helper to count in-flight requests by data direction.
      
      Fixes: f299b7c7 ("blk-mq: provide internal in-flight variant")
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      bf0ddaba
    • T
      Revert: Unify CLOCK_MONOTONIC and CLOCK_BOOTTIME · a3ed0e43
      Thomas Gleixner 提交于
      Revert commits
      
      92af4dcb ("tracing: Unify the "boot" and "mono" tracing clocks")
      127bfa5f ("hrtimer: Unify MONOTONIC and BOOTTIME clock behavior")
      7250a404 ("posix-timers: Unify MONOTONIC and BOOTTIME clock behavior")
      d6c7270e ("timekeeping: Remove boot time specific code")
      f2d6fdbf ("Input: Evdev - unify MONOTONIC and BOOTTIME clock behavior")
      d6ed449a ("timekeeping: Make the MONOTONIC clock behave like the BOOTTIME clock")
      72199320 ("timekeeping: Add the new CLOCK_MONOTONIC_ACTIVE clock")
      
      As stated in the pull request for the unification of CLOCK_MONOTONIC and
      CLOCK_BOOTTIME, it was clear that we might have to revert the change.
      
      As reported by several folks systemd and other applications rely on the
      documented behaviour of CLOCK_MONOTONIC on Linux and break with the above
      changes. After resume daemons time out and other timeout related issues are
      observed. Rafael compiled this list:
      
      * systemd kills daemons on resume, after >WatchdogSec seconds
        of suspending (Genki Sky).  [Verified that that's because systemd uses
        CLOCK_MONOTONIC and expects it to not include the suspend time.]
      
      * systemd-journald misbehaves after resume:
        systemd-journald[7266]: File /var/log/journal/016627c3c4784cd4812d4b7e96a34226/system.journal
      corrupted or uncleanly shut down, renaming and replacing.
        (Mike Galbraith).
      
      * NetworkManager reports "networking disabled" and networking is broken
        after resume 50% of the time (Pavel).  [May be because of systemd.]
      
      * MATE desktop dims the display and starts the screensaver right after
        system resume (Pavel).
      
      * Full system hang during resume (me).  [May be due to systemd or NM or both.]
      
      That happens on debian and open suse systems.
      
      It's sad, that these problems were neither catched in -next nor by those
      folks who expressed interest in this change.
      Reported-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      Reported-by: Genki Sky <sky@genki.is>,
      Reported-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Kevin Easton <kevin@guarana.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mark Salyzyn <salyzyn@android.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      a3ed0e43
    • A
      remoteproc: fix crashed parameter logic on stop call · fcd58037
      Arnaud Pouliquen 提交于
      Fix rproc_add_subdev parameter name and inverse the crashed logic.
      
      Fixes: 880f5b38 ("remoteproc: Pass type of shutdown to subdev remove")
      Reviewed-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NArnaud Pouliquen <arnaud.pouliquen@st.com>
      Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      fcd58037
    • M
      virtio: add ability to iterate over vqs · 24a7e4d2
      Michael S. Tsirkin 提交于
      For cleanup it's helpful to be able to simply scan all vqs and discard
      all data. Add an iterator to do that.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      24a7e4d2
  16. 25 4月, 2018 2 次提交
    • L
      block: mq: Add some minor doc for core structs · fe644072
      Linus Walleij 提交于
      As it came up in discussion on the mailing list that the semantic
      meaning of 'blk_mq_ctx' and 'blk_mq_hw_ctx' isn't completely
      obvious to everyone, let's add some minimal kerneldoc for a
      starter.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      fe644072
    • T
      ALSA: control: Hardening for potential Spectre v1 · 088e861e
      Takashi Iwai 提交于
      As recently Smatch suggested, a few places in ALSA control core codes
      may expand the array directly from the user-space value with
      speculation:
      
        sound/core/control.c:1003 snd_ctl_elem_lock() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:1031 snd_ctl_elem_unlock() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:844 snd_ctl_elem_info() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:891 snd_ctl_elem_read() warn: potential spectre issue 'kctl->vd'
        sound/core/control.c:939 snd_ctl_elem_write() warn: potential spectre issue 'kctl->vd'
      
      Although all these seem doing only the first load without further
      reference, we may want to stay in a safer side, so hardening with
      array_index_nospec() would still make sense.
      
      In this patch, we put array_index_nospec() to the common
      snd_ctl_get_ioff*() helpers instead of each caller.  These helpers are
      also referred from some drivers, too, and basically all usages are to
      calculate the array index from the user-space value, hence it's better
      to cover there.
      
      BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      088e861e