1. 20 2月, 2019 40 次提交
    • E
      signal: Restore the stop PTRACE_EVENT_EXIT · a2b3e2c0
      Eric W. Biederman 提交于
      commit cf43a757fd49442bc38f76088b70c2299eed2c2f upstream.
      
      In the middle of do_exit() there is there is a call
      "ptrace_event(PTRACE_EVENT_EXIT, code);" That call places the process
      in TACKED_TRACED aka "(TASK_WAKEKILL | __TASK_TRACED)" and waits for
      for the debugger to release the task or SIGKILL to be delivered.
      
      Skipping past dequeue_signal when we know a fatal signal has already
      been delivered resulted in SIGKILL remaining pending and
      TIF_SIGPENDING remaining set.  This in turn caused the
      scheduler to not sleep in PTACE_EVENT_EXIT as it figured
      a fatal signal was pending.  This also caused ptrace_freeze_traced
      in ptrace_check_attach to fail because it left a per thread
      SIGKILL pending which is what fatal_signal_pending tests for.
      
      This difference in signal state caused strace to report
      strace: Exit of unknown pid NNNNN ignored
      
      Therefore update the signal handling state like dequeue_signal
      would when removing a per thread SIGKILL, by removing SIGKILL
      from the per thread signal mask and clearing TIF_SIGPENDING.
      Acked-by: NOleg Nesterov <oleg@redhat.com>
      Reported-by: NOleg Nesterov <oleg@redhat.com>
      Reported-by: NIvan Delalande <colona@arista.com>
      Cc: stable@vger.kernel.org
      Fixes: 35634ffa1751 ("signal: Always notice exiting tasks")
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a2b3e2c0
    • J
      scsi: sd: fix entropy gathering for most rotational disks · 0396cf55
      James Bottomley 提交于
      commit e4a056987c86f402f1286e050b1dee3f4ce7c7eb upstream.
      
      The problem is that the default for MQ is not to gather entropy, whereas
      the default for the legacy queue was always to gather it.  The original
      attempt to fix entropy gathering for rotational disks under MQ added an
      else branch in sd_read_block_characteristics().  Unfortunately, the entire
      check isn't reached if the device has no characteristics VPD page.  Since
      this page was only introduced in SBC-3 and its optional anyway, most less
      expensive rotational disks don't have one, meaning they all stopped
      gathering entropy when we made MQ the default.  In a wholly unrelated
      change, openssl and openssh won't function until the random number
      generator is initialised, meaning lots of people have been seeing large
      delays before they could log into systems with default MQ kernels due to
      this lack of entropy, because it now can take tens of minutes to initialise
      the kernel random number generator.
      
      The fix is to set the non-rotational and add-randomness flags
      unconditionally early on in the disk initialization path, so they can be
      reset only if the device actually reports being non-rotational via the VPD
      page.
      Reported-by: NMikael Pettersson <mikpelinux@gmail.com>
      Fixes: 83e32a59 ("scsi: sd: Contribute to randomness when running rotational device")
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      Reviewed-by: NJens Axboe <axboe@kernel.dk>
      Reviewed-by: NXuewei Zhang <xueweiz@google.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0396cf55
    • H
      x86/platform/UV: Use efi_runtime_lock to serialise BIOS calls · cdc35685
      Hedi Berriche 提交于
      commit f331e766c4be33f4338574f3c9f7f77e98ab4571 upstream.
      
      Calls into UV firmware must be protected against concurrency, expose the
      efi_runtime_lock to the UV platform, and use it to serialise UV BIOS
      calls.
      Signed-off-by: NHedi Berriche <hedi.berriche@hpe.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: NRuss Anderson <rja@hpe.com>
      Reviewed-by: NDimitri Sivanich <sivanich@hpe.com>
      Reviewed-by: NMike Travis <mike.travis@hpe.com>
      Cc: Andy Shevchenko <andy@infradead.org>
      Cc: Bhupesh Sharma <bhsharma@redhat.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: linux-efi <linux-efi@vger.kernel.org>
      Cc: platform-driver-x86@vger.kernel.org
      Cc: stable@vger.kernel.org # v4.9+
      Cc: Steve Wahl <steve.wahl@hpe.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: x86-ml <x86@kernel.org>
      Link: https://lkml.kernel.org/r/20190213193413.25560-5-hedi.berriche@hpe.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cdc35685
    • A
      tracing/uprobes: Fix output for multiple string arguments · 45649b99
      Andreas Ziegler 提交于
      commit 0722069a5374b904ec1a67f91249f90e1cfae259 upstream.
      
      When printing multiple uprobe arguments as strings the output for the
      earlier arguments would also include all later string arguments.
      
      This is best explained in an example:
      
      Consider adding a uprobe to a function receiving two strings as
      parameters which is at offset 0xa0 in strlib.so and we want to print
      both parameters when the uprobe is hit (on x86_64):
      
      $ echo 'p:func /lib/strlib.so:0xa0 +0(%di):string +0(%si):string' > \
          /sys/kernel/debug/tracing/uprobe_events
      
      When the function is called as func("foo", "bar") and we hit the probe,
      the trace file shows a line like the following:
      
        [...] func: (0x7f7e683706a0) arg1="foobar" arg2="bar"
      
      Note the extra "bar" printed as part of arg1. This behaviour stacks up
      for additional string arguments.
      
      The strings are stored in a dynamically growing part of the uprobe
      buffer by fetch_store_string() after copying them from userspace via
      strncpy_from_user(). The return value of strncpy_from_user() is then
      directly used as the required size for the string. However, this does
      not take the terminating null byte into account as the documentation
      for strncpy_from_user() cleary states that it "[...] returns the
      length of the string (not including the trailing NUL)" even though the
      null byte will be copied to the destination.
      
      Therefore, subsequent calls to fetch_store_string() will overwrite
      the terminating null byte of the most recently fetched string with
      the first character of the current string, leading to the
      "accumulation" of strings in earlier arguments in the output.
      
      Fix this by incrementing the return value of strncpy_from_user() by
      one if we did not hit the maximum buffer size.
      
      Link: http://lkml.kernel.org/r/20190116141629.5752-1-andreas.ziegler@fau.de
      
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: stable@vger.kernel.org
      Fixes: 5baaa59e ("tracing/probes: Implement 'memory' fetch method for uprobes")
      Acked-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: NAndreas Ziegler <andreas.ziegler@fau.de>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      45649b99
    • H
      s390/zcrypt: fix specification exception on z196 during ap probe · 88e1e66a
      Harald Freudenberger 提交于
      commit 8f9aca0c45322a807a343fc32f95f2500f83b9ae upstream.
      
      The older machines don't have the QCI instruction available.
      With support for up to 256 crypto cards the probing of each
      card has been extended to check card ids from 0 up to 255.
      For machines with QCI support there is a filter limiting the
      range of probed cards. The older machines (z196 and older)
      don't have this filter and so since support for 256 cards is
      in the driver all cards are probed. However, these machines
      also require to have the card id fit into 6 bits. Exceeding
      this limit results in a specification exception which happens
      on every kernel startup even when there is no crypto configured
      and used at all.
      
      This fix limits the range of probed crypto cards to 64 if
      there is no QCI instruction available to obey to the older
      ap architecture and so fixes the specification exceptions
      on z196 machines.
      
      Cc: stable@vger.kernel.org # v4.17+
      Fixes: af4a7227 ("s390/zcrypt: Support up to 256 crypto adapters.")
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      88e1e66a
    • M
      alpha: Fix Eiger NR_IRQS to 128 · a3fadeff
      Meelis Roos 提交于
      commit bfc913682464f45bc4d6044084e370f9048de9d5 upstream.
      
      Eiger machine vector definition has nr_irqs 128, and working 2.6.26
      boot shows SCSI getting IRQ-s 64 and 65. Current kernel boot fails
      because Symbios SCSI fails to request IRQ-s and does not find the disks.
      It has been broken at least since 3.18 - the earliest I could test with
      my gcc-5.
      
      The headers have moved around and possibly another order of defines has
      worked in the past - but since 128 seems to be correct and used, fix
      arch/alpha/include/asm/irq.h to have NR_IRQS=128 for Eiger.
      
      This fixes 4.19-rc7 boot on my Force Flexor A264 (Eiger subarch).
      
      Cc: stable@vger.kernel.org # v3.18+
      Signed-off-by: NMeelis Roos <mroos@linux.ee>
      Signed-off-by: NMatt Turner <mattst88@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a3fadeff
    • S
      alpha: fix page fault handling for r16-r18 targets · c56eef69
      Sergei Trofimovich 提交于
      commit 491af60ffb848b59e82f7c9145833222e0bf27a5 upstream.
      
      Fix page fault handling code to fixup r16-r18 registers.
      Before the patch code had off-by-two registers bug.
      This bug caused overwriting of ps,pc,gp registers instead
      of fixing intended r16,r17,r18 (see `struct pt_regs`).
      
      More details:
      
      Initially Dmitry noticed a kernel bug as a failure
      on strace test suite. Test passes unmapped userspace
      pointer to io_submit:
      
      ```c
          #include <err.h>
          #include <unistd.h>
          #include <sys/mman.h>
          #include <asm/unistd.h>
          int main(void)
          {
              unsigned long ctx = 0;
              if (syscall(__NR_io_setup, 1, &ctx))
                  err(1, "io_setup");
              const size_t page_size = sysconf(_SC_PAGESIZE);
              const size_t size = page_size * 2;
              void *ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
                               MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
              if (MAP_FAILED == ptr)
                  err(1, "mmap(%zu)", size);
              if (munmap(ptr, size))
                  err(1, "munmap");
              syscall(__NR_io_submit, ctx, 1, ptr + page_size);
              syscall(__NR_io_destroy, ctx);
              return 0;
          }
      ```
      
      Running this test causes kernel to crash when handling page fault:
      
      ```
          Unable to handle kernel paging request at virtual address ffffffffffff9468
          CPU 3
          aio(26027): Oops 0
          pc = [<fffffc00004eddf8>]  ra = [<fffffc00004edd5c>]  ps = 0000    Not tainted
          pc is at sys_io_submit+0x108/0x200
          ra is at sys_io_submit+0x6c/0x200
          v0 = fffffc00c58e6300  t0 = fffffffffffffff2  t1 = 000002000025e000
          t2 = fffffc01f159fef8  t3 = fffffc0001009640  t4 = fffffc0000e0f6e0
          t5 = 0000020001002e9e  t6 = 4c41564e49452031  t7 = fffffc01f159c000
          s0 = 0000000000000002  s1 = 000002000025e000  s2 = 0000000000000000
          s3 = 0000000000000000  s4 = 0000000000000000  s5 = fffffffffffffff2
          s6 = fffffc00c58e6300
          a0 = fffffc00c58e6300  a1 = 0000000000000000  a2 = 000002000025e000
          a3 = 00000200001ac260  a4 = 00000200001ac1e8  a5 = 0000000000000001
          t8 = 0000000000000008  t9 = 000000011f8bce30  t10= 00000200001ac440
          t11= 0000000000000000  pv = fffffc00006fd320  at = 0000000000000000
          gp = 0000000000000000  sp = 00000000265fd174
          Disabling lock debugging due to kernel taint
          Trace:
          [<fffffc0000311404>] entSys+0xa4/0xc0
      ```
      
      Here `gp` has invalid value. `gp is s overwritten by a fixup for the
      following page fault handler in `io_submit` syscall handler:
      
      ```
          __se_sys_io_submit
          ...
              ldq     a1,0(t1)
              bne     t0,4280 <__se_sys_io_submit+0x180>
      ```
      
      After a page fault `t0` should contain -EFALUT and `a1` is 0.
      Instead `gp` was overwritten in place of `a1`.
      
      This happens due to a off-by-two bug in `dpf_reg()` for `r16-r18`
      (aka `a0-a2`).
      
      I think the bug went unnoticed for a long time as `gp` is one
      of scratch registers. Any kernel function call would re-calculate `gp`.
      
      Dmitry tracked down the bug origin back to 2.1.32 kernel version
      where trap_a{0,1,2} fields were inserted into struct pt_regs.
      And even before that `dpf_reg()` contained off-by-one error.
      
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Reported-and-reviewed-by: N"Dmitry V. Levin" <ldv@altlinux.org>
      Cc: stable@vger.kernel.org # v2.1.32+
      Bug: https://bugs.gentoo.org/672040Signed-off-by: NSergei Trofimovich <slyfox@gentoo.org>
      Signed-off-by: NMatt Turner <mattst88@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c56eef69
    • D
      Revert "mm: slowly shrink slabs with a relatively small number of objects" · 657fbf79
      Dave Chinner 提交于
      commit a9a238e83fbb0df31c3b9b67003f8f9d1d1b6c96 upstream.
      
      This reverts commit 172b06c3 ("mm: slowly shrink slabs with a
      relatively small number of objects").
      
      This change changes the agressiveness of shrinker reclaim, causing small
      cache and low priority reclaim to greatly increase scanning pressure on
      small caches.  As a result, light memory pressure has a disproportionate
      affect on small caches, and causes large caches to be reclaimed much
      faster than previously.
      
      As a result, it greatly perturbs the delicate balance of the VFS caches
      (dentry/inode vs file page cache) such that the inode/dentry caches are
      reclaimed much, much faster than the page cache and this drives us into
      several other caching imbalance related problems.
      
      As such, this is a bad change and needs to be reverted.
      
      [ Needs some massaging to retain the later seekless shrinker
        modifications.]
      
      Link: http://lkml.kernel.org/r/20190130041707.27750-3-david@fromorbit.com
      Fixes: 172b06c3 ("mm: slowly shrink slabs with a relatively small number of objects")
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Cc: Wolfgang Walter <linux@stwm.de>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Spock <dairinin@gmail.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      657fbf79
    • D
      Revert "mm: don't reclaim inodes with many attached pages" · 8d485d3a
      Dave Chinner 提交于
      commit 69056ee6a8a3d576ed31e38b3b14c70d6c74edcc upstream.
      
      This reverts commit a76cf1a474d7d ("mm: don't reclaim inodes with many
      attached pages").
      
      This change causes serious changes to page cache and inode cache
      behaviour and balance, resulting in major performance regressions when
      combining worklaods such as large file copies and kernel compiles.
      
        https://bugzilla.kernel.org/show_bug.cgi?id=202441
      
      This change is a hack to work around the problems introduced by changing
      how agressive shrinkers are on small caches in commit 172b06c3 ("mm:
      slowly shrink slabs with a relatively small number of objects").  It
      creates more problems than it solves, wasn't adequately reviewed or
      tested, so it needs to be reverted.
      
      Link: http://lkml.kernel.org/r/20190130041707.27750-2-david@fromorbit.com
      Fixes: a76cf1a474d7d ("mm: don't reclaim inodes with many attached pages")
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Cc: Wolfgang Walter <linux@stwm.de>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Spock <dairinin@gmail.com>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8d485d3a
    • J
      Revert "nfsd4: return default lease period" · 93769fef
      J. Bruce Fields 提交于
      commit 3bf6b57ec2ec945e5a6edf5c202a754f1e852ecd upstream.
      
      This reverts commit d6ebf508.
      
      I forgot that the kernel's default lease period should never be
      decreased!
      
      After a kernel upgrade, the kernel has no way of knowing on its own what
      the previous lease time was.  Unless userspace tells it otherwise, it
      will assume the previous lease period was the same.
      
      So if we decrease this value in a kernel upgrade, we end up enforcing a
      grace period that's too short, and clients will fail to reclaim state in
      time.  Symptoms may include EIO and log messages like "NFS:
      nfs4_reclaim_open_state: Lock reclaim failed!"
      
      There was no real justification for the lease period decrease anyway.
      Reported-by: NDonald Buczek <buczek@molgen.mpg.de>
      Fixes: d6ebf508 "nfsd4: return default lease period"
      Cc: stable@vger.kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      93769fef
    • M
      Input: elantech - enable 3rd button support on Fujitsu CELSIUS H780 · 17f4ddaa
      Matti Kurkela 提交于
      commit e8b22d0a329f0fb5c7ef95406872d268f01ee3b1 upstream.
      
      Like Fujitsu CELSIUS H760, the H780 also has a three-button Elantech
      touchpad, but the driver needs to be told so to enable the middle touchpad
      button.
      
      The elantech_dmi_force_crc_enabled quirk was not necessary with the H780.
      
      Also document the fw_version and caps values detected for both H760 and
      H780 models.
      Signed-off-by: NMatti Kurkela <Matti.Kurkela@iki.fi>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17f4ddaa
    • J
      Input: bma150 - register input device after setting private data · 3bd12095
      Jonathan Bakker 提交于
      commit 90cc55f067f6ca0e64e5e52883ece47d8af7b67b upstream.
      
      Otherwise we introduce a race condition where userspace can request input
      before we're ready leading to null pointer dereference such as
      
      input: bma150 as /devices/platform/i2c-gpio-2/i2c-5/5-0038/input/input3
      Unable to handle kernel NULL pointer dereference at virtual address 00000018
      pgd = (ptrval)
      [00000018] *pgd=55dac831, *pte=00000000, *ppte=00000000
      Internal error: Oops: 17 [#1] PREEMPT ARM
      Modules linked in: bma150 input_polldev [last unloaded: bma150]
      CPU: 0 PID: 2870 Comm: accelerometer Not tainted 5.0.0-rc3-dirty #46
      Hardware name: Samsung S5PC110/S5PV210-based board
      PC is at input_event+0x8/0x60
      LR is at bma150_report_xyz+0x9c/0xe0 [bma150]
      pc : [<80450f70>]    lr : [<7f0a614c>]    psr: 800d0013
      sp : a4c1fd78  ip : 00000081  fp : 00020000
      r10: 00000000  r9 : a5e2944c  r8 : a7455000
      r7 : 00000016  r6 : 00000101  r5 : a7617940  r4 : 80909048
      r3 : fffffff2  r2 : 00000000  r1 : 00000003  r0 : 00000000
      Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      Control: 10c5387d  Table: 54e34019  DAC: 00000051
      Process accelerometer (pid: 2870, stack limit = 0x(ptrval))
      Stackck: (0xa4c1fd78 to 0xa4c20000)
      fd60:                                                       fffffff3 fc813f6c
      fd80: 40410581 d7530ce3 a5e2817c a7617f00 a5e29404 a5e2817c 00000000 7f008324
      fda0: a5e28000 8044f59c a5fdd9d0 a5e2945c a46a4a00 a5e29668 a7455000 80454f10
      fdc0: 80909048 a5e29668 a5fdd9d0 a46a4a00 806316d0 00000000 a46a4a00 801df5f0
      fde0: 00000000 d7530ce3 a4c1fec0 a46a4a00 00000000 a5fdd9d0 a46a4a08 801df53c
      fe00: 00000000 801d74bc a4c1fec0 00000000 a4c1ff70 00000000 a7038da8 00000000
      fe20: a46a4a00 801e91fc a411bbe0 801f2e88 00000004 00000000 80909048 00000041
      fe40: 00000000 00020000 00000000 dead4ead a6a88da0 00000000 ffffe000 806fcae8
      fe60: a4c1fec8 00000000 80909048 00000002 a5fdd9d0 a7660110 a411bab0 00000001
      fe80: dead4ead ffffffff ffffffff a4c1fe8c a4c1fe8c d7530ce3 20000013 80909048
      fea0: 80909048 a4c1ff70 00000001 fffff000 a4c1e000 00000005 00026038 801eabd8
      fec0: a7660110 a411bab0 b9394901 00000006 a696201b 76fb3000 00000000 a7039720
      fee0: a5fdd9d0 00000101 00000002 00000096 00000000 00000000 00000000 a4c1ff00
      ff00: a6b310f4 805cb174 a6b310f4 00000010 00000fe0 00000010 a4c1e000 d7530ce3
      ff20: 00000003 a5f41400 a5f41424 00000000 a6962000 00000000 00000003 00000002
      ff40: ffffff9c 000a0000 80909048 d7530ce3 a6962000 00000003 80909048 ffffff9c
      ff60: a6962000 801d890c 00000000 00000000 00020000 a7590000 00000004 00000100
      ff80: 00000001 d7530ce3 000288b8 00026320 000288b8 00000005 80101204 a4c1e000
      ffa0: 00000005 80101000 000288b8 00026320 000288b8 000a0000 00000000 00000000
      ffc0: 000288b8 00026320 000288b8 00000005 7eef3bac 000264e8 00028ad8 00026038
      ffe0: 00000005 7eef3300 76f76e91 76f78546 800d0030 000288b8 00000000 00000000
      [<80450f70>] (input_event) from [<a5e2817c>] (0xa5e2817c)
      Code: e1a08148 eaffffa8 e351001f 812fff1e (e590c018)
      ---[ end trace 1c691ee85f2ff243 ]---
      Signed-off-by: NJonathan Bakker <xc-racer2@live.ca>
      Signed-off-by: NPaweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3bd12095
    • Z
      mmc: block: handle complete_work on separate workqueue · c4609e81
      Zachary Hays 提交于
      commit dcf6e2e38a1c7ccbc535de5e1d9b14998847499d upstream.
      
      The kblockd workqueue is created with the WQ_MEM_RECLAIM flag set.
      This generates a rescuer thread for that queue that will trigger when
      the CPU is under heavy load and collect the uncompleted work.
      
      In the case of mmc, this creates the possibility of a deadlock when
      there are multiple partitions on the device as other blk-mq work is
      also run on the same queue. For example:
      
      - worker 0 claims the mmc host to work on partition 1
      - worker 1 attempts to claim the host for partition 2 but has to wait
        for worker 0 to finish
      - worker 0 schedules complete_work to release the host
      - rescuer thread is triggered after time-out and collects the dangling
        work
      - rescuer thread attempts to complete the work in order starting with
        claim host
      - the task to release host is now blocked by a task to claim it and
        will never be called
      
      The above results in multiple hung tasks that lead to failures to
      mount partitions.
      
      Handling complete_work on a separate workqueue avoids this by keeping
      the work completion tasks separate from the other blk-mq work. This
      allows the host to be released without getting blocked by other tasks
      attempting to claim the host.
      Signed-off-by: NZachary Hays <zhays@lexmark.com>
      Fixes: 81196976 ("mmc: block: Add blk-mq support")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4609e81
    • C
      mmc: sunxi: Filter out unsupported modes declared in the device tree · 248a2f3c
      Chen-Yu Tsai 提交于
      commit d6f11e7d91f2ac85f66194fe3ef8789b49901d64 upstream.
      
      The MMC device tree bindings include properties used to signal various
      signalling speed modes. Until now the sunxi driver was accepting them
      without any further filtering, while the sunxi device trees were not
      actually using them.
      
      Since some of the H5 boards can not run at higher speed modes stably,
      we are resorting to declaring the higher speed modes per-board.
      
      Regardless, having boards declare modes and blindly following them,
      even without proper support in the driver, is generally a bad thing.
      
      Filter out all unsupported modes from the capabilities mask after
      the device tree properties have been parsed.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NChen-Yu Tsai <wens@csie.org>
      Acked-by: NMaxime Ripard <maxime.ripard@bootlin.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      248a2f3c
    • X
      kvm: vmx: Fix entry number check for add_atomic_switch_msr() · 0d41c03c
      Xiaoyao Li 提交于
      commit 98ae70cc476e833332a2c6bb72f941a25f0de226 upstream.
      
      Commit ca83b4a7 ("x86/KVM/VMX: Add find_msr() helper function")
      introduces the helper function find_msr(), which returns -ENOENT when
      not find the msr in vmx->msr_autoload.guest/host. Correct checking contion
      of no more available entry in vmx->msr_autoload.
      
      Fixes: ca83b4a7 ("x86/KVM/VMX: Add find_msr() helper function")
      Cc: stable@vger.kernel.org
      Signed-off-by: NXiaoyao Li <xiaoyao.li@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d41c03c
    • V
      x86/kvm/nVMX: read from MSR_IA32_VMX_PROCBASED_CTLS2 only when it is available · c58f010b
      Vitaly Kuznetsov 提交于
      commit 6b1971c694975e49af302229202c0043568b1791 upstream.
      
      SDM says MSR_IA32_VMX_PROCBASED_CTLS2 is only available "If
      (CPUID.01H:ECX.[5] && IA32_VMX_PROCBASED_CTLS[63])". It was found that
      some old cpus (namely "Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (family: 0x6,
      model: 0xf, stepping: 0x6") don't have it. Add the missing check.
      Reported-by: NZdenek Kaspar <zkaspar82@gmail.com>
      Tested-by: NZdenek Kaspar <zkaspar82@gmail.com>
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Reviewed-by: NJim Mattson <jmattson@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c58f010b
    • S
      riscv: Add pte bit to distinguish swap from invalid · 2ab14838
      Stefan O'Rear 提交于
      commit e3613bb8afc2a9474c9214d65c8326c5ac02135e upstream.
      
      Previously, invalid PTEs and swap PTEs had the same binary
      representation, causing errors when attempting to unmap PROT_NONE
      mappings, including implicit unmap on exit.
      
      Typical error:
      
      swap_info_get: Bad swap file entry 40000000007a9879
      BUG: Bad page map in process a.out  pte:3d4c3cc0 pmd:3e521401
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NStefan O'Rear <sorear2@gmail.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ab14838
    • B
      tools uapi: fix Alpha support · 22d6e72b
      Bob Tracy 提交于
      commit 842fc0f5dc5c9f9bd91f891554996d903c40cf35 upstream.
      
      Cc: stable@vger.kernel.org # v4.18+
      Signed-off-by: NBob Tracy <rct@frus.com>
      Signed-off-by: NMatt Turner <mattst88@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      22d6e72b
    • R
      ASoC: hdmi-codec: fix oops on re-probe · 49720ef5
      Russell King 提交于
      commit 0ce23d6d42147a692768e6baaaa3db75c44f4235 upstream.
      
      hdmi-codec oopses the kernel when it is unbound from a successfully
      bound audio subsystem, and is then rebound:
      
      Unable to handle kernel NULL pointer dereference at virtual address 0000001c
      pgd = ee3f0000
      [0000001c] *pgd=3cc59831
      Internal error: Oops: 817 [#1] PREEMPT ARM
      Modules linked in: ext2 snd_soc_spdif_tx vmeta dove_thermal snd_soc_kirkwood ofpart marvell_cesa m25p80 orion_wdt mtd spi_nor des_generic gpio_ir_recv snd_soc_kirkwood_spdif bmm_dmabuf auth_rpcgss nfsd autofs4 etnaviv thermal_sys hwmon gpu_sched tda9950
      CPU: 0 PID: 1005 Comm: bash Not tainted 4.20.0+ #1762
      Hardware name: Marvell Dove (Cubox)
      PC is at hdmi_dai_probe+0x68/0x80
      LR is at find_held_lock+0x20/0x94
      pc : [<c04c7de0>]    lr : [<c0063bf4>]    psr: 600f0013
      sp : ee15bd28  ip : eebd8b1c  fp : c093b488
      r10: ee048000  r9 : eebdab18  r8 : ee048600
      r7 : 00000001  r6 : 00000000  r5 : 00000000  r4 : ee82c100
      r3 : 00000006  r2 : 00000001  r1 : c067e38c  r0 : ee82c100
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none[  297.318599] Control: 10c5387d  Table: 2e3f0019  DAC: 00000051
      Process bash (pid: 1005, stack limit = 0xee15a248)
      ...
      [<c04c7de0>] (hdmi_dai_probe) from [<c04b7060>] (soc_probe_dai.part.9+0x34/0x70)
      [<c04b7060>] (soc_probe_dai.part.9) from [<c04b81a8>] (snd_soc_instantiate_card+0x734/0xc9c)
      [<c04b81a8>] (snd_soc_instantiate_card) from [<c04b8b6c>] (snd_soc_add_component+0x29c/0x378)
      [<c04b8b6c>] (snd_soc_add_component) from [<c04b8c8c>] (snd_soc_register_component+0x44/0x54)
      [<c04b8c8c>] (snd_soc_register_component) from [<c04c64b4>] (devm_snd_soc_register_component+0x48/0x84)
      [<c04c64b4>] (devm_snd_soc_register_component) from [<c04c7be8>] (hdmi_codec_probe+0x150/0x260)
      [<c04c7be8>] (hdmi_codec_probe) from [<c0373124>] (platform_drv_probe+0x48/0x98)
      
      This happens because hdmi_dai_probe() attempts to access the HDMI
      codec private data, but this has not been assigned by hdmi_dai_probe()
      before it calls devm_snd_soc_register_component().  Move the call to
      dev_set_drvdata() before devm_snd_soc_register_component() to avoid
      this oops.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      49720ef5
    • M
      ALSA: usb-audio: Fix implicit fb endpoint setup by quirk · bdd44810
      Manuel Reinhardt 提交于
      commit 2bc16b9f3223d049b57202ee702fcb5b9b507019 upstream.
      
      The commit a60945fd ("ALSA: usb-audio: move implicit fb quirks to
      separate function") introduced an error in the handling of quirks for
      implicit feedback endpoints. This commit fixes this.
      
      If a quirk successfully sets up an implicit feedback endpoint, usb-audio
      no longer tries to find the implicit fb endpoint itself.
      
      Fixes: a60945fd ("ALSA: usb-audio: move implicit fb quirks to separate function")
      Signed-off-by: NManuel Reinhardt <manuel.rhdt@gmail.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bdd44810
    • J
      ALSA: hda - Add quirk for HP EliteBook 840 G5 · 8715ba45
      Jurica Vukadin 提交于
      commit 4cd3016ce996494f78fdfd87ea35c8ca5d0b413e upstream.
      
      This enables mute LED support and fixes switching jacks when the laptop
      is docked.
      Signed-off-by: NJurica Vukadin <jurica.vukadin@rt-rk.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8715ba45
    • J
      perf/x86: Add check_period PMU callback · 74cbb754
      Jiri Olsa 提交于
      commit 81ec3f3c4c4d78f2d3b6689c9816bfbdf7417dbb upstream.
      
      Vince (and later on Ravi) reported crashes in the BTS code during
      fuzzing with the following backtrace:
      
        general protection fault: 0000 [#1] SMP PTI
        ...
        RIP: 0010:perf_prepare_sample+0x8f/0x510
        ...
        Call Trace:
         <IRQ>
         ? intel_pmu_drain_bts_buffer+0x194/0x230
         intel_pmu_drain_bts_buffer+0x160/0x230
         ? tick_nohz_irq_exit+0x31/0x40
         ? smp_call_function_single_interrupt+0x48/0xe0
         ? call_function_single_interrupt+0xf/0x20
         ? call_function_single_interrupt+0xa/0x20
         ? x86_schedule_events+0x1a0/0x2f0
         ? x86_pmu_commit_txn+0xb4/0x100
         ? find_busiest_group+0x47/0x5d0
         ? perf_event_set_state.part.42+0x12/0x50
         ? perf_mux_hrtimer_restart+0x40/0xb0
         intel_pmu_disable_event+0xae/0x100
         ? intel_pmu_disable_event+0xae/0x100
         x86_pmu_stop+0x7a/0xb0
         x86_pmu_del+0x57/0x120
         event_sched_out.isra.101+0x83/0x180
         group_sched_out.part.103+0x57/0xe0
         ctx_sched_out+0x188/0x240
         ctx_resched+0xa8/0xd0
         __perf_event_enable+0x193/0x1e0
         event_function+0x8e/0xc0
         remote_function+0x41/0x50
         flush_smp_call_function_queue+0x68/0x100
         generic_smp_call_function_single_interrupt+0x13/0x30
         smp_call_function_single_interrupt+0x3e/0xe0
         call_function_single_interrupt+0xf/0x20
         </IRQ>
      
      The reason is that while event init code does several checks
      for BTS events and prevents several unwanted config bits for
      BTS event (like precise_ip), the PERF_EVENT_IOC_PERIOD allows
      to create BTS event without those checks being done.
      
      Following sequence will cause the crash:
      
      If we create an 'almost' BTS event with precise_ip and callchains,
      and it into a BTS event it will crash the perf_prepare_sample()
      function because precise_ip events are expected to come
      in with callchain data initialized, but that's not the
      case for intel_pmu_drain_bts_buffer() caller.
      
      Adding a check_period callback to be called before the period
      is changed via PERF_EVENT_IOC_PERIOD. It will deny the change
      if the event would become BTS. Plus adding also the limit_period
      check as well.
      Reported-by: NVince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Acked-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: <stable@vger.kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20190204123532.GA4794@kravaSigned-off-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      74cbb754
    • I
      perf/core: Fix impossible ring-buffer sizes warning · d10e77c2
      Ingo Molnar 提交于
      commit 528871b456026e6127d95b1b2bd8e3a003dc1614 upstream.
      
      The following commit:
      
        9dff0aa95a32 ("perf/core: Don't WARN() for impossible ring-buffer sizes")
      
      results in perf recording failures with larger mmap areas:
      
        root@skl:/tmp# perf record -g -a
        failed to mmap with 12 (Cannot allocate memory)
      
      The root cause is that the following condition is buggy:
      
      	if (order_base_2(size) >= MAX_ORDER)
      		goto fail;
      
      The problem is that @size is in bytes and MAX_ORDER is in pages,
      so the right test is:
      
      	if (order_base_2(size) >= PAGE_SHIFT+MAX_ORDER)
      		goto fail;
      
      Fix it.
      Reported-by: N"Jin, Yao" <yao.jin@linux.intel.com>
      Bisected-by: NBorislav Petkov <bp@alien8.de>
      Analyzed-by: NPeter Zijlstra <peterz@infradead.org>
      Cc: Julien Thierry <julien.thierry@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: <stable@vger.kernel.org>
      Fixes: 9dff0aa95a32 ("perf/core: Don't WARN() for impossible ring-buffer sizes")
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d10e77c2
    • T
      ARM: OMAP5+: Fix inverted nirq pin interrupts with irq_set_type · 1b1de8b9
      Tony Lindgren 提交于
      commit d0243693fbf6fbd48b4efb2ba7210765983b03e3 upstream.
      
      Commit 83a86fbb ("irqchip/gic: Loudly complain about the use of
      IRQ_TYPE_NONE") started warning about incorrect dts usage for irqs.
      ARM GIC only supports active-high interrupts for SPI (Shared Peripheral
      Interrupts), and the Palmas PMIC by default is active-low.
      
      Palmas PMIC allows changing the interrupt polarity using register
      PALMAS_POLARITY_CTRL_INT_POLARITY, but configuring sys_nirq1 with
      a pull-down and setting PALMAS_POLARITY_CTRL_INT_POLARITY made the
      Palmas RTC interrupts stop working. This can be easily tested with
      kernel tools rtctest.c.
      
      Turns out the SoC inverts the sys_nirq pins for GIC as they do not go
      through a peripheral device but go directly to the MPUSS wakeupgen.
      I've verified this by muxing the interrupt line temporarily to gpio_wk16
      instead of sys_nirq1. with a gpio, the interrupt works fine both
      active-low and active-high with the SoC internal pull configured and
      palmas polarity configured. But as sys_nirq1, the interrupt only works
      when configured ACTIVE_LOW for palmas, and ACTIVE_HIGH for GIC.
      
      Note that there was a similar issue earlier with tegra114 and palmas
      interrupt polarity that got fixed by commit df545d1c ("mfd: palmas:
      Provide irq flags through DT/platform data"). However, the difference
      between omap5 and tegra114 is that tegra inverts the palmas interrupt
      twice, once when entering tegra PMC, and again when exiting tegra PMC
      to GIC.
      
      Let's fix the issue by adding a custom wakeupgen_irq_set_type() for
      wakeupgen and invert any interrupts with wrong polarity. Let's also
      warn about any non-sysnirq pins using wrong polarity. Note that we
      also need to update the dts for the level as IRQ_TYPE_NONE never
      has irq_set_type() called, and let's add some comments and use proper
      pin nameing to avoid more confusion later on.
      
      Cc: Belisko Marek <marek.belisko@gmail.com>
      Cc: Dmitry Lifshitz <lifshitz@compulab.co.il>
      Cc: "Dr. H. Nikolaus Schaller" <hns@goldelico.com>
      Cc: Jon Hunter <jonathanh@nvidia.com>
      Cc: Keerthy <j-keerthy@ti.com>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Cc: Nishanth Menon <nm@ti.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Richard Woodruff <r-woodruff2@ti.com>
      Cc: Santosh Shilimkar <ssantosh@kernel.org>
      Cc: Tero Kristo <t-kristo@ti.com>
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: stable@vger.kernel.org # v4.17+
      Reported-by: NBelisko Marek <marek.belisko@gmail.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1b1de8b9
    • M
      Input: elan_i2c - add ACPI ID for touchpad in Lenovo V330-15ISK · d9a974fd
      Mauro Ciancio 提交于
      commit 7ad222b3aed350adfc27ee7eec4587ffe55dfdce upstream.
      
      This adds ELAN0617 to the ACPI table to support Elan touchpad found in
      Lenovo V330-15ISK.
      Signed-off-by: NMauro Ciancio <mauro@acadeu.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9a974fd
    • D
      Revert "Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G" · 2abf1ce4
      Dmitry Torokhov 提交于
      commit f420c54e4b12c1361c6ed313002ee7bd7ac58362 upstream.
      
      This reverts commit 7db54c89f0b30a101584e09d3729144e6170059d as it
      breaks Acer Aspire V-371 and other devices. According to Elan:
      
      "Acer Aspire F5-573G is MS Precision touchpad which should use hid
       multitouch driver. ELAN0501 should not be added in elan_i2c."
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202503
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2abf1ce4
    • A
      gpio: mxc: move gpio noirq suspend/resume to syscore phase · ede7fb45
      Anson Huang 提交于
      commit 1a5287a3dbc34cd0c02c8f64c9131bd23cdfe2bb upstream.
      
      During noirq suspend/resume phase, GPIO irq could arrive
      and its registers like IMR will be changed by irq handle
      process, to make the GPIO registers exactly when it is
      powered ON after resume, move the GPIO noirq suspend/resume
      callback to syscore suspend/resume phase, local irq is
      disabled at this phase so GPIO registers are atomic.
      
      Fixes: c19fdaee ("gpio: mxc: add power management support")
      Signed-off-by: NAnson Huang <Anson.Huang@nxp.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMartin Hundebøll <martin@geanix.com>
      Cc: <stable@vger.kernel.org> # 4.19.x+
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ede7fb45
    • P
      CIFS: Do not assume one credit for async responses · b1765ebd
      Pavel Shilovsky 提交于
      [ Upstream commit 0fd1d37b0501efc6e295f56ab55cdaff784aa50c ]
      
      If we don't receive a response we can't assume that the server
      granted one credit. Assume zero credits in such cases.
      Signed-off-by: NPavel Shilovsky <pshilov@microsoft.com>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      b1765ebd
    • D
      kvm: sev: Fail KVM_SEV_INIT if already initialized · 6804b3ec
      David Rientjes 提交于
      [ Upstream commit 3f14a89d1132dcae3c8ce6721c6ef51f6e6d9b5f ]
      
      By code inspection, it was found that multiple calls to KVM_SEV_INIT
      could deplete asid bits and overwrite kvm_sev_info's regions_list.
      
      Multiple calls to KVM_SVM_INIT is not likely to occur with QEMU, but this
      should likely be fixed anyway.
      
      This code is serialized by kvm->lock.
      
      Fixes: 1654efcb ("KVM: SVM: Add KVM_SEV_INIT command")
      Reported-by: NCfir Cohen <cfir@google.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      6804b3ec
    • R
      cifs: Limit memory used by lock request calls to a page · 63715c1f
      Ross Lagerwall 提交于
      [ Upstream commit 92a8109e4d3a34fb6b115c9098b51767dc933444 ]
      
      The code tries to allocate a contiguous buffer with a size supplied by
      the server (maxBuf). This could fail if memory is fragmented since it
      results in high order allocations for commonly used server
      implementations. It is also wasteful since there are probably
      few locks in the usual case. Limit the buffer to be no larger than a
      page to avoid memory allocation failures due to fragmentation.
      Signed-off-by: NRoss Lagerwall <ross.lagerwall@citrix.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      63715c1f
    • I
      drm/nouveau/falcon: avoid touching registers if engine is off · 4b709998
      Ilia Mirkin 提交于
      [ Upstream commit a5176a4cb85bb6213daadf691097cf411da35df2 ]
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980Signed-off-by: NIlia Mirkin <imirkin@alum.mit.edu>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4b709998
    • T
      drm/nouveau: Don't disable polling in fallback mode · 85a088cc
      Takashi Iwai 提交于
      [ Upstream commit 118780066e30c34de3d9349710b51780bfa0ba83 ]
      
      When a fan is controlled via linear fallback without cstate, we
      shouldn't stop polling.  Otherwise it won't be adjusted again and
      keeps running at an initial crazy pace.
      
      Fixes: 800efb4c ("drm/nouveau/drm/therm/fan: add a fallback if no fan control is specified in the vbios")
      Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1103356
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107447Reported-by: NThomas Blume <thomas.blume@suse.com>
      Signed-off-by: NTakashi Iwai <tiwai@suse.de>
      Reviewed-by: NMartin Peres <martin.peres@free.fr>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      85a088cc
    • N
      gpio: pl061: handle failed allocations · 0a87c533
      Nicholas Mc Guire 提交于
      [ Upstream commit df209c43a0e8258e096fb722dfbdae4f0dd13fde ]
      
      devm_kzalloc(), devm_kstrdup() and devm_kasprintf() all can
      fail internal allocation and return NULL. Using any of the assigned
      objects without checking is not safe. As this is early in the boot
      phase and these allocations really should not fail, any failure here
      is probably an indication of a more serious issue so it makes little
      sense to try and rollback the previous allocated resources or try to
      continue;  but rather the probe function is simply exited with -ENOMEM.
      Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org>
      Fixes: 684284b6 ("ARM: integrator: add MMCI device to IM-PD1")
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      0a87c533
    • L
      ARM: dts: kirkwood: Fix polarity of GPIO fan lines · 5cf199f8
      Linus Walleij 提交于
      [ Upstream commit b5f034845e70916fd33e172fad5ad530a29c10ab ]
      
      These two lines are active high, not active low. The bug was
      found when we changed the kernel to respect the polarity defined
      in the device tree.
      
      Fixes: 1b90e06b ("ARM: kirkwood: Use devicetree to define DNS-32[05] fan")
      Cc: Jamie Lentin <jm@lentin.co.uk>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Gregory Clement <gregory.clement@bootlin.com>
      Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
      Cc: Julien D'Ascenzio <jdascenzio@posteo.net>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Tested-by: NJamie Lentin <jm@lentin.co.uk>
      Reported-by: NJulien D'Ascenzio <jdascenzio@posteo.net>
      Tested-by: NJulien D'Ascenzio <jdascenzio@posteo.net>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NGregory CLEMENT <gregory.clement@bootlin.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      5cf199f8
    • P
      ARM: dts: da850-lcdk: Correct the sound card name · 6e7136c1
      Peter Ujfalusi 提交于
      [ Upstream commit c25748acc5c20786ecb7518bfeae8fcef93472d6 ]
      
      To avoid  the following error:
      asoc-simple-card sound: ASoC: Failed to create card debugfs directory
      
      Which is because the card name contains '/' character, which can not be
      used in file or directory names.
      Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      6e7136c1
    • P
      ARM: dts: da850-lcdk: Correct the audio codec regulators · 8bea93c8
      Peter Ujfalusi 提交于
      [ Upstream commit bd540ebe68c3017194a1caa38e075bbbc0832749 ]
      
      Add the board level fixed regulators for 3.3V and 1.8V which is used to
      power - among other things - the tlv320aic3106 codec.
      
      Apart from removing the following warning during boot:
      tlv320aic3x-codec 0-0018: Invalid supply voltage(s) AVDD: -22, DVDD: -22
      
      With the correct voltages the driver can select correct OCMV value to
      reduce pop noise.
      Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8bea93c8
    • P
      ARM: dts: da850-evm: Correct the sound card name · f3b61cba
      Peter Ujfalusi 提交于
      [ Upstream commit 7fca69d4e43fa1ae9cb4f652772c132dc5a659c6 ]
      
      To avoid  the following error:
      asoc-simple-card sound: ASoC: Failed to create card debugfs directory
      
      Which is because the card name contains '/' character, which can not be
      used in file or directory names.
      Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f3b61cba
    • P
      ARM: dts: da850-evm: Correct the audio codec regulators · 7c06896e
      Peter Ujfalusi 提交于
      [ Upstream commit 706edaa88835e3d8de8920584ad5da76dd3d6666 ]
      
      Add the board level fixed regulators for 3.3V and 1.8V which is used to
      power - among other things - the tlv320aic3106 codec.
      
      Apart from removing the following warning during boot:
      tlv320aic3x-codec 0-0018: Too high supply voltage(s) AVDD: 5000000, DVDD: 5000000
      
      With the correct voltages the driver can select correct OCMV value to
      reduce pop noise.
      Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Signed-off-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7c06896e
    • J
      drm/amdgpu: set WRITE_BURST_LENGTH to 64B to workaround SDMA1 hang · 46bf9a8c
      Jim Qu 提交于
      [ Upstream commit 0c6c8125582714e1fd3544983eba3d750db0f5b8 ]
      
      effect asics: VEGA10 and VEGA12
      Signed-off-by: NJim Qu <Jim.Qu@amd.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      46bf9a8c
    • K
      nvme: pad fake subsys NQN vid and ssvid with zeros · 2f5581e8
      Keith Busch 提交于
      [ Upstream commit 3da584f57133e51aeb84aaefae5e3d69531a1e4f ]
      
      We need to preserve the leading zeros in the vid and ssvid when generating
      a unique NQN. Truncating these may lead to naming collisions.
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2f5581e8