1. 26 Nov, 2011 38 commits
    • Havard Skinnemoen's avatar
      USB: cdc-acm: Fix disconnect() vs close() race · 195f0cd9
      Havard Skinnemoen authored
      commit 5dc2470c upstream.
      
      There's a race between the USB disconnect handler and the TTY close
      handler which may cause the acm object to be freed while it's still
      being used. This may lead to things like
      
      http://article.gmane.org/gmane.linux.usb.general/54250
      
      and
      
      https://lkml.org/lkml/2011/5/29/64
      
      This is the simplest fix I could come up with. Holding on to open_mutex
      while closing the TTY device prevents acm_disconnect() from freeing the
      acm object between acm->port.count drops to 0 and the TTY side of the
      cleanups are finalized.
      Signed-off-by: default avatarHavard Skinnemoen <hskinnemoen@google.com>
      Cc: Oliver Neukum <oliver@neukum.name>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      195f0cd9
    • Tomoya MORINAGA's avatar
      USB: pch_udc: Support new device LAPIS Semiconductor ML7831 IOH · c5d412bf
      Tomoya MORINAGA authored
      commit 731ad81e upstream.
      
      ML7831 is companion chip for Intel Atom E6xx series.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c5d412bf
    • wangyanqing's avatar
      USB: serial: pl2303: rm duplicate id · a0d5bdc5
      wangyanqing authored
      commit 0c165955 upstream.
      
      I get report from customer that his usb-serial
      converter doesn't work well,it sometimes work,
      but sometimes it doesn't.
      
      The usb-serial converter's id:
      vendor_id product_id
      0x4348    0x5523
      
      Then I search the usb-serial codes, and there are
      two drivers announce support this device, pl2303
      and ch341, commit 026dfaf1 cause it. Through many
      times to test, ch341 works well with this device,
      and pl2303 doesn't work quite often(it just work quite little).
      
      ch341 works well with this device, so we doesn't
      need pl2303 to support.I try to revert 026dfaf1 first,
      but it failed. So I prepare this patch by hand to revert it.
      Signed-off-by: default avatarWang YanQing <Udknight@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a0d5bdc5
    • Ferenc Wagner's avatar
      USB: option: add PID of Huawei E173s 3G modem · 6954d95f
      Ferenc Wagner authored
      commit 4aa3648c upstream.
      Signed-off-by: default avatarFerenc Wagner <wferi@niif.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6954d95f
    • zheng.zhijian@zte.com.cn's avatar
      USB: option: release new PID for ZTE 3G modem · 8cf4a733
      zheng.zhijian@zte.com.cn authored
      commit 46b5a277 upstream.
      
      This patch adds new PIDs for ZTE 3G modem, after we confirm it and tested.
      Thanks for Dan's work at kernel option devier.
      Signed-off-by: default avatarAlvin.Zheng <zheng.zhijian@zte.com.cn>
      Signed-off-by: default avatarwsalvin <wsalvin@yahoo.com.cn>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8cf4a733
    • Alan Stern's avatar
      USB: XHCI: resume root hubs when the controller resumes · 78c5cd61
      Alan Stern authored
      commit f69e3120 upstream.
      
      This patch (as1494) fixes a problem in xhci-hcd's resume routine.
      When the controller is runtime-resumed, this can only mean that one of
      the two root hubs has made a wakeup request and therefore needs to be
      resumed as well.  Rather than try to determine which root hub requires
      attention (which might be difficult in the case where a new
      non-SuperSpeed device has been plugged in), the patch simply resumes
      both root hubs.
      
      Without this change, there is a race: The controller might be put back
      to sleep before it can activate its IRQ line, and the wakeup condition
      might never get handled.
      
      The patch also simplifies the logic in xhci_resume a little, combining
      some repeated flag settings into a single pair of statements.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      78c5cd61
    • Don Zickus's avatar
      usb, xhci: fix lockdep warning on endpoint timeout · 6b17329b
      Don Zickus authored
      commit f43d6231 upstream.
      
      While debugging a usb3 problem, I stumbled upon this lockdep warning.
      
      Oct 18 21:41:17 dhcp47-74 kernel: =================================
      Oct 18 21:41:17 dhcp47-74 kernel: [ INFO: inconsistent lock state ]
      Oct 18 21:41:17 dhcp47-74 kernel: 3.1.0-rc4nmi+ #456
      Oct 18 21:41:17 dhcp47-74 kernel: ---------------------------------
      Oct 18 21:41:17 dhcp47-74 kernel: inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
      Oct 18 21:41:17 dhcp47-74 kernel: swapper/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
      Oct 18 21:41:17 dhcp47-74 kernel: (&(&xhci->lock)->rlock){?.-...}, at: [<ffffffffa0228990>] xhci_stop_endpoint_command_watchdog+0x30/0x340 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel: {IN-HARDIRQ-W} state was registered at:
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8109a941>] __lock_acquire+0x781/0x1660
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8109bed7>] lock_acquire+0x97/0x170
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff81501b46>] _raw_spin_lock+0x46/0x80
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffffa02299fa>] xhci_irq+0x3a/0x1960 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffffa022b351>] xhci_msi_irq+0x31/0x40 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff810d2305>] handle_irq_event_percpu+0x85/0x320
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff810d25e8>] handle_irq_event+0x48/0x70
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff810d537d>] handle_edge_irq+0x6d/0x130
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff810048c9>] handle_irq+0x49/0xa0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8150d56d>] do_IRQ+0x5d/0xe0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff815029b0>] ret_from_intr+0x0/0x13
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff81388aca>] usb_set_device_state+0x8a/0x180
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8138f038>] usb_add_hcd+0x2b8/0x730
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffffa022ed7e>] xhci_pci_probe+0x9e/0xd4 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8127915f>] local_pci_probe+0x5f/0xd0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8127a569>] pci_device_probe+0x119/0x120
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff81334473>] driver_probe_device+0xa3/0x2c0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8133473b>] __driver_attach+0xab/0xb0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8133373c>] bus_for_each_dev+0x6c/0xa0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff813341fe>] driver_attach+0x1e/0x20
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff81333b88>] bus_add_driver+0x1f8/0x2b0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff81334df6>] driver_register+0x76/0x140
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8127a7c6>] __pci_register_driver+0x66/0xe0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffffa013c04a>] snd_timer_find+0x4a/0x70 [snd_timer]
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffffa013c00e>] snd_timer_find+0xe/0x70 [snd_timer]
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff810001d3>] do_one_initcall+0x43/0x180
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff810a9ed2>] sys_init_module+0x92/0x1f0
      Oct 18 21:41:17 dhcp47-74 kernel:  [<ffffffff8150ab6b>] system_call_fastpath+0x16/0x1b
      Oct 18 21:41:17 dhcp47-74 kernel: irq event stamp: 631984
      Oct 18 21:41:17 dhcp47-74 kernel: hardirqs last  enabled at (631984): [<ffffffff81502720>] _raw_spin_unlock_irq+0x30/0x50
      Oct 18 21:41:17 dhcp47-74 kernel: hardirqs last disabled at (631983): [<ffffffff81501c49>] _raw_spin_lock_irq+0x19/0x90
      Oct 18 21:41:17 dhcp47-74 kernel: softirqs last  enabled at (631980): [<ffffffff8105ff63>] _local_bh_enable+0x13/0x20
      Oct 18 21:41:17 dhcp47-74 kernel: softirqs last disabled at (631981): [<ffffffff8150ce6c>] call_softirq+0x1c/0x30
      Oct 18 21:41:17 dhcp47-74 kernel:
      Oct 18 21:41:17 dhcp47-74 kernel: other info that might help us debug this:
      Oct 18 21:41:17 dhcp47-74 kernel: Possible unsafe locking scenario:
      Oct 18 21:41:17 dhcp47-74 kernel:
      Oct 18 21:41:17 dhcp47-74 kernel:       CPU0
      Oct 18 21:41:17 dhcp47-74 kernel:       ----
      Oct 18 21:41:17 dhcp47-74 kernel:  lock(&(&xhci->lock)->rlock);
      Oct 18 21:41:17 dhcp47-74 kernel:  <Interrupt>
      Oct 18 21:41:17 dhcp47-74 kernel:    lock(&(&xhci->lock)->rlock);
      Oct 18 21:41:17 dhcp47-74 kernel:
      Oct 18 21:41:17 dhcp47-74 kernel: *** DEADLOCK ***
      Oct 18 21:41:17 dhcp47-74 kernel:
      Oct 18 21:41:17 dhcp47-74 kernel: 1 lock held by swapper/0:
      Oct 18 21:41:17 dhcp47-74 kernel: #0:  (&ep->stop_cmd_timer){+.-...}, at: [<ffffffff8106abf2>] run_timer_softirq+0x162/0x570
      Oct 18 21:41:17 dhcp47-74 kernel:
      Oct 18 21:41:17 dhcp47-74 kernel: stack backtrace:
      Oct 18 21:41:17 dhcp47-74 kernel: Pid: 0, comm: swapper Tainted: G        W   3.1.0-rc4nmi+ #456
      Oct 18 21:41:17 dhcp47-74 kernel: Call Trace:
      Oct 18 21:41:17 dhcp47-74 kernel: <IRQ>  [<ffffffff81098ed7>] print_usage_bug+0x227/0x270
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff810999c6>] mark_lock+0x346/0x410
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8109a7de>] __lock_acquire+0x61e/0x1660
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81099893>] ? mark_lock+0x213/0x410
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8109bed7>] lock_acquire+0x97/0x170
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffffa0228990>] ? xhci_stop_endpoint_command_watchdog+0x30/0x340 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81501b46>] _raw_spin_lock+0x46/0x80
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffffa0228990>] ? xhci_stop_endpoint_command_watchdog+0x30/0x340 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffffa0228990>] xhci_stop_endpoint_command_watchdog+0x30/0x340 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8106abf2>] ? run_timer_softirq+0x162/0x570
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8106ac9d>] run_timer_softirq+0x20d/0x570
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8106abf2>] ? run_timer_softirq+0x162/0x570
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffffa0228960>] ? xhci_queue_isoc_tx_prepare+0x8e0/0x8e0 [xhci_hcd]
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff810604d2>] __do_softirq+0xf2/0x3f0
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81020edd>] ? lapic_next_event+0x1d/0x30
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81090d4e>] ? clockevents_program_event+0x5e/0x90
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8150ce6c>] call_softirq+0x1c/0x30
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8100484d>] do_softirq+0x8d/0xc0
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8105ff35>] irq_exit+0xe5/0x100
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8150d65e>] smp_apic_timer_interrupt+0x6e/0x99
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff8150b6f0>] apic_timer_interrupt+0x70/0x80
      Oct 18 21:41:17 dhcp47-74 kernel: <EOI>  [<ffffffff81095d8d>] ? trace_hardirqs_off+0xd/0x10
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff812ddb76>] ? acpi_idle_enter_bm+0x227/0x25b
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff812ddb71>] ? acpi_idle_enter_bm+0x222/0x25b
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff813eda63>] cpuidle_idle_call+0x103/0x290
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81002155>] cpu_idle+0xe5/0x160
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff814e7f50>] rest_init+0xe0/0xf0
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff814e7e70>] ? csum_partial_copy_generic+0x170/0x170
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81df8e23>] start_kernel+0x3fc/0x407
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81df8321>] x86_64_start_reservations+0x131/0x135
      Oct 18 21:41:17 dhcp47-74 kernel: [<ffffffff81df8412>] x86_64_start_kernel+0xed/0xf4
      Oct 18 21:41:17 dhcp47-74 kernel: xhci_hcd 0000:00:14.0: xHCI host not responding to stop endpoint command.
      Oct 18 21:41:17 dhcp47-74 kernel: xhci_hcd 0000:00:14.0: Assuming host is dying, halting host.
      Oct 18 21:41:17 dhcp47-74 kernel: xhci_hcd 0000:00:14.0: HC died; cleaning up
      Oct 18 21:41:17 dhcp47-74 kernel: usb 3-4: device descriptor read/8, error -110
      Oct 18 21:41:17 dhcp47-74 kernel: usb 3-4: device descriptor read/8, error -22
      Oct 18 21:41:17 dhcp47-74 kernel: hub 3-0:1.0: cannot disable port 4 (err = -19)
      
      Basically what is happening is in xhci_stop_endpoint_command_watchdog()
      the xhci->lock is grabbed with just spin_lock.  What lockdep deduces is
      that if an interrupt occurred while in this function it would deadlock
      with xhci_irq because that function also grabs the xhci->lock.
      
      Fixing it is trivial by using spin_lock_irqsave instead.
      
      This should be queued to stable kernels as far back as 2.6.33.
      Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6b17329b
    • Don Zickus's avatar
      usb, xhci: Clear warm reset change event during init · 88079a41
      Don Zickus authored
      commit 79c3dd81 upstream.
      
      I noticed on my Panther Point system that I wasn't getting hotplug events
      for my usb3.0 disk on a usb3 port.  I tracked it down to the fact that the
      system had the warm reset change bit still set.  This seemed to block future
      events from being received, including a hotplug event.
      
      Clearing this bit during initialization allowed the hotplug event to be
      received and the disk to be recognized correctly.
      
      This patch should be backported to kernels as old as 2.6.39.
      Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      88079a41
    • Sarah Sharp's avatar
      xhci: Set slot and ep0 flags for address command. · 4e2b6929
      Sarah Sharp authored
      commit d31c285b upstream.
      
      Matt's AsMedia xHCI host controller was responding with a Context Error
      to an address device command after a configured device reset.  Some
      sequence of events leads both the slot and endpoint zero add flags
      cleared to zero, which the AsMedia host doesn't like:
      
      [  223.701839] xhci_hcd 0000:03:00.0: Slot ID 1 Input Context:
      [  223.701841] xhci_hcd 0000:03:00.0: @ffff880137b25000 (virt) @ffffc000 (dma) 0x000000 - drop flags
      [  223.701843] xhci_hcd 0000:03:00.0: @ffff880137b25004 (virt) @ffffc004 (dma) 0x000000 - add flags
      [  223.701846] xhci_hcd 0000:03:00.0: @ffff880137b25008 (virt) @ffffc008 (dma) 0x000000 - rsvd2[0]
      [  223.701848] xhci_hcd 0000:03:00.0: @ffff880137b2500c (virt) @ffffc00c (dma) 0x000000 - rsvd2[1]
      [  223.701850] xhci_hcd 0000:03:00.0: @ffff880137b25010 (virt) @ffffc010 (dma) 0x000000 - rsvd2[2]
      [  223.701852] xhci_hcd 0000:03:00.0: @ffff880137b25014 (virt) @ffffc014 (dma) 0x000000 - rsvd2[3]
      [  223.701854] xhci_hcd 0000:03:00.0: @ffff880137b25018 (virt) @ffffc018 (dma) 0x000000 - rsvd2[4]
      [  223.701857] xhci_hcd 0000:03:00.0: @ffff880137b2501c (virt) @ffffc01c (dma) 0x000000 - rsvd2[5]
      [  223.701858] xhci_hcd 0000:03:00.0: Slot Context:
      [  223.701860] xhci_hcd 0000:03:00.0: @ffff880137b25020 (virt) @ffffc020 (dma) 0x8400000 - dev_info
      [  223.701862] xhci_hcd 0000:03:00.0: @ffff880137b25024 (virt) @ffffc024 (dma) 0x010000 - dev_info2
      [  223.701864] xhci_hcd 0000:03:00.0: @ffff880137b25028 (virt) @ffffc028 (dma) 0x000000 - tt_info
      [  223.701866] xhci_hcd 0000:03:00.0: @ffff880137b2502c (virt) @ffffc02c (dma) 0x000000 - dev_state
      [  223.701869] xhci_hcd 0000:03:00.0: @ffff880137b25030 (virt) @ffffc030 (dma) 0x000000 - rsvd[0]
      [  223.701871] xhci_hcd 0000:03:00.0: @ffff880137b25034 (virt) @ffffc034 (dma) 0x000000 - rsvd[1]
      [  223.701873] xhci_hcd 0000:03:00.0: @ffff880137b25038 (virt) @ffffc038 (dma) 0x000000 - rsvd[2]
      [  223.701875] xhci_hcd 0000:03:00.0: @ffff880137b2503c (virt) @ffffc03c (dma) 0x000000 - rsvd[3]
      [  223.701877] xhci_hcd 0000:03:00.0: Endpoint 00 Context:
      [  223.701879] xhci_hcd 0000:03:00.0: @ffff880137b25040 (virt) @ffffc040 (dma) 0x000000 - ep_info
      [  223.701881] xhci_hcd 0000:03:00.0: @ffff880137b25044 (virt) @ffffc044 (dma) 0x2000026 - ep_info2
      [  223.701883] xhci_hcd 0000:03:00.0: @ffff880137b25048 (virt) @ffffc048 (dma) 0xffffe8e0 - deq
      [  223.701885] xhci_hcd 0000:03:00.0: @ffff880137b25050 (virt) @ffffc050 (dma) 0x000000 - tx_info
      [  223.701887] xhci_hcd 0000:03:00.0: @ffff880137b25054 (virt) @ffffc054 (dma) 0x000000 - rsvd[0]
      [  223.701889] xhci_hcd 0000:03:00.0: @ffff880137b25058 (virt) @ffffc058 (dma) 0x000000 - rsvd[1]
      [  223.701892] xhci_hcd 0000:03:00.0: @ffff880137b2505c (virt) @ffffc05c (dma) 0x000000 - rsvd[2]
      ...
      [  223.701927] xhci_hcd 0000:03:00.0: // Ding dong!
      [  223.701992] xhci_hcd 0000:03:00.0: Setup ERROR: address device command for slot 1.
      
      The xHCI spec says that both flags must be set to one for the Address
      Device command.  When the device is first enumerated,
      xhci_setup_addressable_virt_dev() does set those flags.  However, when
      the device is addressed after it has been reset in the configured state,
      xhci_setup_addressable_virt_dev() is not called, and
      xhci_copy_ep0_dequeue_into_input_ctx() is called instead.  That function
      relies on the flags being set up by previous commands, which apparently
      isn't a good assumption.
      
      Move the setting of the flags into the common parent function.
      
      This should be queued for stable kernels as old as 2.6.35, since that
      was the first introduction of xhci_copy_ep0_dequeue_into_input_ctx.
      Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: default avatarMatt <mdm@iinet.net.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4e2b6929
    • Claudio Scordino's avatar
      drivers/base/node.c: fix compilation error with older versions of gcc · 5bccc0d0
      Claudio Scordino authored
      commit 91a13c28 upstream.
      
      Patch to fix the error message "directives may not be used inside a macro
      argument" which appears when the kernel is compiled for the cris architecture.
      Signed-off-by: default avatarClaudio Scordino <claudio@evidence.eu.com>
      Acked-by: default avatarDavid Rientjes <rientjes@google.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5bccc0d0
    • Axel Lin's avatar
      pcie-gadget-spear: Add "platform:" prefix for platform modalias · c528b724
      Axel Lin authored
      commit 161f1419 upstream.
      
      Since 43cc71ee (platform: prefix MODALIAS
      with "platform:"), the platform modalias is prefixed with "platform:".
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Acked-by: default avatarPratyush Anand <pratyush.anand@st.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c528b724
    • Wu Fengguang's avatar
      ALSA: hda - fix ELD memory leak · 46e18b7f
      Wu Fengguang authored
      Backported from commit b95d68b8.
      
      memset(eld) clears eld->proc_entry which will leak the struct
      snd_info_entry when unloading module.
      
      Fix it by
      - memset only the fields before eld->eld_buffer
      - set eld->eld_valid to true _after_ all eld fields have been filled
      
      Cc: Pierre-louis Bossart <pierre-louis.bossart@intel.com>
      Acked-by: default avatarStephen Warren <swarren@nvidia.com>
      Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      46e18b7f
    • Jeff Layton's avatar
      nfs: when attempting to open a directory, fall back on normal lookup (try #5) · 0d2c754e
      Jeff Layton authored
      commit 1788ea6e upstream.
      
      commit d953126a changed how nfs_atomic_lookup handles an -EISDIR return
      from an OPEN call. Prior to that patch, that caused the client to fall
      back to doing a normal lookup. When that patch went in, the code began
      returning that error to userspace. The d_revalidate codepath however
      never had the corresponding change, so it was still possible to end up
      with a NULL ctx->state pointer after that.
      
      That patch caused a regression. When we attempt to open a directory that
      does not have a cached dentry, that open now errors out with EISDIR. If
      you attempt the same open with a cached dentry, it will succeed.
      
      Fix this by reverting the change in nfs_atomic_lookup and allowing
      attempts to open directories to fall back to a normal lookup
      
      Also, add a NFSv4-specific f_ops->open routine that just returns
      -ENOTDIR. This should never be called if things are working properly,
      but if it ever is, then the dprintk may help in debugging.
      
      To facilitate this, a new file_operations field is also added to the
      nfs_rpc_ops struct.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      0d2c754e
    • Jiri Slaby's avatar
      TTY: ldisc, wait for ldisc infinitely in hangup · e901cc45
      Jiri Slaby authored
      commit 0c73c08e upstream.
      
      For /dev/console case, we do not kill all ldisc users. It's due to
      redirected_tty_write test in __tty_hangup. In that case there still
      might be a process waiting e.g. in n_tty_read for input.
      
      We wait for such processes to disappear. The problem is that we use a
      timeout. After this timeout, we continue closing the ldisc and start
      freeing tty resources. It obviously leads to crashes when the other
      process is woken.
      
      So to fix this, we wait infinitely before reiniting the ldisc. (The
      tiocsetd remains untouched -- times out after 5s.)
      
      This is nicely reproducible with this run from shell:
        exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
      and stopping a getty like:
        systemctl stop serial-getty@ttyS0.service
      
      The crash proper may be produced only under load or with constified
      timing the same as for 92f6fa09.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Dave Young <hidave.darkstar@gmail.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Dmitriy Matrosov <sgf.dma@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      e901cc45
    • Jiri Slaby's avatar
      TTY: ldisc, move wait idle to caller · bb4006e0
      Jiri Slaby authored
      commit 30042072 upstream.
      
      It is the only place where reinit is called from. And we really need
      to wait for the old ldisc to go once. Actually this is the place where
      the waiting originally was (before removed and re-added later).
      
      This will make the fix in the following patch easier to implement.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Dave Young <hidave.darkstar@gmail.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Dmitriy Matrosov <sgf.dma@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      bb4006e0
    • Jiri Slaby's avatar
      TTY: ldisc, allow waiting for ldisc arbitrarily long · d21ada2c
      Jiri Slaby authored
      commit df92d056 upstream.
      
      To fix a nasty bug in ldisc hup vs. reinit we need to wait infinitely
      long for ldisc to be gone. So here we add a parameter to
      tty_ldisc_wait_idle to allow that.
      
      This is only a preparation for the real fix which is done in the
      following patches.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Dave Young <hidave.darkstar@gmail.com>
      Cc: Dave Jones <davej@redhat.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Dmitriy Matrosov <sgf.dma@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d21ada2c
    • Stephen Boyd's avatar
      tty: hvc_dcc: Fix duplicate character inputs · 5a25cbde
      Stephen Boyd authored
      commit c2a3e84f upstream.
      
      Reading from the DCC grabs a character from the buffer and
      clears the status bit. Since this is a context-changing
      operation, instructions following the character read that rely on
      the status bit being accurate need to be synchronized with an
      ISB.
      
      In this case, the status bit check needs to execute after the
      character read otherwise we run the risk of reading the character
      and checking the status bit before the read can clear the status
      bit in the first place. When this happens, the user will see the
      same character they typed twice, instead of once.
      
      Add an ISB after the read and the write, so that the status check
      is synchronized with the read/write operations.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5a25cbde
    • Tomoya MORINAGA's avatar
      pch_uart: Support new device LAPIS Semiconductor ML7831 IOH · 39e005fc
      Tomoya MORINAGA authored
      commit 8249f743 upstream.
      
      ML7831 is companion chip for Intel Atom E6xx series.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
      Acked-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      39e005fc
    • Tomoya MORINAGA's avatar
      pch_uart: Fix DMA resource leak issue · 091fb7d0
      Tomoya MORINAGA authored
      commit 90f04c29 upstream.
      
      Changing UART mode PIO->DMA->PIO->DMA like below, pch_uart driver can't get
      DMA channel resource.
      
      setserial /dev/ttyPCH0 ^low_latency
      setserial /dev/ttyPCH0 low_latency
      
      CAUSE:
      Changing mode using setserial command, ".startup" function which gets DMA
      channel is called before ".verify_port" function which sets
      dma-flag(use_dma/use_dma_flag) as 1.
      
      PIO->DMA
        .startup: Since dma-flag is 0, DMA channel is not requested.
        .verify_port: dma-flag is set as 1.
        .shutdown: N/A
      
      DMA->PIO
        .startup: Since dma-flag is 1, DMA channel is requested.
        .verify_port: dma-flag is set as 0.
        .shutdown: Since dma-flag is 0, DMA channel is not released.
      
      This means DMA channel resource leak occurs.
      Next time, this driver can't get DMA channel resource forever.
      
      MODIFICATION:
        Currently, when release DMA channel resource, this driver checks dma-flag.
        However, this specification occurs the above issue.
        This driver must check whether dma_request_channel is executed or not.
        The values are saved in private data variable "chan_tx/chan_tx".
        These variables mean if the value is NULL, DMA channel is not requested,
        if not NULL, DMA channel is requested.
      
      This patch fixes the issue.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Acked-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      091fb7d0
    • Tomoya MORINAGA's avatar
      pch_uart: Fix hw-flow control issue · 81aaad2c
      Tomoya MORINAGA authored
      commit a1d7cfe2 upstream.
      
      Using hardware flow control,
      currently, register of the control-bit(AFE) is not set.
      This patch fixes the issue.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
      Acked-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      81aaad2c
    • Tomoya MORINAGA's avatar
      pch_phub: Fix MAC address writing issue for LAPIS ML7831 · 9b0c37ef
      Tomoya MORINAGA authored
      commit 2a988791 upstream.
      
      ISSUE:
      Using ML7831, MAC address writing doesn't work well.
      
      CAUSE:
      ML7831 and EG20T have the same register map for MAC address access.
      However, this driver processes the writing the same as ML7223.
      This is not true.
      This driver must process the writing the same as EG20T.
      This patch fixes the issue.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya.rohm@gmail.com>
      Cc: Masayuki Ohtak <masa-korg@dsn.okisemi.com>
      Cc: Alexander Stein <alexander.stein@systec-electronic.com>
      Cc: Denis Turischev <denis@compulab.co.il>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9b0c37ef
    • Tomoya MORINAGA's avatar
      pch_phub: Support new device LAPIS Semiconductor ML7831 IOH · 94e595f0
      Tomoya MORINAGA authored
      commit 584ad00c upstream.
      
      ML7831 is companion chip for Intel Atom E6xx series.
      Signed-off-by: default avatarTomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      94e595f0
    • Peter Chen's avatar
      PM / driver core: disable device's runtime PM during shutdown · a896cd19
      Peter Chen authored
      commit af8db150 upstream.
      
      There may be an issue when the user issue "reboot/shutdown" command, then
      the device has shut down its hardware, after that, this runtime-pm featured
      device's driver will probably be scheduled to do its suspend routine,
      and at its suspend routine, it may access hardware, but the device has
      already shutdown physically, then the system hang may be occurred.
      
      I ran out this issue using an auto-suspend supported USB devices, like
      3G modem, keyboard. The usb runtime suspend routine may be scheduled
      after the usb controller has been shut down, and the usb runtime suspend
      routine will try to suspend its roothub(controller), it will access
      register, then the system hang occurs as the controller is shutdown.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      Acked-by: default avatarMing Lei <tom.leiming@gmail.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a896cd19
    • Josh Boyer's avatar
      ip6_tunnel: copy parms.name after register_netdevice · 268cd052
      Josh Boyer authored
      commit 731abb9c upstream.
      
      Commit 1c5cae81 removed an explicit call to dev_alloc_name in ip6_tnl_create
      because register_netdevice will now create a valid name.  This works for the
      net_device itself.
      
      However the tunnel keeps a copy of the name in the parms structure for the
      ip6_tnl associated with the tunnel.  parms.name is set by copying the net_device
      name in ip6_tnl_dev_init_gen.  That function is called from ip6_tnl_dev_init in
      ip6_tnl_create, but it is done before register_netdevice is called so the name
      is set to a bogus value in the parms.name structure.
      
      This shows up if you do a simple tunnel add, followed by a tunnel show:
      
      [root@localhost ~]# ip -6 tunnel add remote fec0::100 local fec0::200
      [root@localhost ~]# ip -6 tunnel show
      ip6tnl0: ipv6/ipv6 remote :: local :: encaplimit 0 hoplimit 0 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)
      ip6tnl%d: ipv6/ipv6 remote fec0::100 local fec0::200 encaplimit 4 hoplimit 64 tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000)
      [root@localhost ~]#
      
      Fix this by moving the strcpy out of ip6_tnl_dev_init_gen, and calling it after
      register_netdevice has successfully returned.
      Signed-off-by: default avatarJosh Boyer <jwboyer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      268cd052
    • Luis R. Rodriguez's avatar
      cfg80211: fix bug on regulatory core exit on access to last_request · 1d8fdb84
      Luis R. Rodriguez authored
      commit 58ebacc6 upstream.
      
      Commit 4d9d88d1 by Scott James Remnant <keybuk@google.com> added
      the .uevent() callback for the regulatory device used during
      the platform device registration. The change was done to account
      for queuing up udev change requests through udevadm triggers.
      The change also meant that upon regulatory core exit we will now
      send a uevent() but the uevent() callback, reg_device_uevent(),
      also accessed last_request. Right before commiting device suicide
      we free'd last_request but never set it to NULL so
      platform_device_unregister() would lead to bogus kernel paging
      request. Fix this and also simply supress uevents right before
      we commit suicide as they are pointless.
      
      This fix is required for kernels >= v2.6.39
      
      $ git describe --contains 4d9d88d1
      v2.6.39-rc1~468^2~25^2^2~21
      
      The impact of not having this present is that a bogus paging
      access may occur (only read) upon cfg80211 unload time. You
      may also get this BUG complaint below. Although Johannes
      could not reproduce the issue this fix is theoretically correct.
      
      mac80211_hwsim: unregister radios
      mac80211_hwsim: closing netlink
      BUG: unable to handle kernel paging request at ffff88001a06b5ab
      IP: [<ffffffffa030df9a>] reg_device_uevent+0x1a/0x50 [cfg80211]
      PGD 1836063 PUD 183a063 PMD 1ffcb067 PTE 1a06b160
      Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      CPU 0
      Modules linked in: cfg80211(-) [last unloaded: mac80211]
      
      Pid: 2279, comm: rmmod Tainted: G        W   3.1.0-wl+ #663 Bochs Bochs
      RIP: 0010:[<ffffffffa030df9a>]  [<ffffffffa030df9a>] reg_device_uevent+0x1a/0x50 [cfg80211]
      RSP: 0000:ffff88001c5f9d58  EFLAGS: 00010286
      RAX: 0000000000000000 RBX: ffff88001d2eda88 RCX: ffff88001c7468fc
      RDX: ffff88001a06b5a0 RSI: ffff88001c7467b0 RDI: ffff88001c7467b0
      RBP: ffff88001c5f9d58 R08: 000000000000ffff R09: 000000000000ffff
      R10: 0000000000000000 R11: 0000000000000001 R12: ffff88001c7467b0
      R13: ffff88001d2eda78 R14: ffffffff8164a840 R15: 0000000000000001
      FS:  00007f8a91d8a6e0(0000) GS:ffff88001fc00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: ffff88001a06b5ab CR3: 000000001c62e000 CR4: 00000000000006f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process rmmod (pid: 2279, threadinfo ffff88001c5f8000, task ffff88000023c780)
      Stack:
       ffff88001c5f9d98 ffffffff812ff7e5 ffffffff8176ab3d ffff88001c7468c2
       000000000000ffff ffff88001d2eda88 ffff88001c7467b0 ffff880000114820
       ffff88001c5f9e38 ffffffff81241dc7 ffff88001c5f9db8 ffffffff81040189
      Call Trace:
       [<ffffffff812ff7e5>] dev_uevent+0xc5/0x170
       [<ffffffff81241dc7>] kobject_uevent_env+0x1f7/0x490
       [<ffffffff81040189>] ? sub_preempt_count+0x29/0x60
       [<ffffffff814cab1a>] ? _raw_spin_unlock_irqrestore+0x4a/0x90
       [<ffffffff81305307>] ? devres_release_all+0x27/0x60
       [<ffffffff8124206b>] kobject_uevent+0xb/0x10
       [<ffffffff812fee27>] device_del+0x157/0x1b0
       [<ffffffff8130377d>] platform_device_del+0x1d/0x90
       [<ffffffff81303b76>] platform_device_unregister+0x16/0x30
       [<ffffffffa030fffd>] regulatory_exit+0x5d/0x180 [cfg80211]
       [<ffffffffa032bec3>] cfg80211_exit+0x2b/0x45 [cfg80211]
       [<ffffffff8109a84c>] sys_delete_module+0x16c/0x220
       [<ffffffff8108a23e>] ? trace_hardirqs_on_caller+0x7e/0x120
       [<ffffffff814cba02>] system_call_fastpath+0x16/0x1b
      Code: <all your base are belong to me>
      RIP  [<ffffffffa030df9a>] reg_device_uevent+0x1a/0x50 [cfg80211]
       RSP <ffff88001c5f9d58>
      CR2: ffff88001a06b5ab
      ---[ end trace 147c5099a411e8c0 ]---
      Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: Scott James Remnant <keybuk@google.com>
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@qca.qualcomm.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1d8fdb84
    • Johannes Berg's avatar
      nl80211: fix HT capability attribute validation · 2ebd38f3
      Johannes Berg authored
      commit 6c739419 upstream.
      
      Since the NL80211_ATTR_HT_CAPABILITY attribute is
      used as a struct, it needs a minimum, not maximum
      length. Enforce that properly. Not doing so could
      potentially lead to reading after the buffer.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      2ebd38f3
    • Johannes Berg's avatar
      mac80211: fix bug in ieee80211_build_probe_req · 76ba12dd
      Johannes Berg authored
      commit 5b2bbf75 upstream.
      
      ieee80211_probereq_get() can return NULL in
      which case we should clean up & return NULL
      in ieee80211_build_probe_req() as well.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      76ba12dd
    • Johannes Berg's avatar
      mac80211: fix NULL dereference in radiotap code · 4a4d69f0
      Johannes Berg authored
      commit f8d1ccf1 upstream.
      
      When receiving failed PLCP frames is enabled, there
      won't be a rate pointer when we add the radiotap
      header and thus the kernel will crash. Fix this by
      not assuming the rate pointer is always valid. It's
      still always valid for frames that have good PLCP
      though, and that is checked & enforced.
      
      This was broken by my
      commit fc885189
      Author: Johannes Berg <johannes.berg@intel.com>
      Date:   Fri Jul 30 13:23:12 2010 +0200
      
          mac80211: don't check rates on PLCP error frames
      
      where I removed the check in this case but didn't
      take into account that the rate info would be used.
      Reported-by: default avatarXiaokang Qin <xiaokang.qin@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4a4d69f0
    • Gertjan van Wingerde's avatar
      rt2x00: Fix sleep-while-atomic bug in powersaving code. · 7aa8983f
      Gertjan van Wingerde authored
      commit ed66ba47 upstream.
      
      The generic powersaving code that determines after reception of a frame
      whether the device should go back to sleep or whether is could stay
      awake was calling rt2x00lib_config directly from RX tasklet context.
      On a number of the devices this call can actually sleep, due to having
      to confirm that the sleeping commands have been executed successfully.
      
      Fix this by moving the call to rt2x00lib_config to a workqueue call.
      
      This fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=731672Tested-by: default avatarTomas Trnka <tomastrnka@gmx.com>
      Signed-off-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
      Acked-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7aa8983f
    • Jesper Juhl's avatar
      Net, libertas: Resolve memory leak in if_spi_host_to_card() · b426a836
      Jesper Juhl authored
      commit fe09b32a upstream.
      
      If we hit the default case in the switch in if_spi_host_to_card() we'll leak
      the memory we allocated for 'packet'. This patch resolves the leak by freeing
      the allocated memory in that case.
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Acked-by: default avatarDan Williams <dcbw@redhat.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b426a836
    • Catalin Marinas's avatar
      ARM: 7150/1: Allow kernel unaligned accesses on ARMv6+ processors · 92fd7a89
      Catalin Marinas authored
      commit 8428e84d upstream.
      
      Recent gcc versions generate unaligned accesses by default on ARMv6 and
      later processors. This patch ensures that the SCTLR.A bit is always
      cleared on such processors to avoid kernel traping before
      alignment_init() is called.
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Tested-by: default avatarJohn Linn <John.Linn@xilinx.com>
      Acked-by: default avatarNicolas Pitre <nico@linaro.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      92fd7a89
    • Cornelia Huck's avatar
      KVM: s390: Fix RUNNING flag misinterpretation · 57a3b9c2
      Cornelia Huck authored
      commit 9e6dabef upstream.
      
      CPUSTAT_RUNNING was implemented signifying that a vcpu is not stopped.
      This is not, however, what the architecture says: RUNNING should be
      set when the host is acting on the behalf of the guest operating
      system.
      
      CPUSTAT_RUNNING has been changed to be set in kvm_arch_vcpu_load()
      and to be unset in kvm_arch_vcpu_put().
      
      For signifying stopped state of a vcpu, a host-controlled bit has
      been used and is set/unset basically on the reverse as the old
      CPUSTAT_RUNNING bit (including pushing it down into stop handling
      proper in handle_stop()).
      Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: default avatarCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      57a3b9c2
    • Tony Jago's avatar
      saa7164: Add support for another HVR2200 hardware revision · 97e14e74
      Tony Jago authored
      commit 62dd28d0 upstream.
      
      Hauppauge have released a new model rev, sub id 8940, this adds
      support.
      
      [stoth@kernellabs.com: I modified Tony's patch slightly in relation to the
       card numbering in saa7164.h, appending rather than inserting the new card
       - normal practise]
      Signed-off-by: default avatarTony Jago <tony@hammertelecom.com.au>
      Signed-off-by: default avatarSteven Toth <stoth@kernellabs.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      97e14e74
    • Vasily Averin's avatar
      aacraid: controller hangs if kernel uses non-default ASPM policy · 49d1df88
      Vasily Averin authored
      commit cf16123c upstream.
      
      Aacraid controller can hang on some nodes if kernel uses non-default
      (powersave) ASPM policy.  Controller hangs shortly after successful load and
      hardware detection. Scsi error handler detects this hang and tries to restart
      hardware but it does not help.
      
      Initially it was noticed on RHEL6-based openVZ kernel after backporting
      aacraid driver from mainline (RHEL6 kernel with original driver works well)
      http://bugzilla.openvz.org/show_bug.cgi?id=2043
      
      This issue happens because default ASPM policy was changed in Red Hat
      kernels. Therefore guys from Red Hat have noticed this problem long time ago:
      on Fedora 12
       https://bugzilla.redhat.com/show_bug.cgi?id=540478
      on Fedora 14
       https://bugzilla.redhat.com/show_bug.cgi?id=679385
      
      In RHEL6 kernel this issue was fixed, ASPM was disabled in aacraid driver. In
      kernel changelog I've found that seems it was done by Matthew Garrett: -
      [scsi] aacraid: Disable ASPM by default (Matthew Garrett) [599735]
      
      However seems this patch was not submitted to mainline. I've reproduced this
      issue on vanilla 3.1.0 kernel booted with "pcie_aspm.policy=powersave" option,
      So I believe it makes sense to do it now.
      Signed-off-by: default avatarVasily Averin <vvs@sw.ru>
      [mjg: Checking the Windows drivers indicates that they disable ASPM under all
      circumstances, so:]
      Acked-by: default avatarMatthew Garrett <mjg@redhat.com>
      Acked-by: default avatarAchim Leubner <Achim_Leubner@pmc-sierra.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      49d1df88
    • Matthew Garrett's avatar
      hpsa: Disable ASPM · 611397f6
      Matthew Garrett authored
      commit e5a44df8 upstream.
      
      The Windows driver .inf disables ASPM on hpsa devices. Do the same because the
      selection of a non default ASPM policy can cause the device to hang.
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      Acked-by: default avatarMike Miller <mike.miller@hp.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      611397f6
    • James Bottomley's avatar
      fix WARNING: at drivers/scsi/scsi_lib.c:1704 · bf6f111b
      James Bottomley authored
      commit 4e6c82b3 upstream.
      
      On Mon, 2011-11-07 at 17:24 +1100, Stephen Rothwell wrote:
      > Hi all,
      >
      > Starting some time last week I am getting the following during boot on
      > our PPC970 blade:
      >
      > calling  .ipr_init+0x0/0x68 @ 1
      > ipr: IBM Power RAID SCSI Device Driver version: 2.5.2 (April 27, 2011)
      > ipr 0000:01:01.0: Found IOA with IRQ: 26
      > ipr 0000:01:01.0: Starting IOA initialization sequence.
      > ipr 0000:01:01.0: Adapter firmware version: 06160039
      > ipr 0000:01:01.0: IOA initialized.
      > scsi0 : IBM 572E Storage Adapter
      > ------------[ cut here ]------------
      > WARNING: at drivers/scsi/scsi_lib.c:1704
      > Modules linked in:
      > NIP: c00000000053b3d4 LR: c00000000053e5b0 CTR: c000000000541d70
      > REGS: c0000000783c2f60 TRAP: 0700   Not tainted  (3.1.0-autokern1)
      > MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 24002024  XER: 20000002
      > TASK = c0000000783b8000[1] 'swapper' THREAD: c0000000783c0000 CPU: 0
      > GPR00: 0000000000000001 c0000000783c31e0 c000000000cf38b0 c00000000239a9d0
      > GPR04: c000000000cbe8f8 0000000000000000 c0000000783c3040 0000000000000000
      > GPR08: c000000075daf488 c000000078a3b7ff c000000000bcacc8 0000000000000000
      > GPR12: 0000000044002028 c000000007ffb000 0000000002e40000 000000000099b800
      > GPR16: 0000000000000000 c000000000bba5fc c000000000a61db8 0000000000000000
      > GPR20: 0000000001b77200 0000000000000000 c000000078990000 0000000000000001
      > GPR24: c000000002396828 0000000000000000 0000000000000000 c000000078a3b938
      > GPR28: fffffffffffffffa c0000000008ad2c0 c000000000c7faa8 c00000000239a9d0
      > NIP [c00000000053b3d4] .scsi_free_queue+0x24/0x90
      > LR [c00000000053e5b0] .scsi_alloc_sdev+0x280/0x2e0
      > Call Trace:
      > [c0000000783c31e0] [c000000000c7faa8] wireless_seq_fops+0x278d0/0x2eb88 (unreliable)
      > [c0000000783c3270] [c00000000053e5b0] .scsi_alloc_sdev+0x280/0x2e0
      > [c0000000783c3330] [c00000000053eba0] .scsi_probe_and_add_lun+0x390/0xb40
      > [c0000000783c34a0] [c00000000053f7ec] .__scsi_scan_target+0x16c/0x650
      > [c0000000783c35f0] [c00000000053fd90] .scsi_scan_channel+0xc0/0x100
      > [c0000000783c36a0] [c00000000053fefc] .scsi_scan_host_selected+0x12c/0x1c0
      > [c0000000783c3750] [c00000000083dcb4] .ipr_probe+0x2c0/0x390
      > [c0000000783c3830] [c0000000003f50b4] .local_pci_probe+0x34/0x50
      > [c0000000783c38a0] [c0000000003f5f78] .pci_device_probe+0x148/0x150
      > [c0000000783c3950] [c0000000004e1e8c] .driver_probe_device+0xdc/0x210
      > [c0000000783c39f0] [c0000000004e20cc] .__driver_attach+0x10c/0x110
      > [c0000000783c3a80] [c0000000004e1228] .bus_for_each_dev+0x98/0xf0
      > [c0000000783c3b30] [c0000000004e1bf8] .driver_attach+0x28/0x40
      > [c0000000783c3bb0] [c0000000004e07d8] .bus_add_driver+0x218/0x340
      > [c0000000783c3c60] [c0000000004e2a2c] .driver_register+0x9c/0x1b0
      > [c0000000783c3d00] [c0000000003f62d4] .__pci_register_driver+0x64/0x140
      > [c0000000783c3da0] [c000000000b99f88] .ipr_init+0x4c/0x68
      > [c0000000783c3e20] [c00000000000ad24] .do_one_initcall+0x1a4/0x1e0
      > [c0000000783c3ee0] [c000000000b512d0] .kernel_init+0x14c/0x1fc
      > [c0000000783c3f90] [c000000000022468] .kernel_thread+0x54/0x70
      > Instruction dump:
      > ebe1fff8 7c0803a6 4e800020 7c0802a6 fba1ffe8 fbe1fff8 7c7f1b78 f8010010
      > f821ff71 e8030398 3120ffff 7c090110 <0b000000> e86303b0 482de065 60000000
      > ---[ end trace 759bed76a85e8dec ]---
      > scsi 0:0:1:0: Direct-Access     IBM-ESXS MAY2036RC        T106 PQ: 0 ANSI: 5
      > ------------[ cut here ]------------
      >
      > I get lots more of these.  The obvious commit to point the finger at
      > is 3308511c ("[SCSI] Make scsi_free_queue() kill pending SCSI
      > commands") but the root cause may be something different.
      
      Caused by
      
      commit f7c9c6bb
      Author: Anton Blanchard <anton@samba.org>
      Date:   Thu Nov 3 08:56:22 2011 +1100
      
          [SCSI] Fix block queue and elevator memory leak in scsi_alloc_sdev
      
      Doesn't completely do the teardown.  The true fix is to do a proper
      teardown instead of hand rolling it
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Tested-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      bf6f111b
    • Takashi Iwai's avatar
      ALSA: hda - Fix the connection selection of ADCs on Cirrus codecs · ea054a92
      Takashi Iwai authored
      commit 05ee7964 upstream.
      
      spec->cur_adc isn't set until cs_capture_pcm_prepare() is called although
      the driver tries to select the connection at init time and at auto-mic
      switch.  This results in the access to the widget NID 0, which is
      obviously invalid, also a wrong capture source.
      
      This patch fixes the issue by issuing the connect-select verb conditionally
      at appropriate places.
      Reported-and-tested-by: default avatarDylan Reid <dgreid@chromium.org>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ea054a92
    • Edward Donovan's avatar
      genirq: Fix irqfixup, irqpoll regression · d6b8bd1b
      Edward Donovan authored
      commit c75d720f upstream.
      
      commit d05c65ff ("genirq: spurious: Run only one poller at a time")
      introduced a regression, leaving the boot options 'irqfixup' and
      'irqpoll' non-functional. The patch placed tests in each function, to
      exit if the function is already running. The test in 'misrouted_irq'
      exited when it should have proceeded, effectively disabling
      'misrouted_irq' and 'poll_spurious_irqs'.
      
      The check for an already running poller needs to be "!= 1" not "== 1"
      as "1" is the value when the first poller starts running.
      Signed-off-by: default avatarEdward Donovan <edward.donovan@numble.net>
      Cc: maciej.rutecki@gmail.com
      Link: http://lkml.kernel.org/r/1320175784-6745-1-git-send-email-edward.donovan@numble.netSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d6b8bd1b
  2. 21 Nov, 2011 2 commits