1. 06 Feb, 2013 40 commits
    • Felix Fietkau's avatar
      ath9k_hw: fix chain swap setting when setting rx chainmask to 5 · 959f049d
      Felix Fietkau authored
      commit 24171dd9 upstream.
      
      Chain swapping should only be enabled when the EEPROM chainmask is set to 5,
      regardless of what the runtime chainmask is.
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      [bwh: Backported to 3.2: keep the special case for AR_SREV_9462 here]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      959f049d
    • Felix Fietkau's avatar
      ath9k_hw: fix calibration issues on chainmask that don't include chain 0 · b71a6d27
      Felix Fietkau authored
      commit 4a8f1995 upstream.
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      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>
      b71a6d27
    • Nathan Zimmer's avatar
      efi, x86: Pass a proper identity mapping in efi_call_phys_prelog · 8709c92e
      Nathan Zimmer authored
      commit b8f2c21d upstream.
      
      Update efi_call_phys_prelog to install an identity mapping of all available
      memory.  This corrects a bug on very large systems with more then 512 GB in
      which bios would not be able to access addresses above not in the mapping.
      
      The result is a crash that looks much like this.
      
      BUG: unable to handle kernel paging request at 000000effd870020
      IP: [<0000000078bce331>] 0x78bce330
      PGD 0
      Oops: 0000 [#1] SMP
      Modules linked in:
      CPU 0
      Pid: 0, comm: swapper/0 Tainted: G        W    3.8.0-rc1-next-20121224-medusa_ntz+ #2 Intel Corp. Stoutland Platform
      RIP: 0010:[<0000000078bce331>]  [<0000000078bce331>] 0x78bce330
      RSP: 0000:ffffffff81601d28  EFLAGS: 00010006
      RAX: 0000000078b80e18 RBX: 0000000000000004 RCX: 0000000000000004
      RDX: 0000000078bcf958 RSI: 0000000000002400 RDI: 8000000000000000
      RBP: 0000000078bcf760 R08: 000000effd870000 R09: 0000000000000000
      R10: 0000000000000000 R11: 00000000000000c3 R12: 0000000000000030
      R13: 000000effd870000 R14: 0000000000000000 R15: ffff88effd870000
      FS:  0000000000000000(0000) GS:ffff88effe400000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000effd870020 CR3: 000000000160c000 CR4: 00000000000006b0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process swapper/0 (pid: 0, threadinfo ffffffff81600000, task ffffffff81614400)
      Stack:
       0000000078b80d18 0000000000000004 0000000078bced7b ffff880078b81fff
       0000000000000000 0000000000000082 0000000078bce3a8 0000000000002400
       0000000060000202 0000000078b80da0 0000000078bce45d ffffffff8107cb5a
      Call Trace:
       [<ffffffff8107cb5a>] ? on_each_cpu+0x77/0x83
       [<ffffffff8102f4eb>] ? change_page_attr_set_clr+0x32f/0x3ed
       [<ffffffff81035946>] ? efi_call4+0x46/0x80
       [<ffffffff816c5abb>] ? efi_enter_virtual_mode+0x1f5/0x305
       [<ffffffff816aeb24>] ? start_kernel+0x34a/0x3d2
       [<ffffffff816ae5ed>] ? repair_env_string+0x60/0x60
       [<ffffffff816ae2be>] ? x86_64_start_reservations+0xba/0xc1
       [<ffffffff816ae120>] ? early_idt_handlers+0x120/0x120
       [<ffffffff816ae419>] ? x86_64_start_kernel+0x154/0x163
      Code:  Bad RIP value.
      RIP  [<0000000078bce331>] 0x78bce330
       RSP <ffffffff81601d28>
      CR2: 000000effd870020
      ---[ end trace ead828934fef5eab ]---
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: default avatarNathan Zimmer <nzimmer@sgi.com>
      Signed-off-by: default avatarRobin Holt <holt@sgi.com>
      Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8709c92e
    • Piotr Haber's avatar
      brcmsmac: increase timer reference count for new timers only · 9741d4eb
      Piotr Haber authored
      commit a1fe5280 upstream.
      
      On hardware reintialization reference count of
      already existing timers would be increased again.
      This leads to problems on module unloading.
      Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
      Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
      Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
      Signed-off-by: default avatarPiotr Haber <phaber@broadcom.com>
      Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      9741d4eb
    • Felix Fietkau's avatar
      ath9k: fix double-free bug on beacon generate failure · a282707d
      Felix Fietkau authored
      commit 1adb2e2b upstream.
      
      When the next beacon is sent, the ath_buf from the previous run is reused.
      If getting a new beacon from mac80211 fails, bf->bf_mpdu is not reset, yet
      the skb is freed, leading to a double-free on the next beacon tx attempt,
      resulting in a system crash.
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      a282707d
    • Felix Fietkau's avatar
      ath9k: do not link receive buffers during flush · 8e75bb19
      Felix Fietkau authored
      commit a3dc48e8 upstream.
      
      On AR9300 the rx FIFO needs to be empty during reset to ensure that no
      further DMA activity is generated, otherwise it might lead to memory
      corruption issues.
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8e75bb19
    • Sujith Manoharan's avatar
      ath9k_htc: Fix memory leak · 04d88fd9
      Sujith Manoharan authored
      commit 0981c3b2 upstream.
      
      SKBs that are allocated in the HTC layer do not have callbacks
      registered and hence ended up not being freed, Fix this by freeing
      them properly in the TX completion routine.
      Reported-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
      Tested-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>
      04d88fd9
    • Anderson Lizardo's avatar
      Bluetooth: Fix incorrect strncpy() in hidp_setup_hid() · 150df53a
      Anderson Lizardo authored
      commit 0a9ab9bd upstream.
      
      The length parameter should be sizeof(req->name) - 1 because there is no
      guarantee that string provided by userspace will contain the trailing
      '\0'.
      
      Can be easily reproduced by manually setting req->name to 128 non-zero
      bytes prior to ioctl(HIDPCONNADD) and checking the device name setup on
      input subsystem:
      
      $ cat /sys/devices/pnp0/00\:04/tty/ttyS0/hci0/hci0\:1/input8/name
      AAAAAA[...]AAAAAAAAf0:af:f0:af:f0:af
      
      ("f0:af:f0:af:f0:af" is the device bluetooth address, taken from "phys"
      field in struct hid_device due to overflow.)
      Signed-off-by: default avatarAnderson Lizardo <anderson.lizardo@openbossa.org>
      Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      150df53a
    • Cong Ding's avatar
      fs/cifs/cifs_dfs_ref.c: fix potential memory leakage · d62f0c40
      Cong Ding authored
      commit 10b8c7df upstream.
      
      When it goes to error through line 144, the memory allocated to *devname is
      not freed, and the caller doesn't free it either in line 250. So we free the
      memroy of *devname in function cifs_compose_mount_options() when it goes to
      error.
      Signed-off-by: default avatarCong Ding <dinggnu@gmail.com>
      Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarSteve French <smfrench@gmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      d62f0c40
    • Alan Stern's avatar
      USB: UHCI: fix IRQ race during initialization · a928a96a
      Alan Stern authored
      commit 0f815a0a upstream.
      
      This patch (as1644) fixes a race that occurs during startup in
      uhci-hcd.  If the IRQ line is shared with other devices, it's possible
      for the handler routine to be called before the data structures are
      fully initialized.
      
      The problem is fixed by adding a check to the IRQ handler routine.  If
      the initialization hasn't finished yet, the routine will return
      immediately.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarDon Zickus <dzickus@redhat.com>
      Tested-by: default avatar"Huang, Adrian (ISS Linux TW)" <adrian.huang@hp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      a928a96a
    • Steven Rostedt's avatar
      ftrace: Be first to run code modification on modules · 0988130f
      Steven Rostedt authored
      commit c1bf08ac upstream.
      
      If some other kernel subsystem has a module notifier, and adds a kprobe
      to a ftrace mcount point (now that kprobes work on ftrace points),
      when the ftrace notifier runs it will fail and disable ftrace, as well
      as kprobes that are attached to ftrace points.
      
      Here's the error:
      
       WARNING: at kernel/trace/ftrace.c:1618 ftrace_bug+0x239/0x280()
       Hardware name: Bochs
       Modules linked in: fat(+) stap_56d28a51b3fe546293ca0700b10bcb29__8059(F) nfsv4 auth_rpcgss nfs dns_resolver fscache xt_nat iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack lockd sunrpc ppdev parport_pc parport microcode virtio_net i2c_piix4 drm_kms_helper ttm drm i2c_core [last unloaded: bid_shared]
       Pid: 8068, comm: modprobe Tainted: GF            3.7.0-0.rc8.git0.1.fc19.x86_64 #1
       Call Trace:
        [<ffffffff8105e70f>] warn_slowpath_common+0x7f/0xc0
        [<ffffffff81134106>] ? __probe_kernel_read+0x46/0x70
        [<ffffffffa0180000>] ? 0xffffffffa017ffff
        [<ffffffffa0180000>] ? 0xffffffffa017ffff
        [<ffffffff8105e76a>] warn_slowpath_null+0x1a/0x20
        [<ffffffff810fd189>] ftrace_bug+0x239/0x280
        [<ffffffff810fd626>] ftrace_process_locs+0x376/0x520
        [<ffffffff810fefb7>] ftrace_module_notify+0x47/0x50
        [<ffffffff8163912d>] notifier_call_chain+0x4d/0x70
        [<ffffffff810882f8>] __blocking_notifier_call_chain+0x58/0x80
        [<ffffffff81088336>] blocking_notifier_call_chain+0x16/0x20
        [<ffffffff810c2a23>] sys_init_module+0x73/0x220
        [<ffffffff8163d719>] system_call_fastpath+0x16/0x1b
       ---[ end trace 9ef46351e53bbf80 ]---
       ftrace failed to modify [<ffffffffa0180000>] init_once+0x0/0x20 [fat]
        actual: cc:bb:d2:4b:e1
      
      A kprobe was added to the init_once() function in the fat module on load.
      But this happened before ftrace could have touched the code. As ftrace
      didn't run yet, the kprobe system had no idea it was a ftrace point and
      simply added a breakpoint to the code (0xcc in the cc:bb:d2:4b:e1).
      
      Then when ftrace went to modify the location from a call to mcount/fentry
      into a nop, it didn't see a call op, but instead it saw the breakpoint op
      and not knowing what to do with it, ftrace shut itself down.
      
      The solution is to simply give the ftrace module notifier the max priority.
      This should have been done regardless, as the core code ftrace modification
      also happens very early on in boot up. This makes the module modification
      closer to core modification.
      
      Link: http://lkml.kernel.org/r/20130107140333.593683061@goodmis.orgAcked-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Reported-by: default avatarFrank Ch. Eigler <fche@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0988130f
    • Takashi Iwai's avatar
      ALSA: hda - Add Conexant CX20755/20756/20757 codec IDs · 08a43c18
      Takashi Iwai authored
      commit 42c364ac upstream.
      
      These are just compatible with other CX2075x codecs.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      08a43c18
    • Takashi Iwai's avatar
      ALSA: hda/conexant - Correct vendor IDs for new codecs · fc9c1a6f
      Takashi Iwai authored
      commit 2d825fd8 upstream.
      
      Never trust datasheet...
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      fc9c1a6f
    • Takashi Iwai's avatar
      ALSA: hda - Add Conexant CX20751/2/3/4 codec support · 91abcd94
      Takashi Iwai authored
      commit 61d648fb upstream.
      
      These are almost compatible with the older Conexant codecs.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      91abcd94
    • Dmitry Kasatkin's avatar
      evm: checking if removexattr is not a NULL · f6669576
      Dmitry Kasatkin authored
      commit a67adb99 upstream.
      
      The following lines of code produce a kernel oops.
      
      fd = socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
      fchmod(fd, 0666);
      
      [  139.922364] BUG: unable to handle kernel NULL pointer dereference at   (null)
      [  139.924982] IP: [<  (null)>]   (null)
      [  139.924982] *pde = 00000000
      [  139.924982] Oops: 0000 [#5] SMP
      [  139.924982] Modules linked in: fuse dm_crypt dm_mod i2c_piix4 serio_raw evdev binfmt_misc button
      [  139.924982] Pid: 3070, comm: acpid Tainted: G      D      3.8.0-rc2-kds+ #465 Bochs Bochs
      [  139.924982] EIP: 0060:[<00000000>] EFLAGS: 00010246 CPU: 0
      [  139.924982] EIP is at 0x0
      [  139.924982] EAX: cf5ef000 EBX: cf5ef000 ECX: c143d600 EDX: c15225f2
      [  139.924982] ESI: cf4d2a1c EDI: cf4d2a1c EBP: cc02df10 ESP: cc02dee4
      [  139.924982]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      [  139.924982] CR0: 80050033 CR2: 00000000 CR3: 0c059000 CR4: 000006d0
      [  139.924982] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      [  139.924982] DR6: ffff0ff0 DR7: 00000400
      [  139.924982] Process acpid (pid: 3070, ti=cc02c000 task=d7705340 task.ti=cc02c000)
      [  139.924982] Stack:
      [  139.924982]  c1203c88 00000000 cc02def4 cf4d2a1c ae21eefa 471b60d5 1083c1ba c26a5940
      [  139.924982]  e891fb5e 00000041 00000004 cc02df1c c1203964 00000000 cc02df4c c10e20c3
      [  139.924982]  00000002 00000000 00000000 22222222 c1ff2222 cf5ef000 00000000 d76efb08
      [  139.924982] Call Trace:
      [  139.924982]  [<c1203c88>] ? evm_update_evmxattr+0x5b/0x62
      [  139.924982]  [<c1203964>] evm_inode_post_setattr+0x22/0x26
      [  139.924982]  [<c10e20c3>] notify_change+0x25f/0x281
      [  139.924982]  [<c10cbf56>] chmod_common+0x59/0x76
      [  139.924982]  [<c10e27a1>] ? put_unused_fd+0x33/0x33
      [  139.924982]  [<c10cca09>] sys_fchmod+0x39/0x5c
      [  139.924982]  [<c13f4f30>] syscall_call+0x7/0xb
      [  139.924982] Code:  Bad EIP value.
      
      This happens because sockets do not define the removexattr operation.
      Before removing the xattr, verify the removexattr function pointer is
      not NULL.
      Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@intel.com>
      Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Morris <james.l.morris@oracle.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      f6669576
    • Russell King's avatar
      ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem · 41cb955f
      Russell King authored
      commit 15653371 upstream.
      
      Subhash Jadavani reported this partial backtrace:
        Now consider this call stack from MMC block driver (this is on the ARMv7
        based board):
      
        [<c001b50c>] (v7_dma_inv_range+0x30/0x48) from [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c)
        [<c0017b8c>] (dma_cache_maint_page+0x1c4/0x24c) from [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c)
        [<c0017c28>] (___dma_page_cpu_to_dev+0x14/0x1c) from [<c0017ff8>] (dma_map_sg+0x3c/0x114)
      
      This is caused by incrementing the struct page pointer, and running off
      the end of the sparsemem page array.  Fix this by incrementing by pfn
      instead, and convert the pfn to a struct page.
      Suggested-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Tested-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      41cb955f
    • Thomas Schlichter's avatar
      ACPI / processor: Get power info before updating the C-states · 4b4b641b
      Thomas Schlichter authored
      commit f427e5f1 upstream.
      
      acpi_processor_get_power_info() has to be called before
      acpi_processor_setup_cpuidle_states() to have the latest
      information available. This fixes the missing C-state information
      after AC-->DC transition.
      Signed-off-by: default avatarThomas Schlichter <thomas.schlichter@web.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      4b4b641b
    • Konrad Rzeszutek Wilk's avatar
      ACPI / cpuidle: Fix NULL pointer issues when cpuidle is disabled · 8d535aa1
      Konrad Rzeszutek Wilk authored
      commit b88a634a upstream.
      
      If cpuidle is disabled, that means that:
      
      	per_cpu(acpi_cpuidle_device, pr->id)
      
      is set to NULL as the acpi_processor_power_init ends up failing at
      
      	 retval = cpuidle_register_driver(&acpi_idle_driver)
      
      (in acpi_processor_power_init) and never sets the per_cpu idle
      device.  So when acpi_processor_hotplug on CPU online notification
      tries to reference said device it crashes:
      
      cpu 3 spinlock event irq 62
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
      IP: [<ffffffff81381013>] acpi_processor_setup_cpuidle_cx+0x3f/0x105
      PGD a259b067 PUD ab38b067 PMD 0
      Oops: 0002 [#1] SMP
      odules linked in: dm_multipath dm_mod xen_evtchn iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi libcrc32c crc32c nouveau mxm_wmi wmi radeon ttm sg sr_mod sd_mod cdrom ata_generic ata_piix libata crc32c_intel scsi_mod atl1c i915 fbcon tileblit font bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf
      CPU 1
      Pid: 3047, comm: bash Not tainted 3.8.0-rc3upstream-00250-g165c029 #1 MSI MS-7680/H61M-P23 (MS-7680)
      RIP: e030:[<ffffffff81381013>]  [<ffffffff81381013>] acpi_processor_setup_cpuidle_cx+0x3f/0x105
      RSP: e02b:ffff88001742dca8  EFLAGS: 00010202
      RAX: 0000000000010be9 RBX: ffff8800a0a61800 RCX: ffff880105380000
      RDX: 0000000000000003 RSI: 0000000000000200 RDI: ffff8800a0a61800
      RBP: ffff88001742dce8 R08: ffffffff81812360 R09: 0000000000000200
      R10: aaaaaaaaaaaaaaaa R11: 0000000000000001 R12: ffff8800a0a61800
      R13: 00000000ffffff01 R14: 0000000000000000 R15: ffffffff81a907a0
      FS:  00007fd6942f7700(0000) GS:ffff880105280000(0000) knlGS:0000000000000000
      CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000004 CR3: 00000000a6773000 CR4: 0000000000042660
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process bash (pid: 3047, threadinfo ffff88001742c000, task ffff880017944000)
      Stack:
       0000000000000150 ffff880100f59e00 ffff88001742dcd8 ffff8800a0a61800
       0000000000000000 00000000ffffff01 0000000000000000 ffffffff81a907a0
       ffff88001742dd18 ffffffff813815b1 ffff88001742dd08 ffffffff810ae336
      Call Trace:
       [<ffffffff813815b1>] acpi_processor_hotplug+0x7c/0x9f
       [<ffffffff810ae336>] ? schedule_delayed_work_on+0x16/0x20
       [<ffffffff8137ee8f>] acpi_cpu_soft_notify+0x90/0xca
       [<ffffffff8166023d>] notifier_call_chain+0x4d/0x70
       [<ffffffff810bc369>] __raw_notifier_call_chain+0x9/0x10
       [<ffffffff81094a4b>] __cpu_notify+0x1b/0x30
       [<ffffffff81652cf7>] _cpu_up+0x103/0x14b
       [<ffffffff81652e18>] cpu_up+0xd9/0xec
       [<ffffffff8164a254>] store_online+0x94/0xd0
       [<ffffffff814122fb>] dev_attr_store+0x1b/0x20
       [<ffffffff81216404>] sysfs_write_file+0xf4/0x170
      
      This patch fixes it.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      8d535aa1
    • Konrad Rzeszutek Wilk's avatar
      intel_idle: Don't register CPU notifier if we are not running. · 24d64ff7
      Konrad Rzeszutek Wilk authored
      commit 6f8c2e79 upstream.
      
      The 'intel_idle_probe' probes the CPU and sets the CPU notifier.
      But if later on during the module initialization we fail (say
      in cpuidle_register_driver), we stop loading, but we neglect
      to unregister the CPU notifier.  This means that during CPU
      hotplug events the system will fail:
      
      calling  intel_idle_init+0x0/0x326 @ 1
      intel_idle: MWAIT substates: 0x1120
      intel_idle: v0.4 model 0x2A
      intel_idle: lapic_timer_reliable_states 0xffffffff
      intel_idle: intel_idle yielding to none
      initcall intel_idle_init+0x0/0x326 returned -19 after 14 usecs
      
      ... some time later, offlining and onlining a CPU:
      
      cpu 3 spinlock event irq 62
      BUG: unable to ] __cpuidle_register_device+0x1c/0x120
      PGD 99b8b067 PUD 99b95067 PMD 0
      Oops: 0000 [#1] SMP
      Modules linked in: xen_evtchn nouveau mxm_wmi wmi radeon ttm i915 fbcon tileblit font atl1c bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf
      CPU 0
      Pid: 2302, comm: udevd Not tainted 3.8.0-rc3upstream-00249-g09ad159 #1 MSI MS-7680/H61M-P23 (MS-7680)
      RIP: e030:[<ffffffff814d956c>]  [<ffffffff814d956c>] __cpuidle_register_device+0x1c/0x120
      RSP: e02b:ffff88009dacfcb8  EFLAGS: 00010286
      RAX: 0000000000000000 RBX: ffff880105380000 RCX: 000000000000001c
      RDX: 0000000000000000 RSI: 0000000000000055 RDI: ffff880105380000
      RBP: ffff88009dacfce8 R08: ffffffff81a4f048 R09: 0000000000000008
      R10: 0000000000000008 R11: 0000000000000000 R12: ffff880105380000
      R13: 00000000ffffffdd R14: 0000000000000000 R15: ffffffff81a523d0
      FS:  00007f37bd83b7a0(0000) GS:ffff880105200000(0000) knlGS:0000000000000000
      CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000008 CR3: 00000000a09ea000 CR4: 0000000000042660
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process udevd (pid: 2302, threadinfo ffff88009dace000, task ffff88009afb47f0)
      Stack:
       ffffffff8107f2d0 ffffffff810c2fb7 ffff88009dacfce8 00000000ffffffea
       ffff880105380000 00000000ffffffdd ffff88009dacfd08 ffffffff814d9882
       0000000000000003 ffff880105380000 ffff88009dacfd28 ffffffff81340afd
      Call Trace:
       [<ffffffff8107f2d0>] ? collect_cpu_info_local+0x30/0x30
       [<ffffffff810c2fb7>] ? __might_sleep+0xe7/0x100
       [<ffffffff814d9882>] cpuidle_register_device+0x32/0x70
       [<ffffffff81340afd>] intel_idle_cpu_init+0xad/0x110
       [<ffffffff81340bc8>] cpu_hotplug_notify+0x68/0x80
       [<ffffffff8166023d>] notifier_call_chain+0x4d/0x70
       [<ffffffff810bc369>] __raw_notifier_call_chain+0x9/0x10
       [<ffffffff81094a4b>] __cpu_notify+0x1b/0x30
       [<ffffffff81652cf7>] _cpu_up+0x103/0x14b
       [<ffffffff81652e18>] cpu_up+0xd9/0xec
       [<ffffffff8164a254>] store_online+0x94/0xd0
       [<ffffffff814122fb>] dev_attr_store+0x1b/0x20
       [<ffffffff81216404>] sysfs_write_file+0xf4/0x170
       [<ffffffff811a1024>] vfs_write+0xb4/0x130
       [<ffffffff811a17ea>] sys_write+0x5a/0xa0
       [<ffffffff816643a9>] system_call_fastpath+0x16/0x1b
      Code: 03 18 00 c9 c3 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 48 83 ec 30 48 89 5d e8 4c 89 65 f0 48 89 fb 4c 89 6d f8 e8 84 08 00 00 <48> 8b 78 08 49 89 c4 e8 f8 7f c1 ff 89 c2 b8 ea ff ff ff 84 d2
      RIP  [<ffffffff814d956c>] __cpuidle_register_device+0x1c/0x120
       RSP <ffff88009dacfcb8>
      
      This patch fixes that by moving the CPU notifier registration
      as the last item to be done by the module.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      [bwh: Backported to 3.2: notifier is registered only if we do not have ARAT]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      24d64ff7
    • Pratyush Anand's avatar
      usb: dwc3: gadget: fix ep->maxburst for ep0 · 997bc14d
      Pratyush Anand authored
      commit 6048e4c6 upstream.
      
      dwc3_gadget_set_ep_config expects maxburst as incremented by 1. So, by
      default initialize ep->maxburst to 1 for ep0.
      Signed-off-by: default avatarPratyush Anand <pratyush.anand@st.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      997bc14d
    • Wolfgang Frisch's avatar
      USB: io_ti: Fix NULL dereference in chase_port() · 7b499272
      Wolfgang Frisch authored
      commit 1ee0a224 upstream.
      
      The tty is NULL when the port is hanging up.
      chase_port() needs to check for this.
      
      This patch is intended for stable series.
      The behavior was observed and tested in Linux 3.2 and 3.7.1.
      
      Johan Hovold submitted a more elaborate patch for the mainline kernel.
      
      [   56.277883] usb 1-1: edge_bulk_in_callback - nonzero read bulk status received: -84
      [   56.278811] usb 1-1: USB disconnect, device number 3
      [   56.278856] usb 1-1: edge_bulk_in_callback - stopping read!
      [   56.279562] BUG: unable to handle kernel NULL pointer dereference at 00000000000001c8
      [   56.280536] IP: [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.281212] PGD 1dc1b067 PUD 1e0f7067 PMD 0
      [   56.282085] Oops: 0002 [#1] SMP
      [   56.282744] Modules linked in:
      [   56.283512] CPU 1
      [   56.283512] Pid: 25, comm: khubd Not tainted 3.7.1 #1 innotek GmbH VirtualBox/VirtualBox
      [   56.283512] RIP: 0010:[<ffffffff8144e62a>]  [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.283512] RSP: 0018:ffff88001fa99ab0  EFLAGS: 00010046
      [   56.283512] RAX: 0000000000000046 RBX: 00000000000001c8 RCX: 0000000000640064
      [   56.283512] RDX: 0000000000010000 RSI: ffff88001fa99b20 RDI: 00000000000001c8
      [   56.283512] RBP: ffff88001fa99b20 R08: 0000000000000000 R09: 0000000000000000
      [   56.283512] R10: 0000000000000000 R11: ffffffff812fcb4c R12: ffff88001ddf53c0
      [   56.283512] R13: 0000000000000000 R14: 00000000000001c8 R15: ffff88001e19b9f4
      [   56.283512] FS:  0000000000000000(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000
      [   56.283512] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      [   56.283512] CR2: 00000000000001c8 CR3: 000000001dc51000 CR4: 00000000000006e0
      [   56.283512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   56.283512] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [   56.283512] Process khubd (pid: 25, threadinfo ffff88001fa98000, task ffff88001fa94f80)
      [   56.283512] Stack:
      [   56.283512]  0000000000000046 00000000000001c8 ffffffff810578ec ffffffff812fcb4c
      [   56.283512]  ffff88001e19b980 0000000000002710 ffffffff812ffe81 0000000000000001
      [   56.283512]  ffff88001fa94f80 0000000000000202 ffffffff00000001 0000000000000296
      [   56.283512] Call Trace:
      [   56.283512]  [<ffffffff810578ec>] ? add_wait_queue+0x12/0x3c
      [   56.283512]  [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
      [   56.283512]  [<ffffffff812ffe81>] ? chase_port+0x84/0x2d6
      [   56.283512]  [<ffffffff81063f27>] ? try_to_wake_up+0x199/0x199
      [   56.283512]  [<ffffffff81263a5c>] ? tty_ldisc_hangup+0x222/0x298
      [   56.283512]  [<ffffffff81300171>] ? edge_close+0x64/0x129
      [   56.283512]  [<ffffffff810612f7>] ? __wake_up+0x35/0x46
      [   56.283512]  [<ffffffff8106135b>] ? should_resched+0x5/0x23
      [   56.283512]  [<ffffffff81264916>] ? tty_port_shutdown+0x39/0x44
      [   56.283512]  [<ffffffff812fcb4c>] ? usb_serial_port_work+0x28/0x28
      [   56.283512]  [<ffffffff8125d38c>] ? __tty_hangup+0x307/0x351
      [   56.283512]  [<ffffffff812e6ddc>] ? usb_hcd_flush_endpoint+0xde/0xed
      [   56.283512]  [<ffffffff8144e625>] ? _raw_spin_lock_irqsave+0x14/0x35
      [   56.283512]  [<ffffffff812fd361>] ? usb_serial_disconnect+0x57/0xc2
      [   56.283512]  [<ffffffff812ea99b>] ? usb_unbind_interface+0x5c/0x131
      [   56.283512]  [<ffffffff8128d738>] ? __device_release_driver+0x7f/0xd5
      [   56.283512]  [<ffffffff8128d9cd>] ? device_release_driver+0x1a/0x25
      [   56.283512]  [<ffffffff8128d393>] ? bus_remove_device+0xd2/0xe7
      [   56.283512]  [<ffffffff8128b7a3>] ? device_del+0x119/0x167
      [   56.283512]  [<ffffffff812e8d9d>] ? usb_disable_device+0x6a/0x180
      [   56.283512]  [<ffffffff812e2ae0>] ? usb_disconnect+0x81/0xe6
      [   56.283512]  [<ffffffff812e4435>] ? hub_thread+0x577/0xe82
      [   56.283512]  [<ffffffff8144daa7>] ? __schedule+0x490/0x4be
      [   56.283512]  [<ffffffff8105798f>] ? abort_exclusive_wait+0x79/0x79
      [   56.283512]  [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
      [   56.283512]  [<ffffffff812e3ebe>] ? usb_remote_wakeup+0x2f/0x2f
      [   56.283512]  [<ffffffff810570b4>] ? kthread+0x81/0x89
      [   56.283512]  [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
      [   56.283512]  [<ffffffff8145387c>] ? ret_from_fork+0x7c/0xb0
      [   56.283512]  [<ffffffff81057033>] ? __kthread_parkme+0x5c/0x5c
      [   56.283512] Code: 8b 7c 24 08 e8 17 0b c3 ff 48 8b 04 24 48 83 c4 10 c3 53 48 89 fb 41 50 e8 e0 0a c3 ff 48 89 04 24 e8 e7 0a c3 ff ba 00 00 01 00
      <f0> 0f c1 13 48 8b 04 24 89 d1 c1 ea 10 66 39 d1 74 07 f3 90 66
      [   56.283512] RIP  [<ffffffff8144e62a>] _raw_spin_lock_irqsave+0x19/0x35
      [   56.283512]  RSP <ffff88001fa99ab0>
      [   56.283512] CR2: 00000000000001c8
      [   56.283512] ---[ end trace 49714df27e1679ce ]---
      Signed-off-by: default avatarWolfgang Frisch <wfpub@roembden.net>
      Cc: Johan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      7b499272
    • Bjørn Mork's avatar
      USB: option: add TP-LINK HSUPA Modem MA180 · 157bb66c
      Bjørn Mork authored
      commit 99beb2e9 upstream.
      
      The driver description files gives these names to the vendor specific
      functions on this modem:
      
       Diagnostics VID_2357&PID_0201&MI_00
       NMEA        VID_2357&PID_0201&MI_01
       Modem       VID_2357&PID_0201&MI_03
       Networkcard VID_2357&PID_0201&MI_04
      Reported-by: default avatarThomas Schäfer <tschaefer@t-online.de>
      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>
      157bb66c
    • Bjørn Mork's avatar
      USB: option: blacklist network interface on ONDA MT8205 4G LTE · 36a2828e
      Bjørn Mork authored
      commit 2291dff0 upstream.
      
      The driver description files gives these names to the vendor specific
      functions on this modem:
      
       Diag   VID_19D2&PID_0265&MI_00
       NMEA   VID_19D2&PID_0265&MI_01
       AT cmd VID_19D2&PID_0265&MI_02
       Modem  VID_19D2&PID_0265&MI_03
       Net    VID_19D2&PID_0265&MI_04
      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>
      36a2828e
    • Alexander Graf's avatar
      KVM: PPC: Emulate dcbf · 1a14c25a
      Alexander Graf authored
      commit d3286144 upstream.
      
      Guests can trigger MMIO exits using dcbf. Since we don't emulate cache
      incoherent MMIO, just do nothing and move on.
      Reported-by: default avatarBen Collins <ben.c@servergy.com>
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      Tested-by: default avatarBen Collins <ben.c@servergy.com>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      1a14c25a
    • Stephen Hurd's avatar
      8250/16?50: Add support for Broadcom TruManage redirected serial port · 6521d673
      Stephen Hurd authored
      commit ebebd49a upstream.
      
      Add support for the UART device present in Broadcom TruManage capable
      NetXtreme chips (ie: 5761m 5762, and 5725).
      
      This implementation has a hidden transmit FIFO, so running in single-byte
      interrupt mode results in too many interrupts.  The UART_CAP_HFIFO
      capability was added to track this.  It continues to reload the THR as long
      as the THRE and TSRE bits are set in the LSR up to a specified limit (1024
      is used here).
      Signed-off-by: default avatarStephen Hurd <shurd@broadcom.com>
      Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2:
       - Adjust filenames
       - Adjust context
       - First available port type number is 22 not 24
       - s/uart_8250_port/uart_port/
       - Use serial_in() not serial_port_in()]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      6521d673
    • Ben Hutchings's avatar
      staging: vt6656: Fix inconsistent structure packing · 01b7106d
      Ben Hutchings authored
      commit 1ee4c55f upstream.
      
      vt6656 has several headers that use the #pragma pack(1) directive to
      enable structure packing, but never disable it.  The layout of
      structures defined in other headers can then depend on which order the
      various headers are included in, breaking the One Definition Rule.
      
      In practice this resulted in crashes on x86_64 until the order of header
      inclusion was changed for some files in commit 11d404cb ('staging:
      vt6656: fix headers and add cfg80211.').  But we need a proper fix that
      won't be affected by future changes to the order of inclusion.
      
      This removes the #pragma pack(1) directives and adds __packed to the
      structure definitions for which packing appears to have been intended.
      Reported-and-tested-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2]
      01b7106d
    • Andrew Cooper's avatar
      xen: Fix stack corruption in xen_failsafe_callback for 32bit PVOPS guests. · 5c0ce9fe
      Andrew Cooper authored
      commit 9174adbe upstream.
      
      This fixes CVE-2013-0190 / XSA-40
      
      There has been an error on the xen_failsafe_callback path for failed
      iret, which causes the stack pointer to be wrong when entering the
      iret_exc error path.  This can result in the kernel crashing.
      
      In the classic kernel case, the relevant code looked a little like:
      
              popl %eax      # Error code from hypervisor
              jz 5f
              addl $16,%esp
              jmp iret_exc   # Hypervisor said iret fault
      5:      addl $16,%esp
                             # Hypervisor said segment selector fault
      
      Here, there are two identical addls on either option of a branch which
      appears to have been optimised by hoisting it above the jz, and
      converting it to an lea, which leaves the flags register unaffected.
      
      In the PVOPS case, the code looks like:
      
              popl_cfi %eax         # Error from the hypervisor
              lea 16(%esp),%esp     # Add $16 before choosing fault path
              CFI_ADJUST_CFA_OFFSET -16
              jz 5f
              addl $16,%esp         # Incorrectly adjust %esp again
              jmp iret_exc
      
      It is possible unprivileged userspace applications to cause this
      behaviour, for example by loading an LDT code selector, then changing
      the code selector to be not-present.  At this point, there is a race
      condition where it is possible for the hypervisor to return back to
      userspace from an interrupt, fault on its own iret, and inject a
      failsafe_callback into the kernel.
      
      This bug has been present since the introduction of Xen PVOPS support
      in commit 5ead97c8 (xen: Core Xen implementation), in 2.6.23.
      Signed-off-by: default avatarFrediano Ziglio <frediano.ziglio@citrix.com>
      Signed-off-by: default avatarAndrew Cooper <andrew.cooper3@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      5c0ce9fe
    • Nicolas Pitre's avatar
      ARM: 7628/1: head.S: map one extra section for the ATAG/DTB area · 3bba3a68
      Nicolas Pitre authored
      commit 6f16f499 upstream.
      
      We currently use a temporary 1MB section aligned to a 1MB boundary for
      mapping the provided device tree until the final page table is created.
      However, if the device tree happens to cross that 1MB boundary, the end
      of it remains unmapped and the kernel crashes when it attempts to access
      it.  Given no restriction on the location of that DTB, it could end up
      with only a few bytes mapped at the end of a section.
      
      Solve this issue by mapping two consecutive sections.
      Signed-off-by: default avatarNicolas Pitre <nico@linaro.org>
      Tested-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Tested-by: default avatarTomasz Figa <t.figa@samsung.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      [bwh: Backported to 3.2:
       - Adjust context
       - The mapping is not conditional; drop the 'ne' suffixes]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      3bba3a68
    • Stephen Boyd's avatar
      ARM: 7627/1: Predicate preempt logic on PREEMP_COUNT not PREEMPT alone · 04bab8d5
      Stephen Boyd authored
      commit 568dca15 upstream.
      
      Patrik Kluba reports that the preempt count becomes invalid due
      to the preempt_enable() call being unbalanced with a
      preempt_disable() call in the vfp assembly routines. This happens
      because preempt_enable() and preempt_disable() update preempt
      counts under PREEMPT_COUNT=y but the vfp assembly routines do so
      under PREEMPT=y. In a configuration where PREEMPT=n and
      DEBUG_ATOMIC_SLEEP=y, PREEMPT_COUNT=y and so the preempt_enable()
      call in VFP_bounce() keeps subtracting from the preempt count
      until it goes negative.
      
      Fix this by always using PREEMPT_COUNT to decided when to update
      preempt counts in the ARM assembly code.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Reported-by: default avatarPatrik Kluba <pkluba@dension.com>
      Tested-by: default avatarPatrik Kluba <pkluba@dension.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      04bab8d5
    • Heiko Carstens's avatar
      s390/time: fix sched_clock() overflow · 26d5d5d0
      Heiko Carstens authored
      commit ed4f2094 upstream.
      
      Converting a 64 Bit TOD format value to nanoseconds means that the value
      must be divided by 4.096. In order to achieve that we multiply with 125
      and divide by 512.
      When used within sched_clock() this triggers an overflow after appr.
      417 days. Resulting in a sched_clock() return value that is much smaller
      than previously and therefore may cause all sort of weird things in
      subsystems that rely on a monotonic sched_clock() behaviour.
      
      To fix this implement a tod_to_ns() helper function which converts TOD
      values without overflow and call this function from both places that
      open coded the conversion: sched_clock() and kvm_s390_handle_wait().
      Reviewed-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      26d5d5d0
    • Chris Wilson's avatar
      drm/i915: Invalidate the relocation presumed_offsets along the slow path · 2c27f1d9
      Chris Wilson authored
      commit 262b6d36 upstream.
      
      In the slow path, we are forced to copy the relocations prior to
      acquiring the struct mutex in order to handle pagefaults. We forgo
      copying the new offsets back into the relocation entries in order to
      prevent a recursive locking bug should we trigger a pagefault whilst
      holding the mutex for the reservations of the execbuffer. Therefore, we
      need to reset the presumed_offsets just in case the objects are rebound
      back into their old locations after relocating for this exexbuffer - if
      that were to happen we would assume the relocations were valid and leave
      the actual pointers to the kernels dangling, instant hang.
      
      Fixes regression from commit bcf50e27
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Sun Nov 21 22:07:12 2010 +0000
      
          drm/i915: Handle pagefaults in execbuffer user relocations
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55984Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@fwll.ch>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      2c27f1d9
    • Maxime Ripard's avatar
      tty: 8250_dw: Fix inverted arguments to serial_out in IRQ handler · d0c5edd1
      Maxime Ripard authored
      commit 68e56cb3 upstream.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: adjust filename]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      d0c5edd1
    • chao bi's avatar
      serial:ifx6x60:Delete SPI timer when shut down port · 4078a79b
      chao bi authored
      commit 014b9b4c upstream.
      
      When shut down SPI port, it's possible that MRDY has been asserted and a SPI
      timer was activated waiting for SRDY assert, in the case, it needs to delete
      this timer.
      Signed-off-by: default avatarChen Jun <jun.d.chen@intel.com>
      Signed-off-by: default avatarchanning <chao.bi@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      4078a79b
    • Colin Ian King's avatar
      PCI: Allow pcie_aspm=force even when FADT indicates it is unsupported · bd6e8b8c
      Colin Ian King authored
      commit 9e167214 upstream.
      
      Right now using pcie_aspm=force will not enable ASPM if the FADT indicates
      ASPM is unsupported.  However, the semantics of force should probably allow
      for this, especially as they did before 3c076351 ("PCI: Rework ASPM
      disable code")
      
      This patch just skips the clearing of any ASPM setup that the firmware has
      carried out on this bus if pcie_aspm=force is being used.
      
      Reference: http://bugs.launchpad.net/bugs/962038Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      bd6e8b8c
    • Bjorn Helgaas's avatar
      PCI: shpchp: Use per-slot workqueues to avoid deadlock · 0d36c06a
      Bjorn Helgaas authored
      commit f652e7d2 upstream.
      
      When we have an SHPC-capable bridge with a second SHPC-capable bridge
      below it, pushing the upstream bridge's attention button causes a
      deadlock.
      
      The deadlock happens because we use the shpchp_wq workqueue to run
      shpchp_pushbutton_thread(), which uses shpchp_disable_slot() to remove
      devices below the upstream bridge.  When we remove the downstream bridge,
      we call shpc_remove(), the shpchp driver's .remove() method.  That calls
      flush_workqueue(shpchp_wq), which deadlocks because the
      shpchp_pushbutton_thread() work item is still running.
      
      This patch avoids the deadlock by creating a workqueue for every slot
      and removing the single shared workqueue.
      
      Here's the call path that leads to the deadlock:
      
        shpchp_queue_pushbutton_work
          queue_work(shpchp_wq)		# shpchp_pushbutton_thread
          ...
      
        shpchp_pushbutton_thread
          shpchp_disable_slot
            remove_board
              shpchp_unconfigure_device
                pci_stop_and_remove_bus_device
                  ...
                    shpc_remove		# shpchp driver .remove method
                      hpc_release_ctlr
                        cleanup_slots
                          flush_workqueue(shpchp_wq)
      
      This change is based on code inspection, since we don't have hardware
      with this topology.
      Based-on-patch-by: default avatarYijing Wang <wangyijing@huawei.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0d36c06a
    • Bjorn Helgaas's avatar
      PCI: shpchp: Handle push button event asynchronously · 0809b51b
      Bjorn Helgaas authored
      commit d347e758 upstream.
      
      Use non-ordered workqueue for attention button events.
      
      Attention button events on each slot can be handled asynchronously. So
      we should use non-ordered workqueue. This patch also removes ordered
      workqueue in shpchp as a result.
      
      486b10b9 ("PCI: pciehp: Handle push button event asynchronously") made
      the same change to pciehp.  I split this out from a patch by Yijing Wang
      <wangyijing@huawei.com> so we fix one thing at a time and to make the
      shpchp history correspond more closely with the pciehp history.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      CC: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0809b51b
    • Betty Dall's avatar
      PCI/AER: pci_get_domain_bus_and_slot() call missing required pci_dev_put() · c4dca157
      Betty Dall authored
      commit a82b6af3 upstream.
      
      The function aer_recover_queue() calls pci_get_domain_bus_and_slot(), which
      requires that the caller decrement the reference count with pci_dev_put().
      This patch adds the missing call to pci_dev_put().
      Signed-off-by: default avatarBetty Dall <betty.dall@hp.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarShuah Khan <shuah.khan@hp.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      c4dca157
    • Tomasz Mloduchowski's avatar
      usb: ftdi_sio: Crucible Technologies COMET Caller ID - pid added · bc20c871
      Tomasz Mloduchowski authored
      commit 8cf65dc3 upstream.
      
      Simple fix to add support for Crucible Technologies COMET Caller ID
      USB decoder - a device containing FTDI USB/Serial converter chip,
      handling 1200bps CallerID messages decoded from the phone line -
      adding correct USB PID is sufficient.
      
      Tested to apply cleanly and work flawlessly against 3.6.9, 3.7.0-rc8
      and 3.8.0-rc3 on both amd64 and x86 arches.
      Signed-off-by: default avatarTomasz Mloduchowski <q@qdot.me>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      bc20c871
    • Yijing Wang's avatar
      PCI: pciehp: Use per-slot workqueues to avoid deadlock · eda0e8f5
      Yijing Wang authored
      commit c2be6f93 upstream.
      
      When we have a hotplug-capable PCIe port with a second hotplug-capable
      PCIe port below it, removing the device below the upstream port causes
      a deadlock.
      
      The deadlock happens because we use the pciehp_wq workqueue to run
      pciehp_power_thread(), which uses pciehp_disable_slot() to remove devices
      below the upstream port.  When we remove the downstream PCIe port, we call
      pciehp_remove(), the pciehp driver's .remove() method.  That calls
      flush_workqueue(pciehp_wq), which deadlocks because the
      pciehp_power_thread() work item is still running.
      
      This patch avoids the deadlock by creating a workqueue for every PCIe port
      and removing the single shared workqueue.
      
      Here's the call path that leads to the deadlock:
      
        pciehp_queue_pushbutton_work
          queue_work(pciehp_wq)                   # queue pciehp_power_thread
          ...
      
        pciehp_power_thread
          pciehp_disable_slot
            remove_board
      	pciehp_unconfigure_device
      	  pci_stop_and_remove_bus_device
      	    ...
      	      pciehp_remove                 # pciehp driver .remove method
      		pciehp_release_ctrl
      		  pcie_cleanup_slot
      		    flush_workqueue(pciehp_wq)
      
      This is fairly urgent because it can be caused by simply unplugging a
      Thunderbolt adapter, as reported by Daniel below.
      
      [bhelgaas: changelog]
      Reference: http://lkml.kernel.org/r/CAMVG2ssiRgcTD1bej2tkUUfsWmpL5eNtPcNif9va2-Gzb2u8nQ@mail.gmail.comReported-and-tested-by: default avatarDaniel J Blueman <daniel@quora.org>
      Reviewed-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: default avatarYijing Wang <wangyijing@huawei.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      eda0e8f5
    • Kenji Kaneshige's avatar
      PCI: pciehp: Handle push button event asynchronously · 83d03443
      Kenji Kaneshige authored
      commit 486b10b9 upstream.
      
      Use non-ordered workqueue for attention button events.
      
      Attention button events on each slot can be handled asynchronously. So
      we should use non-ordered workqueue. This patch also removes ordered
      workqueue in pciehp as a result.
      Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      83d03443