1. 07 Jan, 2015 2 commits
    • Weijie Yang's avatar
      mm: frontswap: invalidate expired data on a dup-store failure · 94724f27
      Weijie Yang authored
      commit fb993fa1 upstream.
      
      If a frontswap dup-store failed, it should invalidate the expired page
      in the backend, or it could trigger some data corruption issue.
      Such as:
       1. use zswap as the frontswap backend with writeback feature
       2. store a swap page(version_1) to entry A, success
       3. dup-store a newer page(version_2) to the same entry A, fail
       4. use __swap_writepage() write version_2 page to swapfile, success
       5. zswap do shrink, writeback version_1 page to swapfile
       6. version_2 page is overwrited by version_1, data corrupt.
      
      This patch fixes this issue by invalidating expired data immediately
      when meet a dup-store failure.
      Signed-off-by: default avatarWeijie Yang <weijie.yang@samsung.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Seth Jennings <sjennings@variantweb.net>
      Cc: Dan Streetman <ddstreet@ieee.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Bob Liu <bob.liu@oracle.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 avatarJiri Slaby <jslaby@suse.cz>
      94724f27
    • Francesco Ruggeri's avatar
      tty: Fix pty master poll() after slave closes v2 · 6b96727b
      Francesco Ruggeri authored
      commit c4dc3046 upstream.
      
      Commit f95499c3 ("n_tty: Don't wait for buffer work in read() loop")
      introduces a race window where a pty master can be signalled that the pty
      slave was closed before all the data that the slave wrote is delivered.
      Commit f8747d4a ("tty: Fix pty master read() after slave closes") fixed the
      problem in case of n_tty_read, but the problem still exists for n_tty_poll.
      This can be seen by running 'for ((i=0; i<100;i++));do ./test.py ;done'
      where test.py is:
      
      import os, select, pty
      
      (pid, pty_fd) = pty.fork()
      
      if pid == 0:
         os.write(1, 'This string should be received by parent')
      else:
         poller = select.epoll()
         poller.register( pty_fd, select.EPOLLIN )
         ready = poller.poll( 1 * 1000 )
         for fd, events in ready:
            if not events & select.EPOLLIN:
               print 'missed POLLIN event'
            else:
               print os.read(fd, 100)
         poller.close()
      
      The string from the slave is missed several times.
      This patch takes the same approach as the fix for read and special cases
      this condition for poll.
      Tested on 3.16.
      Signed-off-by: default avatarFrancesco Ruggeri <fruggeri@arista.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      6b96727b
  2. 06 Jan, 2015 14 commits
  3. 06 Dec, 2014 24 commits
    • Jiri Slaby's avatar
      Linux 3.12.35 · 490d31e7
      Jiri Slaby authored
      490d31e7
    • Cong Wang's avatar
      batman: fix a bogus warning from batadv_is_on_batman_iface() · 0ac8b68c
      Cong Wang authored
      commit b6ed5498 upstream.
      
      batman tries to search dev->iflink to check if it's a batman interface,
      but ->iflink could be 0, which is not a valid ifindex. It should just
      avoid iflink == 0 case.
      Reported-by: default avatarJet Chen <jet.chen@intel.com>
      Tested-by: default avatarJet Chen <jet.chen@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: Antonio Quartulli <antonio@open-mesh.com>
      Cc: Marek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: default avatarCong Wang <cwang@twopensource.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0ac8b68c
    • Benjamin Herrenschmidt's avatar
      powerpc/powernv: Honor the generic "no_64bit_msi" flag · 3dbce781
      Benjamin Herrenschmidt authored
      commit 36074381 upstream.
      
      Instead of the arch specific quirk which we are deprecating
      and that drivers don't understand.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      3dbce781
    • Jeff Layton's avatar
      locks: eliminate BUG() call when there's an unexpected lock on file close · cac69a82
      Jeff Layton authored
      commit 8c3cac5e upstream.
      
      A leftover lock on the list is surely a sign of a problem of some sort,
      but it's not necessarily a reason to panic the box. Instead, just log a
      warning with some info about the lock, and then delete it like we would
      any other lock.
      
      In the event that the filesystem declares a ->lock f_op, we may end up
      leaking something, but that's generally preferable to an immediate
      panic.
      Acked-by: default avatarJ. Bruce Fields <bfields@fieldses.org>
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Cc: Markus Blank-Burian <burian@muenster.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      cac69a82
    • Benjamin Herrenschmidt's avatar
      gpu/radeon: Set flag to indicate broken 64-bit MSI · 021e1548
      Benjamin Herrenschmidt authored
      commit 91ed6fd2 upstream.
      
      Some radeon ASICs don't support all 64 address bits of MSIs despite
      advertising support for 64-bit MSIs in their configuration space.
      
      This breaks on systems such as IBM POWER7/8, where 64-bit MSIs can
      be assigned with some of the high address bits set.
      
      This makes use of the newly introduced "no_64bit_msi" flag in structure
      pci_dev to allow the MSI allocation code to fallback to 32-bit MSIs
      on those adapters.
      
      Adding Alex's review tag. Patch to the driver is identical to the
      reviewed one, I dropped the arch/powerpc hunk rewrote the subject
      and cset comment.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      021e1548
    • Alex Deucher's avatar
      drm/radeon: fix endian swapping in vbios fetch for tdp table · 14d7ed4d
      Alex Deucher authored
      commit 28731d58 upstream.
      
      Value needs to be swapped on BE.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      14d7ed4d
    • Maurizio Lombardi's avatar
      bnx2fc: do not add shared skbs to the fcoe_rx_list · 46068266
      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 avatarJiri Slaby <jslaby@suse.cz>
      46068266
    • Jane Zhou's avatar
      net/ping: handle protocol mismatching scenario · 29c881ca
      Jane Zhou authored
      commit 91a0b603 upstream.
      
      ping_lookup() may return a wrong sock if sk_buff's and sock's protocols
      dont' match. For example, sk_buff's protocol is ETH_P_IPV6, but sock's
      sk_family is AF_INET, in that case, if sk->sk_bound_dev_if is zero, a wrong
      sock will be returned.
      the fix is to "continue" the searching, if no matching, return NULL.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarJane Zhou <a17711@motorola.com>
      Signed-off-by: default avatarYiwei Zhao <gbjc64@motorola.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      29c881ca
    • Trond Myklebust's avatar
      nfsd: Fix slot wake up race in the nfsv4.1 callback code · 55c8dd29
      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 avatarJiri Slaby <jslaby@suse.cz>
      55c8dd29
    • Christoph Hellwig's avatar
      nfsd: correctly define v4.2 support attributes · e030e3fc
      Christoph Hellwig authored
      commit 6d0ba043 upstream.
      
      Even when security labels are disabled we support at least the same
      attributes as v4.1.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      e030e3fc
    • Stanislaw Gruszka's avatar
      rt2x00: do not align payload on modern H/W · 8c3b78ff
      Stanislaw Gruszka authored
      commit cfd9167a upstream.
      
      RT2800 and newer hardware require padding between header and payload if
      header length is not multiple of 4.
      
      For historical reasons we also align payload to to 4 bytes boundary, but
      such alignment is not needed on modern H/W.
      
      Patch fixes skb_under_panic problems reported from time to time:
      
      https://bugzilla.kernel.org/show_bug.cgi?id=84911
      https://bugzilla.kernel.org/show_bug.cgi?id=72471
      http://marc.info/?l=linux-wireless&m=139108549530402&w=2
      https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1087591
      
      Panic happened because we eat 4 bytes of skb headroom on each
      (re)transmission when sending frame without the payload and the header
      length not being multiple of 4 (i.e. QoS header has 26 bytes). On such
      case because paylad_aling=2 is bigger than header_align=0 we increase
      header_align by 4 bytes. To prevent that we could change the check to:
      
      	if (payload_length && payload_align > header_align)
      		header_align += 4;
      
      but not aligning payload at all is more effective and alignment is not
      really needed by H/W (that has been tested on OpenWrt project for few
      years now).
      Reported-and-tested-by: default avatarAntti S. Lankila <alankila@bel.fi>
      Debugged-by: default avatarAntti S. Lankila <alankila@bel.fi>
      Reported-by: default avatarHenrik Asp <solenskiner@gmail.com>
      Originally-From: Helmut Schaa <helmut.schaa@googlemail.com>
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      8c3b78ff
    • Thomas Körper's avatar
      can: dev: avoid calling kfree_skb() from interrupt context · 20542e3e
      Thomas Körper authored
      commit 5247a589 upstream.
      
      ikfree_skb() is Called in can_free_echo_skb(), which might be called from (TX
      Error) interrupt, which triggers the folloing warning:
      
      [ 1153.360705] ------------[ cut here ]------------
      [ 1153.360715] WARNING: CPU: 0 PID: 31 at net/core/skbuff.c:563 skb_release_head_state+0xb9/0xd0()
      [ 1153.360772] Call Trace:
      [ 1153.360778]  [<c167906f>] dump_stack+0x41/0x52
      [ 1153.360782]  [<c105bb7e>] warn_slowpath_common+0x7e/0xa0
      [ 1153.360784]  [<c158b909>] ? skb_release_head_state+0xb9/0xd0
      [ 1153.360786]  [<c158b909>] ? skb_release_head_state+0xb9/0xd0
      [ 1153.360788]  [<c105bc42>] warn_slowpath_null+0x22/0x30
      [ 1153.360791]  [<c158b909>] skb_release_head_state+0xb9/0xd0
      [ 1153.360793]  [<c158be90>] skb_release_all+0x10/0x30
      [ 1153.360795]  [<c158bf06>] kfree_skb+0x36/0x80
      [ 1153.360799]  [<f8486938>] ? can_free_echo_skb+0x28/0x40 [can_dev]
      [ 1153.360802]  [<f8486938>] can_free_echo_skb+0x28/0x40 [can_dev]
      [ 1153.360805]  [<f849a12c>] esd_pci402_interrupt+0x34c/0x57a [esd402]
      [ 1153.360809]  [<c10a75b5>] handle_irq_event_percpu+0x35/0x180
      [ 1153.360811]  [<c10a7623>] ? handle_irq_event_percpu+0xa3/0x180
      [ 1153.360813]  [<c10a7731>] handle_irq_event+0x31/0x50
      [ 1153.360816]  [<c10a9c7f>] handle_fasteoi_irq+0x6f/0x120
      [ 1153.360818]  [<c10a9c10>] ? handle_edge_irq+0x110/0x110
      [ 1153.360822]  [<c1011b61>] handle_irq+0x71/0x90
      [ 1153.360823]  <IRQ>  [<c168152c>] do_IRQ+0x3c/0xd0
      [ 1153.360829]  [<c1680b6c>] common_interrupt+0x2c/0x34
      [ 1153.360834]  [<c107d277>] ? finish_task_switch+0x47/0xf0
      [ 1153.360836]  [<c167c27b>] __schedule+0x35b/0x7e0
      [ 1153.360839]  [<c10a5334>] ? console_unlock+0x2c4/0x4d0
      [ 1153.360842]  [<c13df500>] ? n_tty_receive_buf_common+0x890/0x890
      [ 1153.360845]  [<c10707b6>] ? process_one_work+0x196/0x370
      [ 1153.360847]  [<c167c723>] schedule+0x23/0x60
      [ 1153.360849]  [<c1070de1>] worker_thread+0x161/0x460
      [ 1153.360852]  [<c1090fcf>] ? __wake_up_locked+0x1f/0x30
      [ 1153.360854]  [<c1070c80>] ? rescuer_thread+0x2f0/0x2f0
      [ 1153.360856]  [<c1074f01>] kthread+0xa1/0xc0
      [ 1153.360859]  [<c1680401>] ret_from_kernel_thread+0x21/0x30
      [ 1153.360861]  [<c1074e60>] ? kthread_create_on_node+0x110/0x110
      [ 1153.360863] ---[ end trace 5ff83639cbb74b35 ]---
      
      This patch replaces the kfree_skb() by dev_kfree_skb_any().
      Signed-off-by: default avatarThomas Körper <thomas.koerper@esd.eu>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      20542e3e
    • Christian Sünkenberg's avatar
      scsi: add Intel Multi-Flex to scsi scan blacklist · 57c63d27
      Christian Sünkenberg authored
      commit 18990455 upstream.
      
      Intel Multi-Flex LUNs choke on REPORT SUPPORTED OPERATION CODES
      resulting in sd_mod hanging for several minutes on startup.
      The issue was introduced with WRITE SAME discovery heuristics.
      
      Fixes: 5db44863 ("[SCSI] sd: Implement support for WRITE SAME")
      Signed-off-by: default avatarChristian Sünkenberg <christian.suenkenberg@hfg-karlsruhe.de>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      57c63d27
    • Nicholas Bellinger's avatar
      vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT · 32d48b3c
      Nicholas Bellinger authored
      commit ab8edab1 upstream.
      
      This patch addresses a bug where individual vhost-scsi configfs endpoint
      groups can be removed from below while active exports to QEMU userspace
      still exist, resulting in an OOPs.
      
      It adds a configfs_depend_item() in vhost_scsi_set_endpoint() to obtain
      an explicit dependency on se_tpg->tpg_group in order to prevent individual
      vhost-scsi WWPN endpoints from being released via normal configfs methods
      while an QEMU ioctl reference still exists.
      
      Also, add matching configfs_undepend_item() in vhost_scsi_clear_endpoint()
      to release the dependency, once QEMU's reference to the individual group
      at /sys/kernel/config/target/vhost/$WWPN/$TPGT is released.
      
      (Fix up vhost_scsi_clear_endpoint() error path - DanC)
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      32d48b3c
    • Thor Thayer's avatar
      spi: dw: Fix dynamic speed change. · 982b1001
      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 avatarJiri Slaby <jslaby@suse.cz>
      982b1001
    • Sagi Grimberg's avatar
      iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly · 0a915349
      Sagi Grimberg authored
      commit 3b726ae2 upstream.
      
      In this case the cm_id->context is the isert_np, and the cm_id->qp
      is NULL, so use that to distinct the cases.
      
      Since we don't expect any other events on this cm_id we can
      just return -1 for explicit termination of the cm_id by the
      cma layer.
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      0a915349
    • Roland Dreier's avatar
      target: Don't call TFO->write_pending if data_length == 0 · 63af3438
      Roland Dreier authored
      commit 885e7b0e upstream.
      
      If an initiator sends a zero-length command (e.g. TEST UNIT READY) but
      sets the transfer direction in the transport layer to indicate a
      data-out phase, we still shouldn't try to transfer data.  At best it's
      a NOP, and depending on the transport, we might crash on an
      uninitialized sg list.
      Reported-by: default avatarCraig Watson <craig.watson@vanguard-rugged.com>
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      63af3438
    • Bart Van Assche's avatar
      srp-target: Retry when QP creation fails with ENOMEM · 090ec5fe
      Bart Van Assche authored
      commit ab477c1f upstream.
      
      It is not guaranteed to that srp_sq_size is supported
      by the HCA. So if we failed to create the QP with ENOMEM,
      try with a smaller srp_sq_size. Keep it up until we hit
      MIN_SRPT_SQ_SIZE, then fail the connection.
      Reported-by: default avatarMark Lehrer <lehrer@gmail.com>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      090ec5fe
    • Greg Kroah-Hartman's avatar
      Input: xpad - use proper endpoint type · 52c0674a
      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 avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      52c0674a
    • Ben Sagal's avatar
      Input: synaptics - adjust min/max on Thinkpad E540 · 2c2bbb8a
      Ben Sagal authored
      commit bce4f9e7 upstream.
      
      The LEN2006 Synaptics touchpad (as found in Thinkpad E540) returns wrong
      min max values.
      
      touchpad-edge-detector output:
      >  Touchpad SynPS/2 Synaptics TouchPad on /dev/input/event6
      >  Move one finger around the touchpad to detect the actual edges
      >  Kernel says:    x [1472..5674], y [1408..4684]
      >  Touchpad sends: x [1264..5675], y [1171..4688]
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88211Signed-off-by: default avatarBinyamin Sagal <bensagal@gmail.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      2c2bbb8a
    • Vladimir Murzin's avatar
      ARM: 8226/1: cacheflush: get rid of restarting block · 932307a4
      Vladimir Murzin authored
      commit 3f4aa45c upstream.
      
      We cannot restart cacheflush safely if a process provides user-defined
      signal handler and signal is pending. In this case -EINTR is returned
      and it is expected that process re-invokes syscall. However, there are
      a few problems with that:
       * looks like nobody bothers checking return value from cacheflush
       * but if it did, we don't provide the restart address for that, so the
         process has to use the same range again
       * ...and again, what might lead to looping forever
      
      So, remove cacheflush restarting code and terminate cache flushing
      as early as fatal signal is pending.
      Reported-by: default avatarChanho Min <chanho.min@lge.com>
      Signed-off-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      932307a4
    • Thomas Petazzoni's avatar
      ARM: 8222/1: mvebu: enable strex backoff delay · 72741f17
      Thomas Petazzoni authored
      commit 995ab518 upstream.
      
      Under extremely rare conditions, in an MPCore node consisting of at
      least 3 CPUs, two CPUs trying to perform a STREX to data on the same
      shared cache line can enter a livelock situation.
      
      This patch enables the HW mechanism that overcomes the bug. This fixes
      the incorrect setup of the STREX backoff delay bit due to a wrong
      description in the specification.
      
      Note that enabling the STREX backoff delay mechanism is done by
      leaving the bit *cleared*, while the bit was currently being set by
      the proc-v7.S code.
      
      [Thomas: adapt to latest mainline, slightly reword the commit log, add
      stable markers.]
      
      Fixes: de490193 ("arm: mm: Add support for PJ4B cpu and init routines")
      Signed-off-by: default avatarNadav Haklai <nadavh@marvell.com>
      Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Acked-by: default avatarGregory CLEMENT <gregory.clement@free-electrons.com>
      Acked-by: default avatarJason Cooper <jason@lakedaemon.net>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      72741f17
    • Dmitry Eremin-Solenikov's avatar
      ARM: 8216/1: xscale: correct auxiliary register in suspend/resume · 77e62e1c
      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 avatarJiri Slaby <jslaby@suse.cz>
      77e62e1c
    • Gu Zheng's avatar
      aio: fix uncorrent dirty pages accouting when truncating AIO ring buffer · cab86d8c
      Gu Zheng authored
      commit 835f252c upstream.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=86831
      
      Markus reported that when shutting down mysqld (with AIO support,
      on a ext3 formatted Harddrive) leads to a negative number of dirty pages
      (underrun to the counter). The negative number results in a drastic reduction
      of the write performance because the page cache is not used, because the kernel
      thinks it is still 2 ^ 32 dirty pages open.
      
      Add a warn trace in __dec_zone_state will catch this easily:
      
      static inline void __dec_zone_state(struct zone *zone, enum
      	zone_stat_item item)
      {
           atomic_long_dec(&zone->vm_stat[item]);
      +    WARN_ON_ONCE(item == NR_FILE_DIRTY &&
      	atomic_long_read(&zone->vm_stat[item]) < 0);
           atomic_long_dec(&vm_stat[item]);
      }
      
      [   21.341632] ------------[ cut here ]------------
      [   21.346294] WARNING: CPU: 0 PID: 309 at include/linux/vmstat.h:242
      cancel_dirty_page+0x164/0x224()
      [   21.355296] Modules linked in: wutbox_cp sata_mv
      [   21.359968] CPU: 0 PID: 309 Comm: kworker/0:1 Not tainted 3.14.21-WuT #80
      [   21.366793] Workqueue: events free_ioctx
      [   21.370760] [<c0016a64>] (unwind_backtrace) from [<c0012f88>]
      (show_stack+0x20/0x24)
      [   21.378562] [<c0012f88>] (show_stack) from [<c03f8ccc>]
      (dump_stack+0x24/0x28)
      [   21.385840] [<c03f8ccc>] (dump_stack) from [<c0023ae4>]
      (warn_slowpath_common+0x84/0x9c)
      [   21.393976] [<c0023ae4>] (warn_slowpath_common) from [<c0023bb8>]
      (warn_slowpath_null+0x2c/0x34)
      [   21.402800] [<c0023bb8>] (warn_slowpath_null) from [<c00c0688>]
      (cancel_dirty_page+0x164/0x224)
      [   21.411524] [<c00c0688>] (cancel_dirty_page) from [<c00c080c>]
      (truncate_inode_page+0x8c/0x158)
      [   21.420272] [<c00c080c>] (truncate_inode_page) from [<c00c0a94>]
      (truncate_inode_pages_range+0x11c/0x53c)
      [   21.429890] [<c00c0a94>] (truncate_inode_pages_range) from
      [<c00c0f6c>] (truncate_pagecache+0x88/0xac)
      [   21.439252] [<c00c0f6c>] (truncate_pagecache) from [<c00c0fec>]
      (truncate_setsize+0x5c/0x74)
      [   21.447731] [<c00c0fec>] (truncate_setsize) from [<c013b3a8>]
      (put_aio_ring_file.isra.14+0x34/0x90)
      [   21.456826] [<c013b3a8>] (put_aio_ring_file.isra.14) from
      [<c013b424>] (aio_free_ring+0x20/0xcc)
      [   21.465660] [<c013b424>] (aio_free_ring) from [<c013b4f4>]
      (free_ioctx+0x24/0x44)
      [   21.473190] [<c013b4f4>] (free_ioctx) from [<c003d8d8>]
      (process_one_work+0x134/0x47c)
      [   21.481132] [<c003d8d8>] (process_one_work) from [<c003e988>]
      (worker_thread+0x130/0x414)
      [   21.489350] [<c003e988>] (worker_thread) from [<c00448ac>]
      (kthread+0xd4/0xec)
      [   21.496621] [<c00448ac>] (kthread) from [<c000ec18>]
      (ret_from_fork+0x14/0x20)
      [   21.503884] ---[ end trace 79c4bf42c038c9a1 ]---
      
      The cause is that we set the aio ring file pages as *DIRTY* via SetPageDirty
      (bypasses the VFS dirty pages increment) when init, and aio fs uses
      *default_backing_dev_info* as the backing dev, which does not disable
      the dirty pages accounting capability.
      So truncating aio ring file will contribute to accounting dirty pages (VFS
      dirty pages decrement), then error occurs.
      
      The original goal is keeping these pages in memory (can not be reclaimed
      or swapped) in life-time via marking it dirty. But thinking more, we have
      already pinned pages via elevating the page's refcount, which can already
      achieve the goal, so the SetPageDirty seems unnecessary.
      
      In order to fix the issue, using the __set_page_dirty_no_writeback instead
      of the nop .set_page_dirty, and dropped the SetPageDirty (don't manually
      set the dirty flags, don't disable set_page_dirty(), rely on default behaviour).
      
      With the above change, the dirty pages accounting can work well. But as we
      known, aio fs is an anonymous one, which should never cause any real write-back,
      we can ignore the dirty pages (write back) accounting by disabling the dirty
      pages (write back) accounting capability. So we introduce an aio private
      backing dev info (disabled the ACCT_DIRTY/WRITEBACK/ACCT_WB capabilities) to
      replace the default one.
      Reported-by: default avatarMarkus Königshaus <m.koenigshaus@wut.de>
      Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
      Acked-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      cab86d8c