1. 06 Aug, 2014 14 commits
    • Gu Zheng's avatar
      cpuset,mempolicy: fix sleeping function called from invalid context · 08c7de52
      Gu Zheng authored
      commit 391acf97 upstream.
      
      When runing with the kernel(3.15-rc7+), the follow bug occurs:
      [ 9969.258987] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:586
      [ 9969.359906] in_atomic(): 1, irqs_disabled(): 0, pid: 160655, name: python
      [ 9969.441175] INFO: lockdep is turned off.
      [ 9969.488184] CPU: 26 PID: 160655 Comm: python Tainted: G       A      3.15.0-rc7+ #85
      [ 9969.581032] Hardware name: FUJITSU-SV PRIMEQUEST 1800E/SB, BIOS PRIMEQUEST 1000 Series BIOS Version 1.39 11/16/2012
      [ 9969.706052]  ffffffff81a20e60 ffff8803e941fbd0 ffffffff8162f523 ffff8803e941fd18
      [ 9969.795323]  ffff8803e941fbe0 ffffffff8109995a ffff8803e941fc58 ffffffff81633e6c
      [ 9969.884710]  ffffffff811ba5dc ffff880405c6b480 ffff88041fdd90a0 0000000000002000
      [ 9969.974071] Call Trace:
      [ 9970.003403]  [<ffffffff8162f523>] dump_stack+0x4d/0x66
      [ 9970.065074]  [<ffffffff8109995a>] __might_sleep+0xfa/0x130
      [ 9970.130743]  [<ffffffff81633e6c>] mutex_lock_nested+0x3c/0x4f0
      [ 9970.200638]  [<ffffffff811ba5dc>] ? kmem_cache_alloc+0x1bc/0x210
      [ 9970.272610]  [<ffffffff81105807>] cpuset_mems_allowed+0x27/0x140
      [ 9970.344584]  [<ffffffff811b1303>] ? __mpol_dup+0x63/0x150
      [ 9970.409282]  [<ffffffff811b1385>] __mpol_dup+0xe5/0x150
      [ 9970.471897]  [<ffffffff811b1303>] ? __mpol_dup+0x63/0x150
      [ 9970.536585]  [<ffffffff81068c86>] ? copy_process.part.23+0x606/0x1d40
      [ 9970.613763]  [<ffffffff810bf28d>] ? trace_hardirqs_on+0xd/0x10
      [ 9970.683660]  [<ffffffff810ddddf>] ? monotonic_to_bootbased+0x2f/0x50
      [ 9970.759795]  [<ffffffff81068cf0>] copy_process.part.23+0x670/0x1d40
      [ 9970.834885]  [<ffffffff8106a598>] do_fork+0xd8/0x380
      [ 9970.894375]  [<ffffffff81110e4c>] ? __audit_syscall_entry+0x9c/0xf0
      [ 9970.969470]  [<ffffffff8106a8c6>] SyS_clone+0x16/0x20
      [ 9971.030011]  [<ffffffff81642009>] stub_clone+0x69/0x90
      [ 9971.091573]  [<ffffffff81641c29>] ? system_call_fastpath+0x16/0x1b
      
      The cause is that cpuset_mems_allowed() try to take
      mutex_lock(&callback_mutex) under the rcu_read_lock(which was hold in
      __mpol_dup()). And in cpuset_mems_allowed(), the access to cpuset is
      under rcu_read_lock, so in __mpol_dup, we can reduce the rcu_read_lock
      protection region to protect the access to cpuset only in
      current_cpuset_is_being_rebound(). So that we can avoid this bug.
      
      This patch is a temporary solution that just addresses the bug
      mentioned above, can not fix the long-standing issue about cpuset.mems
      rebinding on fork():
      
      "When the forker's task_struct is duplicated (which includes
       ->mems_allowed) and it races with an update to cpuset_being_rebound
       in update_tasks_nodemask() then the task's mems_allowed doesn't get
       updated. And the child task's mems_allowed can be wrong if the
       cpuset's nodemask changes before the child has been added to the
       cgroup's tasklist."
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Acked-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      08c7de52
    • Brian King's avatar
      ibmvscsi: Add memory barriers for send / receive · a89c6d3b
      Brian King authored
      commit 7114aae0 upstream.
      
      Add a memory barrier prior to sending a new command to the VIOS
      to ensure the VIOS does not receive stale data in the command buffer.
      Also add a memory barrier when processing the CRQ for completed commands.
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Acked-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      [bwh: Backported to 3.2: as the iSeries code is still present, these
       functions have different names and live in rpa_vscsi.c.]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      a89c6d3b
    • Brian King's avatar
      ibmvscsi: Abort init sequence during error recovery · d9916e33
      Brian King authored
      commit 9ee75597 upstream.
      
      If a CRQ reset is triggered for some reason while in the middle
      of performing VSCSI adapter initialization, we don't want to
      call the done function for the initialization MAD commands as
      this will only result in two threads attempting initialization
      at the same time, resulting in failures.
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Acked-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      d9916e33
    • Wang, Yu's avatar
      xhci: Fix runtime suspended xhci from blocking system suspend. · 54f216e4
      Wang, Yu authored
      commit d6236f6d upstream.
      
      The system suspend flow as following:
      1, Freeze all user processes and kenrel threads.
      
      2, Try to suspend all devices.
      
      2.1, If pci device is in RPM suspended state, then pci driver will try
      to resume it to RPM active state in the prepare stage.
      
      2.2, xhci_resume function calls usb_hcd_resume_root_hub to queue two
      workqueue items to resume usb2&usb3 roothub devices.
      
      2.3, Call suspend callbacks of devices.
      
      2.3.1, All suspend callbacks of all hcd's children, including
      roothub devices are called.
      
      2.3.2, Finally, hcd_pci_suspend callback is called.
      
      Due to workqueue threads were already frozen in step 1, the workqueue
      items can't be scheduled, and the roothub devices can't be resumed in
      this flow. The HCD_FLAG_WAKEUP_PENDING flag which is set in
      usb_hcd_resume_root_hub won't be cleared. Finally,
      hcd_pci_suspend will return -EBUSY, and system suspend fails.
      
      The reason why this issue doesn't show up very often is due to that
      choose_wakeup will be called in step 2.3.1. In step 2.3.1, if
      udev->do_remote_wakeup is not equal to device_may_wakeup(&udev->dev), then
      udev will resume to RPM active for changing the wakeup settings. This
      has been a lucky hit which hides this issue.
      
      For some special xHCI controllers which have no USB2 port, then roothub
      will not match hub driver due to probe failed. Then its
      do_remote_wakeup will be set to zero, and we won't be as lucky.
      
      xhci driver doesn't need to resume roothub devices everytime like in
      the above case. It's only needed when there are pending event TRBs.
      
      This patch should be back-ported to kernels as old as 3.2, that
      contains the commit f69e3120
      "USB: XHCI: resume root hubs when the controller resumes"
      Signed-off-by: default avatarWang, Yu <yu.y.wang@intel.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      [use readl() instead of removed xhci_readl(), reword commit message -Mathias]
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      54f216e4
    • Lu Baolu's avatar
      xhci: clear root port wake on bits if controller isn't wake-up capable · 6833fc85
      Lu Baolu authored
      commit ff8cbf25 upstream.
      
      When xHCI PCI host is suspended, if do_wakeup is false in xhci_pci_suspend,
      xhci_bus_suspend needs to clear all root port wake on bits. Otherwise some Intel
      platforms may get a spurious wakeup, even if PCI PME# is disabled.
      
      This patch should be back-ported to kernels as old as 2.6.37, that
      contains the commit 9777e3ce
      "USB: xHCI: bus power management implementation".
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      6833fc85
    • Mathias Nyman's avatar
      xhci: correct burst count field for isoc transfers on 1.0 xhci hosts · b85631ab
      Mathias Nyman authored
      commit 3213b151 upstream.
      
      The transfer burst count (TBC) field in xhci 1.0 hosts should be set
      to the number of bursts needed to transfer all packets in a isoc TD.
      Supported values are 0-2 (1 to 3 bursts per service interval).
      
      Formula for TBC calculation is given in xhci spec section 4.11.2.3:
      TBC = roundup( Transfer Descriptor Packet Count / Max Burst Size +1 ) - 1
      
      This patch should be applied to stable kernels since 3.0 that contain
      the commit 5cd43e33
      "xhci 1.0: Set transfer burst count field."
      Suggested-by: default avatarShiChun Ma <masc2008@qq.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      b85631ab
    • Bjørn Mork's avatar
      usb: option: add/modify Olivetti Olicard modems · 31f8e87f
      Bjørn Mork authored
      commit b0ebef36 upstream.
      
      Adding a couple of Olivetti modems and blacklisting the net
      function on a couple which are already supported.
      Reported-by: default avatarLars Melin <larsm17@gmail.com>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      31f8e87f
    • Johan Hovold's avatar
      USB: ftdi_sio: fix null deref at port probe · a4518ea1
      Johan Hovold authored
      commit aea1ae87 upstream.
      
      Fix NULL-pointer dereference when probing an interface with no
      endpoints.
      
      These devices have two bulk endpoints per interface, but this avoids
      crashing the kernel if a user forces a non-FTDI device to be probed.
      
      Note that the iterator variable was made unsigned in order to avoid
      a maybe-uninitialized compiler warning for ep_desc after the loop.
      
      Fixes: 895f28ba ("USB: ftdi_sio: fix hi-speed device packet size
      calculation")
      Reported-by: default avatarMike Remski <mremski@mutualink.net>
      Tested-by: default avatarMike Remski <mremski@mutualink.net>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      a4518ea1
    • Michal Nazarewicz's avatar
      usb: gadget: f_fs: fix NULL pointer dereference when there are no strings · 9919dc4b
      Michal Nazarewicz authored
      commit f0688c8b upstream.
      
      If the descriptors do not need any strings and user space sends empty
      set of strings, the ffs->stringtabs field remains NULL.  Thus
      *ffs->stringtabs in functionfs_bind leads to a NULL pointer
      dereferenece.
      
      The bug was introduced by commit [fd7c9a00: “use usb_string_ids_n()”].
      
      While at it, remove double initialisation of lang local variable in
      that function.
      
      ffs->strings_count does not need to be checked in any way since in
      the above scenario it will remain zero and usb_string_ids_n() is
      a no-operation when colled with 0 argument.
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9919dc4b
    • Paolo Bonzini's avatar
      KVM: x86: preserve the high 32-bits of the PAT register · 23f2204d
      Paolo Bonzini authored
      commit 7cb060a9 upstream.
      
      KVM does not really do much with the PAT, so this went unnoticed for a
      long time.  It is exposed however if you try to do rdmsr on the PAT
      register.
      Reported-by: default avatarValentine Sinitsyn <valentine.sinitsyn@gmail.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      23f2204d
    • Nadav Amit's avatar
      KVM: x86: Increase the number of fixed MTRR regs to 10 · 4314612c
      Nadav Amit authored
      commit 682367c4 upstream.
      
      Recent Intel CPUs have 10 variable range MTRRs. Since operating systems
      sometime make assumptions on CPUs while they ignore capability MSRs, it is
      better for KVM to be consistent with recent CPUs. Reporting more MTRRs than
      actually supported has no functional implications.
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      4314612c
    • David R. Piegdon's avatar
      ARM: OMAP2+: Fix parser-bug in platform muxing code · d7a3e3ec
      David R. Piegdon authored
      commit c021f241 upstream.
      
      Fix a parser-bug in the omap2 muxing code where muxtable-entries will be
      wrongly selected if the requested muxname is a *prefix* of their
      m0-entry and they have a matching mN-entry. Fix by additionally checking
      that the length of the m0_entry is equal.
      
      For example muxing of "dss_data2.dss_data2" on omap32xx will fail
      because the prefix "dss_data2" will match the mux-entries "dss_data2" as
      well as "dss_data20", with the suffix "dss_data2" matching m0 (for
      dss_data2) and m4 (for dss_data20). Thus both are recognized as signal
      path candidates:
      
      Relevant muxentries from mux34xx.c:
              _OMAP3_MUXENTRY(DSS_DATA20, 90,
                      "dss_data20", NULL, "mcspi3_somi", "dss_data2",
                      "gpio_90", NULL, NULL, "safe_mode"),
              _OMAP3_MUXENTRY(DSS_DATA2, 72,
                      "dss_data2", NULL, NULL, NULL,
                      "gpio_72", NULL, NULL, "safe_mode"),
      
      This will result in a failure to mux the pin at all:
      
       _omap_mux_get_by_name: Multiple signal paths (2) for dss_data2.dss_data2
      
      Patch should apply to linus' latest master down to rather old linux-2.6
      trees.
      Signed-off-by: default avatarDavid R. Piegdon <lkml@p23q.org>
      [tony@atomide.com: updated description to include full description]
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      d7a3e3ec
    • Ben Hutchings's avatar
      Revert "net: ip, ipv6: handle gso skbs in forwarding path" · 3d4a1eea
      Ben Hutchings authored
      This reverts commit caa53449, which
      was commit fe6cc55f upstream.  In 3.2,
      the transport header length is not calculated in the forwarding path,
      so skb_gso_network_seglen() returns an incorrect result.  We also have
      problems due to the local_df flag not being set correctly.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      3d4a1eea
    • Ben Hutchings's avatar
      Revert "net: ipv4: ip_forward: fix inverted local_df test" · 8bbfe822
      Ben Hutchings authored
      This reverts commit 59d9f389, which
      was commit ca6c5d4a upstream.  It is a
      valid fix, but depends on sk_buff::local_df being set in all the right
      cases, which it wasn't in 3.2.  We need to defer it unless and until
      the other fixes are also backported to 3.2.y.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8bbfe822
  2. 11 Jul, 2014 26 commits