1. 24 Jan, 2015 13 commits
    • Richard Weinberger's avatar
      UBI: Fix invalid vfree() · 1a139e0e
      Richard Weinberger authored
      The logic of vfree()'ing vol->upd_buf is tied to vol->updating.
      In ubi_start_update() vol->updating is set long before vmalloc()'ing
      vol->upd_buf. If we encounter a write failure in ubi_start_update()
      before vmalloc() the UBI device release function will try to vfree()
      vol->upd_buf because vol->updating is set.
      Fix this by allocating vol->upd_buf directly after setting vol->updating.
      
      Fixes:
      [   31.559338] UBI warning: vol_cdev_release: update of volume 2 not finished, volume is damaged
      [   31.559340] ------------[ cut here ]------------
      [   31.559343] WARNING: CPU: 1 PID: 2747 at mm/vmalloc.c:1446 __vunmap+0xe3/0x110()
      [   31.559344] Trying to vfree() nonexistent vm area (ffffc90001f2b000)
      [   31.559345] Modules linked in:
      [   31.565620]  0000000000000bba ffff88002a0cbdb0 ffffffff818f0497 ffff88003b9ba148
      [   31.566347]  ffff88002a0cbde0 ffffffff8156f515 ffff88003b9ba148 0000000000000bba
      [   31.567073]  0000000000000000 0000000000000000 ffff88002a0cbe88 ffffffff8156c10a
      [   31.567793] Call Trace:
      [   31.568034]  [<ffffffff818f0497>] dump_stack+0x4e/0x7a
      [   31.568510]  [<ffffffff8156f515>] ubi_io_write_vid_hdr+0x155/0x160
      [   31.569084]  [<ffffffff8156c10a>] ubi_eba_write_leb+0x23a/0x870
      [   31.569628]  [<ffffffff81569b36>] vol_cdev_write+0x226/0x380
      [   31.570155]  [<ffffffff81179265>] vfs_write+0xb5/0x1f0
      [   31.570627]  [<ffffffff81179f8a>] SyS_pwrite64+0x6a/0xa0
      [   31.571123]  [<ffffffff818fde12>] system_call_fastpath+0x16/0x1b
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      
      (cherry picked from commit f38aed97)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      1a139e0e
    • Myron Stowe's avatar
      PCI: Restore detection of read-only BARs · d089df9e
      Myron Stowe authored
      Commit 6ac665c6 ("PCI: rewrite PCI BAR reading code") masked off
      low-order bits from 'l', but not from 'sz'.  Both are passed to pci_size(),
      which compares 'base == maxbase' to check for read-only BARs.  The masking
      of 'l' means that comparison will never be 'true', so the check for
      read-only BARs no longer works.
      
      Resolve this by also masking off the low-order bits of 'sz' before passing
      it into pci_size() as 'maxbase'.  With this change, pci_size() will once
      again catch the problems that have been encountered to date:
      
        - AGP aperture BAR of AMD-7xx host bridges: if the AGP window is
          disabled, this BAR is read-only and read as 0x00000008 [1]
      
        - BARs 0-4 of ALi IDE controllers can be non-zero and read-only [1]
      
        - Intel Sandy Bridge - Thermal Management Controller [8086:0103];
          BAR 0 returning 0xfed98004 [2]
      
        - Intel Xeon E5 v3/Core i7 Power Control Unit [8086:2fc0];
          Bar 0 returning 0x00001a [3]
      
      Link: [1] https://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/drivers/pci/probe.c?id=1307ef6621991f1c4bc3cec1b5a4ebd6fd3d66b9 ("PCI: probing read-only BARs" (pre-git))
      Link: [2] https://bugzilla.kernel.org/show_bug.cgi?id=43331
      Link: [3] https://bugzilla.kernel.org/show_bug.cgi?id=85991Reported-by: default avatarWilliam Unruh <unruh@physics.ubc.ca>
      Reported-by: default avatarMartin Lucina <martin@lucina.net>
      Signed-off-by: default avatarMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      CC: Matthew Wilcox <willy@linux.intel.com>
      CC: stable@vger.kernel.org	# v2.6.27+
      
      (cherry picked from commit 36e81648)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d089df9e
    • Dmitry Tunin's avatar
      Bluetooth: ath3k: Add support of MCI 13d3:3408 bt device · 75b7515b
      Dmitry Tunin authored
      Add support for Bluetooth MCI WB335 (AR9565) Wi-Fi+bt module. This
      Bluetooth module requires loading patch and sysconfig by ath3k driver.
      
      T:  Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#= 20 Spd=12   MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=13d3 ProdID=3408 Rev= 0.02
      C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      Signed-off-by: default avatarDmitry Tunin <hanipouspilot@gmail.com>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 3bb30a7c)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      75b7515b
    • Steven Rostedt (Red Hat)'s avatar
      ktest: Fix make_min_config to handle new assign_configs call · 22dfce24
      Steven Rostedt (Red Hat) authored
      Commit 6071c22e "ktest: Rewrite the config-bisect to actually work"
      fixed the config-bisect to work nicely but in doing so it broke
      make_min_config by changing the way assign_configs works.
      
      The assign_configs function now adds the config to the hash even if
      it is disabled, but changes the hash value to be that of the
      line "# CONFIG_FOO is not set". Unfortunately, the make_min_config
      test only checks to see if the config is removed. It now needs to
      check if the config is in the hash and not set to be disabled.
      
      Cc: stable@vger.kernel.org # 3.17+
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      
      (cherry picked from commit 9972fc0b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      22dfce24
    • Andrew Jackson's avatar
      ASoC: dwc: Ensure FIFOs are flushed to prevent channel swap · 0033a6d3
      Andrew Jackson authored
      Flush the FIFOs when the stream is prepared for use.  This avoids
      an inadvertent swapping of the left/right channels if the FIFOs are
      not empty at startup.
      Signed-off-by: default avatarAndrew Jackson <Andrew.Jackson@arm.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 3475c3d0)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0033a6d3
    • Lars-Peter Clausen's avatar
      ASoC: sigmadsp: Refuse to load firmware files with a non-supported version · f7970d7f
      Lars-Peter Clausen authored
      Make sure to check the version field of the firmware header to make sure to
      not accidentally try to parse a firmware file with a different layout.
      Trying to do so can result in loading invalid firmware code to the device.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 50c0f21b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f7970d7f
    • Felix Fietkau's avatar
      ath5k: fix hardware queue index assignment · 2e563893
      Felix Fietkau authored
      Like with ath9k, ath5k queues also need to be ordered by priority.
      queue_info->tqi_subtype already contains the correct index, so use it
      instead of relying on the order of ath5k_hw_setup_tx_queue calls.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      
      (cherry picked from commit 9e4982f6)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      2e563893
    • Stefano Stabellini's avatar
      Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single" · 263328fd
      Stefano Stabellini authored
      This reverts commit 2c3fc8d2.
      
      This commit broke on x86 PV because entries in the generic SWIOTLB are
      indexed using (pseudo-)physical address not DMA address and these are
      not the same in a x86 PV guest.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      
      Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single"
      
      This reverts commit 2c3fc8d2.
      
      This commit broke on x86 PV because entries in the generic SWIOTLB are
      indexed using (pseudo-)physical address not DMA address and these are
      not the same in a x86 PV guest.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      
      xen: annotate xen_set_identity_and_remap_chunk() with __init
      
      Commit 5b8e7d80 removed the __init
      annotation from xen_set_identity_and_remap_chunk(). Add it again.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: introduce helper functions to do safe read and write accesses
      
      Introduce two helper functions to safely read and write unsigned long
      values from or to memory when the access may fault because the mapping
      is non-present or read-only.
      
      These helpers can be used instead of open coded uses of __get_user()
      and __put_user() avoiding the need to do casts to fix sparse warnings.
      
      Use the helpers in page.h and p2m.c. This will fix the sparse
      warnings when doing "make C=1".
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: Speed up set_phys_to_machine() by using read-only mappings
      
      Instead of checking at each call of set_phys_to_machine() whether a
      new p2m page has to be allocated due to writing an entry in a large
      invalid or identity area, just map those areas read only and react
      to a page fault on write by allocating the new page.
      
      This change will make the common path with no allocation much
      faster as it only requires a single write of the new mfn instead
      of walking the address translation tables and checking for the
      special cases.
      Suggested-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: switch to linear virtual mapped sparse p2m list
      
      At start of the day the Xen hypervisor presents a contiguous mfn list
      to a pv-domain. In order to support sparse memory this mfn list is
      accessed via a three level p2m tree built early in the boot process.
      Whenever the system needs the mfn associated with a pfn this tree is
      used to find the mfn.
      
      Instead of using a software walked tree for accessing a specific mfn
      list entry this patch is creating a virtual address area for the
      entire possible mfn list including memory holes. The holes are
      covered by mapping a pre-defined  page consisting only of "invalid
      mfn" entries. Access to a mfn entry is possible by just using the
      virtual base address of the mfn list and the pfn as index into that
      list. This speeds up the (hot) path of determining the mfn of a
      pfn.
      
      Kernel build on a Dell Latitude E6440 (2 cores, HT) in 64 bit Dom0
      showed following improvements:
      
      Elapsed time: 32:50 ->  32:35
      System:       18:07 ->  17:47
      User:        104:00 -> 103:30
      
      Tested with following configurations:
      - 64 bit dom0, 8GB RAM
      - 64 bit dom0, 128 GB RAM, PCI-area above 4 GB
      - 32 bit domU, 512 MB, 8 GB, 43 GB (more wouldn't work even without
                                          the patch)
      - 32 bit domU, ballooning up and down
      - 32 bit domU, save and restore
      - 32 bit domU with PCI passthrough
      - 64 bit domU, 8 GB, 2049 MB, 5000 MB
      - 64 bit domU, ballooning up and down
      - 64 bit domU, save and restore
      - 64 bit domU with PCI passthrough
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: Hide get_phys_to_machine() to be able to tune common path
      
      Today get_phys_to_machine() is always called when the mfn for a pfn
      is to be obtained. Add a wrapper __pfn_to_mfn() as inline function
      to be able to avoid calling get_phys_to_machine() when possible as
      soon as the switch to a linear mapped p2m list has been done.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      x86: Introduce function to get pmd entry pointer
      
      Introduces lookup_pmd_address() to get the address of the pmd entry
      related to a virtual address in the current address space. This
      function is needed for support of a virtual mapped sparse p2m list
      in xen pv domains, as we need the address of the pmd entry, not the
      one of the pte in that case.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: Delay invalidating extra memory
      
      When the physical memory configuration is initialized the p2m entries
      for not pouplated memory pages are set to "invalid". As those pages
      are beyond the hypervisor built p2m list the p2m tree has to be
      extended.
      
      This patch delays processing the extra memory related p2m entries
      during the boot process until some more basic memory management
      functions are callable. This removes the need to create new p2m
      entries until virtual memory management is available.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: Delay m2p_override initialization
      
      The m2p overrides are used to be able to find the local pfn for a
      foreign mfn mapped into the domain. They are used by driver backends
      having to access frontend data.
      
      As this functionality isn't used in early boot it makes no sense to
      initialize the m2p override functions very early. It can be done
      later without doing any harm, removing the need for allocating memory
      via extend_brk().
      
      While at it make some m2p override functions static as they are only
      used internally.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: Delay remapping memory of pv-domain
      
      Early in the boot process the memory layout of a pv-domain is changed
      to match the E820 map (either the host one for Dom0 or the Xen one)
      regarding placement of RAM and PCI holes. This requires removing memory
      pages initially located at positions not suitable for RAM and adding
      them later at higher addresses where no restrictions apply.
      
      To be able to operate on the hypervisor supported p2m list until a
      virtual mapped linear p2m list can be constructed, remapping must
      be delayed until virtual memory management is initialized, as the
      initial p2m list can't be extended unlimited at physical memory
      initialization time due to it's fixed structure.
      
      A further advantage is the reduction in complexity and code volume as
      we don't have to be careful regarding memory restrictions during p2m
      updates.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: use common page allocation function in p2m.c
      
      In arch/x86/xen/p2m.c three different allocation functions for
      obtaining a memory page are used: extend_brk(), alloc_bootmem_align()
      or __get_free_page().  Which of those functions is used depends on the
      progress of the boot process of the system.
      
      Introduce a common allocation routine selecting the to be called
      allocation routine dynamically based on the boot progress. This allows
      moving initialization steps without having to care about changing
      allocation calls.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: Make functions static
      
      Some functions in arch/x86/xen/p2m.c are used locally only. Make them
      static. Rearrange the functions in p2m.c to avoid forward declarations.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen: fix some style issues in p2m.c
      
      The source arch/x86/xen/p2m.c has some coding style issues. Fix them.
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen/pci: Use APIC directly when APIC virtualization hardware is available
      
      When hardware supports APIC/x2APIC virtualization we don't need to use
      pirqs for MSI handling and instead use APIC since most APIC accesses
      (MMIO or MSR) will now be processed without VMEXITs.
      
      As an example, netperf on the original code produces this profile
      (collected wih 'xentrace -e 0x0008ffff -T 5'):
      
          342 cpu_change
          260 CPUID
        34638 HLT
        64067 INJ_VIRQ
        28374 INTR
        82733 INTR_WINDOW
           10 NPF
        24337 TRAP
       370610 vlapic_accept_pic_intr
       307528 VMENTRY
       307527 VMEXIT
       140998 VMMCALL
          127 wrap_buffer
      
      After applying this patch the same test shows
      
          230 cpu_change
          260 CPUID
        36542 HLT
          174 INJ_VIRQ
        27250 INTR
          222 INTR_WINDOW
           20 NPF
        24999 TRAP
       381812 vlapic_accept_pic_intr
       166480 VMENTRY
       166479 VMEXIT
        77208 VMMCALL
           81 wrap_buffer
      
      ApacheBench results (ab -n 10000 -c 200) improve by about 10%
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarAndrew Cooper <andrew.cooper3@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen/pci: Defer initialization of MSI ops on HVM guests
      
      If the hardware supports APIC virtualization we may decide not to use
      pirqs and instead use APIC/x2APIC directly, meaning that we don't want
      to set x86_msi.setup_msi_irqs and x86_msi.teardown_msi_irq to
      Xen-specific routines.  However, x2APIC is not set up by the time
      pci_xen_hvm_init() is called so we need to postpone setting these ops
      until later, when we know which APIC mode is used.
      
      (Note that currently x2APIC is never initialized on HVM guests. This
      may change in the future)
      Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen-pciback: drop SR-IOV VFs when PF driver unloads
      
      When a PF driver unloads, it may find it necessary to leave the VFs
      around simply because of pciback having marked them as assigned to a
      guest. Utilize a suitable notification to let go of the VFs, thus
      allowing the PF to go back into the state it was before its driver
      loaded (which in particular allows the driver to be loaded again with
      it being able to create the VFs anew, but which also allows to then
      pass through the PF instead of the VFs).
      
      Don't do this however for any VFs currently in active use by a guest.
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      [v2: Removed the switch statement, moved it about]
      [v3: Redid it a bit differently]
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen/pciback: Restore configuration space when detaching from a guest.
      
      The commit "xen/pciback: Don't deadlock when unbinding." was using
      the version of pci_reset_function which would lock the device lock.
      That is no good as we can dead-lock. As such we swapped to using
      the lock-less version and requiring that the callers
      of 'pcistub_put_pci_dev' take the device lock. And as such
      this bug got exposed.
      
      Using the lock-less version is  OK, except that we tried to
      use 'pci_restore_state' after the lock-less version of
      __pci_reset_function_locked - which won't work as 'state_saved'
      is set to false. Said 'state_saved' is a toggle boolean that
      is to be used by the sequence of a) pci_save_state/pci_restore_state
      or b) pci_load_and_free_saved_state/pci_restore_state. We don't
      want to use a) as the guest might have messed up the PCI
      configuration space and we want it to revert to the state
      when the PCI device was binded to us. Therefore we pick
      b) to restore the configuration space.
      
      We restore from our 'golden' version of PCI configuration space, when an:
       - Device is unbinded from pciback
       - Device is detached from a guest.
      Reported-by: default avatarSander Eikelenboom <linux@eikelenboom.it>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      PCI: Expose pci_load_saved_state for public consumption.
      
      We have the pci_load_and_free_saved_state, and pci_store_saved_state
      but are missing the functionality to just load the state
      multiple times in the PCI device without having to free/save
      the state.
      
      This patch makes it possible to use this function.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen/pciback: Remove tons of dereferences
      
      A little cleanup. No functional difference.
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen/pciback: Print out the domain owning the device.
      
      We had been printing it only if the device was built with
      debug enabled. But this information is useful in the field
      to troubleshoot.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen/pciback: Include the domain id if removing the device whilst still in use
      
      Cleanup the function a bit - also include the id of the
      domain that is using the device.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      driver core: Provide an wrapper around the mutex to do lockdep warnings
      
      Instead of open-coding it in drivers that want to double check
      that their functions are indeed holding the device lock.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Suggested-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      xen/pciback: Don't deadlock when unbinding.
      
      As commit 0a9fd015
      'xen/pciback: Document the entry points for 'pcistub_put_pci_dev''
      explained there are four entry points in this function.
      Two of them are when the user fiddles in the SysFS to
      unbind a device which might be in use by a guest or not.
      
      Both 'unbind' states will cause a deadlock as the the PCI lock has
      already been taken, which then pci_device_reset tries to take.
      
      We can simplify this by requiring that all callers of
      pcistub_put_pci_dev MUST hold the device lock. And then
      we can just call the lockless version of pci_device_reset.
      
      To make it even simpler we will modify xen_pcibk_release_pci_dev
      to quality whether it should take a lock or not - as it ends
      up calling xen_pcibk_release_pci_dev and needs to hold the lock.
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      
      swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single
      
      Need to pass the pointer within the swiotlb internal buffer to the
      swiotlb library, that in the case of xen_unmap_single is dev_addr, not
      paddr.
      Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Acked-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      CC: stable@vger.kernel.org
      
      (cherry picked from commit dbdd7476
      4ef8e3f3
      2c3fc8d2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      263328fd
    • Stephane Grosjean's avatar
      can: peak_usb: fix memset() usage · 39d78677
      Stephane Grosjean authored
      This patchs fixes a misplaced call to memset() that fills the request
      buffer with 0. The problem was with sending PCAN_USBPRO_REQ_FCT
      requests, the content set by the caller was thus lost.
      
      With this patch, the memory area is zeroed only when requesting info
      from the device.
      Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      
      (cherry picked from commit dc50ddcd)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      39d78677
    • Stephane Grosjean's avatar
      can: peak_usb: fix cleanup sequence order in case of error during init · 3ac3698a
      Stephane Grosjean authored
      This patch sets the correct reverse sequence order to the instructions
      set to run, when any failure occurs during the initialization steps.
      It also adds the missing unregistration call of the can device if the
      failure appears after having been registered.
      Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      
      (cherry picked from commit af35d0f1)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3ac3698a
    • Felix Fietkau's avatar
      ath9k: fix BE/BK queue order · 8ce86052
      Felix Fietkau authored
      Hardware queues are ordered by priority. Use queue index 0 for BK, which
      has lower priority than BE.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      
      (cherry picked from commit 78063d81)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8ce86052
    • Felix Fietkau's avatar
      ath9k_hw: fix hardware queue allocation · 5bf04623
      Felix Fietkau authored
      The driver passes the desired hardware queue index for a WMM data queue
      in qinfo->tqi_subtype. This was ignored in ath9k_hw_setuptxqueue, which
      instead relied on the order in which the function is called.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarHubert Feurstein <h.feurstein@gmail.com>
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      
      (cherry picked from commit ad8fdccf)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5bf04623
    • Junxiao Bi's avatar
      ocfs2: fix journal commit deadlock · c112ede6
      Junxiao Bi authored
      For buffer write, page lock will be got in write_begin and released in
      write_end, in ocfs2_write_end_nolock(), before it unlock the page in
      ocfs2_free_write_ctxt(), it calls ocfs2_run_deallocs(), this will ask
      for the read lock of journal->j_trans_barrier.  Holding page lock and
      ask for journal->j_trans_barrier breaks the locking order.
      
      This will cause a deadlock with journal commit threads, ocfs2cmt will
      get write lock of journal->j_trans_barrier first, then it wakes up
      kjournald2 to do the commit work, at last it waits until done.  To
      commit journal, kjournald2 needs flushing data first, it needs get the
      cache page lock.
      
      Since some ocfs2 cluster locks are holding by write process, this
      deadlock may hung the whole cluster.
      
      unlock pages before ocfs2_run_deallocs() can fix the locking order, also
      put unlock before ocfs2_commit_trans() to make page lock is unlocked
      before j_trans_barrier to preserve unlocking order.
      Signed-off-by: default avatarJunxiao Bi <junxiao.bi@oracle.com>
      Reviewed-by: default avatarWengang Wang <wen.gang.wang@oracle.com>
      Cc: <stable@vger.kernel.org>
      Reviewed-by: default avatarMark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit 136f49b9)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c112ede6
  2. 10 Jan, 2015 26 commits
  3. 09 Jan, 2015 1 commit
    • Cong Wang's avatar
      freezer: Do not freeze tasks killed by OOM killer · 778de0ed
      Cong Wang authored
      Since f660daac (oom: thaw threads if oom killed thread is frozen
      before deferring) OOM killer relies on being able to thaw a frozen task
      to handle OOM situation but a3201227 (freezer: make freezing() test
      freeze conditions in effect instead of TIF_FREEZE) has reorganized the
      code and stopped clearing freeze flag in __thaw_task. This means that
      the target task only wakes up and goes into the fridge again because the
      freezing condition hasn't changed for it. This reintroduces the bug
      fixed by f660daac.
      
      Fix the issue by checking for TIF_MEMDIE thread flag in
      freezing_slow_path and exclude the task from freezing completely. If a
      task was already frozen it would get woken by __thaw_task from OOM killer
      and get out of freezer after rechecking freezing().
      
      Changes since v1
      - put TIF_MEMDIE check into freezing_slowpath rather than in __refrigerator
        as per Oleg
      - return __thaw_task into oom_scan_process_thread because
        oom_kill_process will not wake task in the fridge because it is
        sleeping uninterruptible
      
      [mhocko@suse.cz: rewrote the changelog]
      Fixes: a3201227 (freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE)
      Cc: 3.3+ <stable@vger.kernel.org> # 3.3+
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 51fae6da)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      778de0ed