1. 13 2月, 2019 40 次提交
    • O
      cgroup: fix parsing empty mount option string · 4b5abffd
      Ondrej Mosnacek 提交于
      [ Upstream commit e250d91d65750a0c0c62483ac4f9f357e7317617 ]
      
      This fixes the case where all mount options specified are consumed by an
      LSM and all that's left is an empty string. In this case cgroupfs should
      accept the string and not fail.
      
      How to reproduce (with SELinux enabled):
      
          # umount /sys/fs/cgroup/unified
          # mount -o context=system_u:object_r:cgroup_t:s0 -t cgroup2 cgroup2 /sys/fs/cgroup/unified
          mount: /sys/fs/cgroup/unified: wrong fs type, bad option, bad superblock on cgroup2, missing codepage or helper program, or other error.
          # dmesg | tail -n 1
          [   31.575952] cgroup: cgroup2: unknown option ""
      
      Fixes: 67e9c74b ("cgroup: replace __DEVEL__sane_behavior with cgroup2 fs type")
      [NOTE: should apply on top of commit 5136f636 ("cgroup: implement "nsdelegate" mount option"), older versions need manual rebase]
      Suggested-by: NStephen Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NOndrej Mosnacek <omosnace@redhat.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4b5abffd
    • S
      f2fs: fix sbi->extent_list corruption issue · df13b036
      Sahitya Tummala 提交于
      [ Upstream commit e4589fa545e0020dbbc3c9bde35f35f949901392 ]
      
      When there is a failure in f2fs_fill_super() after/during
      the recovery of fsync'd nodes, it frees the current sbi and
      retries again. This time the mount is successful, but the files
      that got recovered before retry, still holds the extent tree,
      whose extent nodes list is corrupted since sbi and sbi->extent_list
      is freed up. The list_del corruption issue is observed when the
      file system is getting unmounted and when those recoverd files extent
      node is being freed up in the below context.
      
      list_del corruption. prev->next should be fffffff1e1ef5480, but was (null)
      <...>
      kernel BUG at kernel/msm-4.14/lib/list_debug.c:53!
      lr : __list_del_entry_valid+0x94/0xb4
      pc : __list_del_entry_valid+0x94/0xb4
      <...>
      Call trace:
      __list_del_entry_valid+0x94/0xb4
      __release_extent_node+0xb0/0x114
      __free_extent_tree+0x58/0x7c
      f2fs_shrink_extent_tree+0xdc/0x3b0
      f2fs_leave_shrinker+0x28/0x7c
      f2fs_put_super+0xfc/0x1e0
      generic_shutdown_super+0x70/0xf4
      kill_block_super+0x2c/0x5c
      kill_f2fs_super+0x44/0x50
      deactivate_locked_super+0x60/0x8c
      deactivate_super+0x68/0x74
      cleanup_mnt+0x40/0x78
      __cleanup_mnt+0x1c/0x28
      task_work_run+0x48/0xd0
      do_notify_resume+0x678/0xe98
      work_pending+0x8/0x14
      
      Fix this by not creating extents for those recovered files if shrinker is
      not registered yet. Once mount is successful and shrinker is registered,
      those files can have extents again.
      Signed-off-by: NSahitya Tummala <stummala@codeaurora.org>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      df13b036
    • K
      niu: fix missing checks of niu_pci_eeprom_read · 4d6b5b08
      Kangjie Lu 提交于
      [ Upstream commit 26fd962bde0b15e54234fe762d86bc0349df1de4 ]
      
      niu_pci_eeprom_read() may fail, so we should check its return value
      before using the read data.
      Signed-off-by: NKangjie Lu <kjlu@umn.edu>
      Acked-by: NShannon Nelson <shannon.lee.nelson@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4d6b5b08
    • A
      um: Avoid marking pages with "changed protection" · 1e480ee6
      Anton Ivanov 提交于
      [ Upstream commit 8892d8545f2d0342b9c550defbfb165db237044b ]
      
      Changing protection is a very high cost operation in UML
      because in addition to an extra syscall it also interrupts
      mmap merge sequences generated by the tlb.
      
      While the condition is not particularly common it is worth
      avoiding.
      Signed-off-by: NAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1e480ee6
    • S
      f2fs: fix use-after-free issue when accessing sbi->stat_info · 69e7f877
      Sahitya Tummala 提交于
      [ Upstream commit 60aa4d5536ab7fe32433ca1173bd9d6633851f27 ]
      
      iput() on sbi->node_inode can update sbi->stat_info
      in the below context, if the f2fs_write_checkpoint()
      has failed with error.
      
      f2fs_balance_fs_bg+0x1ac/0x1ec
      f2fs_write_node_pages+0x4c/0x260
      do_writepages+0x80/0xbc
      __writeback_single_inode+0xdc/0x4ac
      writeback_single_inode+0x9c/0x144
      write_inode_now+0xc4/0xec
      iput+0x194/0x22c
      f2fs_put_super+0x11c/0x1e8
      generic_shutdown_super+0x70/0xf4
      kill_block_super+0x2c/0x5c
      kill_f2fs_super+0x44/0x50
      deactivate_locked_super+0x60/0x8c
      deactivate_super+0x68/0x74
      cleanup_mnt+0x40/0x78
      
      Fix this by moving f2fs_destroy_stats() further below iput() in
      both f2fs_put_super() and f2fs_fill_super() paths.
      Signed-off-by: NSahitya Tummala <stummala@codeaurora.org>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      69e7f877
    • R
      cifs: check ntwrk_buf_start for NULL before dereferencing it · 5d3b4cd8
      Ronnie Sahlberg 提交于
      [ Upstream commit 59a63e479ce36a3f24444c3a36efe82b78e4a8e0 ]
      
      RHBZ: 1021460
      
      There is an issue where when multiple threads open/close the same directory
      ntwrk_buf_start might end up being NULL, causing the call to smbCalcSize
      later to oops with a NULL deref.
      
      The real bug is why this happens and why this can become NULL for an
      open cfile, which should not be allowed.
      This patch tries to avoid a oops until the time when we fix the underlying
      issue.
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      5d3b4cd8
    • S
      MIPS: ralink: Select CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 · 2cdf5246
      Stefan Roese 提交于
      [ Upstream commit 0b15394475e3bcaf35ca4bf22fc55d56df67224e ]
      
      Testing has shown, that when using mainline U-Boot on MT7688 based
      boards, the system may hang or crash while mounting the root-fs. The
      main issue here is that mainline U-Boot configures EBase to a value
      near the end of system memory. And with CONFIG_CPU_MIPSR2_IRQ_VI
      disabled, trap_init() will not allocate a new area to place the
      exception handler. The original value will be used and the handler
      will be copied to this location, which might already be used by some
      userspace application.
      
      The MT7688 supports VI - its config3 register is 0x00002420, so VInt
      (Bit 5) is set. But without setting CONFIG_CPU_MIPSR2_IRQ_VI this
      bit will not be evaluated to result in "cpu_has_vi" being set. This
      patch now selects CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 which results
      trap_init() to allocate some memory for the exception handler.
      
      Please note that this issue was not seen with the Mediatek U-Boot
      version, as it does not touch EBase (stays at default of 0x8000.0000).
      This is strictly also not correct as the kernel (_text) resides
      here.
      Signed-off-by: NStefan Roese <sr@denx.de>
      [paul.burton@mips.com: s/beeing/being/]
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: John Crispin <blogic@openwrt.org>
      Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2cdf5246
    • N
      crypto: ux500 - Use proper enum in hash_set_dma_transfer · 1dc571ff
      Nathan Chancellor 提交于
      [ Upstream commit 5ac93f808338f4dd465402e91869702eb87db241 ]
      
      Clang warns when one enumerated type is implicitly converted to another:
      
      drivers/crypto/ux500/hash/hash_core.c:169:4: warning: implicit
      conversion from enumeration type 'enum dma_data_direction' to different
      enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                              direction, DMA_CTRL_ACK | DMA_PREP_INTERRUPT);
                              ^~~~~~~~~
      1 warning generated.
      
      dmaengine_prep_slave_sg expects an enum from dma_transfer_direction.
      We know that the only direction supported by this function is
      DMA_TO_DEVICE because of the check at the top of this function so we can
      just use the equivalent value from dma_transfer_direction.
      
      DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1
      Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1dc571ff
    • N
      crypto: ux500 - Use proper enum in cryp_set_dma_transfer · 2b020c09
      Nathan Chancellor 提交于
      [ Upstream commit 9d880c5945c748d8edcac30965f3349a602158c4 ]
      
      Clang warns when one enumerated type is implicitly converted to another:
      
      drivers/crypto/ux500/cryp/cryp_core.c:559:5: warning: implicit
      conversion from enumeration type 'enum dma_data_direction' to different
      enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                                      direction, DMA_CTRL_ACK);
                                      ^~~~~~~~~
      drivers/crypto/ux500/cryp/cryp_core.c:583:5: warning: implicit
      conversion from enumeration type 'enum dma_data_direction' to different
      enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
                                      direction,
                                      ^~~~~~~~~
      2 warnings generated.
      
      dmaengine_prep_slave_sg expects an enum from dma_transfer_direction.
      Because we know the value of the dma_data_direction enum from the
      switch statement, we can just use the proper value from
      dma_transfer_direction so there is no more conversion.
      
      DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1
      DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2
      Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      2b020c09
    • M
      seq_buf: Make seq_buf_puts() null-terminate the buffer · 6201e8ad
      Michael Ellerman 提交于
      [ Upstream commit 0464ed24380905d640030d368cd84a4e4d1e15e2 ]
      
      Currently seq_buf_puts() will happily create a non null-terminated
      string for you in the buffer. This is particularly dangerous if the
      buffer is on the stack.
      
      For example:
      
        char buf[8];
        char secret = "secret";
        struct seq_buf s;
      
        seq_buf_init(&s, buf, sizeof(buf));
        seq_buf_puts(&s, "foo");
        printk("Message is %s\n", buf);
      
      Can result in:
      
        Message is fooªªªªªsecret
      
      We could require all users to memset() their buffer to zero before
      use. But that seems likely to be forgotten and lead to bugs.
      
      Instead we can change seq_buf_puts() to always leave the buffer in a
      null-terminated state.
      
      The only downside is that this makes the buffer 1 character smaller
      for seq_buf_puts(), but that seems like a good trade off.
      
      Link: http://lkml.kernel.org/r/20181019042109.8064-1-mpe@ellerman.id.auAcked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      6201e8ad
    • K
      hwmon: (lm80) fix a missing check of bus read in lm80 probe · 040f7697
      Kangjie Lu 提交于
      [ Upstream commit 9aa3aa15f4c2f74f47afd6c5db4b420fadf3f315 ]
      
      In lm80_probe(), if lm80_read_value() fails, it returns a negative
      error number which is stored to data->fan[f_min] and will be further
      used. We should avoid using the data if the read fails.
      
      The fix checks if lm80_read_value() fails, and if so, returns with the
      error number.
      Signed-off-by: NKangjie Lu <kjlu@umn.edu>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      040f7697
    • K
      hwmon: (lm80) fix a missing check of the status of SMBus read · 8dcf8478
      Kangjie Lu 提交于
      [ Upstream commit c9c63915519b1def7043b184680f33c24cd49d7b ]
      
      If lm80_read_value() fails, it returns a negative number instead of the
      correct read data. Therefore, we should avoid using the data if it
      fails.
      
      The fix checks if lm80_read_value() fails, and if so, returns with the
      error number.
      Signed-off-by: NKangjie Lu <kjlu@umn.edu>
      [groeck: One variable for return values is enough]
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8dcf8478
    • S
      perf build: Don't unconditionally link the libbfd feature test to -liberty and -lz · 303d29d8
      Stanislav Fomichev 提交于
      [ Upstream commit 14541b1e7e723859ff2c75c6fc10cdbbec6b8c34 ]
      
      Current libbfd feature test unconditionally links against -liberty and -lz.
      While it's required on some systems (e.g. opensuse), it's completely
      unnecessary on the others, where only -lbdf is sufficient (debian).
      This patch streamlines (and renames) the following feature checks:
      
      feature-libbfd           - only link against -lbfd (debian),
                                 see commit 2cf90407 ("perf tools: Fix bfd
      			   dependency libraries detection")
      feature-libbfd-liberty   - link against -lbfd and -liberty
      feature-libbfd-liberty-z - link against -lbfd, -liberty and -lz (opensuse),
                                 see commit 280e7c48 ("perf tools: fix BFD
      			   detection on opensuse")
      
      (feature-liberty{,-z} were renamed to feature-libbfd-liberty{,z}
      for clarity)
      
      The main motivation is to fix this feature test for bpftool which is
      currently broken on debian (libbfd feature shows OFF, but we still
      unconditionally link against -lbfd and it works).
      
      Tested on debian with only -lbfd installed (without -liberty); I'd
      appreciate if somebody on the other systems can test this new detection
      method.
      Signed-off-by: NStanislav Fomichev <sdf@google.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/4dfc634cfcfb236883971b5107cf3c28ec8a31be.1542328222.git.sdf@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      303d29d8
    • C
      NFS: nfs_compare_mount_options always compare auth flavors. · 8c642d71
      Chris Perl 提交于
      [ Upstream commit 594d1644cd59447f4fceb592448d5cd09eb09b5e ]
      
      This patch removes the check from nfs_compare_mount_options to see if a
      `sec' option was passed for the current mount before comparing auth
      flavors and instead just always compares auth flavors.
      
      Consider the following scenario:
      
      You have a server with the address 192.168.1.1 and two exports /export/a
      and /export/b.  The first export supports `sys' and `krb5' security, the
      second just `sys'.
      
      Assume you start with no mounts from the server.
      
      The following results in EIOs being returned as the kernel nfs client
      incorrectly thinks it can share the underlying `struct nfs_server's:
      
      $ mkdir /tmp/{a,b}
      $ sudo mount -t nfs -o vers=3,sec=krb5 192.168.1.1:/export/a /tmp/a
      $ sudo mount -t nfs -o vers=3          192.168.1.1:/export/b /tmp/b
      $ df >/dev/null
      df: ‘/tmp/b’: Input/output error
      Signed-off-by: NChris Perl <cperl@janestreet.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8c642d71
    • J
      kvm: Change offset in kvm_write_guest_offset_cached to unsigned · ad9241f2
      Jim Mattson 提交于
      [ Upstream commit 7a86dab8cf2f0fdf508f3555dddfc236623bff60 ]
      
      Since the offset is added directly to the hva from the
      gfn_to_hva_cache, a negative offset could result in an out of bounds
      write. The existing BUG_ON only checks for addresses beyond the end of
      the gfn_to_hva_cache, not for addresses before the start of the
      gfn_to_hva_cache.
      
      Note that all current call sites have non-negative offsets.
      
      Fixes: 4ec6e863 ("kvm: Introduce kvm_write_guest_offset_cached()")
      Reported-by: NCfir Cohen <cfir@google.com>
      Signed-off-by: NJim Mattson <jmattson@google.com>
      Reviewed-by: NCfir Cohen <cfir@google.com>
      Reviewed-by: NPeter Shier <pshier@google.com>
      Reviewed-by: NKrish Sadhukhan <krish.sadhukhan@oracle.com>
      Reviewed-by: NSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ad9241f2
    • M
      powerpc/fadump: Do not allow hot-remove memory from fadump reserved area. · fc090081
      Mahesh Salgaonkar 提交于
      [ Upstream commit 0db6896ff6332ba694f1e61b93ae3b2640317633 ]
      
      For fadump to work successfully there should not be any holes in reserved
      memory ranges where kernel has asked firmware to move the content of old
      kernel memory in event of crash. Now that fadump uses CMA for reserved
      area, this memory area is now not protected from hot-remove operations
      unless it is cma allocated. Hence, fadump service can fail to re-register
      after the hot-remove operation, if hot-removed memory belongs to fadump
      reserved region. To avoid this make sure that memory from fadump reserved
      area is not hot-removable if fadump is registered.
      
      However, if user still wants to remove that memory, he can do so by
      manually stopping fadump service before hot-remove operation.
      Signed-off-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      fc090081
    • V
      KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported · 84a4572b
      Vitaly Kuznetsov 提交于
      [ Upstream commit e87555e550cef4941579cd879759a7c0dee24e68 ]
      
      AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm
      knows nothing about it, however, this MSR is among emulated_msrs and
      thus returned with KVM_GET_MSR_INDEX_LIST. The consequent KVM_GET_MSRS,
      of course, fails.
      
      Report the MSR as unsupported to not confuse userspace.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      84a4572b
    • M
      pinctrl: meson: meson8b: fix the GPIO function for the GPIOAO pins · a41cd69e
      Martin Blumenstingl 提交于
      [ Upstream commit 2b745ac3cceb8fc1d9985990c8241a821ea97e53 ]
      
      The GPIOAO pins (as well as the two exotic GPIO_BSD_EN and GPIO_TEST_N)
      only belong to the pin controller in the AO domain. With the current
      definition these pins cannot be referred to in .dts files as group
      (which is possible on GXBB and GXL for example).
      
      Add a separate "gpio_aobus" function to fix the mapping between the pin
      controller and the GPIO pins in the AO domain. This is similar to how
      the GXBB and GXL drivers implement this functionality.
      
      Fixes: 9dab1868 ("pinctrl: amlogic: Make driver independent from two-domain configuration")
      Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      a41cd69e
    • M
      pinctrl: meson: meson8: fix the GPIO function for the GPIOAO pins · 098fa489
      Martin Blumenstingl 提交于
      [ Upstream commit 42f9b48cc5402be11d2364275eb18c257d2a79e8 ]
      
      The GPIOAO pins (as well as the two exotic GPIO_BSD_EN and GPIO_TEST_N)
      only belong to the pin controller in the AO domain. With the current
      definition these pins cannot be referred to in .dts files as group
      (which is possible on GXBB and GXL for example).
      
      Add a separate "gpio_aobus" function to fix the mapping between the pin
      controller and the GPIO pins in the AO domain. This is similar to how
      the GXBB and GXL drivers implement this functionality.
      
      Fixes: 9dab1868 ("pinctrl: amlogic: Make driver independent from two-domain configuration")
      Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      098fa489
    • C
      powerpc/mm: Fix reporting of kernel execute faults on the 8xx · 279eb1d9
      Christophe Leroy 提交于
      [ Upstream commit ffca395b11c4a5a6df6d6345f794b0e3d578e2d0 ]
      
      On the 8xx, no-execute is set via PPP bits in the PTE. Therefore
      a no-exec fault generates DSISR_PROTFAULT error bits,
      not DSISR_NOEXEC_OR_G.
      
      This patch adds DSISR_PROTFAULT in the test mask.
      
      Fixes: d3ca5874 ("powerpc/mm: Fix reporting of kernel execute faults")
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      279eb1d9
    • N
      fbdev: fbcon: Fix unregister crash when more than one framebuffer · 9e9435bc
      Noralf Trønnes 提交于
      [ Upstream commit 2122b40580dd9d0620398739c773d07a7b7939d0 ]
      
      When unregistering fbdev using unregister_framebuffer(), any bound
      console will unbind automatically. This is working fine if this is the
      only framebuffer, resulting in a switch to the dummy console. However if
      there is a fb0 and I unregister fb1 having a bound console, I eventually
      get a crash. The fastest way for me to trigger the crash is to do a
      reboot, resulting in this splat:
      
      [   76.478825] WARNING: CPU: 0 PID: 527 at linux/kernel/workqueue.c:1442 __queue_work+0x2d4/0x41c
      [   76.478849] Modules linked in: raspberrypi_hwmon gpio_backlight backlight bcm2835_rng rng_core [last unloaded: tinydrm]
      [   76.478916] CPU: 0 PID: 527 Comm: systemd-udevd Not tainted 4.20.0-rc4+ #4
      [   76.478933] Hardware name: BCM2835
      [   76.478949] Backtrace:
      [   76.478995] [<c010d388>] (dump_backtrace) from [<c010d670>] (show_stack+0x20/0x24)
      [   76.479022]  r6:00000000 r5:c0bc73be r4:00000000 r3:6fb5bf81
      [   76.479060] [<c010d650>] (show_stack) from [<c08e82f4>] (dump_stack+0x20/0x28)
      [   76.479102] [<c08e82d4>] (dump_stack) from [<c0120070>] (__warn+0xec/0x12c)
      [   76.479134] [<c011ff84>] (__warn) from [<c01201e4>] (warn_slowpath_null+0x4c/0x58)
      [   76.479165]  r9:c0eb6944 r8:00000001 r7:c0e927f8 r6:c0bc73be r5:000005a2 r4:c0139e84
      [   76.479197] [<c0120198>] (warn_slowpath_null) from [<c0139e84>] (__queue_work+0x2d4/0x41c)
      [   76.479222]  r6:d7666a00 r5:c0e918ee r4:dbc4e700
      [   76.479251] [<c0139bb0>] (__queue_work) from [<c013a02c>] (queue_work_on+0x60/0x88)
      [   76.479281]  r10:c0496bf8 r9:00000100 r8:c0e92ae0 r7:00000001 r6:d9403700 r5:d7666a00
      [   76.479298]  r4:20000113
      [   76.479348] [<c0139fcc>] (queue_work_on) from [<c0496c28>] (cursor_timer_handler+0x30/0x54)
      [   76.479374]  r7:d8a8fabc r6:c0e08088 r5:d8afdc5c r4:d8a8fabc
      [   76.479413] [<c0496bf8>] (cursor_timer_handler) from [<c0178744>] (call_timer_fn+0x100/0x230)
      [   76.479435]  r4:c0e9192f r3:d758a340
      [   76.479465] [<c0178644>] (call_timer_fn) from [<c0178980>] (expire_timers+0x10c/0x12c)
      [   76.479495]  r10:40000000 r9:c0e9192f r8:c0e92ae0 r7:d8afdccc r6:c0e19280 r5:c0496bf8
      [   76.479513]  r4:d8a8fabc
      [   76.479541] [<c0178874>] (expire_timers) from [<c0179630>] (run_timer_softirq+0xa8/0x184)
      [   76.479570]  r9:00000001 r8:c0e19280 r7:00000000 r6:c0e08088 r5:c0e1a3e0 r4:c0e19280
      [   76.479603] [<c0179588>] (run_timer_softirq) from [<c0102404>] (__do_softirq+0x1ac/0x3fc)
      [   76.479632]  r10:c0e91680 r9:d8afc020 r8:0000000a r7:00000100 r6:00000001 r5:00000002
      [   76.479650]  r4:c0eb65ec
      [   76.479686] [<c0102258>] (__do_softirq) from [<c0124d10>] (irq_exit+0xe8/0x168)
      [   76.479716]  r10:d8d1a9b0 r9:d8afc000 r8:00000001 r7:d949c000 r6:00000000 r5:c0e8b3f0
      [   76.479734]  r4:00000000
      [   76.479764] [<c0124c28>] (irq_exit) from [<c016b72c>] (__handle_domain_irq+0x94/0xb0)
      [   76.479793] [<c016b698>] (__handle_domain_irq) from [<c01021dc>] (bcm2835_handle_irq+0x3c/0x48)
      [   76.479823]  r8:d8afdebc r7:d8afddfc r6:ffffffff r5:c0e089f8 r4:d8afddc8 r3:d8afddc8
      [   76.479851] [<c01021a0>] (bcm2835_handle_irq) from [<c01019f0>] (__irq_svc+0x70/0x98)
      
      The problem is in the console rebinding in fbcon_fb_unbind(). It uses the
      virtual console index as the new framebuffer index to bind the console(s)
      to. The correct way is to use the con2fb_map lookup table to find the
      framebuffer index.
      
      Fixes: cfafca80 ("fbdev: fbcon: console unregistration from unregister_framebuffer")
      Signed-off-by: NNoralf Trønnes <noralf@tronnes.org>
      Reviewed-by: NMikulas Patocka <mpatocka@redhat.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      9e9435bc
    • L
      ACPI/APEI: Clear GHES block_status before panic() · 00e391ec
      Lenny Szubowicz 提交于
      [ Upstream commit 98cff8b23ed1c763a029ee81ea300df0d153d07d ]
      
      In __ghes_panic() clear the block status in the APEI generic
      error status block for that generic hardware error source before
      calling panic() to prevent a second panic() in the crash kernel
      for exactly the same fatal error.
      
      Otherwise ghes_probe(), running in the crash kernel, would see
      an unhandled error in the APEI generic error status block and
      panic again, thereby precluding any crash dump.
      Signed-off-by: NLenny Szubowicz <lszubowi@redhat.com>
      Signed-off-by: NDavid Arcari <darcari@redhat.com>
      Tested-by: NTyler Baicar <baicar.tyler@gmail.com>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      00e391ec
    • K
      igb: Fix an issue that PME is not enabled during runtime suspend · d657e82f
      Kai-Heng Feng 提交于
      [ Upstream commit 1fb3a7a75e2efcc83ef21f2434069cddd6fae6f5 ]
      
      I210 ethernet card doesn't wakeup when a cable gets plugged. It's
      because its PME is not set.
      
      Since commit 42eca230 ("PCI: Don't touch card regs after runtime
      suspend D3"), if the PCI state is saved, pci_pm_runtime_suspend() stops
      calling pci_finish_runtime_suspend(), which enables the PCI PME.
      
      To fix the issue, let's not to save PCI states when it's runtime
      suspend, to let the PCI subsystem enables PME.
      
      Fixes: 42eca230 ("PCI: Don't touch card regs after runtime suspend D3")
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d657e82f
    • Y
      ice: Do not enable NAPI on q_vectors that have no rings · d01b26e7
      Young Xiao 提交于
      [ Upstream commit eec903769b4ea476591ffff73bb7359f14f38c51 ]
      
      If ice driver has q_vectors w/ active NAPI that has no rings,
      then this will result in a divide by zero error. To correct it
      I am updating the driver code so that we only support NAPI on
      q_vectors that have 1 or more rings allocated to them.
      
      See commit 13a8cd19 ("i40e: Do not enable NAPI on q_vectors
      that have no rings") for detail.
      Signed-off-by: NYoung Xiao <YangX92@hotmail.com>
      Acked-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d01b26e7
    • K
      i40e: define proper net_device::neigh_priv_len · 8a35f678
      Konstantin Khorenko 提交于
      [ Upstream commit 31389b53b3e0b535867af9090a5d19ec64768d55 ]
      
      Out of bound read reported by KASan.
      
      i40iw_net_event() reads unconditionally 16 bytes from
      neigh->primary_key while the memory allocated for
      "neighbour" struct is evaluated in neigh_alloc() as
      
        tbl->entry_size + dev->neigh_priv_len
      
      where "dev" is a net_device.
      
      But the driver does not setup dev->neigh_priv_len and
      we read beyond the neigh entry allocated memory,
      so the patch in the next mail fixes this.
      Signed-off-by: NKonstantin Khorenko <khorenko@virtuozzo.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8a35f678
    • P
      fbdev: fbmem: behave better with small rotated displays and many CPUs · 6584e6c0
      Peter Rosin 提交于
      [ Upstream commit f75df8d4b4fabfad7e3cba2debfad12741c6fde7 ]
      
      Blitting an image with "negative" offsets is not working since there
      is no clipping. It hopefully just crashes. For the bootup logo, there
      is protection so that blitting does not happen as the image is drawn
      further and further to the right (ROTATE_UR) or further and further
      down (ROTATE_CW). There is however no protection when drawing in the
      opposite directions (ROTATE_UD and ROTATE_CCW).
      
      Add back this protection.
      
      The regression is 20-odd years old but the mindless warning-killing
      mentality displayed in commit 34bdb666 ("fbdev: fbmem: remove
      positive test on unsigned values") is also to blame, methinks.
      
      Fixes: 448d4797 ("fbdev: fb_do_show_logo() updates")
      Signed-off-by: NPeter Rosin <peda@axentia.se>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Fabian Frederick <ffrederick@users.sourceforge.net>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      cc: Geoff Levand <geoff@infradead.org>
      Cc: James Simmons <jsimmons@users.sf.net>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      6584e6c0
    • G
      md: fix raid10 hang issue caused by barrier · 54541a75
      Guoqing Jiang 提交于
      [ Upstream commit e820d55cb99dd93ac2dc949cf486bb187e5cd70d ]
      
      When both regular IO and resync IO happen at the same time,
      and if we also need to split regular. Then we can see tasks
      hang due to barrier.
      
      1. resync thread
      [ 1463.757205] INFO: task md1_resync:5215 blocked for more than 480 seconds.
      [ 1463.757207]       Not tainted 4.19.5-1-default #1
      [ 1463.757209] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      [ 1463.757212] md1_resync      D    0  5215      2 0x80000000
      [ 1463.757216] Call Trace:
      [ 1463.757223]  ? __schedule+0x29a/0x880
      [ 1463.757231]  ? raise_barrier+0x8d/0x140 [raid10]
      [ 1463.757236]  schedule+0x78/0x110
      [ 1463.757243]  raise_barrier+0x8d/0x140 [raid10]
      [ 1463.757248]  ? wait_woken+0x80/0x80
      [ 1463.757257]  raid10_sync_request+0x1f6/0x1e30 [raid10]
      [ 1463.757265]  ? _raw_spin_unlock_irq+0x22/0x40
      [ 1463.757284]  ? is_mddev_idle+0x125/0x137 [md_mod]
      [ 1463.757302]  md_do_sync.cold.78+0x404/0x969 [md_mod]
      [ 1463.757311]  ? wait_woken+0x80/0x80
      [ 1463.757336]  ? md_rdev_init+0xb0/0xb0 [md_mod]
      [ 1463.757351]  md_thread+0xe9/0x140 [md_mod]
      [ 1463.757358]  ? _raw_spin_unlock_irqrestore+0x2e/0x60
      [ 1463.757364]  ? __kthread_parkme+0x4c/0x70
      [ 1463.757369]  kthread+0x112/0x130
      [ 1463.757374]  ? kthread_create_worker_on_cpu+0x40/0x40
      [ 1463.757380]  ret_from_fork+0x3a/0x50
      
      2. regular IO
      [ 1463.760679] INFO: task kworker/0:8:5367 blocked for more than 480 seconds.
      [ 1463.760683]       Not tainted 4.19.5-1-default #1
      [ 1463.760684] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      [ 1463.760687] kworker/0:8     D    0  5367      2 0x80000000
      [ 1463.760718] Workqueue: md submit_flushes [md_mod]
      [ 1463.760721] Call Trace:
      [ 1463.760731]  ? __schedule+0x29a/0x880
      [ 1463.760741]  ? wait_barrier+0xdd/0x170 [raid10]
      [ 1463.760746]  schedule+0x78/0x110
      [ 1463.760753]  wait_barrier+0xdd/0x170 [raid10]
      [ 1463.760761]  ? wait_woken+0x80/0x80
      [ 1463.760768]  raid10_write_request+0xf2/0x900 [raid10]
      [ 1463.760774]  ? wait_woken+0x80/0x80
      [ 1463.760778]  ? mempool_alloc+0x55/0x160
      [ 1463.760795]  ? md_write_start+0xa9/0x270 [md_mod]
      [ 1463.760801]  ? try_to_wake_up+0x44/0x470
      [ 1463.760810]  raid10_make_request+0xc1/0x120 [raid10]
      [ 1463.760816]  ? wait_woken+0x80/0x80
      [ 1463.760831]  md_handle_request+0x121/0x190 [md_mod]
      [ 1463.760851]  md_make_request+0x78/0x190 [md_mod]
      [ 1463.760860]  generic_make_request+0x1c6/0x470
      [ 1463.760870]  raid10_write_request+0x77a/0x900 [raid10]
      [ 1463.760875]  ? wait_woken+0x80/0x80
      [ 1463.760879]  ? mempool_alloc+0x55/0x160
      [ 1463.760895]  ? md_write_start+0xa9/0x270 [md_mod]
      [ 1463.760904]  raid10_make_request+0xc1/0x120 [raid10]
      [ 1463.760910]  ? wait_woken+0x80/0x80
      [ 1463.760926]  md_handle_request+0x121/0x190 [md_mod]
      [ 1463.760931]  ? _raw_spin_unlock_irq+0x22/0x40
      [ 1463.760936]  ? finish_task_switch+0x74/0x260
      [ 1463.760954]  submit_flushes+0x21/0x40 [md_mod]
      
      So resync io is waiting for regular write io to complete to
      decrease nr_pending (conf->barrier++ is called before waiting).
      The regular write io splits another bio after call wait_barrier
      which call nr_pending++, then the splitted bio would continue
      with raid10_write_request -> wait_barrier, so the splitted bio
      has to wait for barrier to be zero, then deadlock happens as
      follows.
      
      	resync io		regular io
      
      	raise_barrier
      				wait_barrier
      				generic_make_request
      				wait_barrier
      
      To resolve the issue, we need to call allow_barrier to decrease
      nr_pending before generic_make_request since regular IO is not
      issued to underlying devices, and wait_barrier is called again
      to ensure no internal IO happening.
      
      Fixes: fc9977dd ("md/raid10: simplify the splitting of requests.")
      Reported-and-tested-by: NSiniša Bandin <sinisa@4net.rs>
      Signed-off-by: NGuoqing Jiang <gqjiang@suse.com>
      Signed-off-by: NShaohua Li <shli@fb.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      54541a75
    • A
      video: clps711x-fb: release disp device node in probe() · 8d138565
      Alexey Khoroshilov 提交于
      [ Upstream commit fdac751355cd76e049f628afe6acb8ff4b1399f7 ]
      
      clps711x_fb_probe() increments refcnt of disp device node by
      of_parse_phandle() and leaves it undecremented on both
      successful and error paths.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
      Cc: Alexander Shiyan <shc_work@mail.ru>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8d138565
    • W
      drm/amd/display: validate extended dongle caps · 8f0132db
      Wenjing Liu 提交于
      [ Upstream commit 99b922f9ed6a6313c0d2247cde8aa1e4a0bd67e4 ]
      
      [why]
      Some dongle doesn't have a valid extended dongle caps,
      but we still set the extended dongle caps to be valid.
      This causes validation fails for all timing.
      
      [how]
      If no dp_hdmi_max_pixel_clk is provided,
      don't use extended dongle caps.
      Signed-off-by: NWenjing Liu <Wenjing.Liu@amd.com>
      Reviewed-by: NAric Cyr <Aric.Cyr@amd.com>
      Reviewed-by: NJun Lei <Jun.Lei@amd.com>
      Acked-by: NAbdoulaye Berthe <Abdoulaye.Berthe@amd.com>
      Acked-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8f0132db
    • N
      drbd: Avoid Clang warning about pointless switch statment · bd9218ab
      Nathan Chancellor 提交于
      [ Upstream commit a52c5a16cf19d8a85831bb1b915a221dd4ffae3c ]
      
      There are several warnings from Clang about no case statement matching
      the constant 0:
      
      In file included from drivers/block/drbd/drbd_receiver.c:48:
      In file included from drivers/block/drbd/drbd_int.h:48:
      In file included from ./include/linux/drbd_genl_api.h:54:
      In file included from ./include/linux/genl_magic_struct.h:236:
      ./include/linux/drbd_genl.h:321:1: warning: no case matching constant
      switch condition '0'
      GENL_struct(DRBD_NLA_HELPER, 24, drbd_helper_info,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ./include/linux/genl_magic_struct.h:220:10: note: expanded from macro
      'GENL_struct'
              switch (0) {
                      ^
      
      Silence this warning by adding a 'case 0:' statement. Additionally,
      adjust the alignment of the statements in the ct_assert_unique macro to
      avoid a checkpatch warning.
      
      This solution was originally sent by Arnd Bergmann with a default case
      statement: https://lore.kernel.org/patchwork/patch/756723/
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/43Suggested-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      bd9218ab
    • L
      drbd: skip spurious timeout (ping-timeo) when failing promote · 66345d53
      Lars Ellenberg 提交于
      [ Upstream commit 9848b6ddd8c92305252f94592c5e278574e7a6ac ]
      
      If you try to promote a Secondary while connected to a Primary
      and allow-two-primaries is NOT set, we will wait for "ping-timeout"
      to give this node a chance to detect a dead primary,
      in case the cluster manager noticed faster than we did.
      
      But if we then are *still* connected to a Primary,
      we fail (after an additional timeout of ping-timout).
      
      This change skips the spurious second timeout.
      
      Most people won't notice really,
      since "ping-timeout" by default is half a second.
      
      But in some installations, ping-timeout may be 10 or 20 seconds or more,
      and spuriously delaying the error return becomes annoying.
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      66345d53
    • L
      drbd: disconnect, if the wrong UUIDs are attached on a connected peer · af70af5b
      Lars Ellenberg 提交于
      [ Upstream commit b17b59602b6dcf8f97a7dc7bc489a48388d7063a ]
      
      With "on-no-data-accessible suspend-io", DRBD requires the next attach
      or connect to be to the very same data generation uuid tag it lost last.
      
      If we first lost connection to the peer,
      then later lost connection to our own disk,
      we would usually refuse to re-connect to the peer,
      because it presents the wrong data set.
      
      However, if the peer first connects without a disk,
      and then attached its disk, we accepted that same wrong data set,
      which would be "unexpected" by any user of that DRBD
      and cause "undefined results" (read: very likely data corruption).
      
      The fix is to forcefully disconnect as soon as we notice that the peer
      attached to the "wrong" dataset.
      Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      af70af5b
    • R
      drbd: narrow rcu_read_lock in drbd_sync_handshake · 3d67b428
      Roland Kammerer 提交于
      [ Upstream commit d29e89e34952a9ad02c77109c71a80043544296e ]
      
      So far there was the possibility that we called
      genlmsg_new(GFP_NOIO)/mutex_lock() while holding an rcu_read_lock().
      
      This included cases like:
      
      drbd_sync_handshake (acquire the RCU lock)
        drbd_asb_recover_1p
          drbd_khelper
            drbd_bcast_event
              genlmsg_new(GFP_NOIO) --> may sleep
      
      drbd_sync_handshake (acquire the RCU lock)
        drbd_asb_recover_1p
          drbd_khelper
            notify_helper
              genlmsg_new(GFP_NOIO) --> may sleep
      
      drbd_sync_handshake (acquire the RCU lock)
        drbd_asb_recover_1p
          drbd_khelper
            notify_helper
              mutex_lock --> may sleep
      
      While using GFP_ATOMIC whould have been possible in the first two cases,
      the real fix is to narrow the rcu_read_lock.
      Reported-by: NJia-Ju Bai <baijiaju1990@163.com>
      Reviewed-by: NLars Ellenberg <lars.ellenberg@linbit.com>
      Signed-off-by: NRoland Kammerer <roland.kammerer@linbit.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      3d67b428
    • M
      mlx5: update timecounter at least twice per counter overflow · 8d317b0a
      Miroslav Lichvar 提交于
      [ Upstream commit 5d8678365c90b9ce1fd2243ff5ea562609f6cec1 ]
      
      The timecounter needs to be updated at least once in half of the
      cyclecounter interval to prevent timecounter_cyc2time() interpreting a
      new timestamp as an old value and causing a backward jump.
      
      This would be an issue if the timecounter multiplier was so small that
      the update interval would not be limited by the 64-bit overflow in
      multiplication.
      
      Shorten the calculated interval to make sure the timecounter is updated
      in time even when the system clock is slowed down by up to 10%, the
      multiplier is increased by up to 10%, and the scheduled overflow check
      is late by 15%.
      
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Ariel Levkovich <lariel@mellanox.com>
      Cc: Saeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NMiroslav Lichvar <mlichvar@redhat.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8d317b0a
    • A
      powerpc/powernv/ioda: Allocate indirect TCE levels of cached userspace addresses on demand · 49f182e6
      Alexey Kardashevskiy 提交于
      [ Upstream commit bdbf649efe21173cae63b4b71db84176420f9039 ]
      
      The powernv platform maintains 2 TCE tables for VFIO - a hardware TCE
      table and a table with userspace addresses; the latter is used for
      marking pages dirty when corresponging TCEs are unmapped from
      the hardware table.
      
      a68bd126 ("powerpc/powernv/ioda: Allocate indirect TCE levels
      on demand") enabled on-demand allocation of the hardware table,
      however it missed the other table so it has still been fully allocated
      at the boot time. This fixes the issue by allocating a single level,
      just like we do for the hardware table.
      
      Fixes: a68bd126 ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand")
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      49f182e6
    • N
      iwlwifi: mvm: fix setting HE ppe FW config · 394f9256
      Naftali Goldstein 提交于
      [ Upstream commit 189b8d441b0f7825f0b4278851c52afaa0515ed2 ]
      
      The FW expects to get the ppe value for each NSS-BW pair in the same
      format as in the he phy capabilities IE, which means that a value of 0
      implies ppe should be used for BPSK (mcs 0). If there are no PPE
      thresholds in the IE, or if for some NSS-RU pair there's no threshold
      set for it (this could happen because it's a variable-sized field), it
      means no PPE should not be used for that pair, so the value sent to FW
      should be 7 which corresponds to "none".
      
      Fixes: 514c3069 ("iwlwifi: add support for IEEE802.11ax")
      Signed-off-by: NNaftali Goldstein <naftali.goldstein@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      394f9256
    • M
      powerpc/perf: Fix thresholding counter data for unknown type · 5a0c7fb5
      Madhavan Srinivasan 提交于
      [ Upstream commit 17cfccc91545682513541924245abb876d296063 ]
      
      MMCRA[34:36] and MMCRA[38:44] expose the thresholding counter value.
      Thresholding counter can be used to count latency cycles such as
      load miss to reload. But threshold counter value is not relevant
      when the sampled instruction type is unknown or reserved. Patch to
      fix the thresholding counter value to zero when sampled instruction
      type is unknown or reserved.
      
      Fixes: 170a315f('powerpc/perf: Support to export MMCRA[TEC*] field to userspace')
      Signed-off-by: NMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      5a0c7fb5
    • J
      net: hns3: add max vector number check for pf · d5e2df9f
      Jian Shen 提交于
      [ Upstream commit 75edb610860fda65ceedb017fc69afabd2806b8b ]
      
      Each pf supports max 64 vectors and 128 tqps. For 2p/4p core scenario,
      there may be more than 64 cpus online. So the result of min_t(u16,
      num_Online_cpus(), tqp_num) may be more than 64. This patch adds check
      for the vector number.
      
      Fixes: dd38c726 ("net: hns3: fix for coalesce configuration lost during reset")
      Signed-off-by: NJian Shen <shenjian15@huawei.com>
      Signed-off-by: NPeng Li <lipeng321@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d5e2df9f
    • J
      cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan() · 86760e0d
      Jia-Ju Bai 提交于
      [ Upstream commit 4f68ef64cd7feb1220232bd8f501d8aad340a099 ]
      
      The function cw1200_bss_info_changed() and cw1200_hw_scan() can be
      concurrently executed.
      The two functions both access a possible shared variable "frame.skb".
      
      This shared variable is freed by dev_kfree_skb() in cw1200_upload_beacon(),
      which is called by cw1200_bss_info_changed(). The free operation is
      protected by a mutex lock "priv->conf_mutex" in cw1200_bss_info_changed().
      
      In cw1200_hw_scan(), this shared variable is accessed without the
      protection of the mutex lock "priv->conf_mutex".
      Thus, concurrency use-after-free bugs may occur.
      
      To fix these bugs, the original calls to mutex_lock(&priv->conf_mutex) and
      mutex_unlock(&priv->conf_mutex) are moved to the places, which can
      protect the accesses to the shared variable.
      Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      86760e0d
    • M
      scsi: smartpqi: increase fw status register read timeout · 993ba5d2
      Mahesh Rajashekhara 提交于
      [ Upstream commit 65111785acccb836ec75263b03b0e33f21e74f47 ]
      
      Problem:
       - during the driver initialization, driver will poll fw
         for KERNEL_UP in a 30 seconds timeout.
      
       - if the firmware is not ready after 30 seconds,
         driver will not be loaded.
      
      Fix:
       - change timeout from 30 seconds to 3 minutes.
      Reported-by: NFeng Li <lifeng1519@gmail.com>
      Reviewed-by: NAjish Koshy <ajish.koshy@microsemi.com>
      Reviewed-by: NMurthy Bhat <Murthy.Bhat@microsemi.com>
      Reviewed-by: NDave Carroll <david.carroll@microsemi.com>
      Reviewed-by: NKevin Barnett <kevin.barnett@microsemi.com>
      Signed-off-by: NMahesh Rajashekhara <mahesh.rajashekhara@microsemi.com>
      Signed-off-by: NDon Brace <don.brace@microsemi.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      993ba5d2