1. 14 Apr, 2015 39 commits
    • Lars-Peter Clausen's avatar
      ASoC: sigmadsp: Refuse to load firmware files with a non-supported version · 82da6058
      Lars-Peter Clausen authored
      commit 50c0f21b upstream.
      
      Make sure to check the version field of the firmware header to make sure to
      not accidentally try to parse a firmware file with a different layout.
      Trying to do so can result in loading invalid firmware code to the device.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      82da6058
    • Jens Axboe's avatar
      genhd: check for int overflow in disk_expand_part_tbl() · 45fdc587
      Jens Axboe authored
      commit 5fabcb4c upstream.
      
      We can get here from blkdev_ioctl() -> blkpg_ioctl() -> add_partition()
      with a user passed in partno value. If we pass in 0x7fffffff, the
      new target in disk_expand_part_tbl() overflows the 'int' and we
      access beyond the end of ptbl->part[] and even write to it when we
      do the rcu_assign_pointer() to assign the new partition.
      Reported-by: default avatarDavid Ramos <daramos@stanford.edu>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      45fdc587
    • Hannes Reinecke's avatar
      scsi: correct return values for .eh_abort_handler implementations · 47d90ff8
      Hannes Reinecke authored
      commit b6c92b7e upstream.
      
      The .eh_abort_handler needs to return SUCCESS, FAILED, or
      FAST_IO_FAIL. So fixup all callers to adhere to this requirement.
      Reviewed-by: default avatarRobert Elliott <elliott@hp.com>
      Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      [lizf: Backported to 3.4: drop changes to esas2r_main.c]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      47d90ff8
    • Myron Stowe's avatar
      PCI: Restore detection of read-only BARs · 73837b3a
      Myron Stowe authored
      commit 36e81648 upstream.
      
      Commit 6ac665c6 ("PCI: rewrite PCI BAR reading code") masked off
      low-order bits from 'l', but not from 'sz'.  Both are passed to pci_size(),
      which compares 'base == maxbase' to check for read-only BARs.  The masking
      of 'l' means that comparison will never be 'true', so the check for
      read-only BARs no longer works.
      
      Resolve this by also masking off the low-order bits of 'sz' before passing
      it into pci_size() as 'maxbase'.  With this change, pci_size() will once
      again catch the problems that have been encountered to date:
      
        - AGP aperture BAR of AMD-7xx host bridges: if the AGP window is
          disabled, this BAR is read-only and read as 0x00000008 [1]
      
        - BARs 0-4 of ALi IDE controllers can be non-zero and read-only [1]
      
        - Intel Sandy Bridge - Thermal Management Controller [8086:0103];
          BAR 0 returning 0xfed98004 [2]
      
        - Intel Xeon E5 v3/Core i7 Power Control Unit [8086:2fc0];
          Bar 0 returning 0x00001a [3]
      
      Link: [1] https://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/drivers/pci/probe.c?id=1307ef6621991f1c4bc3cec1b5a4ebd6fd3d66b9 ("PCI: probing read-only BARs" (pre-git))
      Link: [2] https://bugzilla.kernel.org/show_bug.cgi?id=43331
      Link: [3] https://bugzilla.kernel.org/show_bug.cgi?id=85991Reported-by: default avatarWilliam Unruh <unruh@physics.ubc.ca>
      Reported-by: default avatarMartin Lucina <martin@lucina.net>
      Signed-off-by: default avatarMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      CC: Matthew Wilcox <willy@linux.intel.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      73837b3a
    • Lars Ellenberg's avatar
      drbd: merge_bvec_fn: properly remap bvm->bi_bdev · a2288455
      Lars Ellenberg authored
      commit 3b9d35d7 upstream.
      
      This was not noticed for many years. Affects operation if
      md raid is used a backing device for DRBD.
      Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
      Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      [lizf: Backported to 3.4: s/device/mdev]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      a2288455
    • Alex Williamson's avatar
      driver core: Fix unbalanced device reference in drivers_probe · 0a19cbab
      Alex Williamson authored
      commit bb34cb6b upstream.
      
      bus_find_device_by_name() acquires a device reference which is never
      released.  This results in an object leak, which on older kernels
      results in failure to release all resources of PCI devices.  libvirt
      uses drivers_probe to re-attach devices to the host after assignment
      and is therefore a common trigger for this leak.
      
      Example:
      
      # cd /sys/bus/pci/
      # dmesg -C
      # echo 1 > devices/0000\:01\:00.0/sriov_numvfs
      # echo 0 > devices/0000\:01\:00.0/sriov_numvfs
      # dmesg | grep 01:10
       pci 0000:01:10.0: [8086:10ca] type 00 class 0x020000
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_add_internal: parent: '0000:00:01.0', set: 'devices'
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_uevent_env
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_uevent_env
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_uevent_env
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): kobject_cleanup, parent           (null)
       kobject: '0000:01:10.0' (ffff8801d79cd0a8): calling ktype release
       kobject: '0000:01:10.0': free name
      
      [kobject freed as expected]
      
      # dmesg -C
      # echo 1 > devices/0000\:01\:00.0/sriov_numvfs
      # echo 0000:01:10.0 > drivers_probe
      # echo 0 > devices/0000\:01\:00.0/sriov_numvfs
      # dmesg | grep 01:10
       pci 0000:01:10.0: [8086:10ca] type 00 class 0x020000
       kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_add_internal: parent: '0000:00:01.0', set: 'devices'
       kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_uevent_env
       kobject: '0000:01:10.0' (ffff8801d79ce0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
       kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_uevent_env
       kobject: '0000:01:10.0' (ffff8801d79ce0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
       kobject: '0000:01:10.0' (ffff8801d79ce0a8): kobject_uevent_env
       kobject: '0000:01:10.0' (ffff8801d79ce0a8): fill_kobj_path: path = '/devices/pci0000:00/0000:00:01.0/0000:01:10.0'
      
      [no free]
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      0a19cbab
    • Richard Weinberger's avatar
      UBI: Fix invalid vfree() · ca7b6a3e
      Richard Weinberger authored
      commit f38aed97 upstream.
      
      The logic of vfree()'ing vol->upd_buf is tied to vol->updating.
      In ubi_start_update() vol->updating is set long before vmalloc()'ing
      vol->upd_buf. If we encounter a write failure in ubi_start_update()
      before vmalloc() the UBI device release function will try to vfree()
      vol->upd_buf because vol->updating is set.
      Fix this by allocating vol->upd_buf directly after setting vol->updating.
      
      Fixes:
      [   31.559338] UBI warning: vol_cdev_release: update of volume 2 not finished, volume is damaged
      [   31.559340] ------------[ cut here ]------------
      [   31.559343] WARNING: CPU: 1 PID: 2747 at mm/vmalloc.c:1446 __vunmap+0xe3/0x110()
      [   31.559344] Trying to vfree() nonexistent vm area (ffffc90001f2b000)
      [   31.559345] Modules linked in:
      [   31.565620]  0000000000000bba ffff88002a0cbdb0 ffffffff818f0497 ffff88003b9ba148
      [   31.566347]  ffff88002a0cbde0 ffffffff8156f515 ffff88003b9ba148 0000000000000bba
      [   31.567073]  0000000000000000 0000000000000000 ffff88002a0cbe88 ffffffff8156c10a
      [   31.567793] Call Trace:
      [   31.568034]  [<ffffffff818f0497>] dump_stack+0x4e/0x7a
      [   31.568510]  [<ffffffff8156f515>] ubi_io_write_vid_hdr+0x155/0x160
      [   31.569084]  [<ffffffff8156c10a>] ubi_eba_write_leb+0x23a/0x870
      [   31.569628]  [<ffffffff81569b36>] vol_cdev_write+0x226/0x380
      [   31.570155]  [<ffffffff81179265>] vfs_write+0xb5/0x1f0
      [   31.570627]  [<ffffffff81179f8a>] SyS_pwrite64+0x6a/0xa0
      [   31.571123]  [<ffffffff818fde12>] system_call_fastpath+0x16/0x1b
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      ca7b6a3e
    • Kazuya Mizuguchi's avatar
      usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable() · 6a2fa48e
      Kazuya Mizuguchi authored
      commit 11432050 upstream.
      
      This patch fixes an issue that the NULL pointer dereference happens
      when we uses g_audio driver. Since the g_audio driver will call
      usb_ep_disable() in afunc_set_alt() before it calls usb_ep_enable(),
      the uep->pipe of renesas usbhs driver will be NULL. So, this patch
      adds a condition to avoid the oops.
      Signed-off-by: default avatarKazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
      Signed-off-by: default avatarTakeshi Kihara <takeshi.kihara.df@renesas.com>
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Fixes: 2f98382d (usb: renesas_usbhs: Add Renesas USBHS Gadget)
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      6a2fa48e
    • Tejun Heo's avatar
      writeback: fix a subtle race condition in I_DIRTY clearing · a6a93e45
      Tejun Heo authored
      commit 9c6ac78e upstream.
      
      After invoking ->dirty_inode(), __mark_inode_dirty() does smp_mb() and
      tests inode->i_state locklessly to see whether it already has all the
      necessary I_DIRTY bits set.  The comment above the barrier doesn't
      contain any useful information - memory barriers can't ensure "changes
      are seen by all cpus" by itself.
      
      And it sure enough was broken.  Please consider the following
      scenario.
      
       CPU 0					CPU 1
       -------------------------------------------------------------------------------
      
      					enters __writeback_single_inode()
      					grabs inode->i_lock
      					tests PAGECACHE_TAG_DIRTY which is clear
       enters __set_page_dirty()
       grabs mapping->tree_lock
       sets PAGECACHE_TAG_DIRTY
       releases mapping->tree_lock
       leaves __set_page_dirty()
      
       enters __mark_inode_dirty()
       smp_mb()
       sees I_DIRTY_PAGES set
       leaves __mark_inode_dirty()
      					clears I_DIRTY_PAGES
      					releases inode->i_lock
      
      Now @inode has dirty pages w/ I_DIRTY_PAGES clear.  This doesn't seem
      to lead to an immediately critical problem because requeue_inode()
      later checks PAGECACHE_TAG_DIRTY instead of I_DIRTY_PAGES when
      deciding whether the inode needs to be requeued for IO and there are
      enough unintentional memory barriers inbetween, so while the inode
      ends up with inconsistent I_DIRTY_PAGES flag, it doesn't fall off the
      IO list.
      
      The lack of explicit barrier may also theoretically affect the other
      I_DIRTY bits which deal with metadata dirtiness.  There is no
      guarantee that a strong enough barrier exists between
      I_DIRTY_[DATA]SYNC clearing and write_inode() writing out the dirtied
      inode.  Filesystem inode writeout path likely has enough stuff which
      can behave as full barrier but it's theoretically possible that the
      writeout may not see all the updates from ->dirty_inode().
      
      Fix it by adding an explicit smp_mb() after I_DIRTY clearing.  Note
      that I_DIRTY_PAGES needs a special treatment as it always needs to be
      cleared to be interlocked with the lockless test on
      __mark_inode_dirty() side.  It's cleared unconditionally and
      reinstated after smp_mb() if the mapping still has dirty pages.
      
      Also add comments explaining how and why the barriers are paired.
      
      Lightly tested.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Mikulas Patocka <mpatocka@redhat.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      a6a93e45
    • Jan Kara's avatar
      writeback: Move I_DIRTY_PAGES handling · 4dc54f7a
      Jan Kara authored
      commit 6290be1c upstream.
      
      Instead of clearing I_DIRTY_PAGES and resetting it when we didn't succeed in
      writing them all, just clear the bit only when we succeeded writing all the
      pages. We also move the clearing of the bit close to other i_state handling to
      separate it from writeback list handling. This is desirable because list
      handling will differ for flusher thread and other writeback_single_inode()
      callers in future. No filesystem plays any tricks with I_DIRTY_PAGES (like
      checking it in ->writepages or ->write_inode implementation) so this movement
      is safe.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      4dc54f7a
    • Tyler Hicks's avatar
      eCryptfs: Force RO mount when encrypted view is enabled · 073b1bc2
      Tyler Hicks authored
      commit 332b122d upstream.
      
      The ecryptfs_encrypted_view mount option greatly changes the
      functionality of an eCryptfs mount. Instead of encrypting and decrypting
      lower files, it provides a unified view of the encrypted files in the
      lower filesystem. The presence of the ecryptfs_encrypted_view mount
      option is intended to force a read-only mount and modifying files is not
      supported when the feature is in use. See the following commit for more
      information:
      
        e77a56dd [PATCH] eCryptfs: Encrypted passthrough
      
      This patch forces the mount to be read-only when the
      ecryptfs_encrypted_view mount option is specified by setting the
      MS_RDONLY flag on the superblock. Additionally, this patch removes some
      broken logic in ecryptfs_open() that attempted to prevent modifications
      of files when the encrypted view feature was in use. The check in
      ecryptfs_open() was not sufficient to prevent file modifications using
      system calls that do not operate on a file descriptor.
      Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
      Reported-by: default avatarPriya Bansal <p.bansal@samsung.com>
      [lizf: Backported to 3.4: adjust context]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      073b1bc2
    • Grygorii Strashko's avatar
      i2c: davinci: generate STP always when NACK is received · a3b7e569
      Grygorii Strashko authored
      commit 9ea359f7 upstream.
      
      According to I2C specification the NACK should be handled as follows:
      "When SDA remains HIGH during this ninth clock pulse, this is defined as the Not
      Acknowledge signal. The master can then generate either a STOP condition to
      abort the transfer, or a repeated START condition to start a new transfer."
      [I2C spec Rev. 6, 3.1.6: http://www.nxp.com/documents/user_manual/UM10204.pdf]
      
      Currently the Davinci i2c driver interrupts the transfer on receipt of a
      NACK but fails to send a STOP in some situations and so makes the bus
      stuck until next I2C IP reset (idle/enable).
      
      For example, the issue will happen during SMBus read transfer which
      consists from two i2c messages write command/address and read data:
      
      S Slave Address Wr A Command Code A Sr Slave Address Rd A D1..Dn A P
      <--- write -----------------------> <--- read --------------------->
      
      The I2C client device will send NACK if it can't recognize "Command Code"
      and it's expected from I2C master to generate STP in this case.
      But now, Davinci i2C driver will just exit with -EREMOTEIO and STP will
      not be generated.
      
      Hence, fix it by generating Stop condition (STP) always when NACK is received.
      
      This patch fixes Davinci I2C in the same way it was done for OMAP I2C
      commit cda2109a ("i2c: omap: query STP always when NACK is received").
      Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Reported-by: default avatarHein Tibosch <hein_tibosch@yahoo.es>
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      a3b7e569
    • Tejun Heo's avatar
      ahci: disable MSI on SAMSUNG 0xa800 SSD · aa01e324
      Tejun Heo authored
      commit 2b21ef0a upstream.
      
      Just like 0x1600 which got blacklisted by 66a7cbc3 ("ahci: disable
      MSI instead of NCQ on Samsung pci-e SSDs on macbooks"), 0xa800 chokes
      on NCQ commands if MSI is enabled.  Disable MSI.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarDominik Mierzejewski <dominik@greysector.net>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=89171Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      aa01e324
    • Tejun Heo's avatar
      ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks · 1abb03df
      Tejun Heo authored
      commit 66a7cbc3 upstream.
      
      Samsung pci-e SSDs on macbooks failed miserably on NCQ commands, so
      67809f85 ("ahci: disable NCQ on Samsung pci-e SSDs on macbooks")
      disabled NCQ on them.  It turns out that NCQ is fine as long as MSI is
      not used, so let's turn off MSI and leave NCQ on.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=60731
      Tested-by: <dorin@i51.org>
      Tested-by: default avatarImre Kaloz <kaloz@openwrt.org>
      Fixes: 67809f85 ("ahci: disable NCQ on Samsung pci-e SSDs on macbooks")
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      1abb03df
    • Levente Kurusa's avatar
      ahci: disable NCQ on Samsung pci-e SSDs on macbooks · ee2e7288
      Levente Kurusa authored
      commit 67809f85 upstream.
      
      Samsung's pci-e SSDs with device ID 0x1600 which are found on some
      macbooks time out on NCQ commands.  Blacklist NCQ on the device so
      that the affected machines can at least boot.
      Original-patch-by: default avatarLevente Kurusa <levex@linux.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60731
      [lizf: Backported to 3.4: adjust context]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      ee2e7288
    • Hugh Dickins's avatar
      mm: fix swapoff hang after page migration and fork · 1a02d872
      Hugh Dickins authored
      commit 2022b4d1 upstream.
      
      I've been seeing swapoff hangs in recent testing: it's cycling around
      trying unsuccessfully to find an mm for some remaining pages of swap.
      
      I have been exercising swap and page migration more heavily recently,
      and now notice a long-standing error in copy_one_pte(): it's trying to
      add dst_mm to swapoff's mmlist when it finds a swap entry, but is doing
      so even when it's a migration entry or an hwpoison entry.
      
      Which wouldn't matter much, except it adds dst_mm next to src_mm,
      assuming src_mm is already on the mmlist: which may not be so.  Then if
      pages are later swapped out from dst_mm, swapoff won't be able to find
      where to replace them.
      
      There's already a !non_swap_entry() test for stats: move that up before
      the swap_duplicate() and the addition to mmlist.
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Kelley Nielsen <kelleynnn@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      1a02d872
    • Petr Mladek's avatar
      drm/radeon: kernel panic in drm_calc_vbltimestamp_from_scanoutpos with 3.18.0-rc6 · 9cc1941e
      Petr Mladek authored
      commit f5475cc4 upstream.
      
      I was unable too boot 3.18.0-rc6 because of the following kernel
      panic in drm_calc_vbltimestamp_from_scanoutpos():
      
          [drm] Initialized drm 1.1.0 20060810
          [drm] radeon kernel modesetting enabled.
          [drm] initializing kernel modesetting (RV100 0x1002:0x515E 0x15D9:0x8080).
          [drm] register mmio base: 0xC8400000
          [drm] register mmio size: 65536
          radeon 0000:0b:01.0: VRAM: 128M 0x00000000D0000000 - 0x00000000D7FFFFFF (16M used)
          radeon 0000:0b:01.0: GTT: 512M 0x00000000B0000000 - 0x00000000CFFFFFFF
          [drm] Detected VRAM RAM=128M, BAR=128M
          [drm] RAM width 16bits DDR
          [TTM] Zone  kernel: Available graphics memory: 3829346 kiB
          [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
          [TTM] Initializing pool allocator
          [TTM] Initializing DMA pool allocator
          [drm] radeon: 16M of VRAM memory ready
          [drm] radeon: 512M of GTT memory ready.
          [drm] GART: num cpu pages 131072, num gpu pages 131072
          [drm] PCI GART of 512M enabled (table at 0x0000000037880000).
          radeon 0000:0b:01.0: WB disabled
          radeon 0000:0b:01.0: fence driver on ring 0 use gpu addr 0x00000000b0000000 and cpu addr 0xffff8800bbbfa000
          [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
          [drm] Driver supports precise vblank timestamp query.
          [drm] radeon: irq initialized.
          [drm] Loading R100 Microcode
          radeon 0000:0b:01.0: Direct firmware load for radeon/R100_cp.bin failed with error -2
          radeon_cp: Failed to load firmware "radeon/R100_cp.bin"
          [drm:r100_cp_init] *ERROR* Failed to load firmware!
          radeon 0000:0b:01.0: failed initializing CP (-2).
          radeon 0000:0b:01.0: Disabling GPU acceleration
          [drm] radeon: cp finalized
          BUG: unable to handle kernel NULL pointer dereference at 000000000000025c
          IP: [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
          PGD 0
          Oops: 0000 [#1] SMP
          Modules linked in:
          CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc6-4-default #2649
          Hardware name: Supermicro X7DB8/X7DB8, BIOS 6.00 07/26/2006
          task: ffff880234da2010 ti: ffff880234da4000 task.ti: ffff880234da4000
          RIP: 0010:[<ffffffff8150423b>]  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
          RSP: 0000:ffff880234da7918  EFLAGS: 00010086
          RAX: ffffffff81557890 RBX: 0000000000000000 RCX: ffff880234da7a48
          RDX: ffff880234da79f4 RSI: 0000000000000000 RDI: ffff880232e15000
          RBP: ffff880234da79b8 R08: 0000000000000000 R09: 0000000000000000
          R10: 000000000000000a R11: 0000000000000001 R12: ffff880232dda1c0
          R13: ffff880232e1518c R14: 0000000000000292 R15: ffff880232e15000
          FS:  0000000000000000(0000) GS:ffff88023fc40000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
          CR2: 000000000000025c CR3: 0000000002014000 CR4: 00000000000007e0
          Stack:
           ffff880234da79d8 0000000000000286 ffff880232dcbc00 0000000000002480
           ffff880234da7958 0000000000000296 ffff880234da7998 ffffffff8151b51d
           ffff880234da7a48 0000000032dcbeb0 ffff880232dcbc00 ffff880232dcbc58
          Call Trace:
           [<ffffffff8151b51d>] ? drm_vma_offset_remove+0x1d/0x110
           [<ffffffff8152dc98>] radeon_get_vblank_timestamp_kms+0x38/0x60
           [<ffffffff8152076a>] ? ttm_bo_release_list+0xba/0x180
           [<ffffffff81503751>] drm_get_last_vbltimestamp+0x41/0x70
           [<ffffffff81503933>] vblank_disable_and_save+0x73/0x1d0
           [<ffffffff81106b2f>] ? try_to_del_timer_sync+0x4f/0x70
           [<ffffffff81505245>] drm_vblank_cleanup+0x65/0xa0
           [<ffffffff815604fa>] radeon_irq_kms_fini+0x1a/0x70
           [<ffffffff8156c07e>] r100_init+0x26e/0x410
           [<ffffffff8152ae3e>] radeon_device_init+0x7ae/0xb50
           [<ffffffff8152d57f>] radeon_driver_load_kms+0x8f/0x210
           [<ffffffff81506965>] drm_dev_register+0xb5/0x110
           [<ffffffff8150998f>] drm_get_pci_dev+0x8f/0x200
           [<ffffffff815291cd>] radeon_pci_probe+0xad/0xe0
           [<ffffffff8141a365>] local_pci_probe+0x45/0xa0
           [<ffffffff8141b741>] pci_device_probe+0xd1/0x130
           [<ffffffff81633dad>] driver_probe_device+0x12d/0x3e0
           [<ffffffff8163413b>] __driver_attach+0x9b/0xa0
           [<ffffffff816340a0>] ? __device_attach+0x40/0x40
           [<ffffffff81631cd3>] bus_for_each_dev+0x63/0xa0
           [<ffffffff8163378e>] driver_attach+0x1e/0x20
           [<ffffffff81633390>] bus_add_driver+0x180/0x240
           [<ffffffff81634914>] driver_register+0x64/0xf0
           [<ffffffff81419cac>] __pci_register_driver+0x4c/0x50
           [<ffffffff81509bf5>] drm_pci_init+0xf5/0x120
           [<ffffffff821dc871>] ? ttm_init+0x6a/0x6a
           [<ffffffff821dc908>] radeon_init+0x97/0xb5
           [<ffffffff810002fc>] do_one_initcall+0xbc/0x1f0
           [<ffffffff810e3278>] ? __wake_up+0x48/0x60
           [<ffffffff8218e256>] kernel_init_freeable+0x18a/0x215
           [<ffffffff8218d983>] ? initcall_blacklist+0xc0/0xc0
           [<ffffffff818a78f0>] ? rest_init+0x80/0x80
           [<ffffffff818a78fe>] kernel_init+0xe/0xf0
           [<ffffffff818c0c3c>] ret_from_fork+0x7c/0xb0
           [<ffffffff818a78f0>] ? rest_init+0x80/0x80
          Code: 45 ac 0f 88 a8 01 00 00 3b b7 d0 01 00 00 49 89 ff 0f 83 99 01 00 00 48 8b 47 20 48 8b 80 88 00 00 00 48 85 c0 0f 84 cd 01 00 00 <41> 8b b1 5c 02 00 00 41 8b 89 58 02 00 00 89 75 98 41 8b b1 60
          RIP  [<ffffffff8150423b>] drm_calc_vbltimestamp_from_scanoutpos+0x4b/0x320
           RSP <ffff880234da7918>
          CR2: 000000000000025c
          ---[ end trace ad2c0aadf48e2032 ]---
          Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
      
      It has helped me to add a NULL pointer check that was suggested at
      http://lists.freedesktop.org/archives/dri-devel/2014-October/070663.html
      
      I am not familiar with the code. But the change looks sane
      and we need something fast at this stage of 3.18 development.
      Suggested-by: default avatarHelge Deller <deller@gmx.de>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.cz>
      Tested-by: default avatarPetr Mladek <pmladek@suse.cz>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      9cc1941e
    • Dmitry Torokhov's avatar
      sata_fsl: fix error handling of irq_of_parse_and_map · 00646dbf
      Dmitry Torokhov authored
      commit aad0b624 upstream.
      
      irq_of_parse_and_map() returns 0 on error (the result is unsigned int),
      so testing for negative result never works.
      Signed-off-by: default avatarDmitry Torokhov <dtor@chromium.org>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      00646dbf
    • Devin Ryles's avatar
      AHCI: Add DeviceIDs for Sunrise Point-LP SATA controller · 1c84f5cc
      Devin Ryles authored
      commit 249cd0a1 upstream.
      
      This patch adds DeviceIDs for Sunrise Point-LP.
      Signed-off-by: default avatarDevin Ryles <devin.ryles@intel.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      1c84f5cc
    • Daniel Vetter's avatar
      drm/i915: Unlock panel even when LVDS is disabled · 558ab6ce
      Daniel Vetter authored
      commit b0616c53 upstream.
      
      Otherwise we'll have backtraces in assert_panel_unlocked because the
      BIOS locks the register. In the reporter's case this regression was
      introduced in
      
      commit c31407a3
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Thu Oct 18 21:07:01 2012 +0100
      
          drm/i915: Add no-lvds quirk for Supermicro X7SPA-H
      Reported-by: default avatarAlexey Orishko <alexey.orishko@gmail.com>
      Cc: Alexey Orishko <alexey.orishko@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Francois Tigeot <ftigeot@wolfpond.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Tested-by: default avatarAlexey Orishko <alexey.orishko@gmail.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      [lizf: Backported to 3.4: adjust context]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      558ab6ce
    • Laurent Dufour's avatar
      powerpc/pseries: Fix endiannes issue in RTAS call from xmon · 44523712
      Laurent Dufour authored
      commit 3b8a3c01 upstream.
      
      On pseries system (LPAR) xmon failed to enter when running in LE mode,
      system is hunging. Inititating xmon will lead to such an output on the
      console:
      
      SysRq : Entering xmon
      cpu 0x15: Vector: 0  at [c0000003f39ffb10]
          pc: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
          lr: c00000000007ed7c: sysrq_handle_xmon+0x5c/0x70
          sp: c0000003f39ffc70
         msr: 8000000000009033
        current = 0xc0000003fafa7180
        paca    = 0xc000000007d75e80	 softe: 0	 irq_happened: 0x01
          pid   = 14617, comm = bash
      Bad kernel stack pointer fafb4b0 at eca7cc4
      cpu 0x15: Vector: 300 (Data Access) at [c000000007f07d40]
          pc: 000000000eca7cc4
          lr: 000000000eca7c44
          sp: fafb4b0
         msr: 8000000000001000
         dar: 10000000
       dsisr: 42000000
        current = 0xc0000003fafa7180
        paca    = 0xc000000007d75e80	 softe: 0	 irq_happened: 0x01
          pid   = 14617, comm = bash
      cpu 0x15: Exception 300 (Data Access) in xmon, returning to main loop
      xmon: WARNING: bad recursive fault on cpu 0x15
      
      The root cause is that xmon is calling RTAS to turn off the surveillance
      when entering xmon, and RTAS is requiring big endian parameters.
      
      This patch is byte swapping the RTAS arguments when running in LE mode.
      Signed-off-by: default avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      44523712
    • Greg Kroah-Hartman's avatar
      Input: xpad - use proper endpoint type · 267817fd
      Greg Kroah-Hartman authored
      commit a1f9a407 upstream.
      
      The xpad wireless endpoint is not a bulk endpoint on my devices, but
      rather an interrupt one, so the USB core complains when it is submitted.
      I'm guessing that the author really did mean that this should be an
      interrupt urb, but as there are a zillion different xpad devices out
      there, let's cover out bases and handle both bulk and interrupt
      endpoints just as easily.
      Signed-off-by: default avatar"Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      267817fd
    • Hans de Goede's avatar
      usb-quirks: Add reset-resume quirk for MS Wireless Laser Mouse 6000 · f225c526
      Hans de Goede authored
      commit 263e80b4 upstream.
      
      This wireless mouse receiver needs a reset-resume quirk to properly come
      out of reset.
      
      BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1165206Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      f225c526
    • Aaro Koskinen's avatar
      MIPS: Loongson: Make platform serial setup always built-in. · 984541bd
      Aaro Koskinen authored
      commit 26927f76 upstream.
      
      If SERIAL_8250 is compiled as a module, the platform specific setup
      for Loongson will be a module too, and it will not work very well.
      At least on Loongson 3 it will trigger a build failure,
      since loongson_sysconf is not exported to modules.
      
      Fix by making the platform specific serial code always built-in.
      Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
      Reported-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Markos Chandras <Markos.Chandras@imgtec.com>
      Patchwork: https://patchwork.linux-mips.org/patch/8533/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      984541bd
    • Takashi Iwai's avatar
      ALSA: hda - Limit 40bit DMA for AMD HDMI controllers · e39abe89
      Takashi Iwai authored
      commit 413cbf46 upstream.
      
      AMD/ATI HDMI controller chip models, we already have a filter to lower
      to 32bit DMA, but the rest are supposed to be working with 64bit
      although the hardware doesn't really work with 63bit but only with 40
      or 48bit DMA.  In this patch, we take 40bit DMA for safety for the
      AMD/ATI controllers as the graphics drivers does.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [lizf: Backported to 3.4:
       - adjust context
       - s/AZX_GCAP_640K/ICH6_GCAP_64OK]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      e39abe89
    • Lu Baolu's avatar
      usb: xhci: rework root port wake bits if controller isn't allowed to wakeup · 8143ad28
      Lu Baolu authored
      commit a1377e53 upstream.
      
      When system is being suspended, if host device is not allowed to do wakeup,
      xhci_suspend() needs to clear all root port wake on bits. Otherwise, some
      platforms may generate spurious wakeup, even if PCI PME# is disabled.
      
      The initial commit ff8cbf25 ("xhci: clear root port wake on bits"),
      which also got into stable, turned out to not work correctly and had to
      be reverted, and is now rewritten.
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Suggested-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      [Mathias Nyman: reword commit message]
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [lizf: Backported to 3.4:
       - adjust context
       - drop changes to xhci_plat_suspend()]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      8143ad28
    • Mathias Nyman's avatar
      USB: xhci: Reset a halted endpoint immediately when we encounter a stall. · 991182b9
      Mathias Nyman authored
      commit 8e71a322 upstream.
      
      If a device is halted and reuturns a STALL, then the halted endpoint
      needs to be cleared both on the host and device side. The host
      side halt is cleared by issueing a xhci reset endpoint command. The device side
      is cleared with a ClearFeature(ENDPOINT_HALT) request, which should
      be issued by the device driver if a URB reruen -EPIPE.
      
      Previously we cleared the host side halt after the device side was cleared.
      To make sure the host side halt is cleared in time we want to issue the
      reset endpoint command immedialtely when a STALL status is encountered.
      
      Otherwise we end up not following the specs and not returning -EPIPE
      several times in a row when trying to transfer data to a halted endpoint.
      
      Fixes: bcef3fd5 (USB: xhci: Handle errors that cause endpoint halts.)
      Tested-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [lizf: Backported to 3.4: adjust context]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      991182b9
    • Mathias Nyman's avatar
      USB: xhci: don't start a halted endpoint before its new dequeue is set · a3d7be95
      Mathias Nyman authored
      commit c3492dbf upstream.
      
      A halted endpoint ring must first be reset, then move the ring
      dequeue pointer past the problematic TRB. If we start the ring too
      early after reset, but before moving the dequeue pointer we
      will end up executing the same problematic TRB again.
      
      As we always issue a set transfer dequeue command after a reset
      endpoint command we can skip starting endpoint rings at reset endpoint
      command completion.
      
      Without this fix we end up trying to handle the same faulty TD for
      contol endpoints. causing timeout, and failing testusb ctrl_out write
      tests.
      
      Fixes: e9df17eb (USB: xhci: Correct assumptions about number of rings per endpoint.)
      Tested-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      a3d7be95
    • Dmitry Eremin-Solenikov's avatar
      ARM: 8216/1: xscale: correct auxiliary register in suspend/resume · 185a0969
      Dmitry Eremin-Solenikov authored
      commit ef59a20b upstream.
      
      According to the manuals I have, XScale auxiliary register should be
      reached with opc_2 = 1 instead of crn = 1. cpu_xscale_proc_init
      correctly uses c1, c0, 1 arguments, but cpu_xscale_do_suspend and
      cpu_xscale_do_resume use c1, c1, 0. Correct suspend/resume functions to
      also use c1, c0, 1.
      
      The issue was primarily noticed thanks to qemu reporing "unsupported
      instruction" on the pxa suspend path. Confirmed in PXA210/250 and PXA255
      XScale Core manuals and in PXA270 and PXA320 Developers Guides.
      
      Harware tested by me on tosa (pxa255). Robert confirmed on pxa270 board.
      Tested-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      185a0969
    • Maurizio Lombardi's avatar
      bnx2fc: do not add shared skbs to the fcoe_rx_list · 5398d2a6
      Maurizio Lombardi authored
      commit 01a4cc4d upstream.
      
      In some cases, the fcoe_rx_list may contains multiple instances
      of the same skb (the so called "shared skbs").
      
      the bnx2fc_l2_rcv thread is a loop that extracts a skb from the list,
      modifies (and destroys) its content and then proceed to the next one.
      The problem is that if the skb is shared, the remaining instances will
      be corrupted.
      
      The solution is to use skb_share_check() before adding the skb to the
      fcoe_rx_list.
      
      [ 6286.808725] ------------[ cut here ]------------
      [ 6286.808729] WARNING: at include/scsi/fc_frame.h:173 bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]()
      [ 6286.808748] Modules linked in: bnx2x(-) mdio dm_service_time bnx2fc cnic uio fcoe libfcoe 8021q garp stp mrp libfc llc scsi_transport_fc scsi_tgt sg iTCO_wdt iTCO_vendor_support coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper ptp cryptd hpilo serio_raw hpwdt lpc_ich pps_core ipmi_si pcspkr mfd_core ipmi_msghandler shpchp pcc_cpufreq mperf nfsd auth_rpcgss nfs_acl lockd sunrpc dm_multipath xfs libcrc32c ata_generic pata_acpi sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit ata_piix drm_kms_helper ttm drm libata i2c_core hpsa dm_mirror dm_region_hash dm_log dm_mod [last unloaded: mdio]
      [ 6286.808750] CPU: 3 PID: 1304 Comm: bnx2fc_l2_threa Not tainted 3.10.0-121.el7.x86_64 #1
      [ 6286.808750] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013
      [ 6286.808752]  0000000000000000 000000000b36e715 ffff8800deba1e00 ffffffff815ec0ba
      [ 6286.808753]  ffff8800deba1e38 ffffffff8105dee1 ffffffffa05618c0 ffff8801e4c81888
      [ 6286.808754]  ffffe8ffff663868 ffff8801f402b180 ffff8801f56bc000 ffff8800deba1e48
      [ 6286.808754] Call Trace:
      [ 6286.808759]  [<ffffffff815ec0ba>] dump_stack+0x19/0x1b
      [ 6286.808762]  [<ffffffff8105dee1>] warn_slowpath_common+0x61/0x80
      [ 6286.808763]  [<ffffffff8105e00a>] warn_slowpath_null+0x1a/0x20
      [ 6286.808765]  [<ffffffffa054f415>] bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]
      [ 6286.808767]  [<ffffffffa054eff0>] ? bnx2fc_disable+0x90/0x90 [bnx2fc]
      [ 6286.808769]  [<ffffffff81085aef>] kthread+0xcf/0xe0
      [ 6286.808770]  [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
      [ 6286.808772]  [<ffffffff815fc76c>] ret_from_fork+0x7c/0xb0
      [ 6286.808773]  [<ffffffff81085a20>] ? kthread_create_on_node+0x140/0x140
      [ 6286.808774] ---[ end trace c6cdb939184ccb4e ]---
      Signed-off-by: default avatarMaurizio Lombardi <mlombard@redhat.com>
      Acked-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      5398d2a6
    • Trond Myklebust's avatar
      nfsd: Fix slot wake up race in the nfsv4.1 callback code · b198b711
      Trond Myklebust authored
      commit c6c15e1e upstream.
      
      The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no
      locking in order to guarantee atomicity, and so allows for races of
      the form.
      
      Task 1                                  Task 2
      ======                                  ======
      if (test_and_set_bit(0) != 0) {
                                              clear_bit(0)
                                              rpc_wake_up_next(queue)
              rpc_sleep_on(queue)
              return false;
      }
      
      This patch breaks the race condition by adding a retest of the bit
      after the call to rpc_sleep_on().
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      b198b711
    • Trond Myklebust's avatar
      SUNRPC: Fix locking around callback channel reply receive · 63ed3573
      Trond Myklebust authored
      commit 093a1468 upstream.
      
      Both xprt_lookup_rqst() and xprt_complete_rqst() require that you
      take the transport lock in order to avoid races with xprt_transmit().
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
      Reviewed-by: default avatarJeff Layton <jlayton@primarydata.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      [lizf: Backported to 3.4: adjust context]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      63ed3573
    • Johan Hovold's avatar
      USB: ssu100: fix overrun-error reporting · 7167d336
      Johan Hovold authored
      commit 75bcbf29 upstream.
      
      Fix reporting of overrun errors, which should only be reported once
      using the inserted null character.
      
      Fixes: 6b8f1ca5 ("USB: ssu100: set tty_flags in ssu100_process_packet")
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      [lizf: Backported to 3.4:
       - adjust context
       - lookup tty using tty_port_tty_get()]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      7167d336
    • Johan Hovold's avatar
      USB: keyspan: fix overrun-error reporting · 1fb787ce
      Johan Hovold authored
      commit 855515a6 upstream.
      
      Fix reporting of overrun errors, which are not associated with a
      character. Instead insert a null character and report only once.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      [lizf: Backported to 3.4:
       - s/&port->port/tty
       - adjust context
       - adjust indentation]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      1fb787ce
    • Johan Hovold's avatar
      USB: keyspan: fix tty line-status reporting · 3b8a7019
      Johan Hovold authored
      commit 5d1678a3 upstream.
      
      Fix handling of TTY error flags, which are not bitmasks and must
      specifically not be ORed together as this prevents the line discipline
      from recognising them.
      
      Also insert null characters when reporting overrun errors as these are
      not associated with the received character.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      [lizf: Backported to 3.4:
       - s/&port->port/tty/
       - adjust context
       - adjust indentation]
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      3b8a7019
    • Troy Clark's avatar
      usb: serial: ftdi_sio: add PIDs for Matrix Orbital products · 0ff23ffd
      Troy Clark authored
      commit 204ec6e0 upstream.
      
      Add PIDs for new Matrix Orbital GTT series products.
      Signed-off-by: default avatarTroy Clark <tclark@matrixorbital.ca>
      [johan: shorten commit message ]
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      0ff23ffd
    • Cristina Ciocan's avatar
      iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask · e1962953
      Cristina Ciocan authored
      commit ccf54555 upstream.
      
      The direction field is set on 7 bits, thus we need to AND it with 0111 111 mask
      in order to retrieve it, that is 0x7F, not 0xCF as it is now.
      
      Fixes: ade7ef7b (staging:iio: Differential channel handling)
      Signed-off-by: default avatarCristina Ciocan <cristina.ciocan@intel.com>
      Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      e1962953
    • Preston Fick's avatar
      USB: serial: cp210x: add IDs for CEL MeshConnect USB Stick · f3234664
      Preston Fick authored
      commit ffcfe30e upstream.
      Signed-off-by: default avatarPreston Fick <pffick@gmail.com>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      f3234664
    • Thor Thayer's avatar
      spi: dw: Fix dynamic speed change. · c5298dc5
      Thor Thayer authored
      commit 0a8727e6 upstream.
      
      An IOCTL call that calls spi_setup() and then dw_spi_setup() will
      overwrite the persisted last transfer speed. On each transfer, the
      SPI speed is compared to the last transfer speed to determine if the
      clock divider registers need to be updated (did the speed change?).
      This bug was observed with the spidev driver using spi-config to
      update the max transfer speed.
      
      This fix: Don't overwrite the persisted last transaction clock speed
      when updating the SPI parameters in dw_spi_setup(). On the next
      transaction, the new speed won't match the persisted last speed
      and the hardware registers will be updated.
      On initialization, the persisted last transaction clock
      speed will be 0 but will be updated after the first SPI
      transaction.
      
      Move zeroed clock divider check into clock change test because
      chip->clk_div is zero on startup and would cause a divide-by-zero
      error. The calculation was wrong as well (can't support odd #).
      Reported-by: default avatarVlastimil Setka <setka@vsis.cz>
      Signed-off-by: default avatarVlastimil Setka <setka@vsis.cz>
      Signed-off-by: default avatarThor Thayer <tthayer@opensource.altera.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
      c5298dc5
  2. 02 Feb, 2015 1 commit