1. 20 Feb, 2014 10 commits
    • Will Deacon's avatar
      arm64: vdso: prevent ld from aligning PT_LOAD segments to 64k · c1c8c891
      Will Deacon authored
      commit 40507403 upstream.
      
      Whilst the text segment for our VDSO is marked as PT_LOAD in the ELF
      headers, it is mapped by the kernel and not actually subject to
      demand-paging. ld doesn't realise this, and emits a p_align field of 64k
      (the maximum supported page size), which conflicts with the load address
      picked by the kernel on 4k systems, which will be 4k aligned. This
      causes GDB to fail with "Failed to read a valid object file image from
      memory" when attempting to load the VDSO.
      
      This patch passes the -n option to ld, which prevents it from aligning
      PT_LOAD segments to the maximum page size.
      Reported-by: default avatarKyle McMartin <kyle@redhat.com>
      Acked-by: default avatarKyle McMartin <kyle@redhat.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1c8c891
    • Nathan Lynch's avatar
      arm64: vdso: update wtm fields for CLOCK_MONOTONIC_COARSE · 95947843
      Nathan Lynch authored
      commit d4022a33 upstream.
      
      Update wall-to-monotonic fields in the VDSO data page
      unconditionally.  These are used to service CLOCK_MONOTONIC_COARSE,
      which is not guarded by use_syscall.
      Signed-off-by: default avatarNathan Lynch <nathan_lynch@mentor.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95947843
    • Lior Amsalem's avatar
      irqchip: armada-370-xp: fix IPI race condition · 97ec8cd5
      Lior Amsalem authored
      commit a6f089e9 upstream.
      
      In the Armada 370/XP driver, when we receive an IRQ 0, we read the
      list of doorbells that caused the interrupt from register
      ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS. This gives the list of IPIs that
      were generated. However, instead of acknowledging only the IPIs that
      were generated, we acknowledge *all* the IPIs, by writing
      ~IPI_DOORBELL_MASK in the ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS register.
      
      This creates a race condition: if a new IPI that isn't part of the
      ones read into the temporary "ipimask" variable is fired before we
      acknowledge all IPIs, then we will simply loose it. This is causing
      scheduling hangs on SMP intensive workloads.
      
      It is important to mention that this ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS
      register has the following behavior: "A CPU write of 0 clears the bits
      in this field. A CPU write of 1 has no effect". This is what allows us
      to simply write ~ipimask to acknoledge the handled IPIs.
      
      Notice that the same problem is present in the MSI implementation, but
      it will be fixed as a separate patch, so that this IPI fix can be
      pushed to older stable versions as appropriate (all the way to 3.8),
      while the MSI code only appeared in 3.13.
      Signed-off-by: default avatarLior Amsalem <alior@marvell.com>
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Fixes: 344e873e 'arm: mvebu: Add IPI support via doorbells'
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      97ec8cd5
    • Trond Myklebust's avatar
      NFSv4: Fix memory corruption in nfs4_proc_open_confirm · b0e72a22
      Trond Myklebust authored
      commit 17ead6c8 upstream.
      
      nfs41_wake_and_assign_slot() relies on the task->tk_msg.rpc_argp and
      task->tk_msg.rpc_resp always pointing to the session sequence arguments.
      
      nfs4_proc_open_confirm tries to pull a fast one by reusing the open
      sequence structure, thus causing corruption of the NFSv4 slot table.
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b0e72a22
    • Trond Myklebust's avatar
      NFSv4.1: nfs4_destroy_session must call rpc_destroy_waitqueue · 7cdb12c3
      Trond Myklebust authored
      commit 20b9a902 upstream.
      
      There may still be timers active on the session waitqueues. Make sure
      that we kill them before freeing the memory.
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7cdb12c3
    • Harald Freudenberger's avatar
      crypto: s390 - fix des and des3_ede ctr concurrency issue · 9d5e3b52
      Harald Freudenberger authored
      commit ee97dc7d upstream.
      
      In s390 des and 3des ctr mode there is one preallocated page
      used to speed up the en/decryption. This page is not protected
      against concurrent usage and thus there is a potential of data
      corruption with multiple threads.
      
      The fix introduces locking/unlocking the ctr page and a slower
      fallback solution at concurrency situations.
      Signed-off-by: default avatarHarald Freudenberger <freude@linux.vnet.ibm.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9d5e3b52
    • Harald Freudenberger's avatar
      crypto: s390 - fix des and des3_ede cbc concurrency issue · 6414e5ed
      Harald Freudenberger authored
      commit adc3fcf1 upstream.
      
      In s390 des and des3_ede cbc mode the iv value is not protected
      against concurrency access and modifications from another running
      en/decrypt operation which is using the very same tfm struct
      instance. This fix copies the iv to the local stack before
      the crypto operation and stores the value back when done.
      Signed-off-by: default avatarHarald Freudenberger <freude@linux.vnet.ibm.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6414e5ed
    • Harald Freudenberger's avatar
      crypto: s390 - fix concurrency issue in aes-ctr mode · aa1eef2b
      Harald Freudenberger authored
      commit 0519e9ad upstream.
      
      The aes-ctr mode uses one preallocated page without any concurrency
      protection. When multiple threads run aes-ctr encryption or decryption
      this can lead to data corruption.
      
      The patch introduces locking for the page and a fallback solution with
      slower en/decryption performance in concurrency situations.
      Signed-off-by: default avatarHarald Freudenberger <freude@linux.vnet.ibm.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa1eef2b
    • Josef Bacik's avatar
      Btrfs: disable snapshot aware defrag for now · 52a0aaf1
      Josef Bacik authored
      commit 8101c8db upstream.
      
      It's just broken and it's taking a lot of effort to fix it, so for now just
      disable it so people can defrag in peace.  Thanks,
      Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52a0aaf1
    • Stephen Smalley's avatar
      SELinux: Fix kernel BUG on empty security contexts. · 81451fe1
      Stephen Smalley authored
      commit 2172fa70 upstream.
      
      Setting an empty security context (length=0) on a file will
      lead to incorrectly dereferencing the type and other fields
      of the security context structure, yielding a kernel BUG.
      As a zero-length security context is never valid, just reject
      all such security contexts whether coming from userspace
      via setxattr or coming from the filesystem upon a getxattr
      request by SELinux.
      
      Setting a security context value (empty or otherwise) unknown to
      SELinux in the first place is only possible for a root process
      (CAP_MAC_ADMIN), and, if running SELinux in enforcing mode, only
      if the corresponding SELinux mac_admin permission is also granted
      to the domain by policy.  In Fedora policies, this is only allowed for
      specific domains such as livecd for setting down security contexts
      that are not defined in the build host policy.
      
      Reproducer:
      su
      setenforce 0
      touch foo
      setfattr -n security.selinux foo
      
      Caveat:
      Relabeling or removing foo after doing the above may not be possible
      without booting with SELinux disabled.  Any subsequent access to foo
      after doing the above will also trigger the BUG.
      
      BUG output from Matthew Thode:
      [  473.893141] ------------[ cut here ]------------
      [  473.962110] kernel BUG at security/selinux/ss/services.c:654!
      [  473.995314] invalid opcode: 0000 [#6] SMP
      [  474.027196] Modules linked in:
      [  474.058118] CPU: 0 PID: 8138 Comm: ls Tainted: G      D   I
      3.13.0-grsec #1
      [  474.116637] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0
      07/29/10
      [  474.149768] task: ffff8805f50cd010 ti: ffff8805f50cd488 task.ti:
      ffff8805f50cd488
      [  474.183707] RIP: 0010:[<ffffffff814681c7>]  [<ffffffff814681c7>]
      context_struct_compute_av+0xce/0x308
      [  474.219954] RSP: 0018:ffff8805c0ac3c38  EFLAGS: 00010246
      [  474.252253] RAX: 0000000000000000 RBX: ffff8805c0ac3d94 RCX:
      0000000000000100
      [  474.287018] RDX: ffff8805e8aac000 RSI: 00000000ffffffff RDI:
      ffff8805e8aaa000
      [  474.321199] RBP: ffff8805c0ac3cb8 R08: 0000000000000010 R09:
      0000000000000006
      [  474.357446] R10: 0000000000000000 R11: ffff8805c567a000 R12:
      0000000000000006
      [  474.419191] R13: ffff8805c2b74e88 R14: 00000000000001da R15:
      0000000000000000
      [  474.453816] FS:  00007f2e75220800(0000) GS:ffff88061fc00000(0000)
      knlGS:0000000000000000
      [  474.489254] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  474.522215] CR2: 00007f2e74716090 CR3: 00000005c085e000 CR4:
      00000000000207f0
      [  474.556058] Stack:
      [  474.584325]  ffff8805c0ac3c98 ffffffff811b549b ffff8805c0ac3c98
      ffff8805f1190a40
      [  474.618913]  ffff8805a6202f08 ffff8805c2b74e88 00068800d0464990
      ffff8805e8aac860
      [  474.653955]  ffff8805c0ac3cb8 000700068113833a ffff880606c75060
      ffff8805c0ac3d94
      [  474.690461] Call Trace:
      [  474.723779]  [<ffffffff811b549b>] ? lookup_fast+0x1cd/0x22a
      [  474.778049]  [<ffffffff81468824>] security_compute_av+0xf4/0x20b
      [  474.811398]  [<ffffffff8196f419>] avc_compute_av+0x2a/0x179
      [  474.843813]  [<ffffffff8145727b>] avc_has_perm+0x45/0xf4
      [  474.875694]  [<ffffffff81457d0e>] inode_has_perm+0x2a/0x31
      [  474.907370]  [<ffffffff81457e76>] selinux_inode_getattr+0x3c/0x3e
      [  474.938726]  [<ffffffff81455cf6>] security_inode_getattr+0x1b/0x22
      [  474.970036]  [<ffffffff811b057d>] vfs_getattr+0x19/0x2d
      [  475.000618]  [<ffffffff811b05e5>] vfs_fstatat+0x54/0x91
      [  475.030402]  [<ffffffff811b063b>] vfs_lstat+0x19/0x1b
      [  475.061097]  [<ffffffff811b077e>] SyS_newlstat+0x15/0x30
      [  475.094595]  [<ffffffff8113c5c1>] ? __audit_syscall_entry+0xa1/0xc3
      [  475.148405]  [<ffffffff8197791e>] system_call_fastpath+0x16/0x1b
      [  475.179201] Code: 00 48 85 c0 48 89 45 b8 75 02 0f 0b 48 8b 45 a0 48
      8b 3d 45 d0 b6 00 8b 40 08 89 c6 ff ce e8 d1 b0 06 00 48 85 c0 49 89 c7
      75 02 <0f> 0b 48 8b 45 b8 4c 8b 28 eb 1e 49 8d 7d 08 be 80 01 00 00 e8
      [  475.255884] RIP  [<ffffffff814681c7>]
      context_struct_compute_av+0xce/0x308
      [  475.296120]  RSP <ffff8805c0ac3c38>
      [  475.328734] ---[ end trace f076482e9d754adc ]---
      Reported-by: default avatarMatthew Thode <mthode@mthode.org>
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: default avatarPaul Moore <pmoore@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      81451fe1
  2. 13 Feb, 2014 30 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.12.11 · 3cb027bd
      Greg Kroah-Hartman authored
      3cb027bd
    • Adrian Hunter's avatar
      mmc: sdhci-pci: Fix possibility of chip->fixes being null · b8786a04
      Adrian Hunter authored
      commit 945be38c upstream.
      
      It is possible for chip->fixes to be null.  Check before dereferencing it.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarChris Ball <chris@printf.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8786a04
    • Adrian Hunter's avatar
      mmc: sdhci-pci: Fix BYT sd card getting stuck in runtime suspend · 1fb1e637
      Adrian Hunter authored
      commit 77a0122e upstream.
      
      A host controller for a SD card may need a GPIO for card detect in order
      to wake up from runtime suspend when a card is inserted.  If that GPIO is
      not configured, then the host controller will not wake up.  Fix that for
      the affected devices by not enabling runtime PM unless the GPIO is
      successfully set up.
      
      This affects BYT sd card host controller which had runtime PM enabled from
      v3.11.  For completeness, the MFD sd card host controller is flagged also.
      
      The original patch before rebasing (see link below) was tested on v3.11.10
      and v3.12.4 although the patch applied with some offsets and fuzz.  The
      original patch is here:
      
          http://marc.info/?l=linux-mmc&m=138676702327057Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarChris Ball <chris@printf.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1fb1e637
    • Borislav Petkov's avatar
      rtc-cmos: Add an alarm disable quirk · 5c8150ef
      Borislav Petkov authored
      commit d5a1c7e3 upstream.
      
      41c7f742 ("rtc: Disable the alarm in the hardware (v2)") added the
      functionality to disable the RTC wake alarm when shutting down the box.
      
      However, there are at least two b0rked BIOSes we know about:
      
      https://bugzilla.novell.com/show_bug.cgi?id=812592
      https://bugzilla.novell.com/show_bug.cgi?id=805740
      
      where, when wakeup alarm is enabled in the BIOS, the machine reboots
      automatically right after shutdown, regardless of what wakeup time is
      programmed.
      
      Bisecting the issue lead to this patch so disable its functionality with
      a DMI quirk only for those boxes.
      
      Cc: Brecht Machiels <brecht@mos6581.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Rabin Vincent <rabin.vincent@stericsson.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      [jstultz: Changed variable name for clarity, added extra dmi entry]
      Tested-by: default avatarBrecht Machiels <brecht@mos6581.org>
      Tested-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c8150ef
    • John Stultz's avatar
      timekeeping: Fix missing timekeeping_update in suspend path · f7efe92d
      John Stultz authored
      commit 330a1617 upstream.
      
      Since 48cdc135 (Implement a shadow timekeeper), we have to
      call timekeeping_update() after any adjustment to the timekeeping
      structure in order to make sure that any adjustments to the structure
      persist.
      
      In the timekeeping suspend path, we udpate the timekeeper
      structure, so we should be sure to update the shadow-timekeeper
      before releasing the timekeeping locks. Currently this isn't done.
      
      In most cases, the next time related code to run would be
      timekeeping_resume, which does update the shadow-timekeeper, but
      in an abundence of caution, this patch adds the call to
      timekeeping_update() in the suspend path.
      
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f7efe92d
    • John Stultz's avatar
      timekeeping: Fix CLOCK_TAI timer/nanosleep delays · aaa5ad29
      John Stultz authored
      commit 04005f60 upstream.
      
      A think-o in the calculation of the monotonic -> tai time offset
      results in CLOCK_TAI timers and nanosleeps to expire late (the
      latency is ~2x the tai offset).
      
      Fix this by adding the tai offset from the realtime offset instead
      of subtracting.
      
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aaa5ad29
    • John Stultz's avatar
      3.13.y: timekeeping: Fix clock_set/clock_was_set think-o · e14bada9
      John Stultz authored
      In backporting 6fdda9a9
      (timekeeping: Avoid possible deadlock from clock_was_set_delayed),
      I ralized the patch had a think-o where instead of checking
      clock_set I accidentally typed clock_was_set (which is a function
      - so the conditional always is true).
      
      Upstream this was resolved in the immediately following patch
      47a1b796 (tick/timekeeping: Call
      update_wall_time outside the jiffies lock). But since that patch
      really isn't -stable material, so this patch only pulls
      the name change.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e14bada9
    • John Stultz's avatar
      timekeeping: Avoid possible deadlock from clock_was_set_delayed · b6f484ea
      John Stultz authored
      commit 6fdda9a9 upstream.
      
      As part of normal operaions, the hrtimer subsystem frequently calls
      into the timekeeping code, creating a locking order of
        hrtimer locks -> timekeeping locks
      
      clock_was_set_delayed() was suppoed to allow us to avoid deadlocks
      between the timekeeping the hrtimer subsystem, so that we could
      notify the hrtimer subsytem the time had changed while holding
      the timekeeping locks. This was done by scheduling delayed work
      that would run later once we were out of the timekeeing code.
      
      But unfortunately the lock chains are complex enoguh that in
      scheduling delayed work, we end up eventually trying to grab
      an hrtimer lock.
      
      Sasha Levin noticed this in testing when the new seqlock lockdep
      enablement triggered the following (somewhat abrieviated) message:
      
      [  251.100221] ======================================================
      [  251.100221] [ INFO: possible circular locking dependency detected ]
      [  251.100221] 3.13.0-rc2-next-20131206-sasha-00005-g8be2375-dirty #4053 Not tainted
      [  251.101967] -------------------------------------------------------
      [  251.101967] kworker/10:1/4506 is trying to acquire lock:
      [  251.101967]  (timekeeper_seq){----..}, at: [<ffffffff81160e96>] retrigger_next_event+0x56/0x70
      [  251.101967]
      [  251.101967] but task is already holding lock:
      [  251.101967]  (hrtimer_bases.lock#11){-.-...}, at: [<ffffffff81160e7c>] retrigger_next_event+0x3c/0x70
      [  251.101967]
      [  251.101967] which lock already depends on the new lock.
      [  251.101967]
      [  251.101967]
      [  251.101967] the existing dependency chain (in reverse order) is:
      [  251.101967]
      -> #5 (hrtimer_bases.lock#11){-.-...}:
      [snipped]
      -> #4 (&rt_b->rt_runtime_lock){-.-...}:
      [snipped]
      -> #3 (&rq->lock){-.-.-.}:
      [snipped]
      -> #2 (&p->pi_lock){-.-.-.}:
      [snipped]
      -> #1 (&(&pool->lock)->rlock){-.-...}:
      [  251.101967]        [<ffffffff81194803>] validate_chain+0x6c3/0x7b0
      [  251.101967]        [<ffffffff81194d9d>] __lock_acquire+0x4ad/0x580
      [  251.101967]        [<ffffffff81194ff2>] lock_acquire+0x182/0x1d0
      [  251.101967]        [<ffffffff84398500>] _raw_spin_lock+0x40/0x80
      [  251.101967]        [<ffffffff81153e69>] __queue_work+0x1a9/0x3f0
      [  251.101967]        [<ffffffff81154168>] queue_work_on+0x98/0x120
      [  251.101967]        [<ffffffff81161351>] clock_was_set_delayed+0x21/0x30
      [  251.101967]        [<ffffffff811c4bd1>] do_adjtimex+0x111/0x160
      [  251.101967]        [<ffffffff811e2711>] compat_sys_adjtimex+0x41/0x70
      [  251.101967]        [<ffffffff843a4b49>] ia32_sysret+0x0/0x5
      [  251.101967]
      -> #0 (timekeeper_seq){----..}:
      [snipped]
      [  251.101967] other info that might help us debug this:
      [  251.101967]
      [  251.101967] Chain exists of:
        timekeeper_seq --> &rt_b->rt_runtime_lock --> hrtimer_bases.lock#11
      
      [  251.101967]  Possible unsafe locking scenario:
      [  251.101967]
      [  251.101967]        CPU0                    CPU1
      [  251.101967]        ----                    ----
      [  251.101967]   lock(hrtimer_bases.lock#11);
      [  251.101967]                                lock(&rt_b->rt_runtime_lock);
      [  251.101967]                                lock(hrtimer_bases.lock#11);
      [  251.101967]   lock(timekeeper_seq);
      [  251.101967]
      [  251.101967]  *** DEADLOCK ***
      [  251.101967]
      [  251.101967] 3 locks held by kworker/10:1/4506:
      [  251.101967]  #0:  (events){.+.+.+}, at: [<ffffffff81154960>] process_one_work+0x200/0x530
      [  251.101967]  #1:  (hrtimer_work){+.+...}, at: [<ffffffff81154960>] process_one_work+0x200/0x530
      [  251.101967]  #2:  (hrtimer_bases.lock#11){-.-...}, at: [<ffffffff81160e7c>] retrigger_next_event+0x3c/0x70
      [  251.101967]
      [  251.101967] stack backtrace:
      [  251.101967] CPU: 10 PID: 4506 Comm: kworker/10:1 Not tainted 3.13.0-rc2-next-20131206-sasha-00005-g8be2375-dirty #4053
      [  251.101967] Workqueue: events clock_was_set_work
      
      So the best solution is to avoid calling clock_was_set_delayed() while
      holding the timekeeping lock, and instead using a flag variable to
      decide if we should call clock_was_set() once we've released the locks.
      
      This works for the case here, where the do_adjtimex() was the deadlock
      trigger point. Unfortuantely, in update_wall_time() we still hold
      the jiffies lock, which would deadlock with the ipi triggered by
      clock_was_set(), preventing us from calling it even after we drop the
      timekeeping lock. So instead call clock_was_set_delayed() at that point.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Tested-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b6f484ea
    • John Stultz's avatar
      timekeeping: Fix potential lost pv notification of time change · 638d188c
      John Stultz authored
      commit 5258d3f2 upstream.
      
      In 780427f0 (Indicate that clock was set in the pvclock
      gtod notifier), logic was added to pass a CLOCK_WAS_SET
      notification to the pvclock notifier chain.
      
      While that patch added a action flag returned from
      accumulate_nsecs_to_secs(), it only uses the returned value
      in one location, and not in the logarithmic accumulation.
      
      This means if a leap second triggered during the logarithmic
      accumulation (which is most likely where it would happen),
      the notification that the clock was set would not make it to
      the pv notifiers.
      
      This patch extends the logarithmic_accumulation pass down
      that action flag so proper notification will occur.
      
      This patch also changes the varialbe action -> clock_set
      per Ingo's suggestion.
      
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: David Vrabel <david.vrabel@citrix.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: <xen-devel@lists.xen.org>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      638d188c
    • John Stultz's avatar
      timekeeping: Fix lost updates to tai adjustment · 89c23e58
      John Stultz authored
      commit f55c0760 upstream.
      
      Since 48cdc135 (Implement a shadow timekeeper), we have to
      call timekeeping_update() after any adjustment to the timekeeping
      structure in order to make sure that any adjustments to the structure
      persist.
      
      Unfortunately, the updates to the tai offset via adjtimex do not
      trigger this update, causing adjustments to the tai offset to be
      made and then over-written by the previous value at the next
      update_wall_time() call.
      
      This patch resovles the issue by calling timekeeping_update()
      right after setting the tai offset.
      
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89c23e58
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Have function graph only trace based on global_ops filters · 90eecc4b
      Steven Rostedt (Red Hat) authored
      commit 23a8e844 upstream.
      
      Doing some different tests, I discovered that function graph tracing, when
      filtered via the set_ftrace_filter and set_ftrace_notrace files, does
      not always keep with them if another function ftrace_ops is registered
      to trace functions.
      
      The reason is that function graph just happens to trace all functions
      that the function tracer enables. When there was only one user of
      function tracing, the function graph tracer did not need to worry about
      being called by functions that it did not want to trace. But now that there
      are other users, this becomes a problem.
      
      For example, one just needs to do the following:
      
       # cd /sys/kernel/debug/tracing
       # echo schedule > set_ftrace_filter
       # echo function_graph > current_tracer
       # cat trace
      [..]
       0)               |  schedule() {
       ------------------------------------------
       0)    <idle>-0    =>   rcu_pre-7
       ------------------------------------------
      
       0) ! 2980.314 us |  }
       0)               |  schedule() {
       ------------------------------------------
       0)   rcu_pre-7    =>    <idle>-0
       ------------------------------------------
      
       0) + 20.701 us   |  }
      
       # echo 1 > /proc/sys/kernel/stack_tracer_enabled
       # cat trace
      [..]
       1) + 20.825 us   |      }
       1) + 21.651 us   |    }
       1) + 30.924 us   |  } /* SyS_ioctl */
       1)               |  do_page_fault() {
       1)               |    __do_page_fault() {
       1)   0.274 us    |      down_read_trylock();
       1)   0.098 us    |      find_vma();
       1)               |      handle_mm_fault() {
       1)               |        _raw_spin_lock() {
       1)   0.102 us    |          preempt_count_add();
       1)   0.097 us    |          do_raw_spin_lock();
       1)   2.173 us    |        }
       1)               |        do_wp_page() {
       1)   0.079 us    |          vm_normal_page();
       1)   0.086 us    |          reuse_swap_page();
       1)   0.076 us    |          page_move_anon_rmap();
       1)               |          unlock_page() {
       1)   0.082 us    |            page_waitqueue();
       1)   0.086 us    |            __wake_up_bit();
       1)   1.801 us    |          }
       1)   0.075 us    |          ptep_set_access_flags();
       1)               |          _raw_spin_unlock() {
       1)   0.098 us    |            do_raw_spin_unlock();
       1)   0.105 us    |            preempt_count_sub();
       1)   1.884 us    |          }
       1)   9.149 us    |        }
       1) + 13.083 us   |      }
       1)   0.146 us    |      up_read();
      
      When the stack tracer was enabled, it enabled all functions to be traced, which
      now the function graph tracer also traces. This is a side effect that should
      not occur.
      
      To fix this a test is added when the function tracing is changed, as well as when
      the graph tracer is enabled, to see if anything other than the ftrace global_ops
      function tracer is enabled. If so, then the graph tracer calls a test trampoline
      that will look at the function that is being traced and compare it with the
      filters defined by the global_ops.
      
      As an optimization, if there's no other function tracers registered, or if
      the only registered function tracers also use the global ops, the function
      graph infrastructure will call the registered function graph callback directly
      and not go through the test trampoline.
      
      Fixes: d2d45c7a "tracing: Have stack_tracer use a separate list of functions"
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      90eecc4b
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Fix synchronization location disabling and freeing ftrace_ops · b5434bb3
      Steven Rostedt (Red Hat) authored
      commit a4c35ed2 upstream.
      
      The synchronization needed after ftrace_ops are unregistered must happen
      after the callback is disabled from becing called by functions.
      
      The current location happens after the function is being removed from the
      internal lists, but not after the function callbacks were disabled, leaving
      the functions susceptible of being called after their callbacks are freed.
      
      This affects perf and any externel users of function tracing (LTTng and
      SystemTap).
      
      Fixes: cdbe61bf "ftrace: Allow dynamically allocated function tracers"
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b5434bb3
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Synchronize setting function_trace_op with ftrace_trace_function · 2cd6ab0b
      Steven Rostedt (Red Hat) authored
      commit 405e1d83 upstream.
      
      ftrace_trace_function is a variable that holds what function will be called
      directly by the assembly code (mcount). If just a single function is
      registered and it handles recursion itself, then the assembly will call that
      function directly without any helper function. It also passes in the
      ftrace_op that was registered with the callback. The ftrace_op to send is
      stored in the function_trace_op variable.
      
      The ftrace_trace_function and function_trace_op needs to be coordinated such
      that the called callback wont be called with the wrong ftrace_op, otherwise
      bad things can happen if it expected a different op. Luckily, there's no
      callback that doesn't use the helper functions that requires this. But
      there soon will be and this needs to be fixed.
      
      Use a set_function_trace_op to store the ftrace_op to set the
      function_trace_op to when it is safe to do so (during the update function
      within the breakpoint or stop machine calls). Or if dynamic ftrace is not
      being used (static tracing) then we have to do a bit more synchronization
      when the ftrace_trace_function is set as that takes affect immediately
      (as oppose to dynamic ftrace doing it with the modification of the trampoline).
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2cd6ab0b
    • Dave Airlie's avatar
      drm/mgag200,ast,cirrus: fix regression with drm_can_sleep conversion · 891e3d3d
      Dave Airlie authored
      commit 8b7ad1bb upstream.
      
      I totally sign inverted my way out of this one.
      Reported-by: default avatar"Sabrina Dubroca" <sd@queasysnail.net>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      891e3d3d
    • Dave Airlie's avatar
      drm/mgag200: fix typo causing bw limits to be ignored on some chips · 281ee70b
      Dave Airlie authored
      commit ec22b4aa upstream.
      
      mode->mdev otherwise the bw limits never kick in.
      
      Reported in RHEL testing.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      281ee70b
    • Dave Airlie's avatar
      drm/mgag200: fix oops in cursor code. · d79d8ea8
      Dave Airlie authored
      commit 53dac830 upstream.
      
      In some cases we enter the cursor code with file_priv = NULL causing an oops,
      we also can try to unpin something that isn't pinned, and this is a good fix for it.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d79d8ea8
    • Thomas Hellstrom's avatar
      drm/vmwgfx: Fix regression caused by "drm/ttm: make ttm reservation calls... · c3269a10
      Thomas Hellstrom authored
      drm/vmwgfx: Fix regression caused by "drm/ttm: make ttm reservation calls behave like reservation calls"
      
      commit cf5e3413 upstream.
      
      The call to ttm_eu_backoff_reservation() as part of an error path would cause
      a lock imbalance if the reservation ticket was not initialized. This error is
      easily triggered from user-space by submitting a bogus command stream.
      Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: default avatarJakob Bornecrantz <jakob@vmware.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      c3269a10
    • Dave Airlie's avatar
      drm: ast,cirrus,mgag200: use drm_can_sleep · 3cc1638e
      Dave Airlie authored
      commit f4b4718b upstream.
      
      these 3 were checking in_interrupt but we have situations where
      calling vunmap under this could cause a BUG to be hit in
      smp_call_function_many. Use the drm_can_sleep macro instead,
      which should stop this path from been taken in this case.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3cc1638e
    • Patrik Jakobsson's avatar
    • Laurent Pinchart's avatar
      drm/rcar-du: Update plane pitch in .mode_set_base() operation · 1ace7349
      Laurent Pinchart authored
      commit eb86301f upstream.
      
      When setting a new frame buffer with the mode set base operation the
      pitch value might change. Set the hardware plane pitch register at the
      same time as the plane base address in the rcar_du_plane_update_base()
      function to make sure the pitch value always matches the frame buffer.
      Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1ace7349
    • Daniel Vetter's avatar
      drm/gem: Always initialize the gem object in object_init · da31f98c
      Daniel Vetter authored
      commit 6ab11a26 upstream.
      
      At least drm/i915 expects that the obj->dev pointer is set even in
      failure paths. Specifically when the shmem initialization fails we
      call i915_gem_object_free which needs to deref obj->base.dev to get at
      the slab pointer in the device private structure. And the shmem
      allocation can easily fail when userspace is hitting open file limits.
      
      Doing the structure init even when the shmem file allocation fails
      prevents this Oops.
      
      This is a regression from
      
      commit 89c8233f
      Author: David Herrmann <dh.herrmann@gmail.com>
      Date:   Thu Jul 11 11:56:32 2013 +0200
      
          drm/gem: simplify object initialization
      
      v2: Add regression note which Chris supplied.
      
      Testcase: igt/gem_fd_exhaustion
      Reported-and-Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      References: http://lists.freedesktop.org/archives/intel-gfx/2014-January/038433.htmlReviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      da31f98c
    • Takashi Iwai's avatar
      drm/cirrus: correct register values for 16bpp · f793650e
      Takashi Iwai authored
      commit 2510538f upstream.
      
      When the mode is set with 16bpp on QEMU, the output gets totally broken.
      The culprit is the bogus register values set for 16bpp, which was likely
      copied from from a wrong place.
      
      Addresses https://bugzilla.novell.com/show_bug.cgi?id=799216Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: David Airlie <airlied@linux.ie>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f793650e
    • Chris Wilson's avatar
      drm/i915: Decouple GPU error reporting from ring initialisation · da5f952c
      Chris Wilson authored
      commit 372fbb8e upstream.
      
      Currently we report through our error state only the rings that have
      been initialised (as detected by ring->obj). This check is done after
      the GPU reset and ring re-initialisation, which means that the software
      state may not be the same as when we captured the hardware error and we
      may not print out any of the vital information for debugging the hang.
      
      This (and the implied object leak) is a regression from
      
      commit 3d57e5bd
      Author: Ben Widawsky <ben@bwidawsk.net>
      Date:   Mon Oct 14 10:01:36 2013 -0700
      
          drm/i915: Do a fuller init after reset
      
      Note that we are already starting to get bug reports with incomplete
      error states from 3.13, which also hampers debugging userspace driver
      issues.
      
      v2: Prevent a NULL dereference on 830gm/845g after a GPU reset where
          the scratch obj may be NULL.
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      References: https://bugs.freedesktop.org/show_bug.cgi?id=74094Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Add a bit of fluff to make it clear we need this expedited in
      stable.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      da5f952c
    • Stanislaw Gruszka's avatar
      i915: remove pm_qos request on error · 8b839b5d
      Stanislaw Gruszka authored
      commit 22accca0 upstream.
      
      Not removing pm qos request and free memory for it can cause crash,
      when some other driver use pm qos. For example, this oops:
      
      BUG: unable to handle kernel paging request at fffffffffffffff8
      IP: [<ffffffff81307a6b>] plist_add+0x5b/0xd0
      Call Trace:
       [<ffffffff810acf25>] pm_qos_update_target+0x125/0x1e0
       [<ffffffff810ad071>] pm_qos_add_request+0x91/0x100
       [<ffffffffa053ec14>] e1000_open+0xe4/0x5b0 [e1000e]
      
      was caused by earlier i915 probe failure:
      
      [drm:i915_report_and_clear_eir] *ERROR* EIR stuck: 0x00000010, masking
      [drm:init_ring_common] *ERROR* render ring initialization failed ctl 0001f001 head 00003004 tail 00000000 start 00003000
      [drm:i915_driver_load] *ERROR* failed to init modeset
      i915: probe of 0000:00:02.0 failed with error -5
      
      Bug report:
      http://bugzilla.redhat.com/show_bug.cgi?id=1057533Reported-by: default avatarGiandomenico De Tullio <ghisha@gmail.com>
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      [danvet: Drop unnecessary code movement.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8b839b5d
    • Todd Previte's avatar
      drm/i915: VLV2 - Fix hotplug detect bits · 219b7536
      Todd Previte authored
      commit 232a6ee9 upstream.
      
      Add new definitions for hotplug live status bits for VLV2 since they're
      in reverse order from the gen4x ones.
      
      Changelog:
      - Restored gen4 bit definitions
      - Added new definitions for VLV2
      - Added platform check for IS_VALLEYVIEW() in dp_detect to use the correct
        bit defintions
      - Replaced a lost trailing brace for the added switch()
      Signed-off-by: default avatarTodd Previte <tprevite@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73951
      [danvet: Switch to _VLV postfix instead of prefix and regroupg
      comments again so that the g4x warning is right next to those defines.
      Also add a _G4X suffix for those special ones. Also cc stable.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      219b7536
    • Akash Goel's avatar
      drm/i915: Fix the offset issue for the stolen GEM objects · 4e2adfbb
      Akash Goel authored
      commit ec14ba47 upstream.
      
      The 'offset' field of the 'scatterlist' structure was wrongly
      programmed with the offset value from the base of stolen area,
      whereas this field indicates the offset from where the interested
      data starts within the first PAGE pointed to by 'scattterlist'
      structure. As a result when a new GEM object allocated from stolen
      area is mapped to GTT, it could lead to an overwrite of GTT entries
      as the page count calculation will go wrong, refer the function
      'sg_page_count'.
      
      v2: Modified the commit message. (Chris)
      Signed-off-by: default avatarAkash Goel <akash.goel@intel.com>
      Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71908
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69104Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4e2adfbb
    • Chris Wilson's avatar
      drm/i915: Flush outstanding requests before allocating new seqno · 70982deb
      Chris Wilson authored
      commit 304d695c upstream.
      
      In very rare cases (such as a memory failure stress test) it is possible
      to fill the entire ring without emitting a request. Under this
      circumstance, the outstanding request is flushed and waited upon. After
      space on the ring is cleared, we return to emitting the new command -
      except that we just cleared the seqno allocated for this operation and
      trigger the sanity check that a request is only ever emitted with a
      valid seqno. The fix is to rearrange the code to make sure the
      allocation of the seqno for this operation is after any required flushes
      of outstanding operations.
      
      The bug exists since the preallocation was introduced in
      commit 9d773091
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Nov 27 16:22:52 2012 +0000
      
          drm/i915: Preallocate next seqno before touching the ring
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      70982deb
    • Ilia Mirkin's avatar
      drm/nouveau/falcon: use vmalloc to create firwmare copies · d148375e
      Ilia Mirkin authored
      commit 90d6db16 upstream.
      
      Some firmware images may be large (64K), so using kmalloc memory is
      inappropriate for them. Use vmalloc instead, to avoid high-order
      allocation failures.
      Signed-off-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d148375e
    • Maarten Lankhorst's avatar
      drm/nouveau: fix m2mf copy to tiled gart · 5735d668
      Maarten Lankhorst authored
      commit ce8f7699 upstream.
      
      Commit de7b7d59 introduced tiled GART, but a linear copy is
      still performed. This may result in errors on eviction, fix it by
      checking tiling from memtype.
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5735d668
    • Mikulas Patocka's avatar
      dm sysfs: fix a module unload race · 1a46dbe1
      Mikulas Patocka authored
      commit 2995fa78 upstream.
      
      This reverts commit be35f486 ("dm: wait until embedded kobject is
      released before destroying a device") and provides an improved fix.
      
      The kobject release code that calls the completion must be placed in a
      non-module file, otherwise there is a module unload race (if the process
      calling dm_kobject_release is preempted and the DM module unloaded after
      the completion is triggered, but before dm_kobject_release returns).
      
      To fix this race, this patch moves the completion code to dm-builtin.c
      which is always compiled directly into the kernel if BLK_DEV_DM is
      selected.
      
      The patch introduces a new dm_kobject_holder structure, its purpose is
      to keep the completion and kobject in one place, so that it can be
      accessed from non-module code without the need to export the layout of
      struct mapped_device to that code.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      1a46dbe1