1. 12 Sep, 2014 40 commits
    • Benjamin Tissoires's avatar
      Input: synaptics - fix resolution for manually provided min/max · fd84a219
      Benjamin Tissoires authored
      commit 421e08c4 fixed the reported min/max for the X and Y axis,
      but unfortunately, it broke the resolution of those same axis.
      
      On the t540p, the resolution is the same regarding X and Y. It is not
      a problem for xf86-input-synaptics because this driver is only interested
      in the ratio between X and Y.
      Unfortunately, xf86-input-cmt uses directly the resolution, and having a
      null resolution leads to some divide by 0 errors, which are translated by
      -infinity in the resulting coordinates.
      Reported-by: default avatarPeter Hutterer <peter.hutterer@who-t.net>
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      
      (cherry picked from commit d49cb7ae)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      fd84a219
    • Benny Halevy's avatar
      nfsd4: use recall_lock for delegation hashing · 7668c6eb
      Benny Halevy authored
      This fixes a bug in the handling of the fi_delegations list.
      
      nfs4_setlease does not hold the recall_lock when adding to it. The
      client_mutex is held, which prevents against concurrent list changes,
      but nfsd_break_deleg_cb does not hold while walking it. New delegations
      could theoretically creep onto the list while we're walking it there.
      Signed-off-by: default avatarBenny Halevy <bhalevy@primarydata.com>
      Signed-off-by: default avatarJeff Layton <jlayton@primarydata.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      
      (cherry picked from commit 931ee56c)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7668c6eb
    • Jérôme Carretero's avatar
      ahci: Add Device ID for HighPoint RocketRaid 642L · c30e6f9b
      Jérôme Carretero authored
      This device normally comes with a proprietary driver, using a web GUI
      to configure RAID:
       http://www.highpoint-tech.com/USA_new/series_rr600-download.htm
      But thankfully it also works out of the box with the AHCI driver,
      being just a Marvell 88SE9235.
      
      Devices 640L, 644L, 644LS should also be supported but not tested here.
      Signed-off-by: default avatarJérôme Carretero <cJ-ko@zougloub.eu>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit d2518365)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c30e6f9b
    • Yann Droneaud's avatar
      RDMA/cxgb4: Add missing padding at end of struct c4iw_create_cq_resp · 0b7b97df
      Yann Droneaud authored
      The i386 ABI disagrees with most other ABIs regarding alignment of
      data types larger than 4 bytes: on most ABIs a padding must be added
      at end of the structures, while it is not required on i386.
      
      So for most ABI struct c4iw_create_cq_resp gets implicitly padded
      to be aligned on a 8 bytes multiple, while for i386, such padding
      is not added.
      
      The tool pahole can be used to find such implicit padding:
      
        $ pahole --anon_include \
                 --nested_anon_include \
                 --recursive \
                 --class_name c4iw_create_cq_resp \
                 drivers/infiniband/hw/cxgb4/iw_cxgb4.o
      
      Then, structure layout can be compared between i386 and x86_64:
      
        +++ obj-i386/drivers/infiniband/hw/cxgb4/iw_cxgb4.o.pahole.txt   2014-03-28 11:43:05.547432195 +0100
        --- obj-x86_64/drivers/infiniband/hw/cxgb4/iw_cxgb4.o.pahole.txt 2014-03-28 10:55:10.990133017 +0100
        @@ -14,9 +13,8 @@ struct c4iw_create_cq_resp {
                __u32                      size;                 /*    28     4 */
                __u32                      qid_mask;             /*    32     4 */
      
        -       /* size: 36, cachelines: 1, members: 6 */
        -       /* last cacheline: 36 bytes */
        +       /* size: 40, cachelines: 1, members: 6 */
        +       /* padding: 4 */
        +       /* last cacheline: 40 bytes */
         };
      
      This ABI disagreement will make an x86_64 kernel try to write past the
      buffer provided by an i386 binary.
      
      When boundary check will be implemented, the x86_64 kernel will refuse
      to write past the i386 userspace provided buffer and the uverbs will
      fail.
      
      If the structure is on a page boundary and the next page is not
      mapped, ib_copy_to_udata() will fail and the uverb will fail.
      
      This patch adds an explicit padding at end of structure
      c4iw_create_cq_resp, and, like 92b0ca7c ("IB/mlx5: Fix stack info
      leak in mlx5_ib_alloc_ucontext()"), makes function c4iw_create_cq()
      not writting this padding field to userspace. This way, x86_64 kernel
      will be able to write struct c4iw_create_cq_resp as expected by
      unpatched and patched i386 libcxgb4.
      
      Link: http://marc.info/?i=cover.1399309513.git.ydroneaud@opteya.com
      Cc: <stable@vger.kernel.org>
      Fixes: cfdda9d7 ("RDMA/cxgb4: Add driver for Chelsio T4 RNIC")
      Fixes: e24a72a3 ("RDMA/cxgb4: Fix four byte info leak in c4iw_create_cq()")
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarYann Droneaud <ydroneaud@opteya.com>
      Acked-by: default avatarSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      
      (cherry picked from commit b6f04d3d)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      0b7b97df
    • Dan Carpenter's avatar
      RDMA/cxgb4: Fix four byte info leak in c4iw_create_cq() · 9f380f02
      Dan Carpenter authored
      commit e24a72a3 upstream.
      
      There is a four byte hole at the end of the "uresp" struct after the
      ->qid_mask member.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      (cherry picked from commit bec3dbf1)
      9f380f02
    • Thomas Gleixner's avatar
      rtmutex: Fix deadlock detector for real · 4a988694
      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>
      4a988694
    • Johan Hovold's avatar
      USB: cdc-acm: fix potential urb leak and PM imbalance in write · c7868549
      Johan Hovold authored
      Make sure to check return value of autopm get in write() in order to
      avoid urb leak and PM counter imbalance on errors.
      
      Fixes: 11ea859d ("USB: additional power savings for cdc-acm devices
      that support remote wakeup")
      
      Cc: <stable@vger.kernel.org>	# v2.6.27
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 183a4508)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c7868549
    • Rik van Riel's avatar
      mm/page-writeback.c: fix divide by zero in pos_ratio_polynom · 052ebb23
      Rik van Riel authored
      It is possible for "limit - setpoint + 1" to equal zero, after getting
      truncated to a 32 bit variable, and resulting in a divide by zero error.
      
      Using the fully 64 bit divide functions avoids this problem.  It also
      will cause pos_ratio_polynom() to return the correct value when
      (setpoint - limit) exceeds 2^32.
      
      Also uninline pos_ratio_polynom, at Andrew's request.
      Signed-off-by: default avatarRik van Riel <riel@redhat.com>
      Reviewed-by: default avatarMichal Hocko <mhocko@suse.cz>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Cc: Luiz Capitulino <lcapitulino@redhat.com>
      Cc: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit d5c9fde3)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      052ebb23
    • paul.szabo@sydney.edu.au's avatar
      Negative (setpoint-dirty) in bdi_position_ratio() · 9ae21c6f
      paul.szabo@sydney.edu.au authored
      In bdi_position_ratio(), get difference (setpoint-dirty) right even when
      negative. Both setpoint and dirty are unsigned long, the difference was
      zero-padded thus wrongly sign-extended to s64. This issue affects all
      32-bit architectures, does not affect 64-bit architectures where long
      and s64 are equivalent.
      
      In this function, dirty is between freerun and limit, the pseudo-float x
      is between [-1,1], expected to be negative about half the time. With
      zero-padding, instead of a small negative x we obtained a large positive
      one so bdi_position_ratio() returned garbage.
      
      Casting the difference to s64 also prevents overflow with left-shift;
      though normally these numbers are small and I never observed a 32-bit
      overflow there.
      
      (This patch does not solve the PAE OOM issue.)
      
      Paul Szabo   psz@maths.usyd.edu.au   http://www.maths.usyd.edu.au/u/psz/
      School of Mathematics and Statistics   University of Sydney    Australia
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Reported-by: default avatarPaul Szabo <psz@maths.usyd.edu.au>
      Reference: http://bugs.debian.org/695182Signed-off-by: default avatarPaul Szabo <psz@maths.usyd.edu.au>
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      
      (cherry picked from commit ed84825b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9ae21c6f
    • Oleg Nesterov's avatar
      KVM: async_pf: mm->mm_users can not pin apf->mm · 9d42e38b
      Oleg Nesterov authored
      get_user_pages(mm) is simply wrong if mm->mm_users == 0 and exit_mmap/etc
      was already called (or is in progress), mm->mm_count can only pin mm->pgd
      and mm_struct itself.
      
      Change kvm_setup_async_pf/async_pf_execute to inc/dec mm->mm_users.
      
      kvm_create_vm/kvm_destroy_vm play with ->mm_count too but this case looks
      fine at first glance, it seems that this ->mm is only used to verify that
      current->mm == kvm->mm.
      Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      
      (cherry picked from commit 41c22f62)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9d42e38b
    • Radim Krčmář's avatar
      kvm: remove .done from struct kvm_async_pf · 26f1ded6
      Radim Krčmář authored
      '.done' is used to mark the completion of 'async_pf_execute()', but
      'cancel_work_sync()' returns true when the work was canceled, so we
      use it instead.
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarGleb Natapov <gleb@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      
      (cherry picked from commit 98fda169)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      26f1ded6
    • Radim Krčmář's avatar
      kvm: free resources after canceling async_pf · 73756245
      Radim Krčmář authored
      When we cancel 'async_pf_execute()', we should behave as if the work was
      never scheduled in 'kvm_setup_async_pf()'.
      Fixes a bug when we can't unload module because the vm wasn't destroyed.
      Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarGleb Natapov <gleb@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      
      (cherry picked from commit 28b441e2)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      73756245
    • Kazuya Mio's avatar
      ext4: FIBMAP ioctl causes BUG_ON due to handle EXT_MAX_BLOCKS · 8303abc4
      Kazuya Mio authored
      When we try to get 2^32-1 block of the file which has the extent
      (ee_block=2^32-2, ee_len=1) with FIBMAP ioctl, it causes BUG_ON
      in ext4_ext_put_gap_in_cache().
      
      To avoid the problem, ext4_map_blocks() needs to check the file logical block
      number. ext4_ext_put_gap_in_cache() called via ext4_map_blocks() cannot
      handle 2^32-1 because the maximum file logical block number is 2^32-2.
      
      Note that ext4_ind_map_blocks() returns -EIO when the block number is invalid.
      So ext4_map_blocks() should also return the same errno.
      Signed-off-by: default avatarKazuya Mio <k-mio@sx.jp.nec.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit 4adb6ab3)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8303abc4
    • Ben Hutchings's avatar
      Revert "alpha: fix broken network checksum" · 437368bd
      Ben Hutchings authored
      This reverts commit b93b90ff, which
      was commit 0ef38d70 upstream.
      It was intended to fix a regression which never occurred in 3.2.
      
      (cherry picked from commit 53119558)
      
      (cherry picked from commit HEAD)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      437368bd
    • Christopher Friedt's avatar
      drm/vmwgfx: correct fb_fix_screeninfo.line_length · 741f83b1
      Christopher Friedt authored
      commit aa6de142 upstream.
      
      Previously, the vmwgfx_fb driver would allow users to call FBIOSET_VINFO, but it would not adjust
      the FINFO properly, resulting in distorted screen rendering. The patch corrects that behaviour.
      
      See https://bugs.gentoo.org/show_bug.cgi?id=494794 for examples.
      Signed-off-by: default avatarChristopher Friedt <chrisfriedt@gmail.com>
      Reviewed-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      (cherry picked from commit 8dd0cd27)
      741f83b1
    • Eric Whitney's avatar
      ext4: fix partial cluster handling for bigalloc file systems · 69d5e986
      Eric Whitney authored
      Commit 9cb00419, which enables hole punching for bigalloc file
      systems, exposed a bug introduced by commit 6ae06ff5 in an earlier
      release.  When run on a bigalloc file system, xfstests generic/013, 068,
      075, 083, 091, 100, 112, 127, 263, 269, and 270 fail with e2fsck errors
      or cause kernel error messages indicating that previously freed blocks
      are being freed again.
      
      The latter commit optimizes the selection of the starting extent in
      ext4_ext_rm_leaf() when hole punching by beginning with the extent
      supplied in the path argument rather than with the last extent in the
      leaf node (as is still done when truncating).  However, the code in
      rm_leaf that initially sets partial_cluster to track cluster sharing on
      extent boundaries is only guaranteed to run if rm_leaf starts with the
      last node in the leaf.  Consequently, partial_cluster is not correctly
      initialized when hole punching, and a cluster on the boundary of a
      punched region that should be retained may instead be deallocated.
      Signed-off-by: default avatarEric Whitney <enwlinux@gmail.com>
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit c0634493)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      69d5e986
    • Matthew Leach's avatar
      net: socket: error on a negative msg_namelen · 19796c00
      Matthew Leach authored
      When copying in a struct msghdr from the user, if the user has set the
      msg_namelen parameter to a negative value it gets clamped to a valid
      size due to a comparison between signed and unsigned values.
      
      Ensure the syscall errors when the user passes in a negative value.
      Signed-off-by: default avatarMatthew Leach <matthew.leach@arm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit dbb490b9)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      19796c00
    • Peter Boström's avatar
      vlan: Set correct source MAC address with TX VLAN offload enabled · 6d30be70
      Peter Boström authored
      With TX VLAN offload enabled the source MAC address for frames sent using the
      VLAN interface is currently set to the address of the real interface. This is
      wrong since the VLAN interface may be configured with a different address.
      
      The bug was introduced in commit 2205369a
      ("vlan: Fix header ops passthru when doing TX VLAN offload.").
      
      This patch sets the source address before calling the create function of the
      real interface.
      Signed-off-by: default avatarPeter Boström <peter.bostrom@netrounds.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit dd38743b)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      6d30be70
    • Al Viro's avatar
      hpfs: deadlock and race in directory lseek() · 2048f986
      Al Viro authored
      For one thing, there's an ABBA deadlock on hpfs fs-wide lock and i_mutex
      in hpfs_dir_lseek() - there's a lot of methods that grab the former with
      the caller already holding the latter, so it must take i_mutex first.
      
      For another, locking the damn thing, carefully validating the offset,
      then dropping locks and assigning the offset is obviously racy.
      
      Moreover, we _must_ do hpfs_add_pos(), or the machinery in dnode.c
      won't modify the sucker on B-tree surgeries.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      
      (cherry picked from commit 31abdab9)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      2048f986
    • Geert Uytterhoeven's avatar
      TTY: pmac_zilog, check existence of ports in pmz_console_init() · c80a7143
      Geert Uytterhoeven authored
      When booting a multi-platform m68k kernel on a non-Mac with "console=ttyS0"
      on the kernel command line, it crashes with:
      
      Unable to handle kernel NULL pointer dereference at virtual address   (null)
      Oops: 00000000
      PC: [<0013ad28>] __pmz_startup+0x32/0x2a0
      ...
      Call Trace: [<002c5d3e>] pmz_console_setup+0x64/0xe4
      
      The normal tty driver doesn't crash, because init_pmz() checks
      pmz_ports_count again after calling pmz_probe().
      
      In the serial console initialization path, pmz_console_init() doesn't do
      this, causing the driver to crash later.
      
      Add a check for pmz_ports_count to fix this.
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Finn Thain <fthain@telegraphics.com.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit dc1dc2f8)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      c80a7143
    • Helge Deller's avatar
      nfs: fix do_div() warning by instead using sector_div() · f3a5815c
      Helge Deller authored
      When compiling a 32bit kernel with CONFIG_LBDAF=n the compiler complains like
      shown below.  Fix this warning by instead using sector_div() which is provided
      by the kernel.h header file.
      
      fs/nfs/blocklayout/extents.c: In function ‘normalize’:
      include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default]
      fs/nfs/blocklayout/extents.c:47:13: note: in expansion of macro ‘do_div’
      nfs/blocklayout/extents.c:47:2: warning: right shift count >= width of type [enabled by default]
      fs/nfs/blocklayout/extents.c:47:2: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [enabled by default]
      include/asm-generic/div64.h:35:17: note: expected ‘uint64_t *’ but argument is of type ‘sector_t *’
       extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      
      (cherry picked from commit 3873d064)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f3a5815c
    • Marc Kleine-Budde's avatar
      can: flexcan: flexcan_remove(): add missing netif_napi_del() · 8ffe3f4b
      Marc Kleine-Budde authored
      This patch adds the missing netif_napi_del() to the flexcan_remove() function.
      
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      
      (cherry picked from commit d96e43e8)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8ffe3f4b
    • Lai Jiangshan's avatar
      workqueue: ensure @task is valid across kthread_stop() · f42fb6a0
      Lai Jiangshan authored
      When a kworker should die, the kworkre is notified through WORKER_DIE
      flag instead of kthread_should_stop().  This, IIRC, is primarily to
      keep the test synchronized inside worker_pool lock.  WORKER_DIE is
      first set while holding pool->lock, the lock is dropped and
      kthread_stop() is called.
      
      Unfortunately, this means that there's a slight chance that the target
      kworker may see WORKER_DIE before kthread_stop() finishes and exits
      and frees the target task before or during kthread_stop().
      
      Fix it by pinning the target task before setting WORKER_DIE and
      putting it after kthread_stop() is done.
      
      tj: Improved patch description and comment.  Moved pinning above
          WORKER_DIE for better signify what it's protecting.
      
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      
      (cherry picked from commit 5bdfff96)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      f42fb6a0
    • Alan Stern's avatar
      usb-storage: enable multi-LUN scanning when needed · 9a353395
      Alan Stern authored
      People sometimes create their own custom-configured kernels and forget
      to enable CONFIG_SCSI_MULTI_LUN.  This causes problems when they plug
      in a USB storage device (such as a card reader) with more than one
      LUN.
      
      Fortunately, we can tell fairly easily when a storage device claims to
      have more than one LUN.  When that happens, this patch asks the SCSI
      layer to probe all the LUNs automatically, regardless of the config
      setting.
      
      The patch also updates the Kconfig help text for usb-storage,
      explaining that CONFIG_SCSI_MULTI_LUN may be necessary.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarThomas Raschbacher <lordvan@lordvan.com>
      CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
      CC: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 823d12c9)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      9a353395
    • Chris Mason's avatar
      Btrfs: setup inode location during btrfs_init_inode_locked · b7710aeb
      Chris Mason authored
      We have a race during inode init because the BTRFS_I(inode)->location is setup
      after the inode hash table lock is dropped.  btrfs_find_actor uses the location
      field, so our search might not find an existing inode in the hash table if we
      race with the inode init code.
      
      This commit changes things to setup the location field sooner.  Also the find actor now
      uses only the location objectid to match inodes.  For inode hashing, we just
      need a unique and stable test, it doesn't have to reflect the inode numbers we
      show to userland.
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      CC: stable@vger.kernel.org
      
      (cherry picked from commit 90d3e592)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      b7710aeb
    • Mihai Caraman's avatar
      KVM: PPC: e500: Fix bad address type in deliver_tlb_misss() · 1441d808
      Mihai Caraman authored
      Use gva_t instead of unsigned int for eaddr in deliver_tlb_miss().
      Signed-off-by: default avatarMihai Caraman <mihai.caraman@freescale.com>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
      
      (cherry picked from commit 70713fe3)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      1441d808
    • 张君's avatar
      usb: option: add new zte 3g modem pids to option driver · 4b5c514d
      张君 authored
      Signed-off-by: default avatarJun zhang <zhang.jun92@zte.com.cn>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 4d90b819)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      4b5c514d
    • Thomas Hellstrom's avatar
      drm/ttm: Fix accesses through vmas with only partial coverage · 3596770b
      Thomas Hellstrom authored
      VMAs covering a bo but that didn't start at the same address space offset as
      the bo they were mapping were incorrectly generating SEGFAULT errors in
      the fault handler.
      Reported-by: default avatarJoseph Dolinak <kanilo2@yahoo.com>
      Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: default avatarJakob Bornecrantz <jakob@vmware.com>
      Cc: stable@vger.kernel.org
      
      (cherry picked from commit d3867355)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      3596770b
    • Geert Uytterhoeven's avatar
      sh: always link in helper functions extracted from libgcc · 143b1c74
      Geert Uytterhoeven authored
      E.g. landisk_defconfig, which has CONFIG_NTFS_FS=m:
      
        ERROR: "__ashrdi3" [fs/ntfs/ntfs.ko] undefined!
      
      For "lib-y", if no symbols in a compilation unit are referenced by other
      units, the compilation unit will not be included in vmlinux.  This
      breaks modules that do reference those symbols.
      
      Use "obj-y" instead to fix this.
      
      http://kisskb.ellerman.id.au/kisskb/buildresult/8838077/
      
      This doesn't fix all cases. There are others, e.g. udivsi3.
      This is also not limited to sh, many architectures handle this in the
      same way.
      
      A simple solution is to unconditionally include all helper functions.
      A more complex solution is to make the choice of "lib-y" or "obj-y" depend
      on CONFIG_MODULES:
      
        obj-$(CONFIG_MODULES) += ...
        lib-y($CONFIG_MODULES) += ...
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Tested-by: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Reviewed-by: default avatarNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      
      (cherry picked from commit 84ed8a99)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      143b1c74
    • Yan, Zheng's avatar
      ceph: wake up 'safe' waiters when unregistering request · 8f63a0b5
      Yan, Zheng authored
      We also need to wake up 'safe' waiters if error occurs or request
      aborted. Otherwise sync(2)/fsync(2) may hang forever.
      Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
      Signed-off-by: default avatarSage Weil <sage@inktank.com>
      
      (cherry picked from commit fc55d2c9)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8f63a0b5
    • Yan, Zheng's avatar
      ceph: cleanup aborted requests when re-sending requests. · ca238c7a
      Yan, Zheng authored
      Aborted requests usually get cleared when the reply is received.
      If MDS crashes, no reply will be received. So we need to cleanup
      aborted requests when re-sending requests.
      Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
      Reviewed-by: default avatarGreg Farnum <greg@inktank.com>
      Signed-off-by: default avatarSage Weil <sage@inktank.com>
      
      (cherry picked from commit eb1b8af3)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      ca238c7a
    • Dan Carpenter's avatar
      net: clamp ->msg_namelen instead of returning an error · 7f60f768
      Dan Carpenter authored
      If kmsg->msg_namelen > sizeof(struct sockaddr_storage) then in the
      original code that would lead to memory corruption in the kernel if you
      had audit configured.  If you didn't have audit configured it was
      harmless.
      
      There are some programs such as beta versions of Ruby which use too
      large of a buffer and returning an error code breaks them.  We should
      clamp the ->msg_namelen value instead.
      
      Fixes: 1661bf36 ("net: heap overflow in __audit_sockaddr()")
      Reported-by: default avatarEric Wong <normalperson@yhbt.net>
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Tested-by: default avatarEric Wong <normalperson@yhbt.net>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit db31c55a)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      7f60f768
    • Sergei Trofimovich's avatar
      um: add missing declaration of 'getrlimit()' and friends · ff185585
      Sergei Trofimovich authored
      arch/um/os-Linux/start_up.c: In function 'check_coredump_limit':
      arch/um/os-Linux/start_up.c:338:16: error: storage size of 'lim' isn't known
      arch/um/os-Linux/start_up.c:339:2: error: implicit declaration of function 'getrlimit' [-Werror=implicit-function-declaration]
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      CC: Jeff Dike <jdike@addtoit.com>
      CC: Richard Weinberger <richard@nod.at>
      CC: Al Viro <viro@zeniv.linux.org.uk>
      CC: user-mode-linux-devel@lists.sourceforge.net
      CC: user-mode-linux-user@lists.sourceforge.net
      CC: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      
      (cherry picked from commit fdfa4c95)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      ff185585
    • Jean Delvare's avatar
      hwmon: (w83l768ng) Fix fan speed control range · fee83ed3
      Jean Delvare authored
      The W83L786NG stores the fan speed on 4 bits while the sysfs interface
      uses a 0-255 range. Thus the driver should scale the user input down
      to map it to the device range, and scale up the value read from the
      device before presenting it to the user. The reserved register nibble
      should be left unchanged.
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      
      (cherry picked from commit 33a7ab91)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      fee83ed3
    • Matthew Garrett's avatar
      x86, efi: Don't use (U)EFI time services on 32 bit · 019f80eb
      Matthew Garrett authored
      UEFI time services are often broken once we're in virtual mode. We were
      already refusing to use them on 64-bit systems, but it turns out that
      they're also broken on some 32-bit firmware, including the Dell Venue.
      Disable them for now, we can revisit once we have the 1:1 mappings code
      incorporated.
      Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
      Link: http://lkml.kernel.org/r/1385754283-2464-1-git-send-email-matthew.garrett@nebula.com
      Cc: <stable@vger.kernel.org>
      Cc: Matt Fleming <matt.fleming@intel.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      
      (cherry picked from commit 04bf9ba7)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      019f80eb
    • Linus Walleij's avatar
      net: smc91: fix crash regression on the versatile · 1389fc69
      Linus Walleij authored
      After commit e9e4ea74
      "net: smc91x: dont't use SMC_outw for fixing up halfword-aligned data"
      The Versatile SMSC LAN91C111 is crashing like this:
      
      ------------[ cut here ]------------
      kernel BUG at /home/linus/linux/drivers/net/ethernet/smsc/smc91x.c:599!
      Internal error: Oops - BUG: 0 [#1] ARM
      Modules linked in:
      CPU: 0 PID: 43 Comm: udhcpc Not tainted 3.13.0-rc1+ #24
      task: c6ccfaa0 ti: c6cd0000 task.ti: c6cd0000
      PC is at smc_hardware_send_pkt+0x198/0x22c
      LR is at smc_hardware_send_pkt+0x24/0x22c
      pc : [<c01be324>]    lr : [<c01be1b0>]    psr: 20000013
      sp : c6cd1d08  ip : 00000001  fp : 00000000
      r10: c02adb08  r9 : 00000000  r8 : c6ced802
      r7 : c786fba0  r6 : 00000146  r5 : c8800000  r4 : c78d6000
      r3 : 0000000f  r2 : 00000146  r1 : 00000000  r0 : 00000031
      Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 0005317f  Table: 06cf4000  DAC: 00000015
      Process udhcpc (pid: 43, stack limit = 0xc6cd01c0)
      Stack: (0xc6cd1d08 to 0xc6cd2000)
      1d00:                   00000010 c8800000 c78d6000 c786fba0 c78d6000 c01be868
      1d20: c01be7a4 00004000 00000000 c786fba0 c6c12b80 c0208554 000004d0 c780fc60
      1d40: 00000220 c01fb734 00000000 00000000 00000000 c6c9a440 c6c12b80 c78d6000
      1d60: c786fba0 c6c9a440 00000000 c021d1d8 00000000 00000000 c6c12b80 c78d6000
      1d80: c786fba0 00000001 c6c9a440 c02087f8 c6c9a4a0 00080008 00000000 00000000
      1da0: c78d6000 c786fba0 c78d6000 00000138 00000000 00000000 00000000 00000000
      1dc0: 00000000 c027ba74 00000138 00000138 00000001 00000010 c6cedc00 00000000
      1de0: 00000008 c7404400 c6cd1eec c6cd1f14 c067a73c c065c0b8 00000000 c067a740
      1e00: 01ffffff 002040d0 00000000 00000000 00000000 00000000 00000000 ffffffff
      1e20: 43004400 00110022 c6cdef20 c027ae8c c6ccfaa0 be82d65c 00000014 be82d3cc
      1e40: 00000000 00000000 00000000 c01f2870 00000000 00000000 00000000 c6cd1e88
      1e60: c6ccfaa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      1e80: 00000000 00000000 00000031 c7802310 c7802300 00000138 c7404400 c0771da0
      1ea0: 00000000 c6cd1eec c7800340 00000138 be82d65c 00000014 be82d3cc c6cd1f08
      1ec0: 00000014 00000000 c7404400 c7404400 00000138 c01f4628 c78d6000 00000000
      1ee0: 00000000 be82d3cc 00000138 c6cd1f08 00000014 c6cd1ee4 00000001 00000000
      1f00: 00000000 00000000 00080011 00000002 06000000 ffffffff 0000ffff 00000002
      1f20: 06000000 ffffffff 0000ffff c00928c8 c065c520 c6cd1f58 00000003 c009299c
      1f40: 00000003 c065c520 c7404400 00000000 c7404400 c01f2218 c78106b0 c7441cb0
      1f60: 00000000 00000006 c06799fc 00000000 00000000 00000006 00000000 c01f3ee0
      1f80: 00000000 00000000 be82d678 be82d65c 00000014 00000001 00000122 c00139c8
      1fa0: c6cd0000 c0013840 be82d65c 00000014 00000006 be82d3cc 00000138 00000000
      1fc0: be82d65c 00000014 00000001 00000122 00000000 00000000 00018cb1 00000000
      1fe0: 00003801 be82d3a8 0003a0c7 b6e9af08 60000010 00000006 00000000 00000000
      [<c01be324>] (smc_hardware_send_pkt+0x198/0x22c) from [<c01be868>] (smc_hard_start_xmit+0xc4/0x1e8)
      [<c01be868>] (smc_hard_start_xmit+0xc4/0x1e8) from [<c0208554>] (dev_hard_start_xmit+0x460/0x4cc)
      [<c0208554>] (dev_hard_start_xmit+0x460/0x4cc) from [<c021d1d8>] (sch_direct_xmit+0x94/0x18c)
      [<c021d1d8>] (sch_direct_xmit+0x94/0x18c) from [<c02087f8>] (dev_queue_xmit+0x238/0x42c)
      [<c02087f8>] (dev_queue_xmit+0x238/0x42c) from [<c027ba74>] (packet_sendmsg+0xbe8/0xd28)
      [<c027ba74>] (packet_sendmsg+0xbe8/0xd28) from [<c01f2870>] (sock_sendmsg+0x84/0xa8)
      [<c01f2870>] (sock_sendmsg+0x84/0xa8) from [<c01f4628>] (SyS_sendto+0xb8/0xdc)
      [<c01f4628>] (SyS_sendto+0xb8/0xdc) from [<c0013840>] (ret_fast_syscall+0x0/0x2c)
      Code: e3130002 1a000001 e3130001 0affffcd (e7f001f2)
      ---[ end trace 81104fe70e8da7fe ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      This is because the macro operations in smc91x.h defined
      for Versatile are missing SMC_outsw() as used in this
      commit.
      
      The Versatile needs and uses the same accessors as the other
      platforms in the first if(...) clause, just switch it to using
      that and we have one problem less to worry about.
      
      This includes a hunk of a patch from Will Deacon fixin
      the other 32bit platforms as well: Innokom, Ramses, PXA,
      PCM027.
      
      Checkpatch complains about spacing, but I have opted to
      follow the style of this .h-file.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Nicolas Pitre <nico@fluxnic.net>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Cc: Jonathan Cameron <jic23@cam.ac.uk>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      Revert "net: smc91: fix crash regression on the versatile"
      
      This reverts commit b268daff.
      
      I applied the wrong version of this patch, the proper version
      is coming up next.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      net: smc91: fix crash regression on the versatile
      
      After commit e9e4ea74
      "net: smc91x: dont't use SMC_outw for fixing up halfword-aligned data"
      The Versatile SMSC LAN91C111 is crashing like this:
      
      ------------[ cut here ]------------
      kernel BUG at /home/linus/linux/drivers/net/ethernet/smsc/smc91x.c:599!
      Internal error: Oops - BUG: 0 [#1] ARM
      Modules linked in:
      CPU: 0 PID: 43 Comm: udhcpc Not tainted 3.13.0-rc1+ #24
      task: c6ccfaa0 ti: c6cd0000 task.ti: c6cd0000
      PC is at smc_hardware_send_pkt+0x198/0x22c
      LR is at smc_hardware_send_pkt+0x24/0x22c
      pc : [<c01be324>]    lr : [<c01be1b0>]    psr: 20000013
      sp : c6cd1d08  ip : 00000001  fp : 00000000
      r10: c02adb08  r9 : 00000000  r8 : c6ced802
      r7 : c786fba0  r6 : 00000146  r5 : c8800000  r4 : c78d6000
      r3 : 0000000f  r2 : 00000146  r1 : 00000000  r0 : 00000031
      Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 0005317f  Table: 06cf4000  DAC: 00000015
      Process udhcpc (pid: 43, stack limit = 0xc6cd01c0)
      Stack: (0xc6cd1d08 to 0xc6cd2000)
      1d00:                   00000010 c8800000 c78d6000 c786fba0 c78d6000 c01be868
      1d20: c01be7a4 00004000 00000000 c786fba0 c6c12b80 c0208554 000004d0 c780fc60
      1d40: 00000220 c01fb734 00000000 00000000 00000000 c6c9a440 c6c12b80 c78d6000
      1d60: c786fba0 c6c9a440 00000000 c021d1d8 00000000 00000000 c6c12b80 c78d6000
      1d80: c786fba0 00000001 c6c9a440 c02087f8 c6c9a4a0 00080008 00000000 00000000
      1da0: c78d6000 c786fba0 c78d6000 00000138 00000000 00000000 00000000 00000000
      1dc0: 00000000 c027ba74 00000138 00000138 00000001 00000010 c6cedc00 00000000
      1de0: 00000008 c7404400 c6cd1eec c6cd1f14 c067a73c c065c0b8 00000000 c067a740
      1e00: 01ffffff 002040d0 00000000 00000000 00000000 00000000 00000000 ffffffff
      1e20: 43004400 00110022 c6cdef20 c027ae8c c6ccfaa0 be82d65c 00000014 be82d3cc
      1e40: 00000000 00000000 00000000 c01f2870 00000000 00000000 00000000 c6cd1e88
      1e60: c6ccfaa0 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      1e80: 00000000 00000000 00000031 c7802310 c7802300 00000138 c7404400 c0771da0
      1ea0: 00000000 c6cd1eec c7800340 00000138 be82d65c 00000014 be82d3cc c6cd1f08
      1ec0: 00000014 00000000 c7404400 c7404400 00000138 c01f4628 c78d6000 00000000
      1ee0: 00000000 be82d3cc 00000138 c6cd1f08 00000014 c6cd1ee4 00000001 00000000
      1f00: 00000000 00000000 00080011 00000002 06000000 ffffffff 0000ffff 00000002
      1f20: 06000000 ffffffff 0000ffff c00928c8 c065c520 c6cd1f58 00000003 c009299c
      1f40: 00000003 c065c520 c7404400 00000000 c7404400 c01f2218 c78106b0 c7441cb0
      1f60: 00000000 00000006 c06799fc 00000000 00000000 00000006 00000000 c01f3ee0
      1f80: 00000000 00000000 be82d678 be82d65c 00000014 00000001 00000122 c00139c8
      1fa0: c6cd0000 c0013840 be82d65c 00000014 00000006 be82d3cc 00000138 00000000
      1fc0: be82d65c 00000014 00000001 00000122 00000000 00000000 00018cb1 00000000
      1fe0: 00003801 be82d3a8 0003a0c7 b6e9af08 60000010 00000006 00000000 00000000
      [<c01be324>] (smc_hardware_send_pkt+0x198/0x22c) from [<c01be868>] (smc_hard_start_xmit+0xc4/0x1e8)
      [<c01be868>] (smc_hard_start_xmit+0xc4/0x1e8) from [<c0208554>] (dev_hard_start_xmit+0x460/0x4cc)
      [<c0208554>] (dev_hard_start_xmit+0x460/0x4cc) from [<c021d1d8>] (sch_direct_xmit+0x94/0x18c)
      [<c021d1d8>] (sch_direct_xmit+0x94/0x18c) from [<c02087f8>] (dev_queue_xmit+0x238/0x42c)
      [<c02087f8>] (dev_queue_xmit+0x238/0x42c) from [<c027ba74>] (packet_sendmsg+0xbe8/0xd28)
      [<c027ba74>] (packet_sendmsg+0xbe8/0xd28) from [<c01f2870>] (sock_sendmsg+0x84/0xa8)
      [<c01f2870>] (sock_sendmsg+0x84/0xa8) from [<c01f4628>] (SyS_sendto+0xb8/0xdc)
      [<c01f4628>] (SyS_sendto+0xb8/0xdc) from [<c0013840>] (ret_fast_syscall+0x0/0x2c)
      Code: e3130002 1a000001 e3130001 0affffcd (e7f001f2)
      ---[ end trace 81104fe70e8da7fe ]---
      Kernel panic - not syncing: Fatal exception in interrupt
      
      This is because the macro operations in smc91x.h defined
      for Versatile are missing SMC_outsw() as used in this
      commit.
      
      The Versatile needs and uses the same accessors as the other
      platforms in the first if(...) clause, just switch it to using
      that and we have one problem less to worry about.
      
      Checkpatch complains about spacing, but I have opted to
      follow the style of this .h-file.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Nicolas Pitre <nico@fluxnic.net>
      Cc: Eric Miao <eric.y.miao@gmail.com>
      Cc: Jonathan Cameron <jic23@cam.ac.uk>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      
      (cherry picked from commit a0c20fb0
      9d38d28b
      b268daff)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      1389fc69
    • Johan Hovold's avatar
      USB: serial: fix race in generic write · e1044372
      Johan Hovold authored
      Fix race in generic write implementation, which could lead to
      temporarily degraded throughput.
      
      The current generic write implementation introduced by commit
      27c7acf2 ("USB: serial: reimplement generic fifo-based writes") has
      always had this bug, although it's fairly hard to trigger and the
      consequences are not likely to be noticed.
      
      Specifically, a write() on one CPU while the completion handler is
      running on another could result in only one of the two write urbs being
      utilised to empty the remainder of the write fifo (unless there is a
      second write() that doesn't race during that time).
      
      Cc: stable <stable@vger.kernel.org> # 2.6.35
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      (cherry picked from commit 6f648546)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      e1044372
    • Michael Neuling's avatar
      powerpc/signals: Improved mark VSX not saved with small contexts fix · 450c5838
      Michael Neuling authored
      In a recent patch:
        commit c13f20ac
        Author: Michael Neuling <mikey@neuling.org>
        powerpc/signals: Mark VSX not saved with small contexts
      
      We fixed an issue but an improved solution was later discussed after the patch
      was merged.
      
      Firstly, this patch doesn't handle the 64bit signals case, which could also hit
      this issue (but has never been reported).
      
      Secondly, the original patch isn't clear what MSR VSX should be set to.  The
      new approach below always clears the MSR VSX bit (to indicate no VSX is in the
      context) and sets it only in the specific case where VSX is available (ie. when
      VSX has been used and the signal context passed has space to provide the
      state).
      
      This reverts the original patch and replaces it with the improved solution.  It
      also adds a 64 bit version.
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      
      (cherry picked from commit ec67ad82)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      450c5838
    • Xiangliang Yu's avatar
      PCI: Define macro for Marvell vendor ID · 8087b790
      Xiangliang Yu authored
      Define PCI_VENDOR_ID_MARVELL_EXT macro for 0x1b4b vendor ID
      Signed-off-by: default avatarXiangliang Yu <yuxiangl@marvell.com>
      Signed-off-by: default avatarMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      
      (cherry picked from commit 8e7ee6f5)
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      8087b790
    • Michael Neuling's avatar
      powerpc/signals: Mark VSX not saved with small contexts · 80832769
      Michael Neuling authored
      commit c13f20ac upstream.
      
      The VSX MSR bit in the user context indicates if the context contains VSX
      state.  Currently we set this when the process has touched VSX at any stage.
      
      Unfortunately, if the user has not provided enough space to save the VSX state,
      we can't save it but we currently still set the MSR VSX bit.
      
      This patch changes this to clear the MSR VSX bit when the user doesn't provide
      enough space.  This indicates that there is no valid VSX state in the user
      context.
      
      This is needed to support get/set/make/swapcontext for applications that use
      VSX but only provide a small context.  For example, getcontext in glibc
      provides a smaller context since the VSX registers don't need to be saved over
      the glibc function call.  But since the program calling getcontext may have
      used VSX, the kernel currently says the VSX state is valid when it's not.  If
      the returned context is then used in setcontext (ie. a small context without
      VSX but with MSR VSX set), the kernel will refuse the context.  This situation
      has been reported by the glibc community.
      
      Based on patch from Carlos O'Donell.
      Tested-by: default avatarHaren Myneni <haren@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      (cherry picked from commit 3bf4e8c8)
      80832769