1. 06 Mar, 2013 40 commits
    • Jan Beulich's avatar
      xen-blkback: do not leak mode property · 0b9662bc
      Jan Beulich authored
      commit 9d092603 upstream.
      
      "be->mode" is obtained from xenbus_read(), which does a kmalloc() for
      the message body. The short string is never released, so do it along
      with freeing "be" itself, and make sure the string isn't kept when
      backend_changed() doesn't complete successfully (which made it
      desirable to slightly re-structure that function, so that the error
      cleanup can be done in one place).
      Reported-by: default avatarOlaf Hering <olaf@aepfle.de>
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0b9662bc
    • David Henningsson's avatar
      ALSA: hda - hdmi: ELD shouldn't be valid after unplug · dd250c18
      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 avatarBen Hutchings <ben@decadent.org.uk>
      dd250c18
    • Trond Myklebust's avatar
      NLM: Ensure that we resend all pending blocking locks after a reclaim · c0bb151f
      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 avatarBen Hutchings <ben@decadent.org.uk>
      c0bb151f
    • Larry Finger's avatar
      b43: Increase number of RX DMA slots · c6f8eab7
      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 avatarBen Hutchings <ben@decadent.org.uk>
      c6f8eab7
    • Steven Rostedt (Red Hat)'s avatar
      ftrace: Call ftrace cleanup module notifier after all other notifiers · a638e6bb
      Steven Rostedt (Red Hat) authored
      commit 8c189ea6 upstream.
      
      Commit: c1bf08ac "ftrace: Be first to run code modification on modules"
      
      changed ftrace module notifier's priority to INT_MAX in order to
      process the ftrace nops before anything else could touch them
      (namely kprobes). This was the correct thing to do.
      
      Unfortunately, the ftrace module notifier also contains the ftrace
      clean up code. As opposed to the set up code, this code should be
      run *after* all the module notifiers have run in case a module is doing
      correct clean-up and unregisters its ftrace hooks. Basically, ftrace
      needs to do clean up on module removal, as it needs to know about code
      being removed so that it doesn't try to modify that code. But after it
      removes the module from its records, if a ftrace user tries to remove
      a probe, that removal will fail due as the record of that code segment
      no longer exists.
      
      Nothing really bad happens if the probe removal is called after ftrace
      did the clean up, but the ftrace removal function will return an error.
      Correct code (such as kprobes) will produce a WARN_ON() if it fails
      to remove the probe. As people get annoyed by frivolous warnings, it's
      best to do the ftrace clean up after everything else.
      
      By splitting the ftrace_module_notifier into two notifiers, one that
      does the module load setup that is run at high priority, and the other
      that is called for module clean up that is run at low priority, the
      problem is solved.
      Reported-by: default avatarFrank Ch. Eigler <fche@redhat.com>
      Acked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      a638e6bb
    • Nicholas Bellinger's avatar
      target: Add missing mapped_lun bounds checking during make_mappedlun setup · 5f5db37d
      Nicholas Bellinger authored
      commit fbbf8555 upstream.
      
      This patch adds missing bounds checking for the configfs provided
      mapped_lun value during target_fabric_make_mappedlun() setup ahead
      of se_lun_acl initialization.
      
      This addresses a potential OOPs when using a mapped_lun value that
      exceeds the hardcoded TRANSPORT_MAX_LUNS_PER_TPG-1 value within
      se_node_acl->device_list[].
      Reported-by: default avatarJan Engelhardt <jengelh@inai.de>
      Cc: Jan Engelhardt <jengelh@inai.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      5f5db37d
    • Nicholas Bellinger's avatar
      target: Fix lookup of dynamic NodeACLs during cached demo-mode operation · f310bed9
      Nicholas Bellinger authored
      commit fcf29481 upstream.
      
      This patch fixes a bug in core_tpg_check_initiator_node_acl() ->
      core_tpg_get_initiator_node_acl() where a dynamically created
      se_node_acl generated during session login would be skipped during
      subsequent lookup due to the '!acl->dynamic_node_acl' check, causing
      a new se_node_acl to be created with a duplicate ->initiatorname.
      
      This would occur when a fabric endpoint was configured with
      TFO->tpg_check_demo_mode()=1 + TPF->tpg_check_demo_mode_cache()=1
      preventing the release of an existing se_node_acl during se_session
      shutdown.
      
      Also, drop the unnecessary usage of core_tpg_get_initiator_node_acl()
      within core_dev_init_initiator_node_lun_acl() that originally
      required the extra '!acl->dynamic_node_acl' check, and just pass
      the configfs provided se_node_acl pointer instead.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      [bwh: Backported to 3.2: adjust context, filename of header]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f310bed9
    • Jussi Kivilinna's avatar
      rtlwifi: usb: allocate URB control message setup_packet and data buffer separately · 9e2282d4
      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>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9e2282d4
    • Linus Torvalds's avatar
      mm: fix pageblock bitmap allocation · 0d15de8e
      Linus Torvalds authored
      commit 7c45512d upstream.
      
      Commit c060f943 ("mm: use aligned zone start for pfn_to_bitidx
      calculation") fixed out calculation of the index into the pageblock
      bitmap when a !SPARSEMEM zome was not aligned to pageblock_nr_pages.
      
      However, the _allocation_ of that bitmap had never taken this alignment
      requirement into accout, so depending on the exact size and alignment of
      the zone, the use of that index could then access past the allocation,
      resulting in some very subtle memory corruption.
      
      This was reported (and bisected) by Ingo Molnar: one of his random
      config builds would hang with certain very specific kernel command line
      options.
      
      In the meantime, commit c060f943 has been marked for stable, so this
      fix needs to be back-ported to the stable kernels that backported the
      commit to use the right alignment.
      Bisected-and-tested-by: default avatarIngo Molnar <mingo@kernel.org>
      Acked-by: default avatarMel Gorman <mgorman@suse.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0d15de8e
    • Lukas Czerner's avatar
      ext4: fix xattr block allocation/release with bigalloc · f861f64d
      Lukas Czerner authored
      commit 1231b3a1 upstream.
      
      Currently when new xattr block is created or released we we would call
      dquot_free_block() or dquot_alloc_block() respectively, among the else
      decrementing or incrementing the number of blocks assigned to the
      inode by one block.
      
      This however does not work for bigalloc file system because we always
      allocate/free the whole cluster so we have to count with that in
      dquot_free_block() and dquot_alloc_block() as well.
      
      Use the clusters-to-blocks conversion EXT4_C2B() when passing number of
      blocks to the dquot_alloc/free functions to fix the problem.
      
      The problem has been revealed by xfstests #117 (and possibly others).
      Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: default avatarEric Sandeen <sandeen@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f861f64d
    • Li Zefan's avatar
      cpuset: fix cpuset_print_task_mems_allowed() vs rename() race · 59222bdd
      Li Zefan authored
      commit 63f43f55 upstream.
      
      rename() will change dentry->d_name. The result of this race can
      be worse than seeing partially rewritten name, but we might access
      a stale pointer because rename() will re-allocate memory to hold
      a longer name.
      
      It's safe in the protection of dentry->d_lock.
      
      v2: check NULL dentry before acquiring dentry lock.
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      59222bdd
    • Li Zefan's avatar
      cgroup: fix exit() vs rmdir() race · d6f179e6
      Li Zefan authored
      commit 71b5707e upstream.
      
      In cgroup_exit() put_css_set_taskexit() is called without any lock,
      which might lead to accessing a freed cgroup:
      
      thread1                           thread2
      ---------------------------------------------
      exit()
        cgroup_exit()
          put_css_set_taskexit()
            atomic_dec(cgrp->count);
                                         rmdir();
            /* not safe !! */
            check_for_release(cgrp);
      
      rcu_read_lock() can be used to make sure the cgroup is alive.
      Signed-off-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      d6f179e6
    • fanchaoting's avatar
      umount oops when remove blocklayoutdriver first · a6a26fe0
      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 avatarBen Hutchings <ben@decadent.org.uk>
      a6a26fe0
    • Weston Andros Adamson's avatar
      NFSv4.1: Don't decode skipped layoutgets · 3c5add9c
      Weston Andros Adamson authored
      commit 085b7a45 upstream.
      
      layoutget's prepare hook can call rpc_exit with status = NFS4_OK (0).
      Because of this, nfs4_proc_layoutget can't depend on a 0 status to mean
      that the RPC was successfully sent, received and parsed.
      
      To fix this, use the result's len member to see if parsing took place.
      
      This fixes the following OOPS -- calling xdr_init_decode() with a buffer length
      0 doesn't set the stream's 'p' member and ends up using uninitialized memory
      in filelayout_decode_layout.
      
      BUG: unable to handle kernel paging request at 0000000000008050
      IP: [<ffffffff81282e78>] memcpy+0x18/0x120
      PGD 0
      Oops: 0000 [#1] SMP
      last sysfs file: /sys/devices/pci0000:00/0000:00:11.0/0000:02:01.0/irq
      CPU 1
      Modules linked in: nfs_layout_nfsv41_files nfs lockd fscache auth_rpcgss nfs_acl autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 dm_mirror dm_region_hash dm_log dm_mod ppdev parport_pc parport snd_ens1371 snd_rawmidi snd_ac97_codec ac97_bus snd_seq snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc e1000 microcode vmware_balloon i2c_piix4 i2c_core sg shpchp ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif pata_acpi ata_generic ata_piix mptspi mptscsih mptbase scsi_transport_spi [last unloaded: speedstep_lib]
      
      Pid: 1665, comm: flush-0:22 Not tainted 2.6.32-356-test-2 #2 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform
      RIP: 0010:[<ffffffff81282e78>]  [<ffffffff81282e78>] memcpy+0x18/0x120
      RSP: 0018:ffff88003dfab588  EFLAGS: 00010206
      RAX: ffff88003dc42000 RBX: ffff88003dfab610 RCX: 0000000000000009
      RDX: 000000003f807ff0 RSI: 0000000000008050 RDI: ffff88003dc42000
      RBP: ffff88003dfab5b0 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000080 R12: 0000000000000024
      R13: ffff88003dc42000 R14: ffff88003f808030 R15: ffff88003dfab6a0
      FS:  0000000000000000(0000) GS:ffff880003420000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
      CR2: 0000000000008050 CR3: 000000003bc92000 CR4: 00000000001407e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process flush-0:22 (pid: 1665, threadinfo ffff88003dfaa000, task ffff880037f77540)
      Stack:
      ffffffffa0398ac1 ffff8800397c5940 ffff88003dfab610 ffff88003dfab6a0
      <d> ffff88003dfab5d0 ffff88003dfab680 ffffffffa01c150b ffffea0000d82e70
      <d> 000000508116713b 0000000000000000 0000000000000000 0000000000000000
      Call Trace:
      [<ffffffffa0398ac1>] ? xdr_inline_decode+0xb1/0x120 [sunrpc]
      [<ffffffffa01c150b>] filelayout_decode_layout+0xeb/0x350 [nfs_layout_nfsv41_files]
      [<ffffffffa01c17fc>] filelayout_alloc_lseg+0x8c/0x3c0 [nfs_layout_nfsv41_files]
      [<ffffffff8150e6ce>] ? __wait_on_bit+0x7e/0x90
      Signed-off-by: default avatarWeston Andros Adamson <dros@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      3c5add9c
    • J. Bruce Fields's avatar
      svcrpc: make svc_age_temp_xprts enqueue under sv_lock · a60210ba
      J. Bruce Fields authored
      commit e75bafbf upstream.
      
      svc_age_temp_xprts expires xprts in a two-step process: first it takes
      the sv_lock and moves the xprts to expire off their server-wide list
      (sv_tempsocks or sv_permsocks) to a local list.  Then it drops the
      sv_lock and enqueues and puts each one.
      
      I see no reason for this: svc_xprt_enqueue() will take sp_lock, but the
      sv_lock and sp_lock are not otherwise nested anywhere (and documentation
      at the top of this file claims it's correct to nest these with sp_lock
      inside.)
      Tested-by: default avatarJason Tibbitts <tibbs@math.uh.edu>
      Tested-by: default avatarPaweł Sikora <pawel.sikora@agmk.net>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      a60210ba
    • Stanislaw Gruszka's avatar
      posix-cpu-timers: Fix nanosleep task_struct leak · de80ffb4
      Stanislaw Gruszka authored
      commit e6c42c29 upstream.
      
      The trinity fuzzer triggered a task_struct reference leak via
      clock_nanosleep with CPU_TIMERs. do_cpu_nanosleep() calls
      posic_cpu_timer_create(), but misses a corresponding
      posix_cpu_timer_del() which leads to the task_struct reference leak.
      Reported-and-tested-by: default avatarTommi Rantala <tt.rantala@gmail.com>
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Link: http://lkml.kernel.org/r/20130215100810.GF4392@redhat.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      de80ffb4
    • Josh Boyer's avatar
      USB: usb-storage: unusual_devs update for Super TOP SATA bridge · b6803d8d
      Josh Boyer authored
      commit 18e03310 upstream.
      
      The current entry in unusual_cypress.h for the Super TOP SATA bridge devices
      seems to be causing corruption on newer revisions of this device.  This has
      been reported in Arch Linux and Fedora.  The original patch was tested on
      devices with bcdDevice of 1.60, whereas the newer devices report bcdDevice
      as 2.20.  Limit the UNUSUAL_DEV entry to devices less than 2.20.
      
      This fixes https://bugzilla.redhat.com/show_bug.cgi?id=909591
      
      The Arch Forum post on this is here:
      	https://bbs.archlinux.org/viewtopic.php?id=152011Reported-by: default avatarCarsten S. <carsteniq@yahoo.com>
      Tested-by: default avatarCarsten S. <carsteniq@yahoo.com>
      Signed-off-by: default avatarJosh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      b6803d8d
    • Roger Quadros's avatar
      USB: ehci-omap: Fix autoloading of module · 507c50ba
      Roger Quadros authored
      commit 04753523 upstream.
      
      The module alias should be "ehci-omap" and not
      "omap-ehci" to match the platform device name.
      The omap-ehci module should now autoload correctly.
      Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      507c50ba
    • Arnd Bergmann's avatar
      ARM: w90x900: fix legacy assembly syntax · ee0a25ab
      Arnd Bergmann authored
      commit fa5ce5f9 upstream.
      
      New ARM binutils don't allow extraneous whitespace inside
      of brackets, which causes this error on all mach-w90x900
      defconfigs:
      
      arch/arm/kernel/entry-armv.S: Assembler messages:
      arch/arm/kernel/entry-armv.S:214: Error: ARM register expected -- `ldr r0,[ r6,#(0x10C)]'
      arch/arm/kernel/entry-armv.S:214: Error: ARM register expected -- `ldr r0,[ r6,#(0x110)]'
      arch/arm/kernel/entry-armv.S:430: Error: ARM register expected -- `ldr r0,[ r6,#(0x10C)]'
      arch/arm/kernel/entry-armv.S:430: Error: ARM register expected -- `ldr r0,[ r6,#(0x110)]'
      
      This removes the whitespace in order to build the kernel
      again.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Wan ZongShun <mcuos.com@gmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      ee0a25ab
    • Arnd Bergmann's avatar
      ARM: samsung: fix assembly syntax for new gas · 70c46976
      Arnd Bergmann authored
      commit 2815774b upstream.
      
      Recent assembler versions complain about extraneous
      whitespace inside [] brackets. This fixes all of
      these instances for the samsung platforms. We should
      backport this to all kernels that might need to
      be built with new binutils.
      
      arch/arm/kernel/entry-armv.S: Assembler messages:
      arch/arm/kernel/entry-armv.S:214: Error: ARM register expected -- `ldr r2,[ r6,#(0x10)]'
      arch/arm/kernel/entry-armv.S:214: Error: ARM register expected -- `ldr r0,[ r6,#(0x14)]'
      arch/arm/kernel/entry-armv.S:430: Error: ARM register expected -- `ldr r2,[ r6,#(0x10)]'
      arch/arm/kernel/entry-armv.S:430: Error: ARM register expected -- `ldr r0,[ r6,#(0x14)]'
      arch/arm/mach-s3c24xx/sleep-s3c2410.S: Assembler messages:
      arch/arm/mach-s3c24xx/sleep-s3c2410.S:48: Error: ARM register expected -- `ldr r7,[ r4 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2410.S:49: Error: ARM register expected -- `ldr r8,[ r5 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2410.S:50: Error: ARM register expected -- `ldr r9,[ r6 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2410.S:64: Error: ARM register expected -- `streq r7,[ r4 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2410.S:65: Error: ARM register expected -- `streq r8,[ r5 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2410.S:66: Error: ARM register expected -- `streq r9,[ r6 ]'
      arch/arm/kernel/debug.S: Assembler messages:
      arch/arm/kernel/debug.S:83: Error: ARM register expected -- `ldr r2,[ r2,#((0x0B0)+(((0x56000000)-(0x50000000))+(0xF6000000+(0x01000000))))-((0)+(((0x56000000)-(0x50000000))+(0xF6000000+(0x01000000))))]'
      arch/arm/kernel/debug.S:83: Error: ARM register expected -- `ldr r2,[ r3,#(0x18)]'
      arch/arm/kernel/debug.S:85: Error: ARM register expected -- `ldr r2,[ r2,#((0x0B0)+(((0x56000000)-(0x50000000))+(0xF6000000+(0x01000000))))-((0)+(((0x56000000)-(0x50000000))+(0xF6000000+(0x01000000))))]'
      arch/arm/kernel/debug.S:85: Error: ARM register expected -- `ldr r2,[ r3,#(0x18)]'
      arch/arm/mach-s3c24xx/pm-h1940.S: Assembler messages:
      arch/arm/mach-s3c24xx/pm-h1940.S:33: Error: ARM register expected -- `ldr pc,[ r0,#((0x0B8)+(((0x56000000)-(0x50000000))+(0xF6000000+(0x01000000))))-(((0x56000000)-(0x50000000))+(0xF6000000+(0x01000000)))]'
      arch/arm/mach-s3c24xx/sleep-s3c2412.S: Assembler messages:
      arch/arm/mach-s3c24xx/sleep-s3c2412.S:60: Error: ARM register expected -- `ldrne r9,[ r1 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2412.S:61: Error: ARM register expected -- `strne r9,[ r1 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2412.S:62: Error: ARM register expected -- `ldrne r9,[ r2 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2412.S:63: Error: ARM register expected -- `strne r9,[ r2 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2412.S:64: Error: ARM register expected -- `ldrne r9,[ r3 ]'
      arch/arm/mach-s3c24xx/sleep-s3c2412.S:65: Error: ARM register expected -- `strne r9,[ r3 ]'
      arch/arm/kernel/debug.S:83: Error: ARM register expected -- `ldr r2,[ r3,#(0x08)]'
      arch/arm/kernel/debug.S:83: Error: ARM register expected -- `ldr r2,[ r3,#(0x18)]'
      arch/arm/kernel/debug.S:83: Error: ARM register expected -- `ldr r2,[ r3,#(0x10)]'
      arch/arm/kernel/debug.S:85: Error: ARM register expected -- `ldr r2,[ r3,#(0x08)]'
      arch/arm/kernel/debug.S:85: Error: ARM register expected -- `ldr r2,[ r3,#(0x18)]'
      arch/arm/kernel/debug.S:85: Error: ARM register expected -- `ldr r2,[ r3,#(0x10)]'
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarKukjin Kim <kgene.kim@samsung.com>
      Cc: Ben Dooks <ben-linux@fluff.org>
      [bwh: Backported to 3.2: adjust filenames]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      70c46976
    • Satoru Takeuchi's avatar
      efi: Clear EFI_RUNTIME_SERVICES rather than EFI_BOOT by "noefi" boot parameter · ce75086e
      Satoru Takeuchi authored
      commit 1de63d60 upstream.
      
      There was a serious problem in samsung-laptop that its platform driver is
      designed to run under BIOS and running under EFI can cause the machine to
      become bricked or can cause Machine Check Exceptions.
      
          Discussion about this problem:
          https://bugs.launchpad.net/ubuntu-cdimage/+bug/1040557
          https://bugzilla.kernel.org/show_bug.cgi?id=47121
      
          The patches to fix this problem:
          efi: Make 'efi_enabled' a function to query EFI facilities
          83e68189
      
          samsung-laptop: Disable on EFI hardware
          e0094244
      
      Unfortunately this problem comes back again if users specify "noefi" option.
      This parameter clears EFI_BOOT and that driver continues to run even if running
      under EFI. Refer to the document, this parameter should clear
      EFI_RUNTIME_SERVICES instead.
      
      Documentation/kernel-parameters.txt:
      ===============================================================================
      ...
      	noefi		[X86] Disable EFI runtime services support.
      ...
      ===============================================================================
      
      Documentation/x86/x86_64/uefi.txt:
      ===============================================================================
      ...
      - If some or all EFI runtime services don't work, you can try following
        kernel command line parameters to turn off some or all EFI runtime
        services.
      	noefi		turn off all EFI runtime services
      ...
      ===============================================================================
      Signed-off-by: default avatarSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
      Link: http://lkml.kernel.org/r/511C2C04.2070108@jp.fujitsu.com
      Cc: Matt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      ce75086e
    • Bjørn Mork's avatar
      USB: option: add Huawei "ACM" devices using protocol = vendor · e8c94532
      Bjørn Mork authored
      commit 1f3f6877 upstream.
      
      The USB device descriptor of one identity presented by a few
      Huawei morphing devices have serial functions with class codes
      02/02/ff, indicating CDC ACM with a vendor specific protocol. This
      combination is often used for MSFT RNDIS functions, and the CDC
      ACM class driver will therefore ignore such functions.
      
      The CDC ACM class driver cannot support functions with only 2
      endpoints.  The underlying serial functions of these modems are
      also believed to be the same as for alternate device identities
      already supported by the option driver. Letting the same driver
      handle these functions independently of the current identity
      ensures consistent handling and user experience.
      
      There is no need to blacklist these devices in the rndis_host
      driver. Huawei serial functions will either have only 2 endpoints
      or a CDC ACM functional descriptor with bmCapabilities != 0, making
      them correctly ignored as "non RNDIS" by that driver.
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      e8c94532
    • Rafael J. Wysocki's avatar
      PCI/PM: Clean up PME state when removing a device · f93873c3
      Rafael J. Wysocki authored
      commit 249bfb83 upstream.
      
      Devices are added to pci_pme_list when drivers use pci_enable_wake()
      or pci_wake_from_d3(), but they aren't removed from the list unless
      the driver explicitly disables wakeup.  Many drivers never disable
      wakeup, so their devices remain on the list even after they are
      removed, e.g., via hotplug.  A subsequent PME poll will oops when
      it tries to touch the device.
      
      This patch disables PME# on a device before removing it, which removes
      the device from pci_pme_list.  This is safe even if the device never
      had PME# enabled.
      
      This oops can be triggered by unplugging a Thunderbolt ethernet adapter
      on a Macbook Pro, as reported by Daniel below.
      
      [bhelgaas: changelog]
      Reference: http://lkml.kernel.org/r/CAMVG2svG21yiM1wkH4_2pen2n+cr2-Zv7TbH3Gj+8MwevZjDbw@mail.gmail.comReported-and-tested-by: default avatarDaniel J Blueman <daniel@quora.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f93873c3
    • George Spelvin's avatar
      pps: Fix a use-after free bug when unregistering a source. · 77327a71
      George Spelvin authored
      commit d953e0e8 upstream.
      
      Remove the cdev from the system (with cdev_del) *before* deallocating it
      (in pps_device_destruct, called via kobject_put from device_destroy).
      
      Also prevent deallocating a device with open file handles.
      
      A better long-term fix is probably to remove the cdev from the pps_device
      entirely, and instead have all devices reference one global cdev.  Then
      the deallocation ordering becomes simpler.
      
      But that's more complex and invasive change, so we leave that
      for later.
      Signed-off-by: default avatarGeorge Spelvin <linux@horizon.com>
      Acked-by: default avatarRodolfo Giometti <giometti@enneenne.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      77327a71
    • George Spelvin's avatar
      pps: Use pps_lookup_dev to reduce ldisc coupling · 24625640
      George Spelvin authored
      commit 03a7ffe4 upstream.
      
      Now that N_TTY uses tty->disc_data for its private data,
      'subclass' ldiscs cannot use ->disc_data for their own private data.
      (This is a regression is v3.8-rc1)
      
      Use pps_lookup_dev to associate the tty with the pps source instead.
      
      This fixes a crashing regression in 3.8-rc1.
      Signed-off-by: default avatarGeorge Spelvin <linux@horizon.com>
      Acked-by: default avatarRodolfo Giometti <giometti@enneenne.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      24625640
    • George Spelvin's avatar
      pps: Add pps_lookup_dev() function · 7063a995
      George Spelvin authored
      commit 513b032c upstream.
      
      The PPS serial line discipline wants to attach a PPS device to a tty
      without changing the tty code to add a struct pps_device * pointer.
      
      Since the number of PPS devices in a typical system is generally very low
      (n=1 is by far the most common), it's practical to search the entire list
      of allocated pps devices.  (We capture the timestamp before the lookup,
      so the timing isn't affected.)
      
      It is a bit ugly that this function, which is part of the in-kernel
      PPS API, has to be in pps.c as opposed to kapi,c, but that's not
      something that affects users.
      Signed-off-by: default avatarGeorge Spelvin <linux@horizon.com>
      Acked-by: default avatarRodolfo Giometti <giometti@enneenne.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7063a995
    • Philipp Reisner's avatar
      idr: idr_for_each_entry() macro · 72df9ecc
      Philipp Reisner authored
      commit 9749f30f upstream.
      
      Inspired by the list_for_each_entry() macro
      Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      72df9ecc
    • Johan Hovold's avatar
      USB: serial: fix null-pointer dereferences on disconnect · 36614259
      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>
      [bwh: Backported to 3.2:
       - Adjust context
       - Drop changes to quatech2.c]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      36614259
    • Bjørn Mork's avatar
      USB: option: add Yota / Megafon M100-1 4g modem · 0055ccfc
      Bjørn Mork authored
      commit cd565279 upstream.
      
      Interface layout:
      
       00 CD-ROM
       01 debug COM port
       02 AP control port
       03 modem
       04 usb-ethernet
      
      Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  4 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=0408 ProdID=ea42 Rev= 0.00
      S:  Manufacturer=Qualcomm, Incorporated
      S:  Product=Qualcomm CDMA Technologies MSM
      S:  SerialNumber=353568051xxxxxx
      C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0055ccfc
    • Daniel Vetter's avatar
      Revert "drm: Add EDID_QUIRK_FORCE_REDUCED_BLANKING for ASUS VW222S" · 8f8dc63d
      Daniel Vetter authored
      commit db3985e5 upstream.
      
      This reverts commit 6f33814b.
      
      The quirk cause a regression, and it looks like the original bug was
      simply a lack of FIFO bandwidth on the i915G of the reporter. Which
      should eventually be fixed as soon as we get around to implemented
      DSPARB FIFO reassignment on gen 3.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52281Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8f8dc63d
    • Mel Gorman's avatar
      x86/mm: Check if PUD is large when validating a kernel address · 7ee95977
      Mel Gorman authored
      commit 0ee364eb upstream.
      
      A user reported the following oops when a backup process reads
      /proc/kcore:
      
       BUG: unable to handle kernel paging request at ffffbb00ff33b000
       IP: [<ffffffff8103157e>] kern_addr_valid+0xbe/0x110
       [...]
      
       Call Trace:
        [<ffffffff811b8aaa>] read_kcore+0x17a/0x370
        [<ffffffff811ad847>] proc_reg_read+0x77/0xc0
        [<ffffffff81151687>] vfs_read+0xc7/0x130
        [<ffffffff811517f3>] sys_read+0x53/0xa0
        [<ffffffff81449692>] system_call_fastpath+0x16/0x1b
      
      Investigation determined that the bug triggered when reading
      system RAM at the 4G mark. On this system, that was the first
      address using 1G pages for the virt->phys direct mapping so the
      PUD is pointing to a physical address, not a PMD page.
      
      The problem is that the page table walker in kern_addr_valid() is
      not checking pud_large() and treats the physical address as if
      it was a PMD.  If it happens to look like pmd_none then it'll
      silently fail, probably returning zeros instead of real data. If
      the data happens to look like a present PMD though, it will be
      walked resulting in the oops above.
      
      This patch adds the necessary pud_large() check.
      
      Unfortunately the problem was not readily reproducible and now
      they are running the backup program without accessing
      /proc/kcore so the patch has not been validated but I think it
      makes sense.
      Signed-off-by: default avatarMel Gorman <mgorman@suse.de>
      Reviewed-by: default avatarRik van Riel <riel@redhat.coM>
      Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: linux-mm@kvack.org
      Link: http://lkml.kernel.org/r/20130211145236.GX21389@suse.deSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7ee95977
    • Olaf Hering's avatar
      x86: Hyper-V: register clocksource only if its advertised · 12324875
      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>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      12324875
    • Linus Walleij's avatar
      drivers/rtc/rtc-pl031.c: restore ST variant functionality · 7366b52c
      Linus Walleij authored
      commit 3399cfb5 upstream.
      
      Commit e7e034e1 ("drivers/rtc/rtc-pl031.c: fix the missing operation
      on enable") accidentally broke the ST variants of PL031.
      
      The bit that is being poked as "clockwatch" enable bit for the ST
      variants does the work of bit 0 on this variant.  Bit 0 is used for a
      clock divider on the ST variants, and setting it to 1 will affect
      timekeeping in a very bad way.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Acked-by: default avatarHaojian Zhuang <haojian.zhuang@gmail.com>
      Cc: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
      Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7366b52c
    • Denis Efremov's avatar
      ALSA: ali5451: remove irq enabling in pointer callback · 24bc276d
      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 avatarBen Hutchings <ben@decadent.org.uk>
      24bc276d
    • Denis Efremov's avatar
      ALSA: rme32.c irq enabling after spin_lock_irq · e3f48db0
      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 avatarBen Hutchings <ben@decadent.org.uk>
      e3f48db0
    • Stoney Wang's avatar
      x86/apic: Work around boot failure on HP ProLiant DL980 G7 Server systems · 7d2658f0
      Stoney Wang authored
      commit cb214ede upstream.
      
      When a HP ProLiant DL980 G7 Server boots a regular kernel,
      there will be intermittent lost interrupts which could
      result in a hang or (in extreme cases) data loss.
      
      The reason is that this system only supports x2apic physical
      mode, while the kernel boots with a logical-cluster default
      setting.
      
      This bug can be worked around by specifying the "x2apic_phys" or
      "nox2apic" boot option, but we want to handle this system
      without requiring manual workarounds.
      
      The BIOS sets ACPI_FADT_APIC_PHYSICAL in FADT table.
      As all apicids are smaller than 255, BIOS need to pass the
      control to the OS with xapic mode, according to x2apic-spec,
      chapter 2.9.
      
      Current code handle x2apic when BIOS pass with xapic mode
      enabled:
      
      When user specifies x2apic_phys, or FADT indicates PHYSICAL:
      
      1. During madt oem check, apic driver is set with xapic logical
         or xapic phys driver at first.
      
      2. enable_IR_x2apic() will enable x2apic_mode.
      
      3. if user specifies x2apic_phys on the boot line, x2apic_phys_probe()
         will install the correct x2apic phys driver and use x2apic phys mode.
         Otherwise it will skip the driver will let x2apic_cluster_probe to
         take over to install x2apic cluster driver (wrong one) even though FADT
         indicates PHYSICAL, because x2apic_phys_probe does not check
         FADT PHYSICAL.
      
      Add checking x2apic_fadt_phys in x2apic_phys_probe() to fix the
      problem.
      Signed-off-by: default avatarStoney Wang <song-bo.wang@hp.com>
      [ updated the changelog and simplified the code ]
      Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
      Link: http://lkml.kernel.org/r/1360263182-16226-1-git-send-email-yinghai@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7d2658f0
    • Greg Pearson's avatar
      x86/apic: Use x2apic physical mode based on FADT setting · 5fa3fabb
      Greg Pearson authored
      commit ea0dcf90 upstream.
      
      Provide systems that do not support x2apic cluster mode
      a mechanism to select x2apic physical mode using the
      FADT FORCE_APIC_PHYSICAL_DESTINATION_MODE bit.
      
      Changes from v1: (based on Suresh's comments)
       - removed #ifdef CONFIG_ACPI
       - removed #include <linux/acpi.h>
      Signed-off-by: default avatarGreg Pearson <greg.pearson@hp.com>
      Acked-by: default avatarSuresh Siddha <suresh.b.siddha@intel.com>
      Link: http://lkml.kernel.org/r/1335313436-32020-1-git-send-email-greg.pearson@hp.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      5fa3fabb
    • fangxiaozhi's avatar
      USB: storage: properly handle the endian issues of idProduct · d0d26e57
      fangxiaozhi authored
      commit cd060956 upstream.
      
      1. The idProduct is little endian, so make sure its value to be
      compatible with the current CPU. Make no break on big endian processors.
      Signed-off-by: default avatarfangxiaozhi <huananhu@huawei.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      d0d26e57
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Add new USB ID · 4413840e
      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 avatarBen Hutchings <ben@decadent.org.uk>
      4413840e
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id · 581e5891
      Larry Finger authored
      commit 957f4aca upstream.
      
      When the new_id entry in /sysfs is used for a foreign USB device, rtlwifi
      BUGS with a NULL pointer dereference because the per-driver configuration
      data is not available. The probe function has been restructured as
      suggested by Ben Hutchings <bhutchings@solarflare.com>.
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      [bwh: Backported to 3.2: adjust context, indentation]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      581e5891