1. 12 Sep, 2014 40 commits
    • Jon Paul Maloy's avatar
      tipc: clear 'next'-pointer of message fragments before reassembly · 05110600
      Jon Paul Maloy authored
      If the 'next' pointer of the last fragment buffer in a message is not
      zeroed before reassembly, we risk ending up with a corrupt message,
      since the reassembly function itself isn't doing this.
      
      Currently, when a buffer is retrieved from the deferred queue of the
      broadcast link, the next pointer is not cleared, with the result as
      described above.
      
      This commit corrects this, and thereby fixes a bug that may occur when
      long broadcast messages are transmitted across dual interfaces. The bug
      has been present since 40ba3cdf ("tipc:
      message reassembly using fragment chain")
      
      This commit should be applied to both net and net-next.
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 99941754)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      05110600
    • Suresh Reddy's avatar
      be2net: set EQ DB clear-intr bit in be_open() · 344905db
      Suresh Reddy authored
      On BE3, if the clear-interrupt bit of the EQ doorbell is not set the first
      time it is armed, ocassionally we have observed that the EQ doesn't raise
      anymore interrupts even if it is in armed state.
      This patch fixes this by setting the clear-interrupt bit when EQs are
      armed for the first time in be_open().
      Signed-off-by: default avatarSuresh Reddy <Suresh.Reddy@emulex.com>
      Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 4cad9f3b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      344905db
    • Andrey Utkin's avatar
      appletalk: Fix socket referencing in skb · 799445c4
      Andrey Utkin authored
      Setting just skb->sk without taking its reference and setting a
      destructor is invalid. However, in the places where this was done, skb
      is used in a way not requiring skb->sk setting. So dropping the setting
      of skb->sk.
      Thanks to Eric Dumazet <eric.dumazet@gmail.com> for correct solution.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=79441Reported-by: default avatarEd Martin <edman007@edman007.com>
      Signed-off-by: default avatarAndrey Utkin <andrey.krieger.utkin@gmail.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 36beddc2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      799445c4
    • dingtianhong's avatar
      igmp: fix the problem when mc leave group · 8ad105cc
      dingtianhong authored
      The problem was triggered by these steps:
      
      1) create socket, bind and then setsockopt for add mc group.
         mreq.imr_multiaddr.s_addr = inet_addr("255.0.0.37");
         mreq.imr_interface.s_addr = inet_addr("192.168.1.2");
         setsockopt(sockfd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq));
      
      2) drop the mc group for this socket.
         mreq.imr_multiaddr.s_addr = inet_addr("255.0.0.37");
         mreq.imr_interface.s_addr = inet_addr("0.0.0.0");
         setsockopt(sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq));
      
      3) and then drop the socket, I found the mc group was still used by the dev:
      
         netstat -g
      
         Interface       RefCnt Group
         --------------- ------ ---------------------
         eth2		   1	  255.0.0.37
      
      Normally even though the IP_DROP_MEMBERSHIP return error, the mc group still need
      to be released for the netdev when drop the socket, but this process was broken when
      route default is NULL, the reason is that:
      
      The ip_mc_leave_group() will choose the in_dev by the imr_interface.s_addr, if input addr
      is NULL, the default route dev will be chosen, then the ifindex is got from the dev,
      then polling the inet->mc_list and return -ENODEV, but if the default route dev is NULL,
      the in_dev and ifIndex is both NULL, when polling the inet->mc_list, the mc group will be
      released from the mc_list, but the dev didn't dec the refcnt for this mc group, so
      when dropping the socket, the mc_list is NULL and the dev still keep this group.
      
      v1->v2: According Hideaki's suggestion, we should align with IPv6 (RFC3493) and BSDs,
      	so I add the checking for the in_dev before polling the mc_list, make sure when
      	we remove the mc group, dec the refcnt to the real dev which was using the mc address.
      	The problem would never happened again.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 52ad353a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8ad105cc
    • Li RongQing's avatar
      8021q: fix a potential memory leak · 65c5b9d8
      Li RongQing authored
      skb_cow called in vlan_reorder_header does not free the skb when it failed,
      and vlan_reorder_header returns NULL to reset original skb when it is called
      in vlan_untag, lead to a memory leak.
      Signed-off-by: default avatarLi RongQing <roy.qing.li@gmail.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 916c1689)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      65c5b9d8
    • Neal Cardwell's avatar
      tcp: fix tcp_match_skb_to_sack() for unaligned SACK at end of an skb · 01d3428d
      Neal Cardwell authored
      If there is an MSS change (or misbehaving receiver) that causes a SACK
      to arrive that covers the end of an skb but is less than one MSS, then
      tcp_match_skb_to_sack() was rounding up pkt_len to the full length of
      the skb ("Round if necessary..."), then chopping all bytes off the skb
      and creating a zero-byte skb in the write queue.
      
      This was visible now because the recently simplified TLP logic in
      bef1909e ("tcp: fixing TLP's FIN recovery") could find that 0-byte
      skb at the end of the write queue, and now that we do not check that
      skb's length we could send it as a TLP probe.
      
      Consider the following example scenario:
      
       mss: 1000
       skb: seq: 0 end_seq: 4000  len: 4000
       SACK: start_seq: 3999 end_seq: 4000
      
      The tcp_match_skb_to_sack() code will compute:
      
       in_sack = false
       pkt_len = start_seq - TCP_SKB_CB(skb)->seq = 3999 - 0 = 3999
       new_len = (pkt_len / mss) * mss = (3999/1000)*1000 = 3000
       new_len += mss = 4000
      
      Previously we would find the new_len > skb->len check failing, so we
      would fall through and set pkt_len = new_len = 4000 and chop off
      pkt_len of 4000 from the 4000-byte skb, leaving a 0-byte segment
      afterward in the write queue.
      
      With this new commit, we notice that the new new_len >= skb->len check
      succeeds, so that we return without trying to fragment.
      
      Fixes: adb92db8 ("tcp: Make SACK code to split only at mss boundaries")
      Reported-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Cc: Ilpo Jarvinen <ilpo.jarvinen@helsinki.fi>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit 2cd0d743)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      01d3428d
    • Markus F.X.J. Oberhumer's avatar
      crypto: testmgr - update LZO compression test vectors · e762e28d
      Markus F.X.J. Oberhumer authored
      Update the LZO compression test vectors according to the latest compressor
      version.
      Signed-off-by: default avatarMarkus F.X.J. Oberhumer <markus@oberhumer.com>
      
      (cherry picked from commit 0ec73820)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e762e28d
    • Roland Dreier's avatar
      x86, ioremap: Speed up check for RAM pages · 5898e552
      Roland Dreier authored
      In __ioremap_caller() (the guts of ioremap), we loop over the range of
      pfns being remapped and checks each one individually with page_is_ram().
      For large ioremaps, this can be very slow.  For example, we have a
      device with a 256 GiB PCI BAR, and ioremapping this BAR can take 20+
      seconds -- sometimes long enough to trigger the soft lockup detector!
      
      Internally, page_is_ram() calls walk_system_ram_range() on a single
      page.  Instead, we can make a single call to walk_system_ram_range()
      from __ioremap_caller(), and do our further checks only for any RAM
      pages that we find.  For the common case of MMIO, this saves an enormous
      amount of work, since the range being ioremapped doesn't intersect
      system RAM at all.
      
      With this change, ioremap on our 256 GiB BAR takes less than 1 second.
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Link: http://lkml.kernel.org/r/1399054721-1331-1-git-send-email-roland@kernel.orgSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      
      (cherry picked from commit c81c8a1e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5898e552
    • Thomas Gleixner's avatar
      rtmutex: Plug slow unlock race · 26a8b8b7
      Thomas Gleixner authored
      When the rtmutex fast path is enabled the slow unlock function can
      create the following situation:
      
      spin_lock(foo->m->wait_lock);
      foo->m->owner = NULL;
      	    			rt_mutex_lock(foo->m); <-- fast path
      				free = atomic_dec_and_test(foo->refcnt);
      				rt_mutex_unlock(foo->m); <-- fast path
      				if (free)
      				   kfree(foo);
      
      spin_unlock(foo->m->wait_lock); <--- Use after free.
      
      Plug the race by changing the slow unlock to the following scheme:
      
           while (!rt_mutex_has_waiters(m)) {
           	    /* Clear the waiters bit in m->owner */
      	    clear_rt_mutex_waiters(m);
            	    owner = rt_mutex_owner(m);
            	    spin_unlock(m->wait_lock);
            	    if (cmpxchg(m->owner, owner, 0) == owner)
            	       return;
            	    spin_lock(m->wait_lock);
           }
      
      So in case of a new waiter incoming while the owner tries the slow
      path unlock we have two situations:
      
       unlock(wait_lock);
      					lock(wait_lock);
       cmpxchg(p, owner, 0) == owner
       	    	   			mark_rt_mutex_waiters(lock);
      	 				acquire(lock);
      
      Or:
      
       unlock(wait_lock);
      					lock(wait_lock);
      	 				mark_rt_mutex_waiters(lock);
       cmpxchg(p, owner, 0) != owner
      					enqueue_waiter();
      					unlock(wait_lock);
       lock(wait_lock);
       wakeup_next waiter();
       unlock(wait_lock);
      					lock(wait_lock);
      					acquire(lock);
      
      If the fast path is disabled, then the simple
      
         m->owner = NULL;
         unlock(m->wait_lock);
      
      is sufficient as all access to m->owner is serialized via
      m->wait_lock;
      
      Also document and clarify the wakeup_next_waiter function as suggested
      by Oleg Nesterov.
      Reported-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20140611183852.937945560@linutronix.de
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      
      (cherry picked from commit 27e35715)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      26a8b8b7
    • Thomas Gleixner's avatar
      rtmutex: Handle deadlock detection smarter · 6c13cf4e
      Thomas Gleixner authored
      Even in the case when deadlock detection is not requested by the
      caller, we can detect deadlocks. Right now the code stops the lock
      chain walk and keeps the waiter enqueued, even on itself. Silly not to
      yell when such a scenario is detected and to keep the waiter enqueued.
      
      Return -EDEADLK unconditionally and handle it at the call sites.
      
      The futex calls return -EDEADLK. The non futex ones dequeue the
      waiter, throw a warning and put the task into a schedule loop.
      
      Tagged for stable as it makes the code more robust.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Brad Mouring <bmouring@ni.com>
      Link: http://lkml.kernel.org/r/20140605152801.836501969@linutronix.de
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      
      (cherry picked from commit 3d5c9340)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      6c13cf4e
    • Thomas Gleixner's avatar
      rtmutex: Detect changes in the pi lock chain · 4cd98445
      Thomas Gleixner authored
      When we walk the lock chain, we drop all locks after each step. So the
      lock chain can change under us before we reacquire the locks. That's
      harmless in principle as we just follow the wrong lock path. But it
      can lead to a false positive in the dead lock detection logic:
      
      T0 holds L0
      T0 blocks on L1 held by T1
      T1 blocks on L2 held by T2
      T2 blocks on L3 held by T3
      T4 blocks on L4 held by T4
      
      Now we walk the chain
      
      lock T1 -> lock L2 -> adjust L2 -> unlock T1 ->
           lock T2 ->  adjust T2 ->  drop locks
      
      T2 times out and blocks on L0
      
      Now we continue:
      
      lock T2 -> lock L0 -> deadlock detected, but it's not a deadlock at all.
      
      Brad tried to work around that in the deadlock detection logic itself,
      but the more I looked at it the less I liked it, because it's crystal
      ball magic after the fact.
      
      We actually can detect a chain change very simple:
      
      lock T1 -> lock L2 -> adjust L2 -> unlock T1 -> lock T2 -> adjust T2 ->
      
           next_lock = T2->pi_blocked_on->lock;
      
      drop locks
      
      T2 times out and blocks on L0
      
      Now we continue:
      
      lock T2 ->
      
           if (next_lock != T2->pi_blocked_on->lock)
           	   return;
      
      So if we detect that T2 is now blocked on a different lock we stop the
      chain walk. That's also correct in the following scenario:
      
      lock T1 -> lock L2 -> adjust L2 -> unlock T1 -> lock T2 -> adjust T2 ->
      
           next_lock = T2->pi_blocked_on->lock;
      
      drop locks
      
      T3 times out and drops L3
      T2 acquires L3 and blocks on L4 now
      
      Now we continue:
      
      lock T2 ->
      
           if (next_lock != T2->pi_blocked_on->lock)
           	   return;
      
      We don't have to follow up the chain at that point, because T2
      propagated our priority up to T4 already.
      
      [ Folded a cleanup patch from peterz ]
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reported-by: default avatarBrad Mouring <bmouring@ni.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20140605152801.930031935@linutronix.de
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 82084984)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4cd98445
    • Thomas Gleixner's avatar
      rtmutex: Fix deadlock detector for real · 8512d8a2
      Thomas Gleixner authored
      The current deadlock detection logic does not work reliably due to the
      following early exit path:
      
      	/*
      	 * Drop out, when the task has no waiters. Note,
      	 * top_waiter can be NULL, when we are in the deboosting
      	 * mode!
      	 */
      	if (top_waiter && (!task_has_pi_waiters(task) ||
      			   top_waiter != task_top_pi_waiter(task)))
      		goto out_unlock_pi;
      
      So this not only exits when the task has no waiters, it also exits
      unconditionally when the current waiter is not the top priority waiter
      of the task.
      
      So in a nested locking scenario, it might abort the lock chain walk
      and therefor miss a potential deadlock.
      
      Simple fix: Continue the chain walk, when deadlock detection is
      enabled.
      
      We also avoid the whole enqueue, if we detect the deadlock right away
      (A-A). It's an optimization, but also prevents that another waiter who
      comes in after the detection and before the task has undone the damage
      observes the situation and detects the deadlock and returns
      -EDEADLOCK, which is wrong as the other task is not in a deadlock
      situation.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/20140522031949.725272460@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      
      (cherry picked from commit 397335f0)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8512d8a2
    • Steven Rostedt (Red Hat)'s avatar
      tracing: Remove ftrace_stop/start() from reading the trace file · a5f3acde
      Steven Rostedt (Red Hat) authored
      Disabling reading and writing to the trace file should not be able to
      disable all function tracing callbacks. There's other users today
      (like kprobes and perf). Reading a trace file should not stop those
      from happening.
      
      Cc: stable@vger.kernel.org # 3.0+
      Reviewed-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      
      (cherry picked from commit 099ed151)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a5f3acde
    • Christian König's avatar
      drm/radeon: stop poisoning the GART TLB · fb912114
      Christian König authored
      When we set the valid bit on invalid GART entries they are
      loaded into the TLB when an adjacent entry is loaded. This
      poisons the TLB with invalid entries which are sometimes
      not correctly removed on TLB flush.
      
      For stable inclusion the patch probably needs to be modified a bit.
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      
      (cherry picked from commit 0986c1a5)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      fb912114
    • Theodore Ts'o's avatar
      ext4: clarify error count warning messages · a8ee92c7
      Theodore Ts'o authored
      Make it clear that values printed are times, and that it is error
      since last fsck. Also add note about fsck version required.
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit ae0f78de)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a8ee92c7
    • Anton Blanchard's avatar
      powerpc/perf: Never program book3s PMCs with values >= 0x80000000 · 7d767325
      Anton Blanchard authored
      We are seeing a lot of PMU warnings on POWER8:
      
          Can't find PMC that caused IRQ
      
      Looking closer, the active PMC is 0 at this point and we took a PMU
      exception on the transition from negative to 0. Some versions of POWER8
      have an issue where they edge detect and not level detect PMC overflows.
      
      A number of places program the PMC with (0x80000000 - period_left),
      where period_left can be negative. We can either fix all of these or
      just ensure that period_left is always >= 1.
      
      This patch takes the second option.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      
      (cherry picked from commit f5602941)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7d767325
    • Axel Lin's avatar
      hwmon: (adm1029) Ensure the fan_div cache is updated in set_fan_div · aeec260f
      Axel Lin authored
      Writing to fanX_div does not clear the cache. As a result, reading
      from fanX_div may return the old value for up to two seconds
      after writing a new value.
      
      This patch ensures the fan_div cache is updated in set_fan_div().
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      
      (cherry picked from commit 1035a9e3)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      aeec260f
    • Axel Lin's avatar
      hwmon: (amc6821) Fix permissions for temp2_input · 33e69f80
      Axel Lin authored
      temp2_input should not be writable, fix it.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      
      (cherry picked from commit df86754b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      33e69f80
    • Gu Zheng's avatar
      cpuset,mempolicy: fix sleeping function called from invalid context · 0a56cef1
      Gu Zheng authored
      When runing with the kernel(3.15-rc7+), the follow bug occurs:
      [ 9969.258987] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:586
      [ 9969.359906] in_atomic(): 1, irqs_disabled(): 0, pid: 160655, name: python
      [ 9969.441175] INFO: lockdep is turned off.
      [ 9969.488184] CPU: 26 PID: 160655 Comm: python Tainted: G       A      3.15.0-rc7+ #85
      [ 9969.581032] Hardware name: FUJITSU-SV PRIMEQUEST 1800E/SB, BIOS PRIMEQUEST 1000 Series BIOS Version 1.39 11/16/2012
      [ 9969.706052]  ffffffff81a20e60 ffff8803e941fbd0 ffffffff8162f523 ffff8803e941fd18
      [ 9969.795323]  ffff8803e941fbe0 ffffffff8109995a ffff8803e941fc58 ffffffff81633e6c
      [ 9969.884710]  ffffffff811ba5dc ffff880405c6b480 ffff88041fdd90a0 0000000000002000
      [ 9969.974071] Call Trace:
      [ 9970.003403]  [<ffffffff8162f523>] dump_stack+0x4d/0x66
      [ 9970.065074]  [<ffffffff8109995a>] __might_sleep+0xfa/0x130
      [ 9970.130743]  [<ffffffff81633e6c>] mutex_lock_nested+0x3c/0x4f0
      [ 9970.200638]  [<ffffffff811ba5dc>] ? kmem_cache_alloc+0x1bc/0x210
      [ 9970.272610]  [<ffffffff81105807>] cpuset_mems_allowed+0x27/0x140
      [ 9970.344584]  [<ffffffff811b1303>] ? __mpol_dup+0x63/0x150
      [ 9970.409282]  [<ffffffff811b1385>] __mpol_dup+0xe5/0x150
      [ 9970.471897]  [<ffffffff811b1303>] ? __mpol_dup+0x63/0x150
      [ 9970.536585]  [<ffffffff81068c86>] ? copy_process.part.23+0x606/0x1d40
      [ 9970.613763]  [<ffffffff810bf28d>] ? trace_hardirqs_on+0xd/0x10
      [ 9970.683660]  [<ffffffff810ddddf>] ? monotonic_to_bootbased+0x2f/0x50
      [ 9970.759795]  [<ffffffff81068cf0>] copy_process.part.23+0x670/0x1d40
      [ 9970.834885]  [<ffffffff8106a598>] do_fork+0xd8/0x380
      [ 9970.894375]  [<ffffffff81110e4c>] ? __audit_syscall_entry+0x9c/0xf0
      [ 9970.969470]  [<ffffffff8106a8c6>] SyS_clone+0x16/0x20
      [ 9971.030011]  [<ffffffff81642009>] stub_clone+0x69/0x90
      [ 9971.091573]  [<ffffffff81641c29>] ? system_call_fastpath+0x16/0x1b
      
      The cause is that cpuset_mems_allowed() try to take
      mutex_lock(&callback_mutex) under the rcu_read_lock(which was hold in
      __mpol_dup()). And in cpuset_mems_allowed(), the access to cpuset is
      under rcu_read_lock, so in __mpol_dup, we can reduce the rcu_read_lock
      protection region to protect the access to cpuset only in
      current_cpuset_is_being_rebound(). So that we can avoid this bug.
      
      This patch is a temporary solution that just addresses the bug
      mentioned above, can not fix the long-standing issue about cpuset.mems
      rebinding on fork():
      
      "When the forker's task_struct is duplicated (which includes
       ->mems_allowed) and it races with an update to cpuset_being_rebound
       in update_tasks_nodemask() then the task's mems_allowed doesn't get
       updated. And the child task's mems_allowed can be wrong if the
       cpuset's nodemask changes before the child has been added to the
       cgroup's tasklist."
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Acked-by: default avatarLi Zefan <lizefan@huawei.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: stable <stable@vger.kernel.org>
      
      (cherry picked from commit 391acf97)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0a56cef1
    • Bert Vermeulen's avatar
      USB: ftdi_sio: Add extra PID. · 1a80b45c
      Bert Vermeulen authored
      This patch adds PID 0x0003 to the VID 0x128d (Testo). At least the
      Testo 435-4 uses this, likely other gear as well.
      Signed-off-by: default avatarBert Vermeulen <bert@biot.com>
      Cc: Johan Hovold <johan@kernel.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 5a7fbe7e)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      1a80b45c
    • Andras Kovacs's avatar
      USB: cp210x: add support for Corsair usb dongle · 5da8328e
      Andras Kovacs authored
      Corsair USB Dongles are shipped with Corsair AXi series PSUs.
      These are cp210x serial usb devices, so make driver detect these.
      I have a program, that can get information from these PSUs.
      
      Tested with 2 different dongles shipped with Corsair AX860i and
      AX1200i units.
      Signed-off-by: default avatarAndras Kovacs <andras@sth.sze.hu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      
      (cherry picked from commit b9326057)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5da8328e
    • Bernd Wachter's avatar
      usb: option: Add ID for Telewell TW-LTE 4G v2 · 9f7a1f77
      Bernd Wachter authored
      Add ID of the Telewell 4G v2 hardware to option driver to get legacy
      serial interface working
      Signed-off-by: default avatarBernd Wachter <bernd.wachter@jolla.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      
      (cherry picked from commit 3d28bd84)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9f7a1f77
    • Gustavo Maciel Dias Vieira's avatar
      ACPI video: ignore BIOS backlight value for HP dm4 · 7a35ec4d
      Gustavo Maciel Dias Vieira authored
      On a HP Pavilion dm4 laptop the BIOS sets minimum backlight on boot,
      completely dimming the screen. Ignore this initial value for this
      machine.
      Signed-off-by: default avatarGustavo Maciel Dias Vieira <gustavo@sagui.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 771d09b3)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7a35ec4d
    • Alex Hung's avatar
      ACPI video: ignore BIOS initial backlight value for HP 1000 · a74bfa93
      Alex Hung authored
      On HP 1000 lapops, BIOS reports minimum backlight on boot and
      causes backlight to dim completely. This ignores the initial backlight
      values and set to max brightness.
      
      References:: https://bugs.launchpad.net/bugs/1167760Signed-off-by: default avatarAlex Hung <alex.hung@canonical.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      
      (cherry picked from commit 4ef366c5)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a74bfa93
    • Mikulas Patocka's avatar
      sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue · e734e89f
      Mikulas Patocka authored
      This patch fixes I/O errors with the sym53c8xx_2 driver when the disk
      returns QUEUE FULL status.
      
      When the controller encounters an error (including QUEUE FULL or BUSY
      status), it aborts all not yet submitted requests in the function
      sym_dequeue_from_squeue.
      
      This function aborts them with DID_SOFT_ERROR.
      
      If the disk has full tag queue, the request that caused the overflow is
      aborted with QUEUE FULL status (and the scsi midlayer properly retries
      it until it is accepted by the disk), but the sym53c8xx_2 driver aborts
      the following requests with DID_SOFT_ERROR --- for them, the midlayer
      does just a few retries and then signals the error up to sd.
      
      The result is that disk returning QUEUE FULL causes request failures.
      
      The error was reproduced on 53c895 with COMPAQ BD03685A24 disk
      (rebranded ST336607LC) with command queue 48 or 64 tags.  The disk has
      64 tags, but under some access patterns it return QUEUE FULL when there
      are less than 64 pending tags.  The SCSI specification allows returning
      QUEUE FULL anytime and it is up to the host to retry.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit fd1232b2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e734e89f
    • NeilBrown's avatar
      md: flush writes before starting a recovery. · 16499905
      NeilBrown authored
      When we write to a degraded array which has a bitmap, we
      make sure the relevant bit in the bitmap remains set when
      the write completes (so a 're-add' can quickly rebuilt a
      temporarily-missing device).
      
      If, immediately after such a write starts, we incorporate a spare,
      commence recovery, and skip over the region where the write is
      happening (because the 'needs recovery' flag isn't set yet),
      then that write will not get to the new device.
      
      Once the recovery finishes the new device will be trusted, but will
      have incorrect data, leading to possible corruption.
      
      We cannot set the 'needs recovery' flag when we start the write as we
      do not know easily if the write will be "degraded" or not.  That
      depends on details of the particular raid level and particular write
      request.
      
      This patch fixes a corruption issue of long standing and so it
      suitable for any -stable kernel.  It applied correctly to 3.0 at
      least and will minor editing to earlier kernels.
      Reported-by: default avatarBill <billstuff2001@sbcglobal.net>
      Tested-by: default avatarBill <billstuff2001@sbcglobal.net>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/53A518BB.60709@sbcglobal.netSigned-off-by: default avatarNeilBrown <neilb@suse.de>
      
      (cherry picked from commit 133d4527)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      16499905
    • Michal Nazarewicz's avatar
      tools: ffs-test: fix header values endianess · 72dfa206
      Michal Nazarewicz authored
      It appears that no one ever run ffs-test on a big-endian machine,
      since it used cpu-endianess for fs_count and hs_count fields which
      should be in little-endian format.  Fix by wrapping the numbers in
      cpu_to_le32.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      
      (cherry picked from commit f35f7124)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      72dfa206
    • J. Bruce Fields's avatar
      nfsd: fix rare symlink decoding bug · 47f9b6ad
      J. Bruce Fields authored
      An NFS operation that creates a new symlink includes the symlink data,
      which is xdr-encoded as a length followed by the data plus 0 to 3 bytes
      of zero-padding as required to reach a 4-byte boundary.
      
      The vfs, on the other hand, wants null-terminated data.
      
      The simple way to handle this would be by copying the data into a newly
      allocated buffer with space for the final null.
      
      The current nfsd_symlink code tries to be more clever by skipping that
      step in the (likely) case where the byte following the string is already
      0.
      
      But that assumes that the byte following the string is ours to look at.
      In fact, it might be the first byte of a page that we can't read, or of
      some object that another task might modify.
      
      Worse, the NFSv4 code tries to fix the problem by actually writing to
      that byte.
      
      In the NFSv2/v3 cases this actually appears to be safe:
      
      	- nfs3svc_decode_symlinkargs explicitly null-terminates the data
      	  (after first checking its length and copying it to a new
      	  page).
      	- NFSv2 limits symlinks to 1k.  The buffer holding the rpc
      	  request is always at least a page, and the link data (and
      	  previous fields) have maximum lengths that prevent the request
      	  from reaching the end of a page.
      
      In the NFSv4 case the CREATE op is potentially just one part of a long
      compound so can end up on the end of a page if you're unlucky.
      
      The minimal fix here is to copy and null-terminate in the NFSv4 case.
      The nfsd_symlink() interface here seems too fragile, though.  It should
      really either do the copy itself every time or just require a
      null-terminated string.
      Reported-by: default avatarJeff Layton <jlayton@primarydata.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      nfsd: fix rare symlink decoding bug
      
      An NFS operation that creates a new symlink includes the symlink data,
      which is xdr-encoded as a length followed by the data plus 0 to 3 bytes
      of zero-padding as required to reach a 4-byte boundary.
      
      The vfs, on the other hand, wants null-terminated data.
      
      The simple way to handle this would be by copying the data into a newly
      allocated buffer with space for the final null.
      
      The current nfsd_symlink code tries to be more clever by skipping that
      step in the (likely) case where the byte following the string is already
      0.
      
      But that assumes that the byte following the string is ours to look at.
      In fact, it might be the first byte of a page that we can't read, or of
      some object that another task might modify.
      
      Worse, the NFSv4 code tries to fix the problem by actually writing to
      that byte.
      
      In the NFSv2/v3 cases this actually appears to be safe:
      
      	- nfs3svc_decode_symlinkargs explicitly null-terminates the data
      	  (after first checking its length and copying it to a new
      	  page).
      	- NFSv2 limits symlinks to 1k.  The buffer holding the rpc
      	  request is always at least a page, and the link data (and
      	  previous fields) have maximum lengths that prevent the request
      	  from reaching the end of a page.
      
      In the NFSv4 case the CREATE op is potentially just one part of a long
      compound so can end up on the end of a page if you're unlucky.
      
      The minimal fix here is to copy and null-terminate in the NFSv4 case.
      The nfsd_symlink() interface here seems too fragile, though.  It should
      really either do the copy itself every time or just require a
      null-terminated string.
      Reported-by: default avatarJeff Layton <jlayton@primarydata.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      nfsd: properly handle embedded newlines in fault_injection input
      
      Currently rpc_pton() fails to handle the case where you echo an address
      into the file, as it barfs on the newline. Ensure that we NULL out the
      first occurrence of any newline.
      Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      nfsd: fix return of nfs4_acl_write_who
      
      AFAICT, the only way to hit this error is to pass this function a bogus
      "who" value. In that case, we probably don't want to return -1 as that
      could get sent back to the client. Turn this into nfserr_serverfault,
      which is a more appropriate error for a server bug like this.
      Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      nfsd: add appropriate __force directives to filehandle generation code
      
      The filehandle structs all use host-endian values, but will sometimes
      stuff big-endian values into those fields. This is OK since these
      values are opaque to the client, but it confuses sparse. Add __force to
      make it clear that we are doing this intentionally.
      Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      nfsd: nfsd_splice_read and nfsd_readv should return __be32
      
      The callers expect a __be32 return and the functions they call return
      __be32, so having these return int is just wrong. Also, nfsd_finish_read
      can be made static.
      Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      nfsd: clean up sparse endianness warnings in nfscache.c
      
      We currently hash the XID to determine a hash bucket to use for the
      reply cache entry, which is fed into hash_32 without byte-swapping it.
      Add __force to make sparse happy, and add some comments to explain
      why.
      Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      nfsd: add __force to opaque verifier field casts
      
      sparse complains that we're stuffing non-byte-swapped values into
      __be32's here. Since they're supposed to be opaque, it doesn't matter
      much. Just add __force to make sparse happy.
      Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      NFSD: Using exp_get for export getting
      
      Don't using cache_get besides export.h, using exp_get for export.
      Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      NFSD: Using path_get when assigning path for export
      Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      SUNRPC/NFSD: Change to type of bool for rq_usedeferral and rq_splice_ok
      
      rq_usedeferral and rq_splice_ok are used as 0 and 1, just defined to bool.
      Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      NFSD: Using min/max/min_t/max_t for calculate
      Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      (cherry picked from commit b829e919
      76f47128)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      47f9b6ad
    • Paolo Bonzini's avatar
      KVM: x86: preserve the high 32-bits of the PAT register · a804c325
      Paolo Bonzini authored
      KVM does not really do much with the PAT, so this went unnoticed for a
      long time.  It is exposed however if you try to do rdmsr on the PAT
      register.
      Reported-by: default avatarValentine Sinitsyn <valentine.sinitsyn@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      
      (cherry picked from commit 7cb060a9)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a804c325
    • Nadav Amit's avatar
      KVM: x86: Increase the number of fixed MTRR regs to 10 · dc8dca04
      Nadav Amit authored
      commit 682367c4 upstream.
      
      Recent Intel CPUs have 10 variable range MTRRs. Since operating systems
      sometime make assumptions on CPUs while they ignore capability MSRs, it is
      better for KVM to be consistent with recent CPUs. Reporting more MTRRs than
      actually supported has no functional implications.
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 80bbfbaa)
      dc8dca04
    • David R. Piegdon's avatar
      ARM: OMAP2+: Fix parser-bug in platform muxing code · c493b518
      David R. Piegdon authored
      Fix a parser-bug in the omap2 muxing code where muxtable-entries will be
      wrongly selected if the requested muxname is a *prefix* of their
      m0-entry and they have a matching mN-entry. Fix by additionally checking
      that the length of the m0_entry is equal.
      
      For example muxing of "dss_data2.dss_data2" on omap32xx will fail
      because the prefix "dss_data2" will match the mux-entries "dss_data2" as
      well as "dss_data20", with the suffix "dss_data2" matching m0 (for
      dss_data2) and m4 (for dss_data20). Thus both are recognized as signal
      path candidates:
      
      Relevant muxentries from mux34xx.c:
              _OMAP3_MUXENTRY(DSS_DATA20, 90,
                      "dss_data20", NULL, "mcspi3_somi", "dss_data2",
                      "gpio_90", NULL, NULL, "safe_mode"),
              _OMAP3_MUXENTRY(DSS_DATA2, 72,
                      "dss_data2", NULL, NULL, NULL,
                      "gpio_72", NULL, NULL, "safe_mode"),
      
      This will result in a failure to mux the pin at all:
      
       _omap_mux_get_by_name: Multiple signal paths (2) for dss_data2.dss_data2
      
      Patch should apply to linus' latest master down to rather old linux-2.6
      trees.
      Signed-off-by: default avatarDavid R. Piegdon <lkml@p23q.org>
      Cc: stable@vger.kernel.org
      [tony@atomide.com: updated description to include full description]
      Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
      
      (cherry picked from commit c021f241)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c493b518
    • Thomas Hellstrom's avatar
      drm/vmwgfx: Fix incorrect write to read-only register v2: · 61010fb2
      Thomas Hellstrom authored
      Commit "drm/vmwgfx: correct fb_fix_screeninfo.line_length", while fixing a
      vmwgfx fbdev bug, also writes the pitch to a supposedly read-only register:
      SVGA_REG_BYTES_PER_LINE, while it should be (and also in fact is) written to
      SVGA_REG_PITCHLOCK.
      
      This patch is Cc'd stable because of the unknown effects writing to this
      register might have, particularly on older device versions.
      
      v2: Updated log message.
      
      Cc: stable@vger.kernel.org
      Cc: Christopher Friedt <chrisfriedt@gmail.com>
      Tested-by: default avatarChristopher Friedt <chrisfriedt@gmail.com>
      Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: default avatarJakob Bornecrantz <jakob@vmware.com>
      
      (cherry picked from commit 4e578080)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      61010fb2
    • Thomas Petazzoni's avatar
      mtd: pxa3xx_nand: make the driver work on big-endian systems · d6e5b574
      Thomas Petazzoni authored
      The pxa3xx_nand driver currently uses __raw_writel() and __raw_readl()
      to access I/O registers. However, those functions do not do any
      endianness swapping, which means that they won't work when the CPU
      runs in big-endian but the I/O registers are little endian, which is
      the common situation for ARM systems running big endian.
      
      Since __raw_writel() and __raw_readl() do not include any memory
      barriers and the pxa3xx_nand driver can only be compiled for ARM
      platforms, the closest I/o accessors functions that do endianess
      swapping are writel_relaxed() and readl_relaxed().
      
      This patch has been verified to work on Armada XP GP: without the
      patch, the NAND is not detected when the kernel runs big endian while
      it is properly detected when the kernel runs little endian. With the
      patch applied, the NAND is properly detected in both situations
      (little and big endian).
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: <stable@vger.kernel.org> # v3.13+
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      
      (cherry picked from commit b7e46062)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      d6e5b574
    • Michal Nazarewicz's avatar
      usb: gadget: f_fs: fix NULL pointer dereference when there are no strings · 9f7f7931
      Michal Nazarewicz authored
      If the descriptors do not need any strings and user space sends empty
      set of strings, the ffs->stringtabs field remains NULL.  Thus
      *ffs->stringtabs in functionfs_bind leads to a NULL pointer
      dereferenece.
      
      The bug was introduced by commit [fd7c9a00: “use usb_string_ids_n()”].
      
      While at it, remove double initialisation of lang local variable in
      that function.
      
      ffs->strings_count does not need to be checked in any way since in
      the above scenario it will remain zero and usb_string_ids_n() is
      a no-operation when colled with 0 argument.
      
      Cc: <stable@vger.kernel.org>  # v2.6.36+
      Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      
      (cherry picked from commit f0688c8b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9f7f7931
    • Johan Hovold's avatar
      USB: ftdi_sio: fix null deref at port probe · dcdbe379
      Johan Hovold authored
      Fix NULL-pointer dereference when probing an interface with no
      endpoints.
      
      These devices have two bulk endpoints per interface, but this avoids
      crashing the kernel if a user forces a non-FTDI device to be probed.
      
      Note that the iterator variable was made unsigned in order to avoid
      a maybe-uninitialized compiler warning for ep_desc after the loop.
      
      Fixes: 895f28ba ("USB: ftdi_sio: fix hi-speed device packet size
      calculation")
      Reported-by: default avatarMike Remski <mremski@mutualink.net>
      Tested-by: default avatarMike Remski <mremski@mutualink.net>
      Cc: <stable@vger.kernel.org>	# 2.6.31
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      
      (cherry picked from commit aea1ae87)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      dcdbe379
    • Bjørn Mork's avatar
      usb: option: add/modify Olivetti Olicard modems · a886697a
      Bjørn Mork authored
      Adding a couple of Olivetti modems and blacklisting the net
      function on a couple which are already supported.
      Reported-by: default avatarLars Melin <larsm17@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      
      (cherry picked from commit b0ebef36)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      a886697a
    • Oliver Neukum's avatar
      USB: option: add device ID for SpeedUp SU9800 usb 3g modem · 5fbc0fdf
      Oliver Neukum authored
      Reported by Alif Mubarak Ahmad:
      
      This device vendor and product id is 1c9e:9800
      It is working as serial interface with generic usbserial driver.
      I thought it is more suitable to use usbserial option driver, which has
      better capability distinguishing between modem serial interface and
      micro sd storage interface.
      
      [ johan: style changes ]
      Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
      Tested-by: default avatarAlif Mubarak Ahmad <alive4ever@live.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      
      (cherry picked from commit 1cab4c68)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      5fbc0fdf
    • Wang, Yu's avatar
      xhci: Fix runtime suspended xhci from blocking system suspend. · fd99608a
      Wang, Yu authored
      The system suspend flow as following:
      1, Freeze all user processes and kenrel threads.
      
      2, Try to suspend all devices.
      
      2.1, If pci device is in RPM suspended state, then pci driver will try
      to resume it to RPM active state in the prepare stage.
      
      2.2, xhci_resume function calls usb_hcd_resume_root_hub to queue two
      workqueue items to resume usb2&usb3 roothub devices.
      
      2.3, Call suspend callbacks of devices.
      
      2.3.1, All suspend callbacks of all hcd's children, including
      roothub devices are called.
      
      2.3.2, Finally, hcd_pci_suspend callback is called.
      
      Due to workqueue threads were already frozen in step 1, the workqueue
      items can't be scheduled, and the roothub devices can't be resumed in
      this flow. The HCD_FLAG_WAKEUP_PENDING flag which is set in
      usb_hcd_resume_root_hub won't be cleared. Finally,
      hcd_pci_suspend will return -EBUSY, and system suspend fails.
      
      The reason why this issue doesn't show up very often is due to that
      choose_wakeup will be called in step 2.3.1. In step 2.3.1, if
      udev->do_remote_wakeup is not equal to device_may_wakeup(&udev->dev), then
      udev will resume to RPM active for changing the wakeup settings. This
      has been a lucky hit which hides this issue.
      
      For some special xHCI controllers which have no USB2 port, then roothub
      will not match hub driver due to probe failed. Then its
      do_remote_wakeup will be set to zero, and we won't be as lucky.
      
      xhci driver doesn't need to resume roothub devices everytime like in
      the above case. It's only needed when there are pending event TRBs.
      
      This patch should be back-ported to kernels as old as 3.2, that
      contains the commit f69e3120
      "USB: XHCI: resume root hubs when the controller resumes"
      
      Cc: stable@vger.kernel.org # 3.2
      Signed-off-by: default avatarWang, Yu <yu.y.wang@intel.com>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      [use readl() instead of removed xhci_readl(), reword commit message -Mathias]
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit d6236f6d)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      fd99608a
    • Mathias Nyman's avatar
      xhci: correct burst count field for isoc transfers on 1.0 xhci hosts · 7e29a293
      Mathias Nyman authored
      The transfer burst count (TBC) field in xhci 1.0 hosts should be set
      to the number of bursts needed to transfer all packets in a isoc TD.
      Supported values are 0-2 (1 to 3 bursts per service interval).
      
      Formula for TBC calculation is given in xhci spec section 4.11.2.3:
      TBC = roundup( Transfer Descriptor Packet Count / Max Burst Size +1 ) - 1
      
      This patch should be applied to stable kernels since 3.0 that contain
      the commit 5cd43e33
      "xhci 1.0: Set transfer burst count field."
      
      Cc: stable@vger.kernel.org # 3.0
      Suggested-by: default avatarShiChun Ma <masc2008@qq.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 3213b151)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7e29a293
    • Brian King's avatar
      ibmvscsi: Abort init sequence during error recovery · 520db9bb
      Brian King authored
      If a CRQ reset is triggered for some reason while in the middle
      of performing VSCSI adapter initialization, we don't want to
      call the done function for the initialization MAD commands as
      this will only result in two threads attempting initialization
      at the same time, resulting in failures.
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Acked-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      
      (cherry picked from commit 9ee75597)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      520db9bb