1. 28 Feb, 2013 40 commits
    • Paulo Zanoni's avatar
      drm: don't add inferred modes for monitors that don't support them · 7b480b03
      Paulo Zanoni authored
      commit 196e077d upstream.
      
      If bit 0 of the features byte (0x18) is set to 0, then, according to
      the EDID spec, "the display is non-continuous frequency (multi-mode)
      and is only specified to accept the video timing formats that are
      listed in Base EDID and certain Extension Blocks".
      
      For more information, please see the EDID spec, check the notes of the
      table that explains the "Feature Support" byte (18h) and also the
      notes on the tables of the section that explains "Display Range Limits
      & Additional Timing Description Definition (tag #FDh)".
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45729Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7b480b03
    • Dave Airlie's avatar
      vgacon/vt: clear buffer attributes when we load a 512 character font (v2) · df28f489
      Dave Airlie authored
      commit 2a248307 upstream.
      
      When we switch from 256->512 byte font rendering mode, it means the
      current contents of the screen is being reinterpreted. The bit that holds
      the high bit of the 9-bit font, may have been previously set, and thus
      the new font misrenders.
      
      The problem case we see is grub2 writes spaces with the bit set, so it
      ends up with data like 0x820, which gets reinterpreted into 0x120 char
      which the font translates into G with a circumflex. This flashes up on
      screen at boot and is quite ugly.
      
      A current side effect of this patch though is that any rendering on the
      screen changes color to a slightly darker color, but at least the screen
      no longer corrupts.
      
      v2: as suggested by hpa, always clear the attribute space, whether we
      are are going to or from 512 chars.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df28f489
    • Dave Airlie's avatar
      drm/udl: disable fb_defio by default · ae4c05e0
      Dave Airlie authored
      commit 677d23b7 upstream.
      
      There seems to be a bad interaction between gem/shmem and defio on top,
      I get list corruption on the page lru in the shmem code.
      
      Turn it off for now until we get some more digging done.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ae4c05e0
    • Dave Airlie's avatar
      drm/udl: make usage as a console safer · b701cf40
      Dave Airlie authored
      commit bcb39af4 upstream.
      
      Okay you don't really want to use udl devices as your console, but if
      you are unlucky enough to do so, you run into a lot of schedule while atomic
      due to printk being called from all sorts of funky places. So check if we
      are in an atomic context, and queue the damage for later, the next printk
      should cause it to appear. This isn't ideal, but it is simple, and seems to
      work okay in my testing here.
      
      (dirty area idea came from xenfb)
      
      fixes a bunch of sleeping while atomic issues running fbcon on udl devices.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b701cf40
    • Alex Deucher's avatar
      drm/radeon/dce6: fix display powergating · 746042cf
      Alex Deucher authored
      commit 0e3d50bf upstream.
      
      Only enable it when we disable the display rather than
      at DPMS time since enabling it requires a full modeset
      to restore the display state.  Fixes blank screens in
      certain cases.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      746042cf
    • David S. Miller's avatar
      sunvdc: Fix off-by-one in generic_request(). · 5cf5b734
      David S. Miller authored
      [ Upstream commit f4d96054 ]
      
      The 'operations' bitmap corresponds one-for-one with the operation
      codes, no adjustment is necessary.
      Reported-by: default avatarMark Kettenis <mark.kettenis@xs4all.nl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5cf5b734
    • David Henningsson's avatar
      ALSA: hda - hdmi: ELD shouldn't be valid after unplug · 65232894
      David Henningsson authored
      commit bbfd8a19 upstream.
      
      Currently, eld_valid is never set to false, except at kernel module
      load time. This patch makes sure that eld is no longer valid when
      the cable is (hot-)unplugged.
      Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      65232894
    • Fernando Luis Vazquez Cao's avatar
      ALSA: hda - Workaround for silent output on Sony Vaio VGC-LN51JGB with ALC889 · 7e8b41d6
      Fernando Luis Vazquez Cao authored
      commit 12e31a78 upstream.
      
      Some Vaio all-in-one desktop PCs (for example VGC-LN51JGB) are affected by
      the same issue that caused Vaio Z laptops to become silent: the speaker pin
      must be connected to the first DAC even though the codec itself advertises
      flexible routing through any of the DACs.
      
      Use the no-primary-hp fixup for choosing the speaker pin as the primary so
      that the right DAC is assigned on this device.
      Signed-off-by: default avatarFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7e8b41d6
    • Takashi Iwai's avatar
      ALSA: hda - Release assigned pin/cvt at error path of hdmi_pcm_open() · 63b2afe9
      Takashi Iwai authored
      commit 2ad779b7 upstream.
      
      If the driver detects and invalid ELD, it gives an open error.
      But it forgot to release the assigned pin, converter and spdif ctls
      before returning.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      63b2afe9
    • Pawel Moll's avatar
      ALSA: usb: Fix Processing Unit Descriptor parsers · e32afc12
      Pawel Moll authored
      commit b531f81b upstream.
      
      Commit 99fc8645 "ALSA: usb-mixer:
      parse descriptors with structs" introduced a set of useful parsers
      for descriptors. Unfortunately the parses for the Processing Unit
      Descriptor came with a very subtle bug...
      
      Functions uac_processing_unit_iProcessing() and
      uac_processing_unit_specific() were indexing the baSourceID array
      forgetting the fields before the iProcessing and process-specific
      descriptors.
      
      The problem was observed with Sound Blaster Extigy mixer,
      where nNrModes in Up/Down-mix Processing Unit Descriptor
      was accessed at offset 10 of the descriptor (value 0)
      instead of offset 15 (value 7). In result the resulting
      control had interesting limit values:
      
      Simple mixer control 'Channel Routing Mode Select',0
        Capabilities: volume volume-joined penum
        Playback channels: Mono
        Capture channels: Mono
        Limits: 0 - -1
        Mono: -1 [100%]
      
      Fixed by starting from the bmControls, which was calculated
      correctly, instead of baSourceID.
      
      Now the mentioned control is fine:
      
      Simple mixer control 'Channel Routing Mode Select',0
        Capabilities: volume volume-joined penum
        Playback channels: Mono
        Capture channels: Mono
        Limits: 0 - 6
        Mono: 0 [0%]
      Signed-off-by: default avatarPawel Moll <mail@pawelmoll.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e32afc12
    • Clemens Ladisch's avatar
      ALSA: usb-audio: fix Roland A-PRO support · e3fc3cb2
      Clemens Ladisch authored
      commit 7da58046 upstream.
      
      The quirk for the Roland/Cakewalk A-PRO keyboards accidentally used the
      wrong interface number, which prevented the driver from attaching to the
      device.
      Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3fc3cb2
    • Tomasz Guszkowski's avatar
      p54usb: corrected USB ID for T-Com Sinus 154 data II · a8fb02fe
      Tomasz Guszkowski authored
      commit 008e33f7 upstream.
      
      Corrected USB ID for T-Com Sinus 154 data II. ISL3887-based. The
      device was tested in managed mode with no security, WEP 128
      bit and WPA-PSK (TKIP) with firmware 2.13.1.0.lm87.arm (md5sum:
      7d676323ac60d6e1a3b6d61e8c528248). It works.
      Signed-off-by: default avatarTomasz Guszkowski <tsg@o2.pl>
      Acked-By: default avatarChristian Lamparter <chunkeey@googlemail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a8fb02fe
    • Trond Myklebust's avatar
      NLM: Ensure that we resend all pending blocking locks after a reclaim · 92a5267a
      Trond Myklebust authored
      commit 666b3d80 upstream.
      
      Currently, nlmclnt_lock will break out of the for(;;) loop when
      the reclaimer wakes up the blocking lock thread by setting
      nlm_lck_denied_grace_period. This causes the lock request to fail
      with an ENOLCK error.
      The intention was always to ensure that we resend the lock request
      after the grace period has expired.
      Reported-by: default avatarWangyuan Zhang <Wangyuan.Zhang@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      92a5267a
    • fanchaoting's avatar
      umount oops when remove blocklayoutdriver first · 8e0ed825
      fanchaoting authored
      commit 5a12cca6 upstream.
      
      now pnfs client uses block layout, maybe we can remove
      blocklayoutdriver first. if we umount later,
      it can cause oops in unset_pnfs_layoutdriver.
      because nfss->pnfs_curr_ld->clear_layoutdriver is invalid.
      
      reproduce it:
       modprobe  blocklayoutdriver
       mount -t nfs4 -o minorversion=1 pnfsip:/ /mnt/
       rmmod blocklayoutdriver
       umount /mnt
      
      then you can see following
      
      CPU 0
      Pid: 17023, comm: umount.nfs4 Tainted: GF          O 3.7.0-rc6-pnfs #1 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform
      RIP: 0010:[<ffffffffa04cfe6d>]  [<ffffffffa04cfe6d>] unset_pnfs_layoutdriver+0x1d/0x70 [nfsv4]
      RSP: 0018:ffff8800022d9e48  EFLAGS: 00010286
      RAX: ffffffffa04a1b00 RBX: ffff88000b013800 RCX: 0000000000000001
      RDX: ffffffff81ae8ee0 RSI: ffff880001ee94b8 RDI: ffff88000b013800
      RBP: ffff8800022d9e58 R08: 0000000000000001 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffff880001ee9400
      R13: ffff8800105978c0 R14: 00007fff25846c08 R15: 0000000001bba550
      FS:  00007f45ae7f0700(0000) GS:ffff880012c00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: ffffffffa04a1b38 CR3: 0000000002c0c000 CR4: 00000000000006f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process umount.nfs4 (pid: 17023, threadinfo ffff8800022d8000, task ffff880006e48aa0)
      Stack:
      ffff8800105978c0 ffff88000b013800 ffff8800022d9e78 ffffffffa04cd0ce
      ffff8800022d9e78 ffff88000b013800 ffff8800022d9ea8 ffffffffa04755a7
      ffff8800022d9ea8 ffff880002f96400 ffff88000b013800 ffff880002f96400
      Call Trace:
      [<ffffffffa04cd0ce>] nfs4_destroy_server+0x1e/0x30 [nfsv4]
      [<ffffffffa04755a7>] nfs_free_server+0xb7/0x150 [nfs]
      [<ffffffffa047d4d5>] nfs_kill_super+0x35/0x40 [nfs]
      [<ffffffff81178d35>] deactivate_locked_super+0x45/0x70
      [<ffffffff8117986a>] deactivate_super+0x4a/0x70
      [<ffffffff81193ee2>] mntput_no_expire+0xd2/0x130
      [<ffffffff81194d62>] sys_umount+0x72/0xe0
      [<ffffffff8154af59>] system_call_fastpath+0x16/0x1b
      Code: 06 e1 b8 ea ff ff ff eb 9e 0f 1f 44 00 00 55 48 89 e5 53 48 83 ec 08 66 66 66 66 90 48 8b 87 80 03 00 00 48 89 fb 48 85 c0 74 29 <48> 8b 40 38 48 85 c0 74 02 ff d0 48 8b 03 3e ff 48 04 0f 94 c2
      RIP  [<ffffffffa04cfe6d>] unset_pnfs_layoutdriver+0x1d/0x70 [nfsv4]
      RSP <ffff8800022d9e48>
      CR2: ffffffffa04a1b38
      ---[ end trace 29f75aaedda058bf ]---
      
      Signed-off-by: fanchaoting<fanchaoting@cn.fujitsu.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e0ed825
    • Grant Likely's avatar
      drivercore: Fix ordering between deferred_probe and exiting initcalls · 38bc0fe9
      Grant Likely authored
      commit d72cca1e upstream.
      
      One of the side effects of deferred probe is that some drivers which
      used to be probed before initcalls completed are now happening slightly
      later. This causes two problems.
      - If a console driver gets deferred, then it may not be ready when
        userspace starts. For example, if a uart depends on pinctrl, then the
        uart will get deferred and /dev/console will not be available
      - __init sections will be discarded before built-in drivers are probed.
        Strictly speaking, __init functions should not be called in a drivers
        __probe path, but there are a lot of drivers (console stuff again)
        that do anyway. In the past it was perfectly safe to do so because all
        built-in drivers got probed before the end of initcalls.
      
      This patch fixes the problem by forcing the first pass of the deferred
      list to complete at late_initcall time. This is late enough to catch the
      drivers that are known to have the above issues.
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Tested-by: default avatarHaojian Zhuang <haojian.zhuang@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      38bc0fe9
    • Mel Gorman's avatar
      mm/fadvise.c: drain all pagevecs if POSIX_FADV_DONTNEED fails to discard all pages · f4ce5b3f
      Mel Gorman authored
      commit 67d46b29 upstream.
      
      Rob van der Heij reported the following (paraphrased) on private mail.
      
      	The scenario is that I want to avoid backups to fill up the page
      	cache and purge stuff that is more likely to be used again (this is
      	with s390x Linux on z/VM, so I don't give it as much memory that
      	we don't care anymore). So I have something with LD_PRELOAD that
      	intercepts the close() call (from tar, in this case) and issues
      	a posix_fadvise() just before closing the file.
      
      	This mostly works, except for small files (less than 14 pages)
      	that remains in page cache after the face.
      
      Unfortunately Rob has not had a chance to test this exact patch but the
      test program below should be reproducing the problem he described.
      
      The issue is the per-cpu pagevecs for LRU additions.  If the pages are
      added by one CPU but fadvise() is called on another then the pages
      remain resident as the invalidate_mapping_pages() only drains the local
      pagevecs via its call to pagevec_release().  The user-visible effect is
      that a program that uses fadvise() properly is not obeyed.
      
      A possible fix for this is to put the necessary smarts into
      invalidate_mapping_pages() to globally drain the LRU pagevecs if a
      pagevec page could not be discarded.  The downside with this is that an
      inode cache shrink would send a global IPI and memory pressure
      potentially causing global IPI storms is very undesirable.
      
      Instead, this patch adds a check during fadvise(POSIX_FADV_DONTNEED) to
      check if invalidate_mapping_pages() discarded all the requested pages.
      If a subset of pages are discarded it drains the LRU pagevecs and tries
      again.  If the second attempt fails, it assumes it is due to the pages
      being mapped, locked or dirty and does not care.  With this patch, an
      application using fadvise() correctly will be obeyed but there is a
      downside that a malicious application can force the kernel to send
      global IPIs and increase overhead.
      
      If accepted, I would like this to be considered as a -stable candidate.
      It's not an urgent issue but it's a system call that is not working as
      advertised which is weak.
      
      The following test program demonstrates the problem.  It should never
      report that pages are still resident but will without this patch.  It
      assumes that CPU 0 and 1 exist.
      
      int main() {
      	int fd;
      	int pagesize = getpagesize();
      	ssize_t written = 0, expected;
      	char *buf;
      	unsigned char *vec;
      	int resident, i;
      	cpu_set_t set;
      
      	/* Prepare a buffer for writing */
      	expected = FILESIZE_PAGES * pagesize;
      	buf = malloc(expected + 1);
      	if (buf == NULL) {
      		printf("ENOMEM\n");
      		exit(EXIT_FAILURE);
      	}
      	buf[expected] = 0;
      	memset(buf, 'a', expected);
      
      	/* Prepare the mincore vec */
      	vec = malloc(FILESIZE_PAGES);
      	if (vec == NULL) {
      		printf("ENOMEM\n");
      		exit(EXIT_FAILURE);
      	}
      
      	/* Bind ourselves to CPU 0 */
      	CPU_ZERO(&set);
      	CPU_SET(0, &set);
      	if (sched_setaffinity(getpid(), sizeof(set), &set) == -1) {
      		perror("sched_setaffinity");
      		exit(EXIT_FAILURE);
      	}
      
      	/* open file, unlink and write buffer */
      	fd = open("fadvise-test-file", O_CREAT|O_EXCL|O_RDWR);
      	if (fd == -1) {
      		perror("open");
      		exit(EXIT_FAILURE);
      	}
      	unlink("fadvise-test-file");
      	while (written < expected) {
      		ssize_t this_write;
      		this_write = write(fd, buf + written, expected - written);
      
      		if (this_write == -1) {
      			perror("write");
      			exit(EXIT_FAILURE);
      		}
      
      		written += this_write;
      	}
      	free(buf);
      
      	/*
      	 * Force ourselves to another CPU. If fadvise only flushes the local
      	 * CPUs pagevecs then the fadvise will fail to discard all file pages
      	 */
      	CPU_ZERO(&set);
      	CPU_SET(1, &set);
      	if (sched_setaffinity(getpid(), sizeof(set), &set) == -1) {
      		perror("sched_setaffinity");
      		exit(EXIT_FAILURE);
      	}
      
      	/* sync and fadvise to discard the page cache */
      	fsync(fd);
      	if (posix_fadvise(fd, 0, expected, POSIX_FADV_DONTNEED) == -1) {
      		perror("posix_fadvise");
      		exit(EXIT_FAILURE);
      	}
      
      	/* map the file and use mincore to see which parts of it are resident */
      	buf = mmap(NULL, expected, PROT_READ, MAP_SHARED, fd, 0);
      	if (buf == NULL) {
      		perror("mmap");
      		exit(EXIT_FAILURE);
      	}
      	if (mincore(buf, expected, vec) == -1) {
      		perror("mincore");
      		exit(EXIT_FAILURE);
      	}
      
      	/* Check residency */
      	for (i = 0, resident = 0; i < FILESIZE_PAGES; i++) {
      		if (vec[i])
      			resident++;
      	}
      	if (resident != 0) {
      		printf("Nr unexpected pages resident: %d\n", resident);
      		exit(EXIT_FAILURE);
      	}
      
      	munmap(buf, expected);
      	close(fd);
      	free(vec);
      	exit(EXIT_SUCCESS);
      }
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Reported-by: default avatarRob van der Heij <rvdheij@gmail.com>
      Tested-by: default avatarRob van der Heij <rvdheij@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4ce5b3f
    • Greg Thelen's avatar
      tmpfs: fix use-after-free of mempolicy object · 06c7976c
      Greg Thelen authored
      commit 5f00110f upstream.
      
      The tmpfs remount logic preserves filesystem mempolicy if the mpol=M
      option is not specified in the remount request.  A new policy can be
      specified if mpol=M is given.
      
      Before this patch remounting an mpol bound tmpfs without specifying
      mpol= mount option in the remount request would set the filesystem's
      mempolicy object to a freed mempolicy object.
      
      To reproduce the problem boot a DEBUG_PAGEALLOC kernel and run:
          # mkdir /tmp/x
      
          # mount -t tmpfs -o size=100M,mpol=interleave nodev /tmp/x
      
          # grep /tmp/x /proc/mounts
          nodev /tmp/x tmpfs rw,relatime,size=102400k,mpol=interleave:0-3 0 0
      
          # mount -o remount,size=200M nodev /tmp/x
      
          # grep /tmp/x /proc/mounts
          nodev /tmp/x tmpfs rw,relatime,size=204800k,mpol=??? 0 0
              # note ? garbage in mpol=... output above
      
          # dd if=/dev/zero of=/tmp/x/f count=1
              # panic here
      
      Panic:
          BUG: unable to handle kernel NULL pointer dereference at           (null)
          IP: [<          (null)>]           (null)
          [...]
          Oops: 0010 [#1] SMP DEBUG_PAGEALLOC
          Call Trace:
            mpol_shared_policy_init+0xa5/0x160
            shmem_get_inode+0x209/0x270
            shmem_mknod+0x3e/0xf0
            shmem_create+0x18/0x20
            vfs_create+0xb5/0x130
            do_last+0x9a1/0xea0
            path_openat+0xb3/0x4d0
            do_filp_open+0x42/0xa0
            do_sys_open+0xfe/0x1e0
            compat_sys_open+0x1b/0x20
            cstar_dispatch+0x7/0x1f
      
      Non-debug kernels will not crash immediately because referencing the
      dangling mpol will not cause a fault.  Instead the filesystem will
      reference a freed mempolicy object, which will cause unpredictable
      behavior.
      
      The problem boils down to a dropped mpol reference below if
      shmem_parse_options() does not allocate a new mpol:
      
          config = *sbinfo
          shmem_parse_options(data, &config, true)
          mpol_put(sbinfo->mpol)
          sbinfo->mpol = config.mpol  /* BUG: saves unreferenced mpol */
      
      This patch avoids the crash by not releasing the mempolicy if
      shmem_parse_options() doesn't create a new mpol.
      
      How far back does this issue go? I see it in both 2.6.36 and 3.3.  I did
      not look back further.
      Signed-off-by: default avatarGreg Thelen <gthelen@google.com>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06c7976c
    • Lars-Peter Clausen's avatar
      drivers/video/backlight/adp88?0_bl.c: fix resume · 3b6e03c9
      Lars-Peter Clausen authored
      commit 5eb02c01 upstream.
      
      Clearing the NSTBY bit in the control register also automatically clears
      the BLEN bit.  So we need to make sure to set it again during resume,
      otherwise the backlight will stay off.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3b6e03c9
    • Junxiao Bi's avatar
      ocfs2: unlock super lock if lockres refresh failed · cd336937
      Junxiao Bi authored
      commit 3278bb74 upstream.
      
      If lockres refresh failed, the super lock will never be released which
      will cause some processes on other cluster nodes hung forever.
      Signed-off-by: default avatarJunxiao Bi <junxiao.bi@oracle.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd336937
    • MITSUNARI Shigeo's avatar
      fs/block_dev.c: page cache wrongly left invalidated after revalidate_disk() · 9fd4e539
      MITSUNARI Shigeo authored
      commit 7630b661 upstream.
      
      We found that bdev->bd_invalidated was left set once revalidate_disk()
      is called, which results in page cache flush every time that device is
      open.
      
      Specifically, we found this problem in MD block device.  Once we resize
      a MD device, mdadm --monitor periodically flush all page cache for that
      device every 60 or 1000 seconds when it opens the device.
      
      This bug lies since at least 3.2.0 till the latest kernel(3.6.2).  Patch
      is attached.
      
      The following steps will reproduce the problem.
      
      1. prepair a block device (eg /dev/sdb).
      
      2. create two partitions:
      
         sudo parted /dev/sdb
         mklabel gpt
         mkpart primary 0% 50%
         mkpart primary 50% 100%
      
      3. create a md device.
      
         sudo mdadm -C /dev/md/hoge -l 1 -n 2 -e 1.2 --assume-clean --auto=md --symlink=no /dev/sdb1 /dev/sdb2
      
      4. create file system and mount it
      
         sudo mkfs.ext3 /dev/md/hoge
         sudo mkdir /mnt/test
         sudo mount /dev/md/hoge /mnt/test
      
      5. try to resize the device
      
         sudo mdadm -G /dev/md/hoge --size=max
      
      6. create a file to fill file cache.
      
        sudo dd if=/dev/urandom of=/mnt/test/data bs=1M count=10
      
      and verify the current status of file by free command.
      
      7. mdadm monitor will open the md device every 1000 seconds and you
         will find all file cache on the device are cleared.
      
      The timing can be reduced by the following steps.
      
      a) kill mdadm and restart it with --delay option
      
         /sbin/mdadm --monitor --delay=30 --pid-file /var/run/mdadm/monitor.pid --daemonise --scan --syslog
      
      or open the md device directly.
      
         sudo dd if=/dev/md/hoge of=/dev/null bs=4096 count=1
      Signed-off-by: default avatarMITSUNARI Shigeo <herumi@nifty.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9fd4e539
    • Jim Somerville's avatar
      inotify: remove broken mask checks causing unmount to be EINVAL · 0b7fba40
      Jim Somerville authored
      commit 676a0675 upstream.
      
      Running the command:
      
      	inotifywait -e unmount /mnt/disk
      
      immediately aborts with a -EINVAL return code.  This is however a valid
      parameter.  This abort occurs only if unmount is the sole event
      parameter.  If other event parameters are supplied, then the unmount
      event wait will work.
      
      The problem was introduced by commit 44b350fc ("inotify: Fix mask
      checks").  In that commit, it states:
      
      	The mask checks in inotify_update_existing_watch() and
      	inotify_new_watch() are useless because inotify_arg_to_mask()
      	sets FS_IN_IGNORED and FS_EVENT_ON_CHILD bits anyway.
      
      But instead of removing the useless checks, it did this:
      
      	        mask = inotify_arg_to_mask(arg);
      	-       if (unlikely(!mask))
      	+       if (unlikely(!(mask & IN_ALL_EVENTS)))
      	                return -EINVAL;
      
      The problem is that IN_ALL_EVENTS doesn't include IN_UNMOUNT, and other
      parts of the code keep IN_UNMOUNT separate from IN_ALL_EVENTS.  So the
      check should be:
      
      	if (unlikely(!(mask & (IN_ALL_EVENTS | IN_UNMOUNT))))
      
      But inotify_arg_to_mask(arg) always sets the IN_UNMOUNT bit in the mask
      anyway, so the check is always going to pass and thus should simply be
      removed.  Also note that inotify_arg_to_mask completely controls what
      mask bits get set from arg, there's no way for invalid bits to get
      enabled there.
      
      Lets fix it by simply removing the useless broken checks.
      Signed-off-by: default avatarJim Somerville <Jim.Somerville@windriver.com>
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Jerome Marchand <jmarchan@redhat.com>
      Cc: John McCutchan <john@johnmccutchan.com>
      Cc: Robert Love <rlove@rlove.org>
      Cc: Eric Paris <eparis@parisplace.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0b7fba40
    • Thomas Gleixner's avatar
      futex: Revert "futex: Mark get_robust_list as deprecated" · 80343720
      Thomas Gleixner authored
      commit fe2b05f7 upstream.
      
      This reverts commit ec0c4274.
      
      get_robust_list() is in use and a removal would break existing user
      space. With the permission checks in place it's not longer a security
      hole. Remove the deprecation warnings.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: akpm@linux-foundation.org
      Cc: paul.gortmaker@windriver.com
      Cc: davej@redhat.com
      Cc: keescook@chromium.org
      Cc: ebiederm@xmission.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      80343720
    • Christian Borntraeger's avatar
      s390/kvm: Fix store status for ACRS/FPRS · e3aa5ed4
      Christian Borntraeger authored
      commit 15bc8d84 upstream.
      
      On store status we need to copy the current state of registers
      into a save area. Currently we might save stale versions:
      The sie state descriptor doesnt have fields for guest ACRS,FPRS,
      those registers are simply stored in the host registers. The host
      program must copy these away if needed. We do that in vcpu_put/load.
      
      If we now do a store status in KVM code between vcpu_put/load, the
      saved values are not up-to-date. Lets collect the ACRS/FPRS before
      saving them.
      
      This also fixes some strange problems with hotplug and virtio-ccw,
      since the low level machine check handler (on hotplug a machine check
      will happen) will revalidate all registers with the content of the
      save area.
      Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3aa5ed4
    • Cornelia Huck's avatar
      KVM: s390: Handle hosts not supporting s390-virtio. · 2030511a
      Cornelia Huck authored
      commit 55c171a6 upstream.
      
      Running under a kvm host does not necessarily imply the presence of
      a page mapped above the main memory with the virtio information;
      however, the code includes a hard coded access to that page.
      
      Instead, check for the presence of the page and exit gracefully
      before we hit an addressing exception if it does not exist.
      Reviewed-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2030511a
    • Robin Holt's avatar
      mmu_notifier_unregister NULL Pointer deref and multiple ->release() callouts · 7fecb64c
      Robin Holt authored
      commit 751efd86 upstream.
      
      There is a race condition between mmu_notifier_unregister() and
      __mmu_notifier_release().
      
      Assume two tasks, one calling mmu_notifier_unregister() as a result of a
      filp_close() ->flush() callout (task A), and the other calling
      mmu_notifier_release() from an mmput() (task B).
      
                      A                               B
      t1                                              srcu_read_lock()
      t2              if (!hlist_unhashed())
      t3                                              srcu_read_unlock()
      t4              srcu_read_lock()
      t5                                              hlist_del_init_rcu()
      t6                                              synchronize_srcu()
      t7              srcu_read_unlock()
      t8              hlist_del_rcu()  <--- NULL pointer deref.
      
      Additionally, the list traversal in __mmu_notifier_release() is not
      protected by the by the mmu_notifier_mm->hlist_lock which can result in
      callouts to the ->release() notifier from both mmu_notifier_unregister()
      and __mmu_notifier_release().
      
      -stable suggestions:
      
      The stable trees prior to 3.7.y need commits 21a92735 and
      70400303 cherry-picked in that order prior to cherry-picking this
      commit.  The 3.7.y tree already has those two commits.
      Signed-off-by: default avatarRobin Holt <holt@sgi.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
      Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
      Cc: Avi Kivity <avi@redhat.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Sagi Grimberg <sagig@mellanox.co.il>
      Cc: Haggai Eran <haggaie@mellanox.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7fecb64c
    • Andrea Arcangeli's avatar
      mm: mmu_notifier: make the mmu_notifier srcu static · d0730c2b
      Andrea Arcangeli authored
      commit 70400303 upstream.
      
      The variable must be static especially given the variable name.
      
      s/RCU/SRCU/ over a few comments.
      Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Haggai Eran <haggaie@mellanox.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0730c2b
    • Sagi Grimberg's avatar
      mm: mmu_notifier: have mmu_notifiers use a global SRCU so they may safely schedule · 4209ee0d
      Sagi Grimberg authored
      commit 21a92735 upstream.
      
      With an RCU based mmu_notifier implementation, any callout to
      mmu_notifier_invalidate_range_{start,end}() or
      mmu_notifier_invalidate_page() would not be allowed to call schedule()
      as that could potentially allow a modification to the mmu_notifier
      structure while it is currently being used.
      
      Since srcu allocs 4 machine words per instance per cpu, we may end up
      with memory exhaustion if we use srcu per mm.  So all mms share a global
      srcu.  Note that during large mmu_notifier activity exit & unregister
      paths might hang for longer periods, but it is tolerable for current
      mmu_notifier clients.
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.co.il>
      Signed-off-by: default avatarAndrea Arcangeli <aarcange@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Haggai Eran <haggaie@mellanox.com>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4209ee0d
    • Bjorn Helgaas's avatar
      Driver core: treat unregistered bus_types as having no devices · 362efcc9
      Bjorn Helgaas authored
      commit 4fa3e78b upstream.
      
      A bus_type has a list of devices (klist_devices), but the list and the
      subsys_private structure that contains it are not initialized until the
      bus_type is registered with bus_register().
      
      The panic/reboot path has fixups that look up devices in pci_bus_type.  If
      we panic before registering pci_bus_type, the bus_type exists but the list
      does not, so mach_reboot_fixups() trips over a null pointer and panics
      again:
      
          mach_reboot_fixups
            pci_get_device
              ..
                bus_find_device(&pci_bus_type, ...)
                  bus->p is NULL
      
      Joonsoo reported a problem when panicking before PCI was initialized.
      I think this patch should be sufficient to replace the patch he posted
      here: https://lkml.org/lkml/2012/12/28/75 ("[PATCH] x86, reboot: skip
      reboot_fixups in early boot phase")
      Reported-by: default avatarJoonsoo Kim <js1304@gmail.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      362efcc9
    • Wei Liu's avatar
      2199a652
    • Stefan Bader's avatar
      xen: Send spinlock IPI to all waiters · 4f4eb624
      Stefan Bader authored
      commit 76eaca03 upstream.
      
      There is a loophole between Xen's current implementation of
      pv-spinlocks and the scheduler. This was triggerable through
      a testcase until v3.6 changed the TLB flushing code. The
      problem potentially is still there just not observable in the
      same way.
      
      What could happen was (is):
      
      1. CPU n tries to schedule task x away and goes into a slow
         wait for the runq lock of CPU n-# (must be one with a lower
         number).
      2. CPU n-#, while processing softirqs, tries to balance domains
         and goes into a slow wait for its own runq lock (for updating
         some records). Since this is a spin_lock_irqsave in softirq
         context, interrupts will be re-enabled for the duration of
         the poll_irq hypercall used by Xen.
      3. Before the runq lock of CPU n-# is unlocked, CPU n-1 receives
         an interrupt (e.g. endio) and when processing the interrupt,
         tries to wake up task x. But that is in schedule and still
         on_cpu, so try_to_wake_up goes into a tight loop.
      4. The runq lock of CPU n-# gets unlocked, but the message only
         gets sent to the first waiter, which is CPU n-# and that is
         busily stuck.
      5. CPU n-# never returns from the nested interruption to take and
         release the lock because the scheduler uses a busy wait.
         And CPU n never finishes the task migration because the unlock
         notification only went to CPU n-#.
      
      To avoid this and since the unlocking code has no real sense of
      which waiter is best suited to grab the lock, just send the IPI
      to all of them. This causes the waiters to return from the hyper-
      call (those not interrupted at least) and do active spinlocking.
      
      BugLink: http://bugs.launchpad.net/bugs/1011792Acked-by: default avatarJan Beulich <JBeulich@suse.com>
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4f4eb624
    • Jussi Kivilinna's avatar
      rtlwifi: usb: allocate URB control message setup_packet and data buffer separately · 6a171676
      Jussi Kivilinna authored
      commit bc6b8923 upstream.
      
      rtlwifi allocates both setup_packet and data buffer of control message urb,
      using shared kmalloc in _usbctrl_vendorreq_async_write. Structure used for
      allocating is:
      	struct {
      		u8 data[254];
      		struct usb_ctrlrequest dr;
      	};
      
      Because 'struct usb_ctrlrequest' is __packed, setup packet is unaligned and
      DMA mapping of both 'data' and 'dr' confuses ARM/sunxi, leading to memory
      corruptions and freezes.
      
      Patch changes setup packet to be allocated separately.
      
      [v2]:
       - Use WARN_ON_ONCE instead of WARN_ON
      Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6a171676
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Add new USB ID · d1179077
      Larry Finger authored
      commit 8708aac7 upstream.
      
      A new model of the RTL8188CUS has appeared.
      Reported-and-tested-by: default avatarThomas Rosenkrantz <tom.rosary@googlemail.com>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d1179077
    • Larry Finger's avatar
      b43: Increase number of RX DMA slots · 1946c763
      Larry Finger authored
      commit ccae0e50 upstream.
      
      Bastian Bittorf reported that some of the silent freezes on a Linksys WRT54G
      were due to overflow of the RX DMA ring buffer, which was created with 64
      slots. That finding reminded me that I was seeing similar crashed on a netbook,
      which also has a relatively slow processor. After increasing the number of
      slots to 128, runs on the netbook that previously failed now worked; however,
      I found that 109 slots had been used in one test. For that reason, the number
      of slots is being increased to 256.
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Bastian Bittorf <bittorf@bluebottle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1946c763
    • Johan Hovold's avatar
      USB: serial: fix null-pointer dereferences on disconnect · 906c9c42
      Johan Hovold authored
      commit b2ca6990 upstream.
      
      Make sure serial-driver dtr_rts is called with disc_mutex held after
      checking the disconnected flag.
      
      Due to a bug in the tty layer, dtr_rts may get called after a device has
      been disconnected and the tty-device unregistered. Some drivers have had
      individual checks for disconnect to make sure the disconnected interface
      was not accessed, but this should really be handled in usb-serial core
      (at least until the long-standing tty-bug has been fixed).
      
      Note that the problem has been made more acute with commit 0998d063
      ("device-core: Ensure drvdata = NULL when no driver is bound") as the
      port data is now also NULL when dtr_rts is called resulting in further
      oopses.
      Reported-by: default avatarChris Ruehl <chris.ruehl@gtsys.com.hk>
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      906c9c42
    • Oleg Nesterov's avatar
      tty: set_termios/set_termiox should not return -EINTR · 46605dae
      Oleg Nesterov authored
      commit 183d95cd upstream.
      
      See https://bugzilla.redhat.com/show_bug.cgi?id=904907
      read command causes bash to abort with double free or corruption (out).
      
      A simple test-case from Roman:
      
      	// Compile the reproducer and send sigchld ti that process.
      	// EINTR occurs even if SA_RESTART flag is set.
      
      	void handler(int sig)
      	{
      	}
      
      	main()
      	{
      	  struct sigaction act;
      	  act.sa_handler = handler;
      	  act.sa_flags = SA_RESTART;
      	  sigaction (SIGCHLD, &act, 0);
      	  struct termio ttp;
      	  ioctl(0, TCGETA, &ttp);
      	  while(1)
      	  {
      	    if (ioctl(0, TCSETAW, ttp) < 0)
      	      {
      		if (errno == EINTR)
      		{
      		  fprintf(stderr, "BUG!"); return(1);
      		}
      	      }
      	  }
      	}
      
      Change set_termios/set_termiox to return -ERESTARTSYS to fix this
      particular problem.
      
      I didn't dare to change other EINTR's in drivers/tty/, but they look
      equally wrong.
      Reported-by: default avatarRoman Rakus <rrakus@redhat.com>
      Reported-by: default avatarLingzhu Xiang <lxiang@redhat.com>
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      46605dae
    • Dirkjan Bussink's avatar
      tty: Prevent deadlock in n_gsm driver · 0c10d7fd
      Dirkjan Bussink authored
      commit 4d9b1090 upstream.
      
      This change fixes a deadlock when the multiplexer is closed while there
      are still client side ports open.
      
      When the multiplexer is closed and there are active tty's it tries to
      close them with tty_vhangup. This has a problem though, because
      tty_vhangup needs the tty_lock. This patch changes it to unlock the
      tty_lock before attempting the hangup and relocks afterwards. The
      additional call to tty_port_tty_set is needed because otherwise the
      port stays active because of the reference counter.
      
      This change also exposed another problem that other code paths don't
      expect that the multiplexer could have been closed. This patch also adds
      checks for these cases in the gsmtty_ class of function that could be
      called.
      
      The documentation explicitly states that "first close all virtual ports
      before closing the physical port" but we've found this to not always
      reality in our field situations. The GPRS / UTMS modem sometimes crashes
      and needs a power cycle in that case which means cleanly shutting down
      everything is not always possible. This change makes it much more robust
      for our situation where at least the system is recoverable with this patch
      and doesn't hang in a deadlock situation inside the kernel.
      
      The patch is against the long term support kernel (3.4.27) and should
      apply cleanly to more recent branches. Tested with a Telit GE864-QUADV2
      and Telit HE910 modem.
      Signed-off-by: default avatarDirkjan Bussink <dirkjan.bussink@nedap.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0c10d7fd
    • Denis Efremov's avatar
      ALSA: rme32.c irq enabling after spin_lock_irq · ceb0446b
      Denis Efremov authored
      commit f49a59c4 upstream.
      
      According to the other code in this driver and similar
      code in rme96 it seems, that spin_lock_irq in
      snd_rme32_capture_close function should be paired
      with spin_unlock_irq.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: default avatarDenis Efremov <yefremov.denis@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ceb0446b
    • Denis Efremov's avatar
      ALSA: ali5451: remove irq enabling in pointer callback · 7fb3e958
      Denis Efremov authored
      commit dacae5a1 upstream.
      
      snd_ali_pointer function is called with local
      interrupts disabled. However it seems very strange to
      reenable them in such way.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: default avatarDenis Efremov <yefremov.denis@gmail.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7fb3e958
    • Olaf Hering's avatar
      x86: Hyper-V: register clocksource only if its advertised · 507d34bf
      Olaf Hering authored
      commit 32068f65 upstream.
      
      Enable hyperv_clocksource only if its advertised as a feature.
      XenServer 6 returns the signature which is checked in
      ms_hyperv_platform(), but it does not offer all features. Currently the
      clocksource is enabled unconditionally in ms_hyperv_init_platform(), and
      the result is a hanging guest.
      
      Hyper-V spec Bit 1 indicates the availability of Partition Reference
      Counter.  Register the clocksource only if this bit is set.
      
      The guest in question prints this in dmesg:
       [    0.000000] Hypervisor detected: Microsoft HyperV
       [    0.000000] HyperV: features 0x70, hints 0x0
      
      This bug can be reproduced easily be setting 'viridian=1' in a HVM domU
      .cfg file. A workaround without this patch is to boot the HVM guest with
      'clocksource=jiffies'.
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Link: http://lkml.kernel.org/r/1359940959-32168-1-git-send-email-kys@microsoft.comSigned-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      507d34bf
    • Leonid Shatz's avatar
      hrtimer: Prevent hrtimer_enqueue_reprogram race · dd9c58a9
      Leonid Shatz authored
      commit b22affe0 upstream.
      
      hrtimer_enqueue_reprogram contains a race which could result in
      timer.base switch during unlock/lock sequence.
      
      hrtimer_enqueue_reprogram is releasing the lock protecting the timer
      base for calling raise_softirq_irqsoff() due to a lock ordering issue
      versus rq->lock.
      
      If during that time another CPU calls __hrtimer_start_range_ns() on
      the same hrtimer, the timer base might switch, before the current CPU
      can lock base->lock again and therefor the unlock_timer_base() call
      will unlock the wrong lock.
      
      [ tglx: Added comment and massaged changelog ]
      Signed-off-by: default avatarLeonid Shatz <leonid.shatz@ravellosystems.com>
      Signed-off-by: default avatarIzik Eidus <izik.eidus@ravellosystems.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Link: http://lkml.kernel.org/r/1359981217-389-1-git-send-email-izik.eidus@ravellosystems.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dd9c58a9