1. 18 Apr, 2014 7 commits
  2. 13 Apr, 2014 7 commits
    • Finn Thain's avatar
      m68k: Skip futex_atomic_cmpxchg_inatomic() test · 37f6d106
      Finn Thain authored
      commit e571c58f upstream.
      
      Skip the futex_atomic_cmpxchg_inatomic() test in futex_init(). It causes a
      fatal exception on 68030 (and presumably 68020 also).
      Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1403061006440.5525@nippy.intranetSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      37f6d106
    • Heiko Carstens's avatar
      futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test · cee41ea0
      Heiko Carstens authored
      commit 03b8c7b6 upstream.
      
      If an architecture has futex_atomic_cmpxchg_inatomic() implemented and there
      is no runtime check necessary, allow to skip the test within futex_init().
      
      This allows to get rid of some code which would always give the same result,
      and also allows the compiler to optimize a couple of if statements away.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Finn Thain <fthain@telegraphics.com.au>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Link: http://lkml.kernel.org/r/20140302120947.GA3641@osirisSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      [geert: Backported to v3.10..v3.13]
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      cee41ea0
    • Paul Moore's avatar
      selinux: correctly label /proc inodes in use before the policy is loaded · 4a1bdd99
      Paul Moore authored
      commit f64410ec upstream.
      
      This patch is based on an earlier patch by Eric Paris, he describes
      the problem below:
      
        "If an inode is accessed before policy load it will get placed on a
         list of inodes to be initialized after policy load.  After policy
         load we call inode_doinit() which calls inode_doinit_with_dentry()
         on all inodes accessed before policy load.  In the case of inodes
         in procfs that means we'll end up at the bottom where it does:
      
           /* Default to the fs superblock SID. */
           isec->sid = sbsec->sid;
      
           if ((sbsec->flags & SE_SBPROC) && !S_ISLNK(inode->i_mode)) {
                   if (opt_dentry) {
                           isec->sclass = inode_mode_to_security_class(...)
                           rc = selinux_proc_get_sid(opt_dentry,
                                                     isec->sclass,
                                                     &sid);
                           if (rc)
                                   goto out_unlock;
                           isec->sid = sid;
                   }
           }
      
         Since opt_dentry is null, we'll never call selinux_proc_get_sid()
         and will leave the inode labeled with the label on the superblock.
         I believe a fix would be to mimic the behavior of xattrs.  Look
         for an alias of the inode.  If it can't be found, just leave the
         inode uninitialized (and pick it up later) if it can be found, we
         should be able to call selinux_proc_get_sid() ..."
      
      On a system exhibiting this problem, you will notice a lot of files in
      /proc with the generic "proc_t" type (at least the ones that were
      accessed early in the boot), for example:
      
         # ls -Z /proc/sys/kernel/shmmax | awk '{ print $4 " " $5 }'
         system_u:object_r:proc_t:s0 /proc/sys/kernel/shmmax
      
      However, with this patch in place we see the expected result:
      
         # ls -Z /proc/sys/kernel/shmmax | awk '{ print $4 " " $5 }'
         system_u:object_r:sysctl_kernel_t:s0 /proc/sys/kernel/shmmax
      
      Cc: Eric Paris <eparis@redhat.com>
      Signed-off-by: default avatarPaul Moore <pmoore@redhat.com>
      Acked-by: default avatarEric Paris <eparis@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      4a1bdd99
    • Sebastian Hesselbarth's avatar
      PCI: mvebu: move clock enable before register access · 5829b0e0
      Sebastian Hesselbarth authored
      commit b42285f6 upstream.
      
      The clock passed to PCI controller found on MVEBU SoCs may come from a
      clock gate. This requires the clock to be enabled before any registers
      are accessed. Therefore, move the clock enable before register iomap to
      ensure it is enabled.
      Signed-off-by: default avatarSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      5829b0e0
    • Mikulas Patocka's avatar
      powernow-k6: reorder frequencies · 204e4f25
      Mikulas Patocka authored
      commit 22c73795 upstream.
      
      This patch reorders reported frequencies from the highest to the lowest,
      just like in other frequency drivers.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      204e4f25
    • Mikulas Patocka's avatar
      powernow-k6: correctly initialize default parameters · b80bb221
      Mikulas Patocka authored
      commit d82b922a upstream.
      
      The powernow-k6 driver used to read the initial multiplier from the
      powernow register. However, there is a problem with this:
      
      * If there was a frequency transition before, the multiplier read from the
        register corresponds to the current multiplier.
      * If there was no frequency transition since reset, the field in the
        register always reads as zero, regardless of the current multiplier that
        is set using switches on the mainboard and that the CPU is running at.
      
      The zero value corresponds to multiplier 4.5, so as a consequence, the
      powernow-k6 driver always assumes multiplier 4.5.
      
      For example, if we have 550MHz CPU with bus frequency 100MHz and
      multiplier 5.5, the powernow-k6 driver thinks that the multiplier is 4.5
      and bus frequency is 122MHz. The powernow-k6 driver then sets the
      multiplier to 4.5, underclocking the CPU to 450MHz, but reports the
      current frequency as 550MHz.
      
      There is no reliable way how to read the initial multiplier. I modified
      the driver so that it contains a table of known frequencies (based on
      parameters of existing CPUs and some common overclocking schemes) and sets
      the multiplier according to the frequency. If the frequency is unknown
      (because of unusual overclocking or underclocking), the user must supply
      the bus speed and maximum multiplier as module parameters.
      
      This patch should be backported to all stable kernels. If it doesn't
      apply cleanly, change it, or ask me to change it.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      b80bb221
    • Mikulas Patocka's avatar
      powernow-k6: disable cache when changing frequency · 3389f243
      Mikulas Patocka authored
      commit e20e1d0a upstream.
      
      I found out that a system with k6-3+ processor is unstable during network
      server load. The system locks up or the network card stops receiving. The
      reason for the instability is the CPU frequency scaling.
      
      During frequency transition the processor is in "EPM Stop Grant" state.
      The documentation says that the processor doesn't respond to inquiry
      requests in this state. Consequently, coherency of processor caches and
      bus master devices is not maintained, causing the system instability.
      
      This patch flushes the cache during frequency transition. It fixes the
      instability.
      
      Other minor changes:
      * u64 invalue changed to unsigned long because the variable is 32-bit
      * move the logic to set the multiplier to a separate function
        powernow_k6_set_cpu_multiplier
      * preserve lower 5 bits of the powernow port instead of 4 (the voltage
        field has 5 bits)
      * mask interrupts when reading the multiplier, so that the port is not
        open during other activity (running other kernel code with the port open
        shouldn't cause any misbehavior, but we should better be safe and keep
        the port closed)
      
      This patch should be backported to all stable kernels. If it doesn't
      apply cleanly, change it, or ask me to change it.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3389f243
  3. 03 Apr, 2014 26 commits
    • Jiri Slaby's avatar
      Linux 3.12.17 · 2acf1c25
      Jiri Slaby authored
      2acf1c25
    • Daniel Borkmann's avatar
      netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages · f9c8e356
      Daniel Borkmann authored
      commit b22f5126 upstream.
      
      Some occurences in the netfilter tree use skb_header_pointer() in
      the following way ...
      
        struct dccp_hdr _dh, *dh;
        ...
        skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
      
      ... where dh itself is a pointer that is being passed as the copy
      buffer. Instead, we need to use &_dh as the forth argument so that
      we're copying the data into an actual buffer that sits on the stack.
      
      Currently, we probably could overwrite memory on the stack (e.g.
      with a possibly mal-formed DCCP packet), but unintentionally, as
      we only want the buffer to be placed into _dh variable.
      
      Fixes: 2bc78049 ("[NETFILTER]: nf_conntrack: add DCCP protocol support")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f9c8e356
    • David Rientjes's avatar
      mm: close PageTail race · 9a110858
      David Rientjes authored
      commit 668f9abb upstream.
      
      Commit bf6bddf1 ("mm: introduce compaction and migration for
      ballooned pages") introduces page_count(page) into memory compaction
      which dereferences page->first_page if PageTail(page).
      
      This results in a very rare NULL pointer dereference on the
      aforementioned page_count(page).  Indeed, anything that does
      compound_head(), including page_count() is susceptible to racing with
      prep_compound_page() and seeing a NULL or dangling page->first_page
      pointer.
      
      This patch uses Andrea's implementation of compound_trans_head() that
      deals with such a race and makes it the default compound_head()
      implementation.  This includes a read memory barrier that ensures that
      if PageTail(head) is true that we return a head page that is neither
      NULL nor dangling.  The patch then adds a store memory barrier to
      prep_compound_page() to ensure page->first_page is set.
      
      This is the safest way to ensure we see the head page that we are
      expecting, PageTail(page) is already in the unlikely() path and the
      memory barriers are unfortunately required.
      
      Hugetlbfs is the exception, we don't enforce a store memory barrier
      during init since no race is possible.
      Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
      Cc: Holger Kiehl <Holger.Kiehl@dwd.de>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Rafael Aquini <aquini@redhat.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9a110858
    • Thomas Petazzoni's avatar
      net: mvneta: fix usage as a module on RGMII configurations · 2c34f0e2
      Thomas Petazzoni authored
      commit e3a8786c upstream.
      
      Commit 5445eaf3 ('mvneta: Try to fix mvneta when compiled as
      module') fixed the mvneta driver to make it work properly when loaded
      as a module in SGMII configuration, which was tested successful by the
      author on the Armada XP OpenBlocks AX3, which uses SGMII.
      
      However, it turns out that the Armada XP GP, which uses RGMII, is
      affected by a similar problem: its SERDES configuration is lost when
      mvneta is loaded as a module, because this configuration is set by the
      bootloader, and then lost because the clock is gated by the clock
      framework until the mvneta driver is loaded again and the clock is
      re-enabled.
      
      However, it turns out that for the RGMII case, setting the SERDES
      configuration is not sufficient: the PCS enable bit in the
      MVNETA_GMAC_CTRL_2 register must also be set, like in the SGMII
      configuration.
      
      Therefore, this commit reworks the SGMII/RGMII initialization: the
      only difference between the two now is a different SERDES
      configuration, all the rest is identical.
      
      In detail, to achieve this, the commit:
      
       * Renames MVNETA_SGMII_SERDES_CFG to MVNETA_SERDES_CFG because it is
         not specific to SGMII, but also used on RGMII configurations.
      
       * Adds a MVNETA_RGMII_SERDES_PROTO definition, that must be used as
         the MVNETA_SERDES_CFG value in RGMII configurations.
      
       * Removes the mvneta_gmac_rgmii_set() and mvneta_port_sgmii_config()
         functions, and instead directly do the SGMII/RGMII configuration in
         mvneta_port_up(), from where those functions where called. It is
         worth mentioning that mvneta_gmac_rgmii_set() had an 'enable'
         parameter that was always passed as '1', so it was pretty useless.
      
       * Reworks the mvneta_port_up() function to set the MVNETA_SERDES_CFG
         register to the appropriate value depending on the RGMII vs. SGMII
         configuration. It also unconditionally set the PCS_ENABLE bit (was
         already done for SGMII, but is now also needed for RGMII), and sets
         the PORT_RGMII bit (which was already done for both SGMII and
         RGMII).
      
      This commit was successfully tested with mvneta compiled as a module,
      on both the OpenBlocks AX3 (SGMII configuration) and the Armada XP GP
      (RGMII configuration).
      Reported-by: default avatarSteve McIntyre <steve@einval.com>
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2c34f0e2
    • Thomas Petazzoni's avatar
      net: mvneta: rename MVNETA_GMAC2_PSC_ENABLE to MVNETA_GMAC2_PCS_ENABLE · 44144f93
      Thomas Petazzoni authored
      commit a79121d3 upstream.
      
      Bit 3 of the MVNETA_GMAC_CTRL_2 is actually used to enable the PCS,
      not the PSC: there was a typo in the name of the define, which this
      commit fixes.
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      44144f93
    • Al Viro's avatar
      make prepend_name() work correctly when called with negative *buflen · a41fd753
      Al Viro authored
      commit e825196d upstream.
      
      In all callchains leading to prepend_name(), the value left in *buflen
      is eventually discarded unused if prepend_name() has returned a negative.
      So we are free to do what prepend() does, and subtract from *buflen
      *before* checking for underflow (which turns into checking the sign
      of subtraction result, of course).
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      a41fd753
    • Artem Fetishev's avatar
      x86: fix boot on uniprocessor systems · 2c611dc0
      Artem Fetishev authored
      commit 825600c0 upstream.
      
      On x86 uniprocessor systems topology_physical_package_id() returns -1
      which causes rapl_cpu_prepare() to leave rapl_pmu variable uninitialized
      which leads to GPF in rapl_pmu_init().
      
      See arch/x86/kernel/cpu/perf_event_intel_rapl.c.
      
      It turns out that physical_package_id and core_id can actually be
      retreived for uniprocessor systems too.  Enabling them also fixes
      rapl_pmu code.
      Signed-off-by: default avatarArtem Fetishev <artem_fetishev@epam.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2c611dc0
    • Daniel Vetter's avatar
      drm/i915: Undo gtt scratch pte unmapping again · c890d3e4
      Daniel Vetter authored
      commit 8ee661b5 upstream.
      
      It apparently blows up on some machines. This functionally reverts
      
      commit 828c7908
      Author: Ben Widawsky <benjamin.widawsky@intel.com>
      Date:   Wed Oct 16 09:21:30 2013 -0700
      
          drm/i915: Disable GGTT PTEs on GEN6+ suspend
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=64841Reported-and-Tested-by: default avatarBrad  Jackson <bjackson0971@gmail.com>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Todd Previte <tprevite@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c890d3e4
    • Scott Wood's avatar
      i2c: cpm: Fix build by adding of_address.h and of_irq.h · 9002dd5f
      Scott Wood authored
      commit 5f12c5ec upstream.
      
      Fixes a build break due to the undeclared use of irq_of_parse_and_map()
      and of_iomap().  This build break was apparently introduced while the
      driver was unbuildable due to the bug fixed by
      62c19c9d ("i2c: Remove usage of
      orphaned symbol OF_I2C").  When 62c19c was added in v3.14-rc7,
      the driver was enabled again, breaking the powerpc mpc85xx_defconfig
      and mpc85xx_smp_defconfig.
      
      62c19c is marked for stable, so this should go there as well.
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9002dd5f
    • David Vrabel's avatar
      Revert "xen: properly account for _PAGE_NUMA during xen pte translations" · 1f21fba4
      David Vrabel authored
      commit 5926f87f upstream.
      
      This reverts commit a9c8e4be.
      
      PTEs in Xen PV guests must contain machine addresses if _PAGE_PRESENT
      is set and pseudo-physical addresses is _PAGE_PRESENT is clear.
      
      This is because during a domain save/restore (migration) the page
      table entries are "canonicalised" and uncanonicalised". i.e., MFNs are
      converted to PFNs during domain save so that on a restore the page
      table entries may be rewritten with the new MFNs on the destination.
      This canonicalisation is only done for PTEs that are present.
      
      This change resulted in writing PTEs with MFNs if _PAGE_PROTNONE (or
      _PAGE_NUMA) was set but _PAGE_PRESENT was clear.  These PTEs would be
      migrated as-is which would result in unexpected behaviour in the
      destination domain.  Either a) the MFN would be translated to the
      wrong PFN/page; b) setting the _PAGE_PRESENT bit would clear the PTE
      because the MFN is no longer owned by the domain; or c) the present
      bit would not get set.
      
      Symptoms include "Bad page" reports when munmapping after migrating a
      domain.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1f21fba4
    • Wei Liu's avatar
      xen/balloon: flush persistent kmaps in correct position · d9533eb7
      Wei Liu authored
      commit 09ed3d5b upstream.
      
      Xen balloon driver will update ballooned out pages' P2M entries to point
      to scratch page for PV guests. In 24f69373 ("xen/balloon: don't alloc
      page while non-preemptible", kmap_flush_unused was moved after updating
      P2M table. In that case for 32 bit PV guest we might end up with
      
        P2M    X -----> S  (S is mfn of balloon scratch page)
        M2P    Y -----> X  (Y is mfn in persistent kmap entry)
      
      kmap_flush_unused() iterates through all the PTEs in the kmap address
      space, using pte_to_page() to obtain the page. If the p2m and the m2p
      are inconsistent the incorrect page is returned.  This will clear
      page->address on the wrong page which may cause subsequent oopses if
      that page is currently kmap'ed.
      
      Move the flush back between get_page and __set_phys_to_machine to fix
      this.
      Signed-off-by: default avatarWei Liu <wei.liu2@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      d9533eb7
    • Hans de Goede's avatar
      Input: cypress_ps2 - don't report as a button pads · 6ed1a01c
      Hans de Goede authored
      commit 6797b39e upstream.
      
      The cypress PS/2 trackpad models supported by the cypress_ps2 driver
      emulate BTN_RIGHT events in firmware based on the finger position, as part
      of this no motion events are sent when the finger is in the button area.
      
      The INPUT_PROP_BUTTONPAD property is there to indicate to userspace that
      BTN_RIGHT events should be emulated in userspace, which is not necessary
      in this case.
      
      When INPUT_PROP_BUTTONPAD is advertised userspace will wait for a motion
      event before propagating the button event higher up the stack, as it needs
      current abs x + y data for its BTN_RIGHT emulation. Since in the
      cypress_ps2 pads don't report motion events in the button area, this means
      that clicks in the button area end up being ignored, so
      INPUT_PROP_BUTTONPAD actually causes problems for these touchpads, and
      removing it fixes:
      
      https://bugs.freedesktop.org/show_bug.cgi?id=76341Reported-by: default avatarAdam Williamson <awilliam@redhat.com>
      Tested-by: default avatarAdam Williamson <awilliam@redhat.com>
      Reviewed-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6ed1a01c
    • Hans de Goede's avatar
      Input: synaptics - add manual min/max quirk for ThinkPad X240 · 45b50b25
      Hans de Goede authored
      commit 8a0435d9 upstream.
      
      This extends Benjamin Tissoires manual min/max quirk table with support for
      the ThinkPad X240.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      45b50b25
    • Benjamin Tissoires's avatar
      Input: synaptics - add manual min/max quirk · 0247679c
      Benjamin Tissoires authored
      commit 421e08c4 upstream.
      
      The new Lenovo Haswell series (-40's) contains a new Synaptics touchpad.
      However, these new Synaptics devices report bad axis ranges.
      Under Windows, it is not a problem because the Windows driver uses RMI4
      over SMBus to talk to the device. Under Linux, we are using the PS/2
      fallback interface and it occurs the reported ranges are wrong.
      
      Of course, it would be too easy to have only one range for the whole
      series, each touchpad seems to be calibrated in a different way.
      
      We can not use SMBus to get the actual range because I suspect the firmware
      will switch into the SMBus mode and stop talking through PS/2 (this is the
      case for hybrid HID over I2C / PS/2 Synaptics touchpads).
      
      So as a temporary solution (until RMI4 land into upstream), start a new
      list of quirks with the min/max manually set.
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0247679c
    • Dmitry Torokhov's avatar
      Input: mousedev - fix race when creating mixed device · 3e477ed8
      Dmitry Torokhov authored
      commit e4dbedc7 upstream.
      
      We should not be using static variable mousedev_mix in methods that can be
      called before that singleton gets assigned. While at it let's add open and
      close methods to mousedev structure so that we do not need to test if we
      are dealing with multiplexor or normal device and simply call appropriate
      method directly.
      
      This fixes: https://bugzilla.kernel.org/show_bug.cgi?id=71551Reported-by: default avatarGiulioDP <depasquale.giulio@gmail.com>
      Tested-by: default avatarGiulioDP <depasquale.giulio@gmail.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3e477ed8
    • Theodore Ts'o's avatar
      ext4: atomically set inode->i_flags in ext4_set_inode_flags() · 710e5cbe
      Theodore Ts'o authored
      commit 00a1a053 upstream.
      
      Use cmpxchg() to atomically set i_flags instead of clearing out the
      S_IMMUTABLE, S_APPEND, etc. flags and then setting them from the
      EXT4_IMMUTABLE_FL, EXT4_APPEND_FL flags, since this opens up a race
      where an immutable file has the immutable flag cleared for a brief
      window of time.
      Reported-by: default avatarJohn Sullivan <jsrhbz@kanargh.force9.co.uk>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      710e5cbe
    • Martin Schwidefsky's avatar
      s390/time,vdso: fix clock_gettime for CLOCK_MONOTONIC · f01b3751
      Martin Schwidefsky authored
      commit ca5de58b upstream.
      
      With git commit 79c74ecb
      "s390/time,vdso: convert to the new update_vsyscall interface"
      the new update_vsyscall function already does the sum of xtime
      and wall_to_monotonic. The old update_vsyscall function only
      copied the wall_to_monotonic offset. The vdso code needs to be
      modified to take this into consideration.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      f01b3751
    • Ping Cheng's avatar
      Input: wacom - add support for three new Intuos Pro devices · 1c1fa991
      Ping Cheng authored
      commit b5fd2a3e upstream.
      
      Two tablets in this series support both pen and touch. One (Intuos S)
      only supports pen. This patch also updates the driver to process wireless
      devices that do not support touch interface.
      Tested-by: default avatarJason Gerecke <killertofu@gmail.com>
      Acked-by: default avatarChris Bagwell <chris@cnpbagwell.com>
      Signed-off-by: default avatarPing Cheng <pingc@wacom.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1c1fa991
    • Michal Kubecek's avatar
      ipvs: fix AF assignment in ip_vs_conn_new() · 9573757c
      Michal Kubecek authored
      commit 2a971354 upstream.
      
      If a fwmark is passed to ip_vs_conn_new(), it is passed in
      vaddr, not daddr. Therefore we should set AF to AF_UNSPEC in
      vaddr assignment (like we do in ip_vs_ct_in_get()), otherwise we
      may copy only first 4 bytes of an IPv6 address into cp->daddr.
      Signed-off-by: default avatarBogdano Arendartchuk <barendartchuk@suse.com>
      Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
      Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
      Signed-off-by: default avatarSimon Horman <horms@verge.net.au>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      9573757c
    • David Howells's avatar
      FS-Cache: Handle removal of unadded object to the fscache_object_list rb tree · c8a3d3bc
      David Howells authored
      commit 7026f192 upstream.
      
      When FS-Cache allocates an object, the following sequence of events can
      occur:
      
       -->fscache_alloc_object()
          -->cachefiles_alloc_object() [via cache->ops->alloc_object]
          <--[returns new object]
          -->fscache_attach_object()
          <--[failed]
          -->cachefiles_put_object() [via cache->ops->put_object]
             -->fscache_object_destroy()
                -->fscache_objlist_remove()
                   -->rb_erase() to remove the object from fscache_object_list.
      
      resulting in a crash in the rbtree code.
      
      The problem is that the object is only added to fscache_object_list on
      the success path of fscache_attach_object() where it calls
      fscache_objlist_add().
      
      So if fscache_attach_object() fails, the object won't have been added to
      the objlist rbtree.  We do, however, unconditionally try to remove the
      object from the tree.
      
      Thanks to NeilBrown for finding this and suggesting this solution.
      Reported-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatar(a customer of) NeilBrown <neilb@suse.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      c8a3d3bc
    • Dongmao Zhang's avatar
      dlm: set zero linger time on sctp socket · 67ea6061
      Dongmao Zhang authored
      commit ece35848 upstream.
      
      The recovery time for a failed node was taking a long
      time because the failed node could not perform the full
      shutdown process.  Removing the linger time speeds this
      up.  The dlm does not care what happens to messages to
      or from the failed node.
      Signed-off-by: default avatarDongmao Zhang <dmzhang@suse.com>
      Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      67ea6061
    • Andy Adamson's avatar
      NFSv4.1 free slot before resending I/O to MDS · 96ab13e3
      Andy Adamson authored
      commit f9c96fcc upstream.
      
      Fix a dynamic session slot leak where a slot is preallocated and I/O is
      resent through the MDS.
      Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      96ab13e3
    • Jeff Layton's avatar
      nfs: add memory barriers around NFS_INO_INVALID_DATA and NFS_INO_INVALIDATING · fca36cf6
      Jeff Layton authored
      commit 4db72b40 upstream.
      
      If the setting of NFS_INO_INVALIDATING gets reordered to before the
      clearing of NFS_INO_INVALID_DATA, then another task may hit a race
      window where both appear to be clear, even though the inode's pages are
      still in need of invalidation. Fix this by adding the appropriate memory
      barriers.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      fca36cf6
    • Trond Myklebust's avatar
      NFS: Fix races in nfs_revalidate_mapping · 2791fc92
      Trond Myklebust authored
      commit 17dfeb91 upstream.
      
      Commit d529ef83 (NFS: fix the handling
      of NFS_INO_INVALID_DATA flag in nfs_revalidate_mapping) introduces
      a potential race, since it doesn't test the value of nfsi->cache_validity
      and set the bitlock in nfsi->flags atomically.
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Cc: Jeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2791fc92
    • Jeff Layton's avatar
      NFS: fix the handling of NFS_INO_INVALID_DATA flag in nfs_revalidate_mapping · a18d7602
      Jeff Layton authored
      commit d529ef83 upstream.
      
      There is a possible race in how the nfs_invalidate_mapping function is
      handled.  Currently, we go and invalidate the pages in the file and then
      clear NFS_INO_INVALID_DATA.
      
      The problem is that it's possible for a stale page to creep into the
      mapping after the page was invalidated (i.e., via readahead). If another
      writer comes along and sets the flag after that happens but before
      invalidate_inode_pages2 returns then we could clear the flag
      without the cache having been properly invalidated.
      
      So, we must clear the flag first and then invalidate the pages. Doing
      this however, opens another race:
      
      It's possible to have two concurrent read() calls that end up in
      nfs_revalidate_mapping at the same time. The first one clears the
      NFS_INO_INVALID_DATA flag and then goes to call nfs_invalidate_mapping.
      
      Just before calling that though, the other task races in, checks the
      flag and finds it cleared. At that point, it trusts that the mapping is
      good and gets the lock on the page, allowing the read() to be satisfied
      from the cache even though the data is no longer valid.
      
      These effects are easily manifested by running diotest3 from the LTP
      test suite on NFS. That program does a series of DIO writes and buffered
      reads. The operations are serialized and page-aligned but the existing
      code fails the test since it occasionally allows a read to come out of
      the cache incorrectly. While mixing direct and buffered I/O isn't
      recommended, I believe it's possible to hit this in other ways that just
      use buffered I/O, though that situation is much harder to reproduce.
      
      The problem is that the checking/clearing of that flag and the
      invalidation of the mapping really need to be atomic. Fix this by
      serializing concurrent invalidations with a bitlock.
      
      At the same time, we also need to allow other places that check
      NFS_INO_INVALID_DATA to check whether we might be in the middle of
      invalidating the file, so fix up a couple of places that do that
      to look for the new NFS_INO_INVALIDATING flag.
      
      Doing this requires us to be careful not to set the bitlock
      unnecessarily, so this code only does that if it believes it will
      be doing an invalidation.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      a18d7602
    • Weston Andros Adamson's avatar
      pnfs: fix BUG in filelayout_recover_commit_reqs · 1b70c8f6
      Weston Andros Adamson authored
      commit 471252cd upstream.
      
      cond_resched_lock(cinfo->lock) is called everywhere else while holding
      the cinfo->lock spinlock.  Not holding this lock while calling
      transfer_commit_list in filelayout_recover_commit_reqs causes the BUG
      below.
      
      It's true that we can't hold this lock while calling pnfs_put_lseg,
      because that might try to lock the inode lock - which might be the
      same lock as cinfo->lock.
      
      To reproduce, mount a 2 DS pynfs server and run an O_DIRECT command
      that crosses a stripe boundary and is not page aligned, such as:
      
       dd if=/dev/zero of=/mnt/f bs=17000 count=1 oflag=direct
      
      BUG: sleeping function called from invalid context at linux/fs/nfs/nfs4filelayout.c:1161
      in_atomic(): 0, irqs_disabled(): 0, pid: 27, name: kworker/0:1
      2 locks held by kworker/0:1/27:
       #0:  (events){.+.+.+}, at: [<ffffffff810501d7>] process_one_work+0x175/0x3a5
       #1:  ((&dreq->work)){+.+...}, at: [<ffffffff810501d7>] process_one_work+0x175/0x3a5
      CPU: 0 PID: 27 Comm: kworker/0:1 Not tainted 3.13.0-rc3-branch-dros_testing+ #21
      Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013
      Workqueue: events nfs_direct_write_schedule_work [nfs]
       0000000000000000 ffff88007a39bbb8 ffffffff81491256 ffff88007b87a130  ffff88007a39bbd8 ffffffff8105f103 ffff880079614000 ffff880079617d40  ffff88007a39bc20 ffffffffa011603e ffff880078988b98 0000000000000000
      Call Trace:
       [<ffffffff81491256>] dump_stack+0x4d/0x66
       [<ffffffff8105f103>] __might_sleep+0x100/0x105
       [<ffffffffa011603e>] transfer_commit_list+0x94/0xf1 [nfs_layout_nfsv41_files]
       [<ffffffffa01160d6>] filelayout_recover_commit_reqs+0x3b/0x68 [nfs_layout_nfsv41_files]
       [<ffffffffa00ba53a>] nfs_direct_write_reschedule+0x9f/0x1d6 [nfs]
       [<ffffffff810705df>] ? mark_lock+0x1df/0x224
       [<ffffffff8106e617>] ? trace_hardirqs_off_caller+0x37/0xa4
       [<ffffffff8106e691>] ? trace_hardirqs_off+0xd/0xf
       [<ffffffffa00ba8f8>] nfs_direct_write_schedule_work+0x9d/0xb7 [nfs]
       [<ffffffff810501d7>] ? process_one_work+0x175/0x3a5
       [<ffffffff81050258>] process_one_work+0x1f6/0x3a5
       [<ffffffff810501d7>] ? process_one_work+0x175/0x3a5
       [<ffffffff8105187e>] worker_thread+0x149/0x1f5
       [<ffffffff81051735>] ? rescuer_thread+0x28d/0x28d
       [<ffffffff81056d74>] kthread+0xd2/0xda
       [<ffffffff81056ca2>] ? __kthread_parkme+0x61/0x61
       [<ffffffff8149e66c>] ret_from_fork+0x7c/0xb0
       [<ffffffff81056ca2>] ? __kthread_parkme+0x61/0x61
      Signed-off-by: default avatarWeston Andros Adamson <dros@primarydata.com>
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      1b70c8f6