1. 18 Oct, 2018 3 commits
  2. 17 Oct, 2018 4 commits
    • Steven Rostedt (VMware)'s avatar
      tracing: Use trace_clock_local() for looping in preemptirq_delay_test.c · 12ad0cb2
      Steven Rostedt (VMware) authored
      The preemptirq_delay_test module is used for the ftrace selftest code that
      tests the latency tracers. The problem is that it uses ktime for the delay
      loop, and then checks the tracer to see if the delay loop is caught, but the
      tracer uses trace_clock_local() which uses various different other clocks to
      measure the latency. As ktime uses the clock cycles, and the code then
      converts that to nanoseconds, it causes rounding errors, and the preemptirq
      latency tests are failing due to being off by 1 (it expects to see a delay
      of 500000 us, but the delay is only 499999 us). This is happening due to a
      rounding error in the ktime (which is totally legit). The purpose of the
      test is to see if it can catch the delay, not to test the accuracy between
      trace_clock_local() and ktime_get(). Best to use apples to apples, and have
      the delay loop use the same clock as the latency tracer does.
      
      Cc: stable@vger.kernel.org
      Fixes: f96e8577 ("lib: Add module for testing preemptoff/irqsoff latency tracers")
      Acked-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      12ad0cb2
    • Mathieu Desnoyers's avatar
      tracepoint: Fix tracepoint array element size mismatch · 9c0be3f6
      Mathieu Desnoyers authored
      commit 46e0c9be ("kernel: tracepoints: add support for relative
      references") changes the layout of the __tracepoint_ptrs section on
      architectures supporting relative references. However, it does so
      without turning struct tracepoint * const into const int elsewhere in
      the tracepoint code, which has the following side-effect:
      
      Setting mod->num_tracepoints is done in by module.c:
      
          mod->tracepoints_ptrs = section_objs(info, "__tracepoints_ptrs",
                                               sizeof(*mod->tracepoints_ptrs),
                                               &mod->num_tracepoints);
      
      Basically, since sizeof(*mod->tracepoints_ptrs) is a pointer size
      (rather than sizeof(int)), num_tracepoints is erroneously set to half the
      size it should be on 64-bit arch. So a module with an odd number of
      tracepoints misses the last tracepoint due to effect of integer
      division.
      
      So in the module going notifier:
      
              for_each_tracepoint_range(mod->tracepoints_ptrs,
                      mod->tracepoints_ptrs + mod->num_tracepoints,
                      tp_module_going_check_quiescent, NULL);
      
      the expression (mod->tracepoints_ptrs + mod->num_tracepoints) actually
      evaluates to something within the bounds of the array, but miss the
      last tracepoint if the number of tracepoints is odd on 64-bit arch.
      
      Fix this by introducing a new typedef: tracepoint_ptr_t, which
      is either "const int" on architectures that have PREL32 relocations,
      or "struct tracepoint * const" on architectures that does not have
      this feature.
      
      Also provide a new tracepoint_ptr_defer() static inline to
      encapsulate deferencing this type rather than duplicate code and
      ugly idefs within the for_each_tracepoint_range() implementation.
      
      This issue appears in 4.19-rc kernels, and should ideally be fixed
      before the end of the rc cycle.
      Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: default avatarJessica Yu <jeyu@kernel.org>
      Link: http://lkml.kernel.org/r/20181013191050.22389-1-mathieu.desnoyers@efficios.com
      Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheuvel@linaro.org
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: James Morris <james.morris@microsoft.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Nicolas Pitre <nico@linaro.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Thomas Garnier <thgarnie@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      9c0be3f6
    • Greg Kroah-Hartman's avatar
      Merge branch 'parisc-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · c343db45
      Greg Kroah-Hartman authored
      Helge writes:
         "parisc fix:
      
          Fix an unitialized variable usage in the parisc unwind code."
      
      * 'parisc-4.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Fix uninitialized variable usage in unwind.c
      c343db45
    • Greg Kroah-Hartman's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · c0cff31b
      Greg Kroah-Hartman authored
      Stephen writes:
        "clk fixes for v4.19-rc8
      
         One fix for the Allwinner A10 SoC's audio PLL that wasn't properly
         set and generating noise."
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: sunxi-ng: sun4i: Set VCO and PLL bias current to lowest setting
      c0cff31b
  3. 16 Oct, 2018 4 commits
  4. 15 Oct, 2018 6 commits
    • Matthew Wilcox's avatar
      idr: Change documentation license · a309d5db
      Matthew Wilcox authored
      This documentation was inadvertently released under the CC-BY-SA-4.0
      license.  It was intended to be released under GPL-2.0 or later.
      Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
      a309d5db
    • Matthew Wilcox's avatar
      test_ida: Fix lockdep warning · c994b129
      Matthew Wilcox authored
      The IDA was declared on the stack instead of statically, so lockdep
      triggered a warning that it was improperly initialised.
      
      Reported-by: 0day bot
      Tested-by: default avatarRong Chen <rong.a.chen@intel.com>
      Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
      c994b129
    • David Howells's avatar
      afs: Fix clearance of reply · f0a7d188
      David Howells authored
      The recent patch to fix the afs_server struct leak didn't actually fix the
      bug, but rather fixed some of the symptoms.  The problem is that an
      asynchronous call that holds a resource pointed to by call->reply[0] will
      find the pointer cleared in the call destructor, thereby preventing the
      resource from being cleaned up.
      
      In the case of the server record leak, the afs_fs_get_capabilities()
      function in devel code sets up a call with reply[0] pointing at the server
      record that should be altered when the result is obtained, but this was
      being cleared before the destructor was called, so the put in the
      destructor does nothing and the record is leaked.
      
      Commit f014ffb0 removed the additional ref obtained by
      afs_install_server(), but the removal of this ref is actually used by the
      garbage collector to mark a server record as being defunct after the record
      has expired through lack of use.
      
      The offending clearance of call->reply[0] upon completion in
      afs_process_async_call() has been there from the origin of the code, but
      none of the asynchronous calls actually use that pointer currently, so it
      should be safe to remove (note that synchronous calls don't involve this
      function).
      
      Fix this by the following means:
      
       (1) Revert commit f014ffb0.
      
       (2) Remove the clearance of reply[0] from afs_process_async_call().
      
      Without this, afs_manage_servers() will suffer an assertion failure if it
      sees a server record that didn't get used because the usage count is not 1.
      
      Fixes: f014ffb0 ("afs: Fix afs_server struct leak")
      Fixes: 08e0e7c8 ("[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f0a7d188
    • Greg Kroah-Hartman's avatar
      Linux 4.19-rc8 · 35a7f35a
      Greg Kroah-Hartman authored
      35a7f35a
    • David S. Miller's avatar
      sparc64: Set %l4 properly on trap return after handling signals. · d1f1f98c
      David S. Miller authored
      If we did some signal processing, we have to reload the pt_regs
      tstate register because it's value may have changed.
      
      In doing so we also have to extract the %pil value contained in there
      anre load that into %l4.
      
      This value is at bit 20 and thus needs to be shifted down before we
      later write it into the %pil register.
      
      Most of the time this is harmless as we are returning to userspace
      and the %pil is zero for that case.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d1f1f98c
    • David S. Miller's avatar
      sparc64: Make proc_id signed. · b3e1eb8e
      David S. Miller authored
      So that when it is unset, ie. '-1', userspace can see it
      properly.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3e1eb8e
  5. 14 Oct, 2018 2 commits
  6. 13 Oct, 2018 11 commits
  7. 12 Oct, 2018 10 commits
    • David S. Miller's avatar
      sparc: Throttle perf events properly. · 455adb31
      David S. Miller authored
      Like x86 and arm, call perf_sample_event_took() in perf event
      NMI interrupt handler.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      455adb31
    • David S. Miller's avatar
      sparc: Fix single-pcr perf event counter management. · cfdc3170
      David S. Miller authored
      It is important to clear the hw->state value for non-stopped events
      when they are added into the PMU.  Otherwise when the event is
      scheduled out, we won't read the counter because HES_UPTODATE is still
      set.  This breaks 'perf stat' and similar use cases, causing all the
      events to show zero.
      
      This worked for multi-pcr because we make explicit sparc_pmu_start()
      calls in calculate_multiple_pcrs().  calculate_single_pcr() doesn't do
      this because the idea there is to accumulate all of the counter
      settings into the single pcr value.  So we have to add explicit
      hw->state handling there.
      
      Like x86, we use the PERF_HES_ARCH bit to track truly stopped events
      so that we don't accidently start them on a reload.
      
      Related to all of this, sparc_pmu_start() is missing a userpage update
      so add it.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfdc3170
    • Greg Kroah-Hartman's avatar
      Merge tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · bab5c80b
      Greg Kroah-Hartman authored
      Arnd writes:
        "ARM: SoC fixes for 4.19
      
         Two last minute bugfixes, both for NXP platforms:
      
         * The Layerscape 'qbman' infrastructure suffers from probe ordering
           bugs in some configurations, a two-patch series adds a hotfix for
           this. 4.20 will have a longer set of patches to rework it.
      
         * The old imx53-qsb board regressed in 4.19 after the addition
           of cpufreq support, adding a set of explicit operating points
           fixes this."
      
      * tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        soc: fsl: qman_portals: defer probe after qman's probe
        soc: fsl: qbman: add APIs to retrieve the probing status
        ARM: dts: imx53-qsb: disable 1.2GHz OPP
      bab5c80b
    • David Howells's avatar
      afs: Fix afs_server struct leak · f014ffb0
      David Howells authored
      Fix a leak of afs_server structs.  The routine that installs them in the
      various lookup lists and trees gets a ref on leaving the function, whether
      it added the server or a server already exists.  It shouldn't increment
      the refcount if it added the server.
      
      The effect of this that "rmmod kafs" will hang waiting for the leaked
      server to become unused.
      
      Fixes: d2ddc776 ("afs: Overhaul volume and server record caching and fileserver rotation")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f014ffb0
    • Peter Rosin's avatar
      MAINTAINERS: use the correct location for dt-bindings includes for mux · b40afc00
      Peter Rosin authored
      Just drop the "linux" part of the path, it was never correct.
      Reported-by: default avatarJoe Perches <joe@perches.com>
      Fixes: 256ac037 ("dt-bindings: document devicetree bindings for mux-controllers and gpio-mux")
      Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b40afc00
    • Peter Rosin's avatar
      mux: adgs1408: use the correct MODULE_LICENSE · 38a12607
      Peter Rosin authored
      The file is GPL v2 or later.
      Acked-by: default avatarMircea Caprioru <mircea.caprioru@analog.com>
      Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      38a12607
    • Andreas Gruenbacher's avatar
      gfs2: Fix iomap buffered write support for journaled files (2) · fee5150c
      Andreas Gruenbacher authored
      It turns out that the fix in commit 6636c3cc56 is bad; the assertion
      that the iomap code no longer creates buffer heads is incorrect for
      filesystems that set the IOMAP_F_BUFFER_HEAD flag.
      
      Instead, what's happening is that gfs2_iomap_begin_write treats all
      files that have the jdata flag set as journaled files, which is
      incorrect as long as those files are inline ("stuffed").  We're handling
      stuffed files directly via the page cache, which is why we ended up with
      pages without buffer heads in gfs2_page_add_databufs.
      
      Fix this by handling stuffed journaled files correctly in
      gfs2_iomap_begin_write.
      
      This reverts commit 6636c3cc5690c11631e6366cf9a28fb99c8b25bb.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      fee5150c
    • Will Deacon's avatar
      arm64: perf: Reject stand-alone CHAIN events for PMUv3 · ca2b4972
      Will Deacon authored
      It doesn't make sense for a perf event to be configured as a CHAIN event
      in isolation, so extend the arm_pmu structure with a ->filter_match()
      function to allow the backend PMU implementation to reject CHAIN events
      early.
      
      Cc: <stable@vger.kernel.org>
      Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      ca2b4972
    • Will Deacon's avatar
      arm64: Fix /proc/iomem for reserved but not memory regions · d91680e6
      Will Deacon authored
      We describe ranges of 'reserved' memory to userspace via /proc/iomem.
      Commit 50d7ba36 ("arm64: export memblock_reserve()d regions via
      /proc/iomem") updated the logic to export regions that were reserved
      because their contents should be preserved. This allowed kexec-tools
      to tell the difference between 'reserved' memory that must be
      preserved and not overwritten, (e.g. the ACPI tables), and 'nomap'
      memory that must not be touched without knowing the memory-attributes
      (e.g. RAS CPER regions).
      
      The above commit wrongly assumed that memblock_reserve() would not
      be used to reserve regions that aren't memory. It turns out this is
      exactly what early_init_dt_reserve_memory_arch() will do if it finds
      a DT reserved-memory that was also carved out of the memory node, which
      results in a WARN_ON_ONCE() and the region being reserved instead of
      ignored. The ramoops description on hikey and dragonboard-410c both do
      this, so we can't simply write this configuration off as "buggy firmware".
      
      Avoid this issue by rewriting reserve_memblock_reserved_regions() so
      that only the portions of reserved regions which overlap with mapped
      memory are actually reserved.
      
      Fixes: 50d7ba36 ("arm64: export memblock_reserve()d regions via /proc/iomem")
      Reported-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Reported-by: default avatarPaolo Pisati <p.pisati@gmail.com>
      CC: Akashi Takahiro <takahiro.akashi@linaro.org>
      CC: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      d91680e6
    • David Howells's avatar
      afs: Fix cell proc list · 6b3944e4
      David Howells authored
      Access to the list of cells by /proc/net/afs/cells has a couple of
      problems:
      
       (1) It should be checking against SEQ_START_TOKEN for the keying the
           header line.
      
       (2) It's only holding the RCU read lock, so it can't just walk over the
           list without following the proper RCU methods.
      
      Fix these by using an hlist instead of an ordinary list and using the
      appropriate accessor functions to follow it with RCU.
      
      Since the code that adds a cell to the list must also necessarily change,
      sort the list on insertion whilst we're at it.
      
      Fixes: 989782dc ("afs: Overhaul cell database management")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6b3944e4